Commit f57241f2 by liangjianmin

add

parent 3fe5901f
Showing with 13 additions and 4 deletions
...@@ -122,8 +122,7 @@ ...@@ -122,8 +122,7 @@
}; };
}, },
onShow() { onShow() {
this.getData(); this.loadHomeData();
this.getStayHandleCount();
}, },
/** /**
* 下拉刷新 * 下拉刷新
...@@ -132,11 +131,21 @@ ...@@ -132,11 +131,21 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.vibrateShort(); uni.vibrateShort();
// #endif // #endif
Promise.all([this.getData(), this.getStayHandleCount()]).finally(() => { this.loadHomeData(true);
},
methods: {
/**
* 统一加载首页数据
* @param {Boolean} needStopRefresh 是否需要结束下拉刷新
* @return {Promise}
*/
loadHomeData(needStopRefresh = false) {
return Promise.allSettled([this.getData(), this.getStayHandleCount()]).finally(() => {
if (needStopRefresh) {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}
}); });
}, },
methods: {
/** /**
* 获取首页统计数据 * 获取首页统计数据
* @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