zsk 2 years ago
parent cdefc54486
commit 5d1fa36fbf

@ -42,7 +42,7 @@ Page({
inputShowed: false, inputShowed: false,
inputVal: "搜索工作", inputVal: "搜索工作",
wxCode: "", wxCode: "",
isLogin: app.globalData.isLogin, isLogin: false,
hasUserInfo: 0, hasUserInfo: 0,
pageShow: false, pageShow: false,
recordCount: 0, recordCount: 0,
@ -59,7 +59,8 @@ Page({
var that = this; var that = this;
console.log('点击tab',e.currentTarget.dataset.active) console.log('点击tab',e.currentTarget.dataset.active)
console.log('点击tab',e.currentTarget.dataset.id) 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({ this.setData({
active:e.currentTarget.dataset.active,// tab切换 active:e.currentTarget.dataset.active,// tab切换
storeJobListSearchForm: that.data.storeJobListSearchForm storeJobListSearchForm: that.data.storeJobListSearchForm
@ -89,9 +90,12 @@ Page({
* *
*/ */
onShow() { onShow() {
let that = this; let that = this;
console.log(app.globalData)
that.data.storeJobListSearchForm.pageNum = 1; that.data.storeJobListSearchForm.pageNum = 1;
that.setData({
isLogin:app.globalData.isLogin
})
that.getType(); that.getType();
}, },
getType(){ getType(){
@ -101,7 +105,17 @@ Page({
method: "get", method: "get",
header: app.globalData.headers, header: app.globalData.headers,
success: function (res) { 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.data.storeJobListSearchForm['jobCategoryLabelIds'] = res.data.data.labels[0].id
that.setData({ that.setData({
list:res.data.data.labels, list:res.data.data.labels,
@ -135,19 +149,15 @@ Page({
totalPage: res.data.data.pageBean.pageCount, totalPage: res.data.data.pageBean.pageCount,
currPage: res.data.data.pageBean.currentPage, 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) { 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); var jobListTemp = commonUtil.disposeJobListData(res.data.data.pageBean.recordList);
that.data.recordList = that.data.recordList.concat(jobListTemp); that.data.recordList = that.data.recordList.concat(jobListTemp);
that.setData({ that.setData({
recordList: that.data.recordList, recordList: that.data.recordList,
hasMoreData: false,
isTrigger: false, isTrigger: false,
}); });
} else { } else {
@ -156,10 +166,18 @@ Page({
that.setData({ that.setData({
recordList: that.data.recordList, recordList: that.data.recordList,
hasMoreData: true,
isTrigger: false, isTrigger: false,
}); });
} }
// if (res.data.data.pageBean.recordCount >= res.data.data.pageBean.pageSize) {
// that.setData({
// hasMoreData: true,
// });
// } else {
// that.setData({
// hasMoreData: false,
// });
// }
wx.hideLoading({ wx.hideLoading({
success: (res) => {}, success: (res) => {},
@ -267,7 +285,6 @@ Page({
}, },
// 下拉加载更多 // 下拉加载更多
onScrollToLower () { onScrollToLower () {
console.log("====================================================");
var that = this; var that = this;
that.data.storeJobListSearchForm.pageNum = that.data.storeJobListSearchForm.pageNum =
that.data.storeJobListSearchForm.pageNum + 1; that.data.storeJobListSearchForm.pageNum + 1;

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

Loading…
Cancel
Save