diff --git a/src/pages/my-growth.vue b/src/pages/my-growth.vue index 7cd4b63..4353e28 100644 --- a/src/pages/my-growth.vue +++ b/src/pages/my-growth.vue @@ -15,18 +15,6 @@ const selectedIndex = ref(0); const matchList = ref([]); const battleList = ref([]); const practiseList = ref([]); -const trainingTypeNameMap = Object.freeze({ - base: "基础训练", - endurance: "耐力训练", - precision: "精准训练", - rhythm: "节奏训练", - stability: "稳定训练", -}); - -const getTrainingTypeName = (trainingType) => { - const normalizedType = String(trainingType || "").trim().toLowerCase(); - return trainingTypeNameMap[normalizedType] || "自由训练"; -}; const formatPractiseTime = (value) => { const normalizedTime = String(value || "").trim(); @@ -173,7 +161,7 @@ onLoad((options) => { @click="() => getPractiseDetail(item.id)" > {{ getTrainingTypeName(item.trainingType) }} + >{{ item.trainingTypeText }} {{ formatPractiseTime(item.createTime) }} diff --git a/src/pages/user.vue b/src/pages/user.vue index dd37b4c..1e7cdba 100644 --- a/src/pages/user.vue +++ b/src/pages/user.vue @@ -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__ : '' 已完成 未完成 - +