下拉刷新很简单,主要刷新的时候业务不要写错就行
在全局或者页面配置中开启下拉刷新
"enablePullDownRefresh" : true
然后在页面中实现下拉的操作
onPullDownRefresh: function(res) {
var that = this;
wx.showNavigationBarLoading();
//加个定时器模拟请求的时间
setTimeout(function()
{
//刷新页面的操作
http.get('api/Index/index', {}, function(res){
console.log(res);
}, true);
wx.hideNavigationBarLoading();
wx.stopPullDownRefresh();
},0500);
}