|
|
|
|
@ -195,7 +195,8 @@ Page({
|
|
|
|
|
],
|
|
|
|
|
active:0,
|
|
|
|
|
|
|
|
|
|
scrollInfoView:'category_0'
|
|
|
|
|
scrollInfoView:'category_0',
|
|
|
|
|
sList:[],
|
|
|
|
|
},
|
|
|
|
|
// onPullDownRefresh:function(){
|
|
|
|
|
// this.getJobList();
|
|
|
|
|
@ -1174,6 +1175,7 @@ Page({
|
|
|
|
|
|
|
|
|
|
// that.getJobList();
|
|
|
|
|
// }
|
|
|
|
|
that.getJobList('onshow');
|
|
|
|
|
|
|
|
|
|
wx.removeStorage({
|
|
|
|
|
key: "townsManInfo",
|
|
|
|
|
@ -1205,7 +1207,7 @@ Page({
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getJobList() {
|
|
|
|
|
getJobList($type) {
|
|
|
|
|
var that = this;
|
|
|
|
|
// debugger
|
|
|
|
|
that.setData({
|
|
|
|
|
@ -1294,6 +1296,25 @@ Page({
|
|
|
|
|
index: that.data.currentJobDrawer.index ? that.data.currentJobDrawer.index : null,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let _stopList = [];
|
|
|
|
|
if($type == 'onshow'){
|
|
|
|
|
that.data.list.forEach((item,index) => {
|
|
|
|
|
// 动态计算高度并赋值
|
|
|
|
|
that.getDomInfo('category_' + index,(categoryRes)=>{
|
|
|
|
|
// console.log('指定区域:',categoryRes)
|
|
|
|
|
_stopList.push(Number(categoryRes.top))
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
sList:_stopList,
|
|
|
|
|
recordList: that.data.recordList,
|
|
|
|
|
currentJobDrawer: that.data.currentJobDrawer,
|
|
|
|
|
});
|
|
|
|
|
that.setData({
|
|
|
|
|
recordList: that.data.recordList,
|
|
|
|
|
@ -1312,7 +1333,44 @@ Page({
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
bindCategoryScroll(e){
|
|
|
|
|
let that = this;
|
|
|
|
|
console.log('分类滚动:',e.detail.scrollTop,' ',that.data.sList)
|
|
|
|
|
// 核心思想:判断当前数值在数组的哪两个区间中,取临界值 Math方法
|
|
|
|
|
if(0 <= e.detail.scrollTop && e.detail.scrollTop < 4241){
|
|
|
|
|
that.setData({
|
|
|
|
|
active:0
|
|
|
|
|
})
|
|
|
|
|
}else if(4241 <= e.detail.scrollTop && e.detail.scrollTop < 8482){
|
|
|
|
|
that.setData({
|
|
|
|
|
active:1
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
that.setData({
|
|
|
|
|
active:2
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getDomInfo($obj,callback=()=>{}){
|
|
|
|
|
if($obj){
|
|
|
|
|
const query = wx.createSelectorQuery()
|
|
|
|
|
query.select('#' + $obj).boundingClientRect(function(categoryRes){
|
|
|
|
|
callback(categoryRes);
|
|
|
|
|
})
|
|
|
|
|
query.exec()
|
|
|
|
|
}else{
|
|
|
|
|
callback({
|
|
|
|
|
bottom: -1,
|
|
|
|
|
dataset: {},
|
|
|
|
|
height: -1,
|
|
|
|
|
id: "",
|
|
|
|
|
left: -1,
|
|
|
|
|
right: -1,
|
|
|
|
|
top: -1,
|
|
|
|
|
width: -1
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
onScrollRefresh() {
|
|
|
|
|
this.data.recordList = [];
|
|
|
|
|
this.data.storeJobListSearchForm.pageNum = 1;
|
|
|
|
|
|