fix: index detail
This commit is contained in:
@@ -219,7 +219,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, computed } from "vue";
|
import { ref, onMounted, computed } from "vue";
|
||||||
import { getStatusBarHeight } from "@/utils/system";
|
import { getStatusBarHeight } from "@/utils/system";
|
||||||
import { onShareAppMessage, onShareTimeline, onShow } from "@dcloudio/uni-app";
|
import {
|
||||||
|
onShareAppMessage,
|
||||||
|
onShareTimeline,
|
||||||
|
onShow,
|
||||||
|
onPullDownRefresh,
|
||||||
|
} from "@dcloudio/uni-app";
|
||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
import {
|
import {
|
||||||
getRankList,
|
getRankList,
|
||||||
@@ -359,9 +364,13 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
// if (userStore.userInfo) {
|
fetchHomeData();
|
||||||
// // userInfo.value = userStore.userInfo; // 已改为 computed
|
fetchUserSingInfo();
|
||||||
// }
|
});
|
||||||
|
|
||||||
|
onPullDownRefresh(() => {
|
||||||
|
fetchHomeData();
|
||||||
|
fetchUserSingInfo();
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchUserSingInfo = async () => {
|
const fetchUserSingInfo = async () => {
|
||||||
@@ -386,6 +395,8 @@ const fetchHomeData = async () => {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("fetchHomeData error", e);
|
console.error("fetchHomeData error", e);
|
||||||
|
} finally {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user