From 5bb9df8a030362e9557e9cacfbadf60fec94c15a Mon Sep 17 00:00:00 2001 From: zhangyibo95 <690096405@qq.com> Date: Mon, 12 Oct 2026 16:12:24 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=E4=BC=98=E5=8C=96=E8=8A=82?= =?UTF-8?q?=E5=A5=8F=E8=AE=AD=E7=BB=83=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../training/components/ShootProgress.vue | 2 +- src/pages/training/practise-one.vue | 28 ++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/pages/training/components/ShootProgress.vue b/src/pages/training/components/ShootProgress.vue index b117e0c..9b05675 100644 --- a/src/pages/training/components/ShootProgress.vue +++ b/src/pages/training/components/ShootProgress.vue @@ -223,7 +223,7 @@ const rhythmTitle = computed(() => { if (!validRhythmHitReq.value) { return `在最后的${validRhythmShootTime.value}秒内射箭`; } - return `在最后的${validRhythmShootTime.value}秒并命中${validRhythmHitReq.value}环内`; + return `在最后的${validRhythmShootTime.value}秒射箭并命中${validRhythmHitReq.value}环内`; }); const displayName = computed(() => { diff --git a/src/pages/training/practise-one.vue b/src/pages/training/practise-one.vue index 6b4aa15..3dbb376 100644 --- a/src/pages/training/practise-one.vue +++ b/src/pages/training/practise-one.vue @@ -494,21 +494,17 @@ const trainingCopy = computed(() => { if (trainingType.value === "rhythm") { const totalArrows = getPositiveInteger(rhythmTargetArrows.value) || total.value; - // 总箭数与达标箭数分别展示,合格进度优先使用服务端快照。 + // 节奏训练进度由总箭数减剩余箭数计算,qualifiedArrows 仅用于稳定训练。 const targetArrows = getPositiveInteger(practiceInfo.value.targetArrows) || getPositiveInteger(trainingParams.value.totalReq) || totalArrows; - const arrowsLeft = Math.min( + const completedArrows = Math.min( totalArrows, Math.max( 0, - getPracticeNumber(practiceInfo.value.arrowsLeft, totalArrows) + totalArrows - getPracticeNumber(practiceInfo.value.arrowsLeft, totalArrows) ) ); - const completedArrows = Math.max( - 0, - getPracticeNumber(practiceInfo.value.qualifiedArrows, totalArrows - arrowsLeft) - ); const hitReq = rhythmHitReq.value; return { @@ -735,6 +731,24 @@ const syncPracticeInfo = (message = {}) => { return result; }, {}); + const isRhythmSnapshot = + messageTrainingType === "rhythm" && + (message.type === undefined || + [ + MESSAGETYPESV2.BattleStart, + MESSAGETYPESV2.ShootResult, + MESSAGETYPESV2.BattleEnd, + ].includes(message.type)); + + if (isRhythmSnapshot) { + // 完整快照中 proto3 会省略 0;最后一箭及重连时不能保留旧剩余数。 + for (const field of ["arrowsLeft", "qualifiedArrows"]) { + if (!Object.prototype.hasOwnProperty.call(nextInfo, field)) { + nextInfo[field] = 0; + } + } + } + const isStabilityEnergySnapshot = messageTrainingType === "stability" && (Object.prototype.hasOwnProperty.call(message, "currentEnergy") ||