fix: 修改充值提现配置和充值接口

This commit is contained in:
JiaJun
2026-07-06 16:52:47 +08:00
parent e0859d2606
commit db1251c761
13 changed files with 830 additions and 13 deletions

View File

@@ -85,6 +85,7 @@ export function useWithdrawVm() {
withdraw: {
...baseConfig.withdraw,
banks: baseConfig.withdraw.banks,
payChannels: baseConfig.withdraw.payChannels,
},
}
}, [withdrawConfigQuery.data])
@@ -109,17 +110,25 @@ export function useWithdrawVm() {
const selectedRate = selectedCurrency.withdrawCoinsPerFiatValue || 1
const sortedPayChannels = useMemo(
() =>
[...config.payChannels]
[
...(config.withdraw.payChannels.length > 0
? config.withdraw.payChannels
: config.payChannels),
]
.filter((channel) => channel.status === 1)
.sort((left, right) => left.sort - right.sort),
[config.payChannels],
[config.payChannels, config.withdraw.payChannels],
)
const sortedBanks = useMemo(
() =>
[...config.withdraw.banks]
.filter((bank) => bank.status === 1)
.filter(
(bank) =>
bank.status === 1 &&
(!bank.currencyCode || bank.currencyCode === selectedCurrency.code),
)
.sort((left, right) => left.sort - right.sort),
[config.withdraw.banks],
[config.withdraw.banks, selectedCurrency.code],
)
const availableBalance = Number(currentUser?.coin ?? 0)
const maxWithdrawAmount = Math.max(0, Math.floor(availableBalance))