update:个人训练优化
This commit is contained in:
+22
-3
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user