From 9bcfe1d8feba8405fdd24ff1f3a24e65c6e90f4d Mon Sep 17 00:00:00 2001 From: Seven Date: Mon, 19 Jan 2026 01:17:07 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=87=BD=E6=95=B0=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=94=B6=E7=9B=8A=E9=92=B1=E5=8C=85=E5=92=8C=E8=B4=A6?= =?UTF-8?q?=E6=88=B7=E4=BD=99=E9=A2=9D=E7=9A=84=E5=B1=95=E7=A4=BA=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/profile/index.vue | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/views/profile/index.vue b/src/views/profile/index.vue index 93329db..0cbc60a 100644 --- a/src/views/profile/index.vue +++ b/src/views/profile/index.vue @@ -13,6 +13,14 @@ const { userProfile } = storeToRefs(userStore); const balanceWallet = await walletStore.getWalletByType("balance"); const profitWallet = await walletStore.getWalletByType("profit"); +function formatAmount(amount: number | string) { + const num = Number(amount); + return num.toLocaleString("zh-CN", { + minimumFractionDigits: 0, + maximumFractionDigits: 2, + }); +} + function handleRecharge() { router.push("/recharge"); } @@ -92,19 +100,19 @@ async function handleLogout() {
-
+
收益钱包
-
- ¥{{ Number(profitWallet?.available).toString() }} +
+ ¥{{ formatAmount(profitWallet?.available || 0) }}
-
+
账户余额
-
- ¥{{ Number(balanceWallet?.available).toString() }} +
+ ¥{{ formatAmount(balanceWallet?.available || 0) }}