update:优化个人训练

This commit is contained in:
2026-08-28 11:12:28 +08:00
parent 469487ba73
commit bbfa35e871
2 changed files with 18 additions and 14 deletions
+17 -1
View File
@@ -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"