zsk 2 years ago
parent cdefc54486
commit 5d1fa36fbf

@ -42,7 +42,7 @@ Page({
inputShowed: false,
inputVal: "搜索工作",
wxCode: "",
isLogin: app.globalData.isLogin,
isLogin: false,
hasUserInfo: 0,
pageShow: false,
recordCount: 0,
@ -59,7 +59,8 @@ Page({
var that = this;
console.log('点击tab',e.currentTarget.dataset.active)
console.log('点击tab',e.currentTarget.dataset.id)
that.data.storeJobListSearchForm['jobCategoryLabelIds'] = e.currentTarget.dataset.id
that.data.storeJobListSearchForm['jobCategoryLabelIds'] = e.currentTarget.dataset.id
that.data.storeJobListSearchForm.pageNum = 1
this.setData({
active:e.currentTarget.dataset.active,// tab切换
storeJobListSearchForm: that.data.storeJobListSearchForm
@ -89,9 +90,12 @@ Page({
*
*/
onShow() {
let that = this;
let that = this;
console.log(app.globalData)
that.data.storeJobListSearchForm.pageNum = 1;
that.setData({
isLogin:app.globalData.isLogin
})
that.getType();
},
getType(){
@ -101,7 +105,17 @@ Page({
method: "get",
header: app.globalData.headers,
success: function (res) {
console.log(res);
if(res.data.data.labels.length > 2){
var first = res.data.data.labels[0];
var last = res.data.data.labels[res.data.data.labels.length - 1];
res.data.data.labels.pop();
res.data.data.labels.shift();
res.data.data.labels.sort((a, b) => b.num - a.num)
res.data.data.labels.unshift(first);
res.data.data.labels.push(last);
}
that.data.storeJobListSearchForm['jobCategoryLabelIds'] = res.data.data.labels[0].id
that.setData({
list:res.data.data.labels,
@ -136,18 +150,14 @@ Page({
currPage: res.data.data.pageBean.currentPage,
});
setTimeout(function () {
that.setData({
triggered: false,
});
}, 1000);
if (res.data.data.pageBean.recordList == null || res.data.data.pageBean.recordList.length == 0 || res.data.data.pageBean.recordList.length < that.data.storeJobListSearchForm.pageSize) {
var jobListTemp = commonUtil.disposeJobListData(res.data.data.pageBean.recordList);
that.data.recordList = that.data.recordList.concat(jobListTemp);
that.setData({
recordList: that.data.recordList,
hasMoreData: false,
isTrigger: false,
});
} else {
@ -156,10 +166,18 @@ Page({
that.setData({
recordList: that.data.recordList,
hasMoreData: true,
isTrigger: false,
});
}
}
// if (res.data.data.pageBean.recordCount >= res.data.data.pageBean.pageSize) {
// that.setData({
// hasMoreData: true,
// });
// } else {
// that.setData({
// hasMoreData: false,
// });
// }
wx.hideLoading({
success: (res) => {},
@ -267,7 +285,6 @@ Page({
},
// 下拉加载更多
onScrollToLower () {
console.log("====================================================");
var that = this;
that.data.storeJobListSearchForm.pageNum =
that.data.storeJobListSearchForm.pageNum + 1;

@ -68,10 +68,10 @@
</view>
</view>
</view>
</view>
</view>
</view>
<block wx:if="{{(recordList == null || recordList.length == 0) && (storeJobListSearchForm.keys != null && storeJobListSearchForm.keys != '')}}">
<view class="tc p20 f12 c045">没有符合条件的职位</view>
<block wx:if="{{recordList == null || recordList.length == 0}}">
<!-- <view class="tc p20 f12 c045">没有符合条件的职位</view> -->
</block>
<block wx:else>
<block wx:if="{{isLogin}}">

Loading…
Cancel
Save