update:优化个人训练
This commit is contained in:
+1
-13
@@ -15,18 +15,6 @@ const selectedIndex = ref(0);
|
|||||||
const matchList = ref([]);
|
const matchList = ref([]);
|
||||||
const battleList = ref([]);
|
const battleList = ref([]);
|
||||||
const practiseList = 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 formatPractiseTime = (value) => {
|
||||||
const normalizedTime = String(value || "").trim();
|
const normalizedTime = String(value || "").trim();
|
||||||
@@ -173,7 +161,7 @@ onLoad((options) => {
|
|||||||
@click="() => getPractiseDetail(item.id)"
|
@click="() => getPractiseDetail(item.id)"
|
||||||
>
|
>
|
||||||
<text
|
<text
|
||||||
>{{ getTrainingTypeName(item.trainingType) }}
|
>{{ item.trainingTypeText }}
|
||||||
{{ formatPractiseTime(item.createTime) }}</text
|
{{ formatPractiseTime(item.createTime) }}</text
|
||||||
>
|
>
|
||||||
<image src="../static/back.png" mode="widthFix" />
|
<image src="../static/back.png" mode="widthFix" />
|
||||||
|
|||||||
+17
-1
@@ -4,6 +4,7 @@ import Container from "@/components/Container.vue";
|
|||||||
import UserHeader from "@/components/UserHeader.vue";
|
import UserHeader from "@/components/UserHeader.vue";
|
||||||
import UserItem from "@/components/UserItem.vue";
|
import UserItem from "@/components/UserItem.vue";
|
||||||
import Avatar from "@/components/Avatar.vue";
|
import Avatar from "@/components/Avatar.vue";
|
||||||
|
import { getMyGoldAPI } from "@/apis";
|
||||||
import { canEenter } from "@/util";
|
import { canEenter } from "@/util";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
@@ -29,6 +30,16 @@ const toCoinPage = () => {
|
|||||||
url: "/pages/coin/nearby-stores",
|
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 = () => {
|
const toBeVipPage = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/member/be-vip",
|
url: "/pages/member/be-vip",
|
||||||
@@ -74,6 +85,7 @@ const logout = () => {
|
|||||||
updateUser();
|
updateUser();
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
loadCoinEntryVisibility();
|
||||||
const accountInfo = uni.getAccountInfoSync();
|
const accountInfo = uni.getAccountInfoSync();
|
||||||
const envVersion = accountInfo.miniProgram.envVersion;
|
const envVersion = accountInfo.miniProgram.envVersion;
|
||||||
if (envVersion !== "release") showLogout.value = true;
|
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-if="user.trio > 0" :style="{ color: '#259249' }">已完成</text>
|
||||||
<text v-else :style="{ color: '#CC311F' }">未完成</text>
|
<text v-else :style="{ color: '#CC311F' }">未完成</text>
|
||||||
</UserItem>
|
</UserItem>
|
||||||
<UserItem title="我的金币" :onClick="toCoinPage" />
|
<UserItem
|
||||||
|
v-if="showCoinEntry"
|
||||||
|
title="我的金币"
|
||||||
|
:onClick="toCoinPage"
|
||||||
|
/>
|
||||||
<UserItem title="会员" :onClick="toBeVipPage">
|
<UserItem title="会员" :onClick="toBeVipPage">
|
||||||
<view
|
<view
|
||||||
v-if="user.sVip === true"
|
v-if="user.sVip === true"
|
||||||
|
|||||||
Reference in New Issue
Block a user