diff --git a/src/views/RechargeAgency/index.vue b/src/views/RechargeAgency/index.vue index f4d9915..47cb268 100644 --- a/src/views/RechargeAgency/index.vue +++ b/src/views/RechargeAgency/index.vue @@ -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 {