update:优化稳定训练提示
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user