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"],
deltaUnit: "",
},
{
label: "十环次数",
valueKeys: ["tenRingCount", "ten_ring_count"],
unit: "次",
deltaKeys: ["deltaTenRingCount", "delta_ten_ring_count"],
deltaUnit: "次",
},
],
rhythm: [
{
@@ -296,35 +303,36 @@ const metricConfigs = {
deltaKeys: ["deltaTotalRings", "delta_total_rings"],
deltaUnit: "环",
},
{
label: "平均环数",
valueKeys: ["averageRing", "average_ring"],
unit: "环",
deltaKeys: ["deltaAverageRing", "delta_average_ring"],
deltaUnit: "环",
},
],
precision: [
{
label: "命中目标",
label: "命中目标",
valueKeys: ["totalHits", "total_hits"],
fallback: () => 0,
unit: "次",
deltaKeys: [
"deltaTotalHits",
"delta_total_hits",
"hitCompare",
"hitDiff",
"hitDelta",
],
deltaKeys: ["deltaTotalHits", "delta_total_hits"],
deltaUnit: "次",
},
{
label: "用时",
valueKeys: ["duration", "usedTime", "shootTime", "time"],
unit: "",
deltaKeys: [
"deltaDuration",
"delta_duration",
"timeCompare",
"timeDiff",
"durationDiff",
],
deltaUnit: "",
duration: true,
label: "射箭数",
valueKeys: ["totalArrows", "total_arrows"],
unit: "",
deltaKeys: ["deltaTotalArrows", "delta_total_arrows"],
deltaUnit: "箭",
},
{
label: "命中率",
valueKeys: ["hitRate", "hit_rate"],
unit: "%",
deltaKeys: ["deltaHitRate", "delta_hit_rate"],
deltaUnit: "%",
},
],
};
@@ -360,9 +368,6 @@ const handlePrimary = () => {
retryPractice();
};
const calories = computed(
() => formatMetricNumber(readMetricNumber(["calories", "calorie", "kcal"]))
);
</script>
<template>
@@ -398,28 +403,6 @@ const calories = computed(
<view v-else class="stat-value">--</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="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" />
@@ -663,14 +646,6 @@ const calories = computed(
transform: skewX(12deg);
}
.stat-equal{
width: 30rpx;
height: 40rpx;
color: #F3E0B9;
font-size: 30rpx;
margin-left: 10rpx;
}
.trend-icon {
width: 28rpx;
height: 42rpx;
@@ -689,18 +664,6 @@ const calories = computed(
height: 62rpx;
}
.rice-list {
width: 160rpx;
display: flex;
align-items: center;
}
.rice-icon {
width: 36rpx;
height: 34rpx;
margin-right: 14rpx;
}
.oper-box {
position: relative;
z-index: 1;
+18 -14
View File
@@ -303,15 +303,6 @@ const rhythmHitReq = computed(
getPositiveInteger(trainingParams.value.hitReq)
);
const stabilityEnergyPerHit = computed(() =>
Math.max(
0,
getPracticeNumber(
practiceInfo.value.energyPerHit,
trainingParams.value.energyPerHit
)
)
);
const stabilityEnergyReqPercent = computed(() =>
Math.max(
0,
@@ -502,14 +493,22 @@ const trainingCopy = computed(() => {
practiceInfo.value.hitReq,
trainingParams.value.hitReq
);
const stabilityTimeLimit = getPracticeNumber(
practiceInfo.value.timeLimit,
trainingParams.value.timeLimit
);
return {
inline: true,
details: [
{ text: "射箭命中" },
{ text: `${hitReq}环及以上`, highlight: true },
{ text: `每箭可获得${stabilityEnergyPerHit.value}点能量,` },
{ text: "计时结束时能量需达到" },
{ text: stabilityTimeLimit > 0 ? "在" : "" },
{
text: stabilityTimeLimit > 0 ? `${stabilityTimeLimit}` : "不限时",
highlight: true,
},
{ text: stabilityTimeLimit > 0 ? "内射箭,命中" : "射箭,命中" },
{ text: `${hitReq}`, highlight: true },
{ text: "可获得能量,计时结束能量需要大于" },
{
text: `${stabilityEnergyReqPercent.value}%`,
highlight: true,
@@ -575,8 +574,10 @@ const practiceInfoFields = [
"stability",
"maxCombo",
"totalHits",
"hitRate",
"deltaTotalHits",
"deltaDuration",
"deltaHitRate",
"deltaMaxCombo",
"deltaTotalRings",
"deltaTotalArrows",
@@ -604,6 +605,7 @@ const practiceResultFields = [
"stability",
"maxCombo",
"totalHits",
"hitRate",
"currentRings",
"scoreSlot",
"currentEnergy",
@@ -619,6 +621,7 @@ const practiceResultFields = [
"deltaQualifiedRate",
"deltaTotalHits",
"deltaDuration",
"deltaHitRate",
"deltaMaxCombo",
"deltaTotalRings",
"deltaTotalArrows",
@@ -1371,7 +1374,7 @@ onLoad((options = {}) => {
serverAddr.value = trainingContext.serverAddr || "";
const startAudioKey = getTrainingStartAudioKey(trainingParams.value.type);
const warmupKeys = [startAudioKey];
const warmupKeys = [startAudioKey, "胜利", "失败"];
if (trainingParams.value.type === "precision") {
warmupKeys.push("Bingo命中目标", "未命中");
} else if (trainingParams.value.type === "rhythm") {
@@ -1450,6 +1453,7 @@ const enterPracticeResult = (result = {}) => {
clearPracticeRuntimeContext();
closePracticeConnection("training-practice-result");
pageStage.value = pageStages.RESULT;
audioManager.play(result.completed === 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 做静态字段解码和客户端消息编码。
// <match-schema-generated>
// 此区块由 scripts/generate-match-schema.mjs 自动生成,请勿手动修改。
// 来源:src/utils/match.min.jssha256: 0fe50dfa2644f750
// 协议命名空间:rpc;消息数:12;字段数:161
// 来源:src/utils/match.min.jssha256: bece92f31bde3072
// 协议命名空间:rpc;消息数:12;字段数:163
export const ServerMessageType = {
SERVER_MSG_UNKNOWN: 0,
@@ -204,6 +204,8 @@ const SCHEMAS = {
59: { name: "delta_max_energy_percent", kind: "int32" },
60: { name: "delta_qualified_arrows", kind: "int32" },
61: { name: "delta_qualified_rate", kind: "int32" },
62: { name: "hit_rate", kind: "int32" },
63: { name: "delta_hit_rate", kind: "int32" },
},
MatchInfo: {
1: { name: "match_id", kind: "string" },