|
...
|
...
|
@@ -248,7 +248,41 @@ Page({ |
|
|
|
url: util.http_build_query(this.data.options,'./cart')
|
|
|
|
})
|
|
|
|
},
|
|
|
|
bindscroll(e){
|
|
|
|
getClassNameFlag:true,
|
|
|
|
async bindscroll(e){
|
|
|
|
if(!this.getClassNameFlag) return;
|
|
|
|
console.log(e);
|
|
|
|
}
|
|
|
|
this.getClassNameFlag=false;
|
|
|
|
let activeId=await this.getClassName();
|
|
|
|
this.getClassNameFlag=true;
|
|
|
|
this.setData({
|
|
|
|
activeId:activeId,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getClassName(){
|
|
|
|
let that=this;
|
|
|
|
return new Promise(function(success,fail){
|
|
|
|
let activeId='';
|
|
|
|
let activeTop=-100000;
|
|
|
|
var query = wx.createSelectorQuery();
|
|
|
|
query.selectAll('.list-model-masonry').boundingClientRect()
|
|
|
|
query.exec(function (res) {
|
|
|
|
for(let i=0;i<res[0].length;i++){
|
|
|
|
let x=res[0][i];
|
|
|
|
if(x.top<150){
|
|
|
|
console.log(x)
|
|
|
|
if(x.top>activeTop){
|
|
|
|
activeTop=x.top
|
|
|
|
activeId=x.id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log('class_name-activeId',activeId,activeTop);
|
|
|
|
if(activeId==that.data.cookbooklist[0].id && activeTop<150){
|
|
|
|
activeId='';
|
|
|
|
}
|
|
|
|
success(activeId)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|