优化用户中心下拉刷新更新数据

This commit is contained in:
gyq
2025-01-14 09:36:56 +08:00
parent 85708668b3
commit 52487cc3c1
2 changed files with 27 additions and 21 deletions

View File

@@ -111,7 +111,7 @@
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app';
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
import { linkTo } from '@/utils/app.js';
@@ -162,8 +162,17 @@ function toTask() {
});
}
onLoad(() => {});
onShow(() => {
onPullDownRefresh(async () => {
await selectByUserIdAjax();
await collectVideoSummaryAjax();
await selectUserMoneyAjax();
userInfo.value = uni.getStorageSync('userInfo');
setTimeout(() => {
uni.stopPullDownRefresh();
}, 500);
});
onLoad(() => {
selectByUserIdAjax();
collectVideoSummaryAjax();
selectUserMoneyAjax();