Commit f57241f2 by liangjianmin

add

parent 3fe5901f
Showing with 14 additions and 5 deletions
...@@ -122,8 +122,7 @@ ...@@ -122,8 +122,7 @@
}; };
}, },
onShow() { onShow() {
this.getData(); this.loadHomeData();
this.getStayHandleCount();
}, },
/** /**
* 下拉刷新 * 下拉刷新
...@@ -132,12 +131,22 @@ ...@@ -132,12 +131,22 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.vibrateShort(); uni.vibrateShort();
// #endif // #endif
Promise.all([this.getData(), this.getStayHandleCount()]).finally(() => { this.loadHomeData(true);
uni.stopPullDownRefresh();
});
}, },
methods: { methods: {
/** /**
* 统一加载首页数据
* @param {Boolean} needStopRefresh 是否需要结束下拉刷新
* @return {Promise}
*/
loadHomeData(needStopRefresh = false) {
return Promise.allSettled([this.getData(), this.getStayHandleCount()]).finally(() => {
if (needStopRefresh) {
uni.stopPullDownRefresh();
}
});
},
/**
* 获取首页统计数据 * 获取首页统计数据
* @return {Promise} * @return {Promise}
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment