From f4e7fc2fd4fb2050ce89279f5a1706a609383bf6 Mon Sep 17 00:00:00 2001 From: Seven Date: Tue, 13 Jan 2026 00:20:52 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=92=8C=E5=88=97=E8=A1=A8=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E6=A0=87=E8=83=8C=E6=99=AF=E8=89=B2=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=B7=B1=E8=89=B2=E6=A8=A1=E5=BC=8F=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/notify/detail.vue | 15 ++++++++++----- src/views/notify/index.vue | 12 +++++++++++- src/views/wallet/transfer.vue | 20 +++++--------------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/views/notify/detail.vue b/src/views/notify/detail.vue index 348323c..724919a 100644 --- a/src/views/notify/detail.vue +++ b/src/views/notify/detail.vue @@ -23,7 +23,7 @@ function getConfigByType(type: string) {
-
+
@@ -65,10 +65,15 @@ function getConfigByType(type: string) { line-height: 1.8; } +.icon { + --bg-icon-color: #d5e8b4; +} + /* 深色模式适配 */ -@media (prefers-color-scheme: dark) { - .notification-content { - color: var(--ion-color-step-600); - } +.ion-palette-dark .icon { + --bg-icon-color: #262d1b; +} +.ion-palette-dark .notification-content { + color: var(--ion-color-step-600); } diff --git a/src/views/notify/index.vue b/src/views/notify/index.vue index 61edc8c..92661f0 100644 --- a/src/views/notify/index.vue +++ b/src/views/notify/index.vue @@ -103,7 +103,7 @@ onBeforeMount(() => { class="py-3" @click="handleItemClick(item)" > -
+
@@ -133,3 +133,13 @@ onBeforeMount(() => { + + diff --git a/src/views/wallet/transfer.vue b/src/views/wallet/transfer.vue index 86f7b1e..4f34b1e 100644 --- a/src/views/wallet/transfer.vue +++ b/src/views/wallet/transfer.vue @@ -12,7 +12,8 @@ import { getCryptoIcon } from "@/config/crypto"; const { t } = useI18n(); const router = useRouter(); const walletStore = useWalletStore(); -const { fundingBalances, tradingBalances } = storeToRefs(walletStore); +const { USDTBalance } = storeToRefs(walletStore); +await walletStore.syncUSDTBalance(); const formRef = useTemplateRef("formRef"); type AccountType = "funding" | "trading"; @@ -31,17 +32,6 @@ const initialValues: TransferForm = { toAccount: "trading", }; -// 可用余额 -const availableBalance = computed(() => { - const form = formRef.value?.values as TransferForm | undefined; - if (!form) - return "0"; - - const balances = form.fromAccount === "funding" ? fundingBalances.value : tradingBalances.value; - const balance = balances?.find(item => item.assetCode === form.assetCode); - return balance ? balance.available : "0"; -}); - // 验证规则 const schema = computed(() => z.object({ assetCode: z.string({ message: t("transfer.assetCodeRequired") }).min(1, t("transfer.assetCodeRequired")), @@ -49,7 +39,7 @@ const schema = computed(() => z.object({ .string({ message: t("transfer.amountRequired") }) .min(1, t("transfer.amountRequired")) .refine(value => Number(value) > 0, t("transfer.amountMinError")) - .refine(value => Number(value) <= Number(availableBalance.value), t("transfer.amountMaxError", { amount: availableBalance.value })), + .refine(value => Number(value) <= Number(USDTBalance.value?.available), t("transfer.amountMaxError", { amount: USDTBalance.value?.available })), fromAccount: z.string({ message: t("transfer.fromAccountRequired") }).min(1, t("transfer.fromAccountRequired")), toAccount: z.string({ message: t("transfer.toAccountRequired") }).min(1, t("transfer.toAccountRequired")), })); @@ -73,7 +63,7 @@ function setMaxAmount() { if (!form) return; - form.setFieldValue("amount", availableBalance.value); + form.setFieldValue("amount", USDTBalance.value?.available || "0"); } // 提交划转 @@ -229,7 +219,7 @@ function getAccountTypeName(type: AccountType) {
{{ t("transfer.available") }} - {{ Number(availableBalance).toFixed(2) }} + {{ Number(USDTBalance?.available).toFixed(2) }}