问题就是如何触发onreachBottom呢?我自己的结果是:
只有在滚动条的情况才能触发onReachBottom,所以这个页面的高度我只能设置110vh这样才能有滚动条,很明显这个地方是有瑕疵的,但是我不知道如何解决,因为不这么设置就无法触发,或者就只触发一次
`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),
})
})`
请问如何很好的触发这个事件呢
当页面滚动到底部之后,view始终在页面的底部所以不再触发scorll,所以外层用view,里层用sroll-view绑定bindscroll事件,事件中用