From 81505df53f9aa5d24153f4c7e6903f61638a573b Mon Sep 17 00:00:00 2001 From: woody Date: Wed, 16 Jul 2025 10:40:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(mine):=20=E6=8B=93=E5=B1=95=E7=BB=93?= =?UTF-8?q?=E4=BD=99=E5=B1=95=E7=A4=BA=E4=B8=87=E7=BA=A7=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/index.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pages/mine/index.vue b/pages/mine/index.vue index a982548..92472a8 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -131,8 +131,9 @@ }" > - 左区 {{ totalBalanceProgress.leftValue || 0 }}/右区 - {{ totalBalanceProgress.rightValue || 0 }} + 左区 + {{ totalBalanceFormat(totalBalanceProgress.leftValue) }}/右区 + {{ totalBalanceFormat(totalBalanceProgress.rightValue) }} @@ -632,13 +633,24 @@ export default { return { leftProgress, rightProgress, - leftValue: leftValue.toFixed(0), - rightValue: rightValue.toFixed(0), + leftValue: leftValue, + rightValue: rightValue, } }, }, methods: { + totalBalanceFormat(value) { + const num = parseFloat(value) + if (isNaN(num)) { + return '0.0000万' + } + if (num >= 5000000) { + return '500万+' + } + const valueInWan = num / 10000 + return `${valueInWan.toFixed(4)}万` + }, getMemberBalance() { getMemberBalance().then(res => { console.log('🌈res', res)