feat(提现相关页面): 增加获取提现最低金额和手续费的接口,对提现的提示文本进行调整,对输入的金额与获取的最低金额进行比较处理

This commit is contained in:
hzj 2026-04-15 19:17:21 +08:00
parent a1542f9e43
commit 71afa388e4
9 changed files with 205 additions and 27 deletions

View File

@ -387,6 +387,30 @@ export const apiGetWithdrawEnabled = async () => {
} }
} }
// 获取提现美金手续费
export const apiGetUsdWithdrawServiceCharge = async () => {
try {
const response = await get(`/wallet/bank/service-charge`)
return response
} catch (error) {
console.error('Failed to fetch withdraw service charge:', error)
console.error('error:' + error.response.errorMsg)
throw error
}
}
// 获取提现美金门槛
export const apiGetUsdWithdrawalThreshold = async () => {
try {
const response = await get(`/wallet/bank/withdrawal-threshold`)
return response
} catch (error) {
console.error('Failed to fetch withdraw threshold:', error)
console.error('error:' + error.response.errorMsg)
throw error
}
}
/** /**
* 获取当前余额 * 获取当前余额
* @returns {Promise} 返回当前的余额信息 * @returns {Promise} 返回当前的余额信息

View File

@ -273,8 +273,6 @@
"please_select_bank_card": "يرجى اختيار بطاقة مصرفية", "please_select_bank_card": "يرجى اختيار بطاقة مصرفية",
"change_withdrawal_method": "تغيير طريقة السحب", "change_withdrawal_method": "تغيير طريقة السحب",
"enter_cash_out_amount": "يرجى إدخال مبلغ السحب", "enter_cash_out_amount": "يرجى إدخال مبلغ السحب",
"cash_out_minimum": "*يجب أن يكون مبلغ السحب أكبر من أو يساوي 50 دولارًا",
"new_year_cash_out_minimum": "*يجب أن يكون مبلغ السحب أكبر من أو يساوي 10 دولارًا",
"cash_withdraw": "سحب نقدي", "cash_withdraw": "سحب نقدي",
"bank_card": "بطاقة مصرفية", "bank_card": "بطاقة مصرفية",
@ -300,8 +298,8 @@
"confirm_modify_kyc": "هل أنت متأكد من أنك تريد تعديل المعلومات الحالية؟", "confirm_modify_kyc": "هل أنت متأكد من أنك تريد تعديل المعلومات الحالية؟",
"salary_balance": "رصيد الراتب: ${amount}", "salary_balance": "رصيد الراتب: ${amount}",
"enter_withdraw_amount": "أدخل مبلغ السحب", "enter_withdraw_amount": "أدخل مبلغ السحب",
"withdrawal_rule_1": "*(1)يجب أن يكون مبلغ السحب >=$50", "withdrawal_rule_1": "*(1)يجب أن يكون مبلغ السحب >=${amount}",
"withdrawal_rule_2": "(2)ستفرض المنصة رسوم معالجة بنسبة 20% على مبلغ السحب الحالي.", "withdrawal_rule_2": "(2)ستفرض المنصة رسوم معالجة بنسبة {fee}% على مبلغ السحب الحالي.",
"admin_policy": "سياسة المشرف", "admin_policy": "سياسة المشرف",

View File

@ -273,8 +273,6 @@
"please_select_bank_card": "দয়া করে একটি ব্যাংক কার্ড নির্বাচন করুন", "please_select_bank_card": "দয়া করে একটি ব্যাংক কার্ড নির্বাচন করুন",
"change_withdrawal_method": "উত্তোলন পদ্ধতি পরিবর্তন", "change_withdrawal_method": "উত্তোলন পদ্ধতি পরিবর্তন",
"enter_cash_out_amount": "দয়া করে নগদ উত্তোলনের পরিমাণ লিখুন", "enter_cash_out_amount": "দয়া করে নগদ উত্তোলনের পরিমাণ লিখুন",
"cash_out_minimum": "*নগদ উত্তোলনের পরিমাণ >= $50 হতে হবে",
"new_year_cash_out_minimum": "*নগদ উত্তোলনের পরিমাণ >= $10 হতে হবে",
"cash_withdraw": "নগদ উত্তোলন", "cash_withdraw": "নগদ উত্তোলন",
"bank_card": "ব্যাংক কার্ড", "bank_card": "ব্যাংক কার্ড",
@ -300,8 +298,8 @@
"confirm_modify_kyc": "আপনি কি বর্তমান তথ্য পরিবর্তন করতে চান?", "confirm_modify_kyc": "আপনি কি বর্তমান তথ্য পরিবর্তন করতে চান?",
"salary_balance": "বেতন ব্যালেন্স: ${amount}", "salary_balance": "বেতন ব্যালেন্স: ${amount}",
"enter_withdraw_amount": "উত্তোলনের পরিমাণ লিখুন", "enter_withdraw_amount": "উত্তোলনের পরিমাণ লিখুন",
"withdrawal_rule_1": "*(1)উত্তোলনের পরিমাণ অবশ্যই >=$50 হতে হবে", "withdrawal_rule_1": "*(1)উত্তোলনের পরিমাণ অবশ্যই >=${amount} হতে হবে",
"withdrawal_rule_2": "(2)প্ল্যাটফর্ম বর্তমান উত্তোলনের পরিমাণের উপর 20% হ্যান্ডলিং ফি চার্জ করবে।", "withdrawal_rule_2": "(2)প্ল্যাটফর্ম বর্তমান উত্তোলনের পরিমাণের উপর {fee}% হ্যান্ডলিং ফি চার্জ করবে।",
"admin_policy": "অ্যাডমিন নীতি", "admin_policy": "অ্যাডমিন নীতি",

View File

@ -273,8 +273,6 @@
"please_select_bank_card": "Please select a bank card", "please_select_bank_card": "Please select a bank card",
"change_withdrawal_method": "Change withdrawal method", "change_withdrawal_method": "Change withdrawal method",
"enter_cash_out_amount": "Please enter the cash out amount", "enter_cash_out_amount": "Please enter the cash out amount",
"cash_out_minimum": "*The cash out amount must be >= $50",
"new_year_cash_out_minimum": "*The cash out amount must be >= $10",
"cash_withdraw": "Cash Withdraw", "cash_withdraw": "Cash Withdraw",
"bank_card": "Bank Card", "bank_card": "Bank Card",
@ -300,8 +298,8 @@
"confirm_modify_kyc": "Are you sure you want to modify the current information?", "confirm_modify_kyc": "Are you sure you want to modify the current information?",
"salary_balance": "Salary Balance: ${amount}", "salary_balance": "Salary Balance: ${amount}",
"enter_withdraw_amount": "Enter withdraw amount", "enter_withdraw_amount": "Enter withdraw amount",
"withdrawal_rule_1": "*(1)Withdrawal amount must be >=$50", "withdrawal_rule_1": "*(1)Withdrawal amount must be >=${amount}",
"withdrawal_rule_2": "(2)The platform will charge a 20% handling fee on the current withdrawal amount.", "withdrawal_rule_2": "(2)The platform will charge a {fee}% handling fee on the current withdrawal amount.",
"admin_policy": "Admin Policy", "admin_policy": "Admin Policy",

View File

@ -273,8 +273,6 @@
"please_select_bank_card": "Lütfen bir banka kartı seçin", "please_select_bank_card": "Lütfen bir banka kartı seçin",
"change_withdrawal_method": "Çekim yöntemini değiştir", "change_withdrawal_method": "Çekim yöntemini değiştir",
"enter_cash_out_amount": "Lütfen nakit çekme miktarını girin", "enter_cash_out_amount": "Lütfen nakit çekme miktarını girin",
"cash_out_minimum": "*Nakit çekme miktarı >= $50 olmalıdır",
"new_year_cash_out_minimum": "*Nakit çekme miktarı >= $10 olmalıdır",
"cash_withdraw": "Nakit Çekim", "cash_withdraw": "Nakit Çekim",
"bank_card": "Banka Kartı", "bank_card": "Banka Kartı",
@ -300,8 +298,8 @@
"confirm_modify_kyc": "Mevcut bilgileri değiştirmek istediğinizden emin misiniz?", "confirm_modify_kyc": "Mevcut bilgileri değiştirmek istediğinizden emin misiniz?",
"salary_balance": "Maaş Bakiyesi: ${amount}", "salary_balance": "Maaş Bakiyesi: ${amount}",
"enter_withdraw_amount": "Çekim miktarını girin", "enter_withdraw_amount": "Çekim miktarını girin",
"withdrawal_rule_1": "*(1)Çekim miktarı >=$50 olmalıdır", "withdrawal_rule_1": "*(1)Çekim miktarı >=${amount} olmalıdır",
"withdrawal_rule_2": "(2)Platform, mevcut çekim miktarı üzerinden %20 işlem ücreti alacaktır.", "withdrawal_rule_2": "(2)Platform, mevcut çekim miktarı üzerinden %{fee} işlem ücreti alacaktır.",
"admin_policy": "Yönetici Politikası", "admin_policy": "Yönetici Politikası",

View File

@ -273,8 +273,6 @@
"please_select_bank_card": "请选择银行卡", "please_select_bank_card": "请选择银行卡",
"change_withdrawal_method": "更改提现方式", "change_withdrawal_method": "更改提现方式",
"enter_cash_out_amount": "请输入提现金额", "enter_cash_out_amount": "请输入提现金额",
"cash_out_minimum": "*提现金额必须大于等于50美元",
"new_year_cash_out_minimum": "*提现金额必须大于等于10美元",
"cash_withdraw": "现金提现", "cash_withdraw": "现金提现",
"bank_card": "银行卡", "bank_card": "银行卡",
@ -300,8 +298,8 @@
"confirm_modify_kyc": "您确定要修改当前信息吗?", "confirm_modify_kyc": "您确定要修改当前信息吗?",
"salary_balance": "薪资余额:${amount}", "salary_balance": "薪资余额:${amount}",
"enter_withdraw_amount": "请输入提现金额", "enter_withdraw_amount": "请输入提现金额",
"withdrawal_rule_1": "*(1)提现金额必须 >=$50", "withdrawal_rule_1": "*(1)提现金额必须 >=${amount}",
"withdrawal_rule_2": "(2)平台将收取当前提现金额 20% 的手续费。", "withdrawal_rule_2": "(2)平台将收取当前提现金额 {fee}% 的手续费。",
"admin_policy": "管理员政策", "admin_policy": "管理员政策",

View File

@ -338,7 +338,9 @@
</div> </div>
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 600; font-size: 0.9em"> <div style="color: rgba(0, 0, 0, 0.4); font-weight: 600; font-size: 0.9em">
{{ t('new_year_cash_out_minimum') }} {{ t('withdrawal_rule_1', { amount: withdrawalThresholdDisplay }) }}
<br />
{{ t('withdrawal_rule_2', { fee: withdrawalServiceChargeDisplay }) }}
</div> </div>
<div style="display: flex; justify-content: center; align-items: center"> <div style="display: flex; justify-content: center; align-items: center">
@ -427,6 +429,7 @@ import { setApplyInfo, getApplyInfo } from '@/utils/applyStore.js'
import { ref, onMounted, computed, onUnmounted } from 'vue' import { ref, onMounted, computed, onUnmounted } from 'vue'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
import { setDocumentDirection } from '@/locales/i18n' import { setDocumentDirection } from '@/locales/i18n'
import { showError } from '@/utils/toast.js'
import { import {
withdrawableAmount, // withdrawableAmount, //
@ -435,6 +438,8 @@ import {
import { import {
getBankCardList, //使 getBankCardList, //使
getWithdrawInfoList, // getWithdrawInfoList, //
apiGetUsdWithdrawServiceCharge, //
apiGetUsdWithdrawalThreshold, //
} from '@/api/wallet.js' } from '@/api/wallet.js'
import GeneralHeader from '@/components/GeneralHeader.vue' import GeneralHeader from '@/components/GeneralHeader.vue'
@ -452,6 +457,10 @@ const cashOutTypeShow = ref(false)
const cashOutShow = ref(false) const cashOutShow = ref(false)
const cashOutAmount = ref(null) const cashOutAmount = ref(null)
//
const withdrawalServiceCharge = ref(20)
//
const withdrawalThreshold = ref(50)
const maskLayerShow = computed(() => { const maskLayerShow = computed(() => {
return cashOutTipShow.value || cashOutShow.value || cashOutTypeShow.value return cashOutTipShow.value || cashOutShow.value || cashOutTypeShow.value
@ -477,6 +486,27 @@ const hasKYC = computed(() => {
return bankCardInfo.value != null return bankCardInfo.value != null
}) })
// NaN
const formatRuleNumber = (value) => {
const numericValue = Number(value)
if (!Number.isFinite(numericValue)) {
return '0'
}
return numericValue.toString()
}
//
const withdrawalServiceChargeDisplay = computed(() => {
return formatRuleNumber(withdrawalServiceCharge.value)
})
//
const withdrawalThresholdDisplay = computed(() => {
return formatRuleNumber(withdrawalThreshold.value)
})
// //
const gotoselectBank = () => { const gotoselectBank = () => {
router.push('/bank-card') router.push('/bank-card')
@ -503,7 +533,11 @@ const CashOut = () => {
// //
const checkStatus = computed(() => { const checkStatus = computed(() => {
return bankCardInfo.value?.status == 'PASS' && usedBankCard.value?.id && cashOutAmount.value >= 10 return (
bankCardInfo.value?.status == 'PASS' &&
usedBankCard.value?.id &&
cashOutAmount.value >= withdrawalThreshold.value
)
}) })
// //
@ -540,6 +574,27 @@ const getDrawableAmount = async () => {
} }
} }
//
const getWithdrawConfig = async () => {
try {
const resServiceCharge = await apiGetUsdWithdrawServiceCharge()
if (resServiceCharge.status && typeof resServiceCharge.body === 'number') {
withdrawalServiceCharge.value = resServiceCharge.body
}
} catch (error) {
console.error('获取提现手续费失败:', error)
}
try {
const resThreshold = await apiGetUsdWithdrawalThreshold()
if (resThreshold.status && typeof resThreshold.body === 'number') {
withdrawalThreshold.value = resThreshold.body
}
} catch (error) {
console.error('获取提现门槛失败:', error)
}
}
const handleCashOutAmountInput = (event) => { const handleCashOutAmountInput = (event) => {
let value = event.target.value let value = event.target.value
@ -601,6 +656,7 @@ const getBankCards = async () => {
onMounted(() => { onMounted(() => {
getDrawableAmount() // getDrawableAmount() //
getWithdrawConfig() //
getWithdrawInfoListData() // getWithdrawInfoListData() //
getBankCards() // 使 getBankCards() // 使
}) })

View File

@ -52,9 +52,9 @@
<!-- 规则 --> <!-- 规则 -->
<div style="color: #f00; font-weight: 500; font-size: 0.8em"> <div style="color: #f00; font-weight: 500; font-size: 0.8em">
{{ t('withdrawal_rule_1') }} {{ t('withdrawal_rule_1', { amount: withdrawalThresholdDisplay }) }}
<br /> <br />
{{ t('withdrawal_rule_2') }} {{ t('withdrawal_rule_2', { fee: withdrawalServiceChargeDisplay }) }}
</div> </div>
</div> </div>
@ -612,6 +612,8 @@ import {
getBankCardList, // 使 getBankCardList, // 使
getWithdrawInfoList, // getWithdrawInfoList, //
useBankCard, // useBankCard, //
apiGetUsdWithdrawServiceCharge, //
apiGetUsdWithdrawalThreshold, //
withdrawApply, // withdrawApply, //
} from '@/api/wallet.js' } from '@/api/wallet.js'
@ -630,6 +632,10 @@ const cashOutTypeShow = ref(false)
const cashOutShow = ref(false) const cashOutShow = ref(false)
const cashOutAmount = ref(null) const cashOutAmount = ref(null)
//
const withdrawalServiceCharge = ref(20)
//
const withdrawalThreshold = ref(50)
const identityStore = useIdentityStore() const identityStore = useIdentityStore()
const maskLayerShow = computed(() => { const maskLayerShow = computed(() => {
@ -652,6 +658,27 @@ const hasKYC = computed(() => {
return bankCardInfo.value != null return bankCardInfo.value != null
}) })
// NaN
const formatRuleNumber = (value) => {
const numericValue = Number(value)
if (!Number.isFinite(numericValue)) {
return '0'
}
return numericValue.toString()
}
//
const withdrawalServiceChargeDisplay = computed(() => {
return formatRuleNumber(withdrawalServiceCharge.value)
})
//
const withdrawalThresholdDisplay = computed(() => {
return formatRuleNumber(withdrawalThreshold.value)
})
// //
const goToSelectBank = () => { const goToSelectBank = () => {
router.push('/bank-card') router.push('/bank-card')
@ -669,7 +696,11 @@ const goToKYC = () => {
// //
const checkStatus = computed(() => { const checkStatus = computed(() => {
return bankCardInfo.value?.status == 'PASS' && usedBankCard.value?.id && cashOutAmount.value >= 50 return (
bankCardInfo.value?.status == 'PASS' &&
usedBankCard.value?.id &&
cashOutAmount.value >= withdrawalThreshold.value
)
}) })
// //
@ -728,6 +759,27 @@ const getDrawableAmount = async () => {
} }
} }
//
const getWithdrawConfig = async () => {
try {
const resServiceCharge = await apiGetUsdWithdrawServiceCharge()
if (resServiceCharge.status && typeof resServiceCharge.body === 'number') {
withdrawalServiceCharge.value = resServiceCharge.body
}
} catch (error) {
console.error('获取提现手续费失败:', error)
}
try {
const resThreshold = await apiGetUsdWithdrawalThreshold()
if (resThreshold.status && typeof resThreshold.body === 'number') {
withdrawalThreshold.value = resThreshold.body
}
} catch (error) {
console.error('获取提现门槛失败:', error)
}
}
// //
const handleCashOutAmountInput = (event) => { const handleCashOutAmountInput = (event) => {
let value = event.target.value let value = event.target.value
@ -809,6 +861,7 @@ const setDefaultBankCard = async (cardId) => {
onMounted(() => { onMounted(() => {
getDrawableAmount() // getDrawableAmount() //
getWithdrawConfig() //
getWithdrawInfoListData() // getWithdrawInfoListData() //
getBankCards() // 使 getBankCards() // 使
}) })

View File

@ -696,7 +696,9 @@
</div> </div>
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 600; font-size: 0.9em"> <div style="color: rgba(0, 0, 0, 0.4); font-weight: 600; font-size: 0.9em">
{{ t('cash_out_minimum') }} {{ t('withdrawal_rule_1', { amount: withdrawalThresholdDisplay }) }}
<br />
{{ t('withdrawal_rule_2', { fee: withdrawalServiceChargeDisplay }) }}
</div> </div>
<div style="display: flex; justify-content: center; align-items: center"> <div style="display: flex; justify-content: center; align-items: center">
@ -793,6 +795,8 @@ import {
apiGetBankBalance, // apiGetBankBalance, //
apiExchange, // apiExchange, //
apiTransfer, // apiTransfer, //
apiGetUsdWithdrawServiceCharge, //
apiGetUsdWithdrawalThreshold, //
getBankCardList, //使 getBankCardList, //使
getWithdrawInfoList, // getWithdrawInfoList, //
withdrawApply, // withdrawApply, //
@ -827,6 +831,10 @@ const cashOutTypeShow = ref(false)
const cashOutShow = ref(false) const cashOutShow = ref(false)
const cashOutAmount = ref(null) const cashOutAmount = ref(null)
//
const withdrawalServiceCharge = ref(20)
//
const withdrawalThreshold = ref(50)
const maskLayerShow = computed(() => { const maskLayerShow = computed(() => {
return exchangeTipShow.value || cashOutTipShow.value || cashOutShow.value || cashOutTypeShow.value return exchangeTipShow.value || cashOutTipShow.value || cashOutShow.value || cashOutTypeShow.value
@ -894,6 +902,27 @@ const hasKYC = computed(() => {
return bankCardInfo.value != null return bankCardInfo.value != null
}) })
// NaN
const formatRuleNumber = (value) => {
const numericValue = Number(value)
if (!Number.isFinite(numericValue)) {
return '0'
}
return numericValue.toString()
}
//
const withdrawalServiceChargeDisplay = computed(() => {
return formatRuleNumber(withdrawalServiceCharge.value)
})
//
const withdrawalThresholdDisplay = computed(() => {
return formatRuleNumber(withdrawalThreshold.value)
})
const formattedAmount = (amount) => { const formattedAmount = (amount) => {
if (locale.value === 'ar') { if (locale.value === 'ar') {
return `${amount}$` return `${amount}$`
@ -994,6 +1023,27 @@ const fetchBankBalance = async () => {
} }
} }
//
const getWithdrawConfig = async () => {
try {
const resServiceCharge = await apiGetUsdWithdrawServiceCharge()
if (resServiceCharge.status && typeof resServiceCharge.body === 'number') {
withdrawalServiceCharge.value = resServiceCharge.body
}
} catch (error) {
console.error('获取提现手续费失败:', error)
}
try {
const resThreshold = await apiGetUsdWithdrawalThreshold()
if (resThreshold.status && typeof resThreshold.body === 'number') {
withdrawalThreshold.value = resThreshold.body
}
} catch (error) {
console.error('获取提现门槛失败:', error)
}
}
// //
const gotoKYC = () => { const gotoKYC = () => {
router.push({ path: '/KYC', query: { from: '/available-income', activeAction: 'Cash out' } }) router.push({ path: '/KYC', query: { from: '/available-income', activeAction: 'Cash out' } })
@ -1147,7 +1197,11 @@ const handleExchange = async () => {
// //
const checkStatus = computed(() => { const checkStatus = computed(() => {
return bankCardInfo.value?.status == 'PASS' && usedBankCard.value?.id && cashOutAmount.value >= 50 return (
bankCardInfo.value?.status == 'PASS' &&
usedBankCard.value?.id &&
cashOutAmount.value >= withdrawalThreshold.value
)
}) })
// //
@ -1182,6 +1236,7 @@ const Receive = async () => {
// //
onMounted(() => { onMounted(() => {
fetchBankBalance() // fetchBankBalance() //
getWithdrawConfig() //
initializePayee() // initializePayee() //
getWithdrawInfoListData() // getWithdrawInfoListData() //
getBankCards() // 使 getBankCards() // 使