|
@@ -31,9 +31,14 @@ const formData = ref({
|
|
|
bank: userInfo.value.bank,
|
|
|
bankAccountName: userInfo.value.bankAccountName,
|
|
|
bankAccount: userInfo.value.bankAccount,
|
|
|
- channel: 1,
|
|
|
- currency: 1,
|
|
|
+ currency: 'BDT',
|
|
|
})
|
|
|
+
|
|
|
+const bankColumns = [
|
|
|
+ { label: 'BKASH', value: 'BKASH' },
|
|
|
+ { label: 'NAGAD', value: 'NAGAD' },
|
|
|
+ { label: 'ROCKET', value: 'ROCKET' },
|
|
|
+]
|
|
|
async function submit() {
|
|
|
if (!formData.value.bank) {
|
|
|
toast.info(t('wallet.withdraw.error.bankName'))
|
|
@@ -51,8 +56,17 @@ async function submit() {
|
|
|
toast.info(t('wallet.withdraw.error.amount'))
|
|
|
return
|
|
|
}
|
|
|
- const res = await withdrawAdd({ ...formData.value, accountType: queryParams.value.type })
|
|
|
+ const res = await withdrawAdd({ ...formData.value, accountType: queryParams.value.type, channel: formData.value.bank })
|
|
|
console.log(res)
|
|
|
+ if (res.code === '200') {
|
|
|
+ toast.success(t('wallet.withdraw.success'))
|
|
|
+ setTimeout(() => {
|
|
|
+ goBack()
|
|
|
+ }, 1500)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ toast.error(res.message || t('wallet.withdraw.fail'))
|
|
|
+ }
|
|
|
}
|
|
|
const withdrawRate = ref<any>()
|
|
|
async function getConfig() {
|
|
@@ -107,13 +121,17 @@ onLoad((options) => {
|
|
|
</view>
|
|
|
<wd-form ref="form" :model="formData" custom-class="mb-28rpx">
|
|
|
<view class="mb-40rpx space-y-32rpx">
|
|
|
- <wd-input
|
|
|
- v-model="formData.bank"
|
|
|
- :placeholder="t('wallet.withdraw.form.bankName')"
|
|
|
- no-border
|
|
|
- custom-class="bandhu-auth-input-field"
|
|
|
- :disabled="Boolean(userInfo.bank)"
|
|
|
- />
|
|
|
+ <wd-picker v-model="formData.bank" :disabled="Boolean(userInfo.bank)" :columns="bankColumns" use-default-slot>
|
|
|
+ <wd-input
|
|
|
+ v-model="formData.bank"
|
|
|
+ :placeholder="t('wallet.withdraw.form.bankName')"
|
|
|
+ no-border
|
|
|
+ readonly
|
|
|
+ custom-class="bandhu-auth-input-field"
|
|
|
+ :disabled="Boolean(userInfo.bank)"
|
|
|
+ />
|
|
|
+ </wd-picker>
|
|
|
+
|
|
|
<wd-input
|
|
|
v-model="formData.bankAccountName"
|
|
|
:placeholder="t('wallet.withdraw.form.bankAccountName')"
|