From f374e242d00c106f4b03b491f3ccf8f590800c9d Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Sat, 9 May 2026 12:01:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B4=BB=E5=8A=A8=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2):=20=E9=97=A8=E6=A7=9B=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E5=88=B04=E6=9C=8815=E5=8F=B7=E7=9A=84=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E4=B9=8B=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/ar.json | 1 + src/locales/bn.json | 1 + src/locales/en.json | 1 + src/locales/tr.json | 1 + src/locales/zh.json | 1 + src/views/Wallet/CashOut/CashOut.vue | 76 +++++----------------------- 6 files changed, 18 insertions(+), 63 deletions(-) diff --git a/src/locales/ar.json b/src/locales/ar.json index 994fc26..0a59571 100644 --- a/src/locales/ar.json +++ b/src/locales/ar.json @@ -278,6 +278,7 @@ "please_select_bank_card": "يرجى اختيار بطاقة مصرفية", "change_withdrawal_method": "تغيير طريقة السحب", "enter_cash_out_amount": "يرجى إدخال مبلغ السحب", + "cash_out_min_amount_tip": "*يجب أن يكون مبلغ السحب >= $10", "cash_withdraw": "سحب نقدي", "bank_card": "بطاقة مصرفية", diff --git a/src/locales/bn.json b/src/locales/bn.json index 1f04998..e5b8e5c 100644 --- a/src/locales/bn.json +++ b/src/locales/bn.json @@ -278,6 +278,7 @@ "please_select_bank_card": "দয়া করে একটি ব্যাংক কার্ড নির্বাচন করুন", "change_withdrawal_method": "উত্তোলন পদ্ধতি পরিবর্তন", "enter_cash_out_amount": "দয়া করে নগদ উত্তোলনের পরিমাণ লিখুন", + "cash_out_min_amount_tip": "*নগদ উত্তোলনের পরিমাণ অবশ্যই >= $10 হতে হবে", "cash_withdraw": "নগদ উত্তোলন", "bank_card": "ব্যাংক কার্ড", diff --git a/src/locales/en.json b/src/locales/en.json index 0de30d7..4dc902e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -278,6 +278,7 @@ "please_select_bank_card": "Please select a bank card", "change_withdrawal_method": "Change withdrawal method", "enter_cash_out_amount": "Please enter the cash out amount", + "cash_out_min_amount_tip": "*The cash out amount must be >= $10", "cash_withdraw": "Cash Withdraw", "bank_card": "Bank Card", diff --git a/src/locales/tr.json b/src/locales/tr.json index e3f76ea..06fd50d 100644 --- a/src/locales/tr.json +++ b/src/locales/tr.json @@ -278,6 +278,7 @@ "please_select_bank_card": "Lütfen bir banka kartı seçin", "change_withdrawal_method": "Çekim yöntemini değiştir", "enter_cash_out_amount": "Lütfen nakit çekme miktarını girin", + "cash_out_min_amount_tip": "*Nakit çekme tutarı >= $10 olmalıdır", "cash_withdraw": "Nakit Çekim", "bank_card": "Banka Kartı", diff --git a/src/locales/zh.json b/src/locales/zh.json index d4b5084..7a20b1d 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -278,6 +278,7 @@ "please_select_bank_card": "请选择银行卡", "change_withdrawal_method": "更改提现方式", "enter_cash_out_amount": "请输入提现金额", + "cash_out_min_amount_tip": "*提现金额必须 >= $10", "cash_withdraw": "现金提现", "bank_card": "银行卡", diff --git a/src/views/Wallet/CashOut/CashOut.vue b/src/views/Wallet/CashOut/CashOut.vue index 58d9cb4..332d9ff 100644 --- a/src/views/Wallet/CashOut/CashOut.vue +++ b/src/views/Wallet/CashOut/CashOut.vue @@ -338,9 +338,7 @@
- {{ t('withdrawal_rule_1', { amount: withdrawalThresholdDisplay }) }} -
- {{ t('withdrawal_rule_2', { fee: withdrawalServiceChargeDisplay }) }} + {{ t('cash_out_min_amount_tip') }}
@@ -429,7 +427,6 @@ import { setApplyInfo, getApplyInfo } from '@/utils/applyStore.js' import { ref, onMounted, computed, onUnmounted } from 'vue' import { useRouter, useRoute } from 'vue-router' import { setDocumentDirection } from '@/locales/i18n' -import { showError } from '@/utils/toast.js' import { withdrawableAmount, //获取可提现金额 @@ -438,8 +435,6 @@ import { import { getBankCardList, //获取正在使用的银行卡 getWithdrawInfoList, //获取申请提现信息 - apiGetUsdWithdrawServiceCharge, // 获取提现美金手续费 - apiGetUsdWithdrawalThreshold, // 获取提现美金门槛 } from '@/api/wallet.js' import GeneralHeader from '@/components/GeneralHeader.vue' @@ -457,10 +452,6 @@ const cashOutTypeShow = ref(false) const cashOutShow = ref(false) const cashOutAmount = ref(null) -// 提现手续费比例,接口成功后会覆盖默认值 -const withdrawalServiceCharge = ref(20) -// 提现最低金额,接口成功后会覆盖默认值 -const withdrawalThreshold = ref(50) const maskLayerShow = computed(() => { return cashOutTipShow.value || cashOutShow.value || cashOutTypeShow.value @@ -486,27 +477,6 @@ const hasKYC = computed(() => { 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 = () => { router.push('/bank-card') @@ -533,11 +503,7 @@ const CashOut = () => { // 是否可以提现 const checkStatus = computed(() => { - return ( - bankCardInfo.value?.status == 'PASS' && - usedBankCard.value?.id && - cashOutAmount.value >= withdrawalThreshold.value - ) + return bankCardInfo.value?.status == 'PASS' && usedBankCard.value?.id && cashOutAmount.value >= 10 }) // 确认提现 @@ -574,44 +540,29 @@ 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) => { let value = event.target.value - // 只保留整数数字 - value = value.replace(/[^\d]/g, '') + // 只保留数字和小数点 + value = value.replace(/[^\d.]/g, '') + + // 防止多个小数点 + const parts = value.split('.') + if (parts.length > 2) { + value = parts[0] + '.' + parts.slice(1).join('') + } // 如果输入值超过可用余额,则限制为最大值 - const numericValue = parseInt(value, 10) + const numericValue = parseFloat(value) if (numericValue > availableBalance.value) { - value = Math.floor(Number(availableBalance.value)).toString() + value = availableBalance.value.toString() } // 更新输入框的值 event.target.value = value // 更新 cashOutAmount 的值 - cashOutAmount.value = parseInt(value, 10) || 0 + cashOutAmount.value = parseFloat(value) || 0 } // 获取提现信息列表 @@ -650,7 +601,6 @@ const getBankCards = async () => { onMounted(() => { getDrawableAmount() //获取可提现金额 - getWithdrawConfig() // 获取提现配置 getWithdrawInfoListData() // 获取提现信息列表 getBankCards() // 获取正在使用的银行卡 })