Merge branch 'feat-training' into test

This commit is contained in:
2026-09-24 10:23:55 +08:00
2 changed files with 12 additions and 3 deletions
@@ -77,6 +77,10 @@ const props = defineProps({
type: Number,
default: 0,
},
scoreSlot: {
type: Number,
default: 0,
},
isVip: {
type: Boolean,
default: false,
@@ -183,8 +187,12 @@ const progressPercent = computed(() => {
return Math.max(0, Math.min(100, (remain.value / props.total) * 100));
});
const stabilityEnergyCostText = computed(() => {
const value = Math.max(0, Number(props.energyCostPerSec) || 0);
const stabilityEnergyCostPercentText = computed(() => {
const scoreSlot = Number(props.scoreSlot);
// 以满能量值为基数,换算每秒损失的能量百分比。
const value = scoreSlot > 0
? (Math.max(0, Number(props.energyCostPerSec) || 0) / scoreSlot) * 100
: 0;
return Number.isInteger(value) ? String(value) : String(Number(value.toFixed(2)));
});
@@ -558,7 +566,7 @@ onBeforeUnmount(() => {
>
<template v-if="isStabilityTraining">
<text class="stability-progress__cost">
每秒失去{{ stabilityEnergyCostText }}能量
每秒失去{{ stabilityEnergyCostPercentText }}%能量
</text>
<view v-if="countdownEnabled" class="stability-progress__countdown">
<view