feat(金币代理页面): 做两种模式的兼容

This commit is contained in:
hzj 2026-04-15 20:43:27 +08:00
parent 1751eb56c1
commit 5264795e89

View File

@ -653,8 +653,8 @@ const rechargeNow = useThrottle(async () => {
if (!canRecharge.value || isRecharging.value) return if (!canRecharge.value || isRecharging.value) return
const amount = rechargeDollarAmount.value const amount = rechargeDollarAmount.value
const quantity = rechargeCoinsNeeded.value const quantity = hasRechargeRatio.value ? rechargeCoinsNeeded.value : rechargeDollarAmount.value
if (amount <= 0) { if (quantity <= 0) {
showError(t('please_enter_valid_amount')) showError(t('please_enter_valid_amount'))
return return
} }
@ -676,12 +676,12 @@ const rechargeNow = useThrottle(async () => {
const rechargeData = hasRechargeRatio.value const rechargeData = hasRechargeRatio.value
? { ? {
acceptUserId: acceptUserId, acceptUserId: acceptUserId,
quantity: amount, quantity: quantity,
amount: quantity, amount: amount,
} }
: { : {
acceptUserId: acceptUserId, acceptUserId: acceptUserId,
quantity: amount, quantity: quantity,
} }
const response = await freightRecharge(rechargeData) const response = await freightRecharge(rechargeData)
@ -694,7 +694,7 @@ const rechargeNow = useThrottle(async () => {
showSuccess( showSuccess(
t('transfer_coin_success', { t('transfer_coin_success', {
amount: hasRechargeRatio.value ? quantity : amount, amount: quantity,
name: selectedUser.value.name, name: selectedUser.value.name,
}), }),
) )
@ -704,7 +704,7 @@ const rechargeNow = useThrottle(async () => {
} else { } else {
showError( showError(
t('transfer_coin_failed', { t('transfer_coin_failed', {
amount: hasRechargeRatio.value ? quantity : amount, amount: quantity,
}), }),
) )
} }
@ -713,7 +713,7 @@ const rechargeNow = useThrottle(async () => {
showError( showError(
error.response.errorMsg || error.response.errorMsg ||
t('transfer_coin_failed', { t('transfer_coin_failed', {
amount: hasRechargeRatio.value ? quantity : amount, amount: quantity,
}), }),
) )
} finally { } finally {