Commit f57241f2 by liangjianmin

add

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