feat(金币代理页面): 做两种模式的兼容
This commit is contained in:
parent
1751eb56c1
commit
5264795e89
@ -653,8 +653,8 @@ const rechargeNow = useThrottle(async () => {
|
||||
if (!canRecharge.value || isRecharging.value) return
|
||||
|
||||
const amount = rechargeDollarAmount.value
|
||||
const quantity = rechargeCoinsNeeded.value
|
||||
if (amount <= 0) {
|
||||
const quantity = hasRechargeRatio.value ? rechargeCoinsNeeded.value : rechargeDollarAmount.value
|
||||
if (quantity <= 0) {
|
||||
showError(t('please_enter_valid_amount'))
|
||||
return
|
||||
}
|
||||
@ -676,12 +676,12 @@ const rechargeNow = useThrottle(async () => {
|
||||
const rechargeData = hasRechargeRatio.value
|
||||
? {
|
||||
acceptUserId: acceptUserId,
|
||||
quantity: amount,
|
||||
amount: quantity,
|
||||
quantity: quantity,
|
||||
amount: amount,
|
||||
}
|
||||
: {
|
||||
acceptUserId: acceptUserId,
|
||||
quantity: amount,
|
||||
quantity: quantity,
|
||||
}
|
||||
|
||||
const response = await freightRecharge(rechargeData)
|
||||
@ -694,7 +694,7 @@ const rechargeNow = useThrottle(async () => {
|
||||
|
||||
showSuccess(
|
||||
t('transfer_coin_success', {
|
||||
amount: hasRechargeRatio.value ? quantity : amount,
|
||||
amount: quantity,
|
||||
name: selectedUser.value.name,
|
||||
}),
|
||||
)
|
||||
@ -704,7 +704,7 @@ const rechargeNow = useThrottle(async () => {
|
||||
} else {
|
||||
showError(
|
||||
t('transfer_coin_failed', {
|
||||
amount: hasRechargeRatio.value ? quantity : amount,
|
||||
amount: quantity,
|
||||
}),
|
||||
)
|
||||
}
|
||||
@ -713,7 +713,7 @@ const rechargeNow = useThrottle(async () => {
|
||||
showError(
|
||||
error.response.errorMsg ||
|
||||
t('transfer_coin_failed', {
|
||||
amount: hasRechargeRatio.value ? quantity : amount,
|
||||
amount: quantity,
|
||||
}),
|
||||
)
|
||||
} finally {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user