question is how to trigger onreachBottom? My own result is that
can only trigger onReachBottom, in the case of a scroll bar, so I can only set the height of this page to 110vh so that I can have a scroll bar. Obviously there is a flaw in this place, but I don"t know how to solve it, because if I don"t set it up, I can"t trigger it, or just trigger it once
`onReachBottom:function () {
console.log("")
if(this.data.flag){
wx.showLoading({
title: "...",
})
setTimeout(()=>{
wx.hideLoading()
},1500)
return
}
let {options,page}=this.data;
this.data.page+=1
this.setData({
page:this.data.page,
})
api.getRents(options.type,this.data.page, (res)=> {
if(res.data=[]){
this.setData({
flag:true
})
}
console.log(res)
this.setData({
rents: this.data.rents.concat(res.data),
})
})`