微信小程序下拉刷新
1、在app.json的"window"中进行配置
(1)把"backgroundTextStyle": "light" 改为 "backgroundTextStyle": "dark"
(2)添加"enablePullDownRefresh": true, 开启下拉刷新。
2、在app.js中增加两个生命周期函数
onPullDownRefresh:function(){ this.onRefresh(); }, onRefresh:function(){ //导航条加载动画 wx.showNavigationBarLoading(); //loading 提示框 wx.showLoading({ title: '刷新中请稍后...', }) setTimeout(function () { wx.hideLoading(); wx.hideNavigationBarLoading(); //停止下拉刷新 wx.stopPullDownRefresh(); }, 1500); },