优化个人中心刷新数据

This commit is contained in:
gyq
2025-01-16 15:18:10 +08:00
parent 51f8f54a26
commit be4bf820b4

View File

@@ -111,21 +111,19 @@
<script setup> <script setup>
import { ref, reactive } from 'vue'; import { ref, reactive } from 'vue';
import { onLoad,onShow, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js'; import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
import { linkTo } from '@/utils/app.js'; import { linkTo } from '@/utils/app.js';
import { import { useCommonStore } from '@/store/common.js';
useCommonStore const $common = useCommonStore();
} from '@/store/common.js'
const $common = useCommonStore()
const userInfo = ref({}); const userInfo = ref({});
// 获取最近的三条观看历史 // 获取最近的三条观看历史
const recordThree = ref([]); const recordThree = ref([]);
onShow(()=>{ onShow(() => {
// 判断ios是否审核 // 判断ios是否审核
$common.init() $common.init();
}) });
async function selectByUserIdAjax() { async function selectByUserIdAjax() {
try { try {
const res = await selectByUserId({ page: 1, limit: 3, classify: 3 }); const res = await selectByUserId({ page: 1, limit: 3, classify: 3 });
@@ -179,7 +177,7 @@ onPullDownRefresh(async () => {
}, 500); }, 500);
}); });
onLoad(() => { onShow(() => {
selectByUserIdAjax(); selectByUserIdAjax();
collectVideoSummaryAjax(); collectVideoSummaryAjax();
selectUserMoneyAjax(); selectUserMoneyAjax();