update:优化个人训练
This commit is contained in:
+17
-1
@@ -4,6 +4,7 @@ import Container from "@/components/Container.vue";
|
||||
import UserHeader from "@/components/UserHeader.vue";
|
||||
import UserItem from "@/components/UserItem.vue";
|
||||
import Avatar from "@/components/Avatar.vue";
|
||||
import { getMyGoldAPI } from "@/apis";
|
||||
import { canEenter } from "@/util";
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
@@ -29,6 +30,16 @@ const toCoinPage = () => {
|
||||
url: "/pages/coin/nearby-stores",
|
||||
});
|
||||
};
|
||||
const showCoinEntry = ref(false);
|
||||
const loadCoinEntryVisibility = async () => {
|
||||
showCoinEntry.value = false;
|
||||
try {
|
||||
const result = await getMyGoldAPI();
|
||||
showCoinEntry.value = result?.hasTempBind === true;
|
||||
} catch (error) {
|
||||
console.error("加载金币入口状态失败", error);
|
||||
}
|
||||
};
|
||||
const toBeVipPage = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/member/be-vip",
|
||||
@@ -74,6 +85,7 @@ const logout = () => {
|
||||
updateUser();
|
||||
};
|
||||
onMounted(() => {
|
||||
loadCoinEntryVisibility();
|
||||
const accountInfo = uni.getAccountInfoSync();
|
||||
const envVersion = accountInfo.miniProgram.envVersion;
|
||||
if (envVersion !== "release") showLogout.value = true;
|
||||
@@ -113,7 +125,11 @@ const buildVersion = typeof __BUILD_TIME__ !== 'undefined' ? __BUILD_TIME__ : ''
|
||||
<text v-if="user.trio > 0" :style="{ color: '#259249' }">已完成</text>
|
||||
<text v-else :style="{ color: '#CC311F' }">未完成</text>
|
||||
</UserItem>
|
||||
<UserItem title="我的金币" :onClick="toCoinPage" />
|
||||
<UserItem
|
||||
v-if="showCoinEntry"
|
||||
title="我的金币"
|
||||
:onClick="toCoinPage"
|
||||
/>
|
||||
<UserItem title="会员" :onClick="toBeVipPage">
|
||||
<view
|
||||
v-if="user.sVip === true"
|
||||
|
||||
Reference in New Issue
Block a user