feat(活动提现页面): 门槛回退到4月15号的更改之前
This commit is contained in:
parent
2991e9ef8c
commit
f374e242d0
@ -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": "بطاقة مصرفية",
|
||||
|
||||
@ -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": "ব্যাংক কার্ড",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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ı",
|
||||
|
||||
@ -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": "银行卡",
|
||||
|
||||
@ -338,9 +338,7 @@
|
||||
</div>
|
||||
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 600; font-size: 0.9em">
|
||||
{{ t('withdrawal_rule_1', { amount: withdrawalThresholdDisplay }) }}
|
||||
<br />
|
||||
{{ t('withdrawal_rule_2', { fee: withdrawalServiceChargeDisplay }) }}
|
||||
{{ t('cash_out_min_amount_tip') }}
|
||||
</div>
|
||||
|
||||
<div style="display: flex; justify-content: center; align-items: center">
|
||||
@ -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() // 获取正在使用的银行卡
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user