update:个人训练优化

This commit is contained in:
2026-08-14 17:13:23 +08:00
parent d662db9465
commit e7f073ed7c
25 changed files with 481 additions and 344 deletions
+22 -3
View File
@@ -15,6 +15,25 @@ const selectedIndex = ref(0);
const matchList = ref([]);
const battleList = ref([]);
const practiseList = ref([]);
const trainingTypeNameMap = Object.freeze({
base: "基础训练",
endurance: "耐力训练",
precision: "精准训练",
rhythm: "节奏训练",
});
const getTrainingTypeName = (trainingType) => {
const normalizedType = String(trainingType || "").trim().toLowerCase();
return trainingTypeNameMap[normalizedType] || "自由训练";
};
const formatPractiseTime = (value) => {
const normalizedTime = String(value || "").trim();
const matchedTime = normalizedTime.match(
/^(\d{4}-\d{2}-\d{2})[T\s](\d{2}:\d{2}:\d{2})/
);
return matchedTime ? `${matchedTime[1]} ${matchedTime[2]}` : normalizedTime;
};
const toMatchDetail = (id) => {
uni.navigateTo({
@@ -81,7 +100,7 @@ onLoad((options) => {
<Container title="我的成长脚印" :scroll="false">
<view class="tabs">
<view
v-for="(rankType, index) in ['排位赛', '好友约战', '个人练']"
v-for="(rankType, index) in ['排位赛', '好友约战', '个人练']"
:key="index"
:style="{
color: index === selectedIndex ? '#000' : '#fff',
@@ -153,8 +172,8 @@ onLoad((options) => {
@click="() => getPractiseDetail(item.id)"
>
<text
>{{ item.completed_arrows === 36 ? "耐力挑战" : "单组练习" }}
{{ item.createTime }}</text
>{{ getTrainingTypeName(item.trainingType) }}
{{ formatPractiseTime(item.createTime) }}</text
>
<image src="../static/back.png" mode="widthFix" />
</view>