update:优化新版个人训练

This commit is contained in:
2026-08-26 17:23:36 +08:00
parent 11eeb98b74
commit b9bbaba77f
4 changed files with 51 additions and 82 deletions
+28 -65
View File
@@ -231,6 +231,13 @@ const metricConfigs = {
deltaKeys: ["deltaStability", "delta_stability"], deltaKeys: ["deltaStability", "delta_stability"],
deltaUnit: "", deltaUnit: "",
}, },
{
label: "十环次数",
valueKeys: ["tenRingCount", "ten_ring_count"],
unit: "次",
deltaKeys: ["deltaTenRingCount", "delta_ten_ring_count"],
deltaUnit: "次",
},
], ],
rhythm: [ rhythm: [
{ {
@@ -296,35 +303,36 @@ const metricConfigs = {
deltaKeys: ["deltaTotalRings", "delta_total_rings"], deltaKeys: ["deltaTotalRings", "delta_total_rings"],
deltaUnit: "环", deltaUnit: "环",
}, },
{
label: "平均环数",
valueKeys: ["averageRing", "average_ring"],
unit: "环",
deltaKeys: ["deltaAverageRing", "delta_average_ring"],
deltaUnit: "环",
},
], ],
precision: [ precision: [
{ {
label: "命中目标", label: "命中目标",
valueKeys: ["totalHits", "total_hits"], valueKeys: ["totalHits", "total_hits"],
fallback: () => 0, fallback: () => 0,
unit: "次", unit: "次",
deltaKeys: [ deltaKeys: ["deltaTotalHits", "delta_total_hits"],
"deltaTotalHits",
"delta_total_hits",
"hitCompare",
"hitDiff",
"hitDelta",
],
deltaUnit: "次", deltaUnit: "次",
}, },
{ {
label: "用时", label: "射箭数",
valueKeys: ["duration", "usedTime", "shootTime", "time"], valueKeys: ["totalArrows", "total_arrows"],
unit: "", unit: "",
deltaKeys: [ deltaKeys: ["deltaTotalArrows", "delta_total_arrows"],
"deltaDuration", deltaUnit: "箭",
"delta_duration", },
"timeCompare", {
"timeDiff", label: "命中率",
"durationDiff", valueKeys: ["hitRate", "hit_rate"],
], unit: "%",
deltaUnit: "", deltaKeys: ["deltaHitRate", "delta_hit_rate"],
duration: true, deltaUnit: "%",
}, },
], ],
}; };
@@ -360,9 +368,6 @@ const handlePrimary = () => {
retryPractice(); retryPractice();
}; };
const calories = computed(
() => formatMetricNumber(readMetricNumber(["calories", "calorie", "kcal"]))
);
</script> </script>
<template> <template>
@@ -398,28 +403,6 @@ const calories = computed(
<view v-else class="stat-value">--</view> <view v-else class="stat-value">--</view>
</view> </view>
</view> </view>
<view
v-if="!['rhythm', 'stability'].includes(resultTrainingType)"
class="stat-row"
>
<image class="stat-bg" src="https://static.shelingxingqiu.com/shootmini/static/training-difficulty-design/result-c-bg.png" mode="scaleToFill" />
<view class="stat-cell">
<text class="stat-label">消耗卡路里</text>
<view class="stat-value">
<text>{{ calories }}</text>
</view>
</view>
<text class="stat-equal"></text>
<!-- <view class="stat-divider"></view> -->
<view class="stat-cell stat-cell--compare">
<view class="stat-value">
<image v-for="index in 3" :key="index" class="rice-icon"
src="https://static.shelingxingqiu.com/shootmini/static/training-difficulty-design/result-rice.png" mode="widthFix" />
</view>
</view>
</view>
<view class="actions"> <view class="actions">
<view class="action-item" @click="() => (showBowData = true)"> <view class="action-item" @click="() => (showBowData = true)">
<image class="action-icon" src="https://static.shelingxingqiu.com/shootmini/static/training-difficulty-design/result-icon-1.png" mode="widthFix" /> <image class="action-icon" src="https://static.shelingxingqiu.com/shootmini/static/training-difficulty-design/result-icon-1.png" mode="widthFix" />
@@ -663,14 +646,6 @@ const calories = computed(
transform: skewX(12deg); transform: skewX(12deg);
} }
.stat-equal{
width: 30rpx;
height: 40rpx;
color: #F3E0B9;
font-size: 30rpx;
margin-left: 10rpx;
}
.trend-icon { .trend-icon {
width: 28rpx; width: 28rpx;
height: 42rpx; height: 42rpx;
@@ -689,18 +664,6 @@ const calories = computed(
height: 62rpx; height: 62rpx;
} }
.rice-list {
width: 160rpx;
display: flex;
align-items: center;
}
.rice-icon {
width: 36rpx;
height: 34rpx;
margin-right: 14rpx;
}
.oper-box { .oper-box {
position: relative; position: relative;
z-index: 1; z-index: 1;
+18 -14
View File
@@ -303,15 +303,6 @@ const rhythmHitReq = computed(
getPositiveInteger(trainingParams.value.hitReq) getPositiveInteger(trainingParams.value.hitReq)
); );
const stabilityEnergyPerHit = computed(() =>
Math.max(
0,
getPracticeNumber(
practiceInfo.value.energyPerHit,
trainingParams.value.energyPerHit
)
)
);
const stabilityEnergyReqPercent = computed(() => const stabilityEnergyReqPercent = computed(() =>
Math.max( Math.max(
0, 0,
@@ -502,14 +493,22 @@ const trainingCopy = computed(() => {
practiceInfo.value.hitReq, practiceInfo.value.hitReq,
trainingParams.value.hitReq trainingParams.value.hitReq
); );
const stabilityTimeLimit = getPracticeNumber(
practiceInfo.value.timeLimit,
trainingParams.value.timeLimit
);
return { return {
inline: true, inline: true,
details: [ details: [
{ text: "射箭命中" }, { text: stabilityTimeLimit > 0 ? "在" : "" },
{ text: `${hitReq}环及以上`, highlight: true }, {
{ text: `每箭可获得${stabilityEnergyPerHit.value}点能量,` }, text: stabilityTimeLimit > 0 ? `${stabilityTimeLimit}` : "不限时",
{ text: "计时结束时能量需达到" }, highlight: true,
},
{ text: stabilityTimeLimit > 0 ? "内射箭,命中" : "射箭,命中" },
{ text: `${hitReq}`, highlight: true },
{ text: "可获得能量,计时结束能量需要大于" },
{ {
text: `${stabilityEnergyReqPercent.value}%`, text: `${stabilityEnergyReqPercent.value}%`,
highlight: true, highlight: true,
@@ -575,8 +574,10 @@ const practiceInfoFields = [
"stability", "stability",
"maxCombo", "maxCombo",
"totalHits", "totalHits",
"hitRate",
"deltaTotalHits", "deltaTotalHits",
"deltaDuration", "deltaDuration",
"deltaHitRate",
"deltaMaxCombo", "deltaMaxCombo",
"deltaTotalRings", "deltaTotalRings",
"deltaTotalArrows", "deltaTotalArrows",
@@ -604,6 +605,7 @@ const practiceResultFields = [
"stability", "stability",
"maxCombo", "maxCombo",
"totalHits", "totalHits",
"hitRate",
"currentRings", "currentRings",
"scoreSlot", "scoreSlot",
"currentEnergy", "currentEnergy",
@@ -619,6 +621,7 @@ const practiceResultFields = [
"deltaQualifiedRate", "deltaQualifiedRate",
"deltaTotalHits", "deltaTotalHits",
"deltaDuration", "deltaDuration",
"deltaHitRate",
"deltaMaxCombo", "deltaMaxCombo",
"deltaTotalRings", "deltaTotalRings",
"deltaTotalArrows", "deltaTotalArrows",
@@ -1371,7 +1374,7 @@ onLoad((options = {}) => {
serverAddr.value = trainingContext.serverAddr || ""; serverAddr.value = trainingContext.serverAddr || "";
const startAudioKey = getTrainingStartAudioKey(trainingParams.value.type); const startAudioKey = getTrainingStartAudioKey(trainingParams.value.type);
const warmupKeys = [startAudioKey]; const warmupKeys = [startAudioKey, "胜利", "失败"];
if (trainingParams.value.type === "precision") { if (trainingParams.value.type === "precision") {
warmupKeys.push("Bingo命中目标", "未命中"); warmupKeys.push("Bingo命中目标", "未命中");
} else if (trainingParams.value.type === "rhythm") { } else if (trainingParams.value.type === "rhythm") {
@@ -1450,6 +1453,7 @@ const enterPracticeResult = (result = {}) => {
clearPracticeRuntimeContext(); clearPracticeRuntimeContext();
closePracticeConnection("training-practice-result"); closePracticeConnection("training-practice-result");
pageStage.value = pageStages.RESULT; pageStage.value = pageStages.RESULT;
audioManager.play(result.completed === true ? "胜利" : "失败");
return true; return true;
}; };
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -2
View File
@@ -7,8 +7,8 @@ const { Reader, Writer } = protobuf;
// 所以这里使用 minimal Reader/Writer 做静态字段解码和客户端消息编码。 // 所以这里使用 minimal Reader/Writer 做静态字段解码和客户端消息编码。
// <match-schema-generated> // <match-schema-generated>
// 此区块由 scripts/generate-match-schema.mjs 自动生成,请勿手动修改。 // 此区块由 scripts/generate-match-schema.mjs 自动生成,请勿手动修改。
// 来源:src/utils/match.min.jssha256: 0fe50dfa2644f750 // 来源:src/utils/match.min.jssha256: bece92f31bde3072
// 协议命名空间:rpc;消息数:12;字段数:161 // 协议命名空间:rpc;消息数:12;字段数:163
export const ServerMessageType = { export const ServerMessageType = {
SERVER_MSG_UNKNOWN: 0, SERVER_MSG_UNKNOWN: 0,
@@ -204,6 +204,8 @@ const SCHEMAS = {
59: { name: "delta_max_energy_percent", kind: "int32" }, 59: { name: "delta_max_energy_percent", kind: "int32" },
60: { name: "delta_qualified_arrows", kind: "int32" }, 60: { name: "delta_qualified_arrows", kind: "int32" },
61: { name: "delta_qualified_rate", kind: "int32" }, 61: { name: "delta_qualified_rate", kind: "int32" },
62: { name: "hit_rate", kind: "int32" },
63: { name: "delta_hit_rate", kind: "int32" },
}, },
MatchInfo: { MatchInfo: {
1: { name: "match_id", kind: "string" }, 1: { name: "match_id", kind: "string" },