热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_53051713
油麦菜你好
3 年前
trueweixin_53051713

小程序P56 18.案例-判断数据是否加载完毕
// pages/shoplist/shoplist.js
data: {
query:{},
shopList:[],
page:1,
pageSize:10,
total:0,
isloading:false
},

if(this.data.page*this.data.pageSize >= this.data.total){
//证明没有下一页数据
return wx.showToast({
title: '数据加载完毕!',
icon:'none'
})
}
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom:function() {
if(this.data.page*this.data.pageSize >= this.data.total){
//证明没有下一页数据
return wx.showToast({
title: '数据加载完毕!',
icon:'none'
})
}
//判断是否正在加载其他数据
if(this.data.isloading) return
//页码值+1
this.setData({
page:this.data.page+1
})
this.getShopList()
},

CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条:
TCGA
立即登录