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

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

@@ -50,7 +50,8 @@
"path": "pages/me/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
}, {
"path": "pages/me/contact",
@@ -171,33 +172,29 @@
}
},
{
"path" : "pages/task/prizeList",
"style" :
{
"navigationBarTitleText" : "任务"
"path": "pages/task/prizeList",
"style": {
"navigationBarTitleText": "任务"
}
},
{
"path" : "pages/task/receiveMember",
"style" :
{
"navigationBarTitleText" : "",
"path": "pages/task/receiveMember",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/me/prizeDraw",
"style" :
{
"navigationBarTitleText" : "抽奖"
"path": "pages/me/prizeDraw",
"style": {
"navigationBarTitleText": "抽奖"
}
},
{
"path" : "pages/pays/pays",
"style" :
{
"navigationBarTitleText" : ""
"path": "pages/pays/pays",
"style": {
"navigationBarTitleText": ""
}
}
],

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();