手机扫码查看
- 监听页面的下拉刷新事件
在页面的.js 文件中,通过 onPullDownRefresh() 函数即可监听当前页面的下拉刷新事件 - 停止下拉刷新事件
当处理完下拉刷新后,下拉刷新的 loading 效果会一直显示,不会主动消失。
调用wx.stopPullDownRefresh() 可以停止当前页面的下拉刷新 - 监听上拉触底事件
在页面的.js 文件中,通过 onReachBottom() 函数即可监听当前页面的上拉触底事件 - 添加loading效果
- 对上拉触底进行节流处理
data:{
isLoding:false
}
getColor:{
this.setData({
isLoding:true
})
wx.request(){
success下面
complete:()=>{
wx.hideLoading()
this.setData({
isLoding:false
})
}
}
}
onReachBottom:function(){
if(this.data.isLoading) return
this.getColors()
}
- 本页地址 http://www.evshou.com/?p=3291
- 上一篇 <<微信小程序之导航传参
- 下一篇 >>微信小程序之WXS脚本


发表评论