From 8519a36ab781607474b4119ac285109fea305827 Mon Sep 17 00:00:00 2001 From: JiaJun <2394389886@qq.com> Date: Tue, 7 Jul 2026 15:53:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(withdraw):=20=E6=B7=BB=E5=8A=A0=E5=85=91?= =?UTF-8?q?=E6=8D=A2=E6=B1=87=E7=8E=87=E8=AE=A1=E7=AE=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 selectedExchangeRate 变量用于获取钻石兑换汇率 - 更新预览界面显示正确的汇率值 - 将汇率值传递给依赖数组以确保正确更新 --- src/hooks/use-withdraw-vm.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hooks/use-withdraw-vm.ts b/src/hooks/use-withdraw-vm.ts index b322728..f0e0ec8 100644 --- a/src/hooks/use-withdraw-vm.ts +++ b/src/hooks/use-withdraw-vm.ts @@ -108,6 +108,9 @@ export function useWithdrawVm() { currencyCode, ) const selectedRate = selectedCurrency.withdrawCoinsPerFiatValue || 1 + const selectedExchangeRate = + config.rates.find((rate) => rate.currency === selectedCurrency.code) + ?.diamondsPerFiatUnitValue || selectedRate const sortedPayChannels = useMemo( () => [ @@ -246,7 +249,7 @@ export function useWithdrawVm() { exchangeRateLabel: t('gameDesktop.withdraw.preview.exchangeRate', { currency: selectedCurrency.code, }), - exchangeRateValue: `1:${formatNumber(locale, selectedRate)}`, + exchangeRateValue: `1:${formatNumber(locale, selectedExchangeRate)}`, convertibleLabel: t('gameDesktop.withdraw.preview.convertible', { currency: selectedCurrency.code, }), @@ -260,6 +263,7 @@ export function useWithdrawVm() { locale, selectedCurrency.code, selectedCurrency.label, + selectedExchangeRate, selectedRate, t, ],