|
|
@@ -1,3 +1,4 @@
|
|
|
+<!-- 提现-界面 -->
|
|
|
<template>
|
|
|
<app-view class="g-form bank-wallet-withdraw">
|
|
|
<Form ref="formRef" class="g-form__container" @submit="doWithDrawWarning">
|
|
|
@@ -21,11 +22,26 @@
|
|
|
</template>
|
|
|
</CellGroup>
|
|
|
<CellGroup>
|
|
|
- <Cell :title="$t('banksign.wallet.withdraw.bankaccountname')"
|
|
|
- :value="handleNoneValue(sign.bankaccountname)" />
|
|
|
- <Cell :title="$t('banksign.wallet.withdraw.bankname')" :value="handleNoneValue(sign.bankname)" />
|
|
|
- <Cell :title="$t('banksign.wallet.withdraw.bankaccountno')"
|
|
|
- :value="handleNoneValue(sign.bankaccountno)" />
|
|
|
+ <Cell v-if="sign.ismix === 0" :title="$t('banksign.wallet.withdraw.bankaccountname')" :value="handleNoneValue(sign.bankaccountname)" />
|
|
|
+ <Cell v-if="sign.ismix === 0" :title="$t('banksign.wallet.withdraw.bankname')" :value="handleNoneValue(sign.bankname)" />
|
|
|
+ <Cell v-if="sign.ismix === 0" :title="$t('banksign.wallet.withdraw.bankaccountno')" :value="handleNoneValue(sign.bankaccountno)" />
|
|
|
+ <Field v-if="sign.ismix === 1" name="bankaccountname" :label="$t('banksign.wallet.withdraw.bankaccountname')" v-model.trim="sign.bankaccountname" @click="showReciver = true" is-link readonly />
|
|
|
+ <Field v-if="sign.ismix === 1" type="number" name="phone_number" label="电话号码" maxlength="30" v-model.trim="onboard.phone_number" :placeholder="$t('banksign.Pleaseenterbankaccountno')"
|
|
|
+ :rules="formRules.phone_number" />
|
|
|
+ <Field v-if="sign.ismix === 1" type="number" name="cert_no" label="证件号码" maxlength="30" v-model.trim="onboard.cert_no" placeholder="请输入证件号码" :rules="formRules.cert_no" />
|
|
|
+ <Field v-if="sign.ismix === 1" label="银行渠道" name="channel_code" is-link >
|
|
|
+ <template #input>
|
|
|
+ <app-select v-model="channel_code" :options="hybrids" :optionProps="{ label: 'channel_name', value: 'channel_code' }"
|
|
|
+ @confirm="onHibirdChange"/>
|
|
|
+ </template>
|
|
|
+ </Field>
|
|
|
+ <Field v-if="sign.ismix === 1 && channel_banks.length != 0" label="银行名称" name="bank_code" is-link >
|
|
|
+ <template #input>
|
|
|
+ <app-select v-model="bank_code" :options="channel_banks" :optionProps="{ label: 'bank_name', value: 'bank_code' }" />
|
|
|
+ </template>
|
|
|
+ </Field>
|
|
|
+ <Field v-if="sign.ismix === 1" type="number" name="bank_account" label="银行卡号" maxlength="30" v-model.trim="onboard.bank_account" :placeholder="$t('banksign.Pleaseenterbankaccountno')"
|
|
|
+ :rules="formRules.bank_account" />
|
|
|
</CellGroup>
|
|
|
<CellGroup v-if="msg_317">
|
|
|
<Cell :title="$t('common.tips')">
|
|
|
@@ -52,21 +68,24 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</app-view>
|
|
|
+ <component :is="Reciver" v-model:show="showReciver" @change="onChange" />
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
+import { reactive, shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { Form, Field, Cell, CellGroup, FormInstance, Button, FieldRule } from 'vant'
|
|
|
import { fullloading, dialog, } from '@/utils/vant'
|
|
|
import { useDoWithdraw, useAccountFundInfo, useDoCusBankExtendConfigs } from '@/business/bank'
|
|
|
import { getServerTime } from '@/services/api/common'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { useUserStore, i18n } from '@/stores'
|
|
|
-import moment from 'moment'
|
|
|
import { handleNoneValue } from '@/filters'
|
|
|
+import moment from 'moment'
|
|
|
+import AppSelect from '@mobile/components/base/select/index.vue'
|
|
|
|
|
|
-const { formData, onSubmit, sign } = useDoWithdraw()
|
|
|
+const { formData, onSubmit, sign, hybrids, channel_code, bank_code, channel_banks } = useDoWithdraw()
|
|
|
const { configs, cusBank, startTime, endTime } = useDoCusBankExtendConfigs(3)
|
|
|
+
|
|
|
/// 资金账户信息
|
|
|
const { fund } = useAccountFundInfo()
|
|
|
const { router } = useNavigation()
|
|
|
@@ -74,9 +93,36 @@ const formRef = shallowRef<FormInstance>()
|
|
|
const { getSystemParamValue } = useUserStore()
|
|
|
const msg = getSystemParamValue('302')
|
|
|
const msg_317 = getSystemParamValue('317')
|
|
|
-const userStore = useUserStore()
|
|
|
const { global: { t } } = i18n
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
+const { userinfotype } = userStore.userInfo
|
|
|
+
|
|
|
+const showReciver = shallowRef(false)
|
|
|
+const Reciver = defineAsyncComponent(() => import('./reciver/Index.vue'))
|
|
|
+
|
|
|
+const onboard = reactive<Partial<Model.HybridReceiverOnboard>>({
|
|
|
+ receiver_type: userinfotype === 1 ? 'Individual' : 'Organization'
|
|
|
+})
|
|
|
+
|
|
|
+// 选择接收人信息
|
|
|
+const onChange = (item: Model.HybridReceiverOnboard) => {
|
|
|
+ channel_code.value = item.channel_code
|
|
|
+ onboard.cert_no = item.cert_no
|
|
|
+ onboard.phone_number = item.phone_number
|
|
|
+ onboard.bank_account = item.bank_account
|
|
|
+ showReciver.value = false
|
|
|
+ // 切换银行
|
|
|
+ onHibirdChange(item.channel_code)
|
|
|
+}
|
|
|
+
|
|
|
+const onHibirdChange = (code: string) => {
|
|
|
+ channel_banks.value = hybrids.value.find(e => e.channel_code === code)?.bank_infos.filter(e => e.out_in_flag === 0 && e.is_enabled === 1) ?? []
|
|
|
+ if(channel_banks.value.length && bank_code.value) {
|
|
|
+ bank_code.value = channel_banks.value[0].bank_code ?? ''
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 表单验证规则
|
|
|
const formRules: { [key: string]: FieldRule[] } = {
|
|
|
Amount: [{
|
|
|
@@ -91,6 +137,18 @@ const formRules: { [key: string]: FieldRule[] } = {
|
|
|
return t('banksign.wallet.withdraw.exceedingthepayableamount')
|
|
|
}
|
|
|
}
|
|
|
+ }],
|
|
|
+ cert_no: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入证件号码',
|
|
|
+ }],
|
|
|
+ phone_number: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入电话号码',
|
|
|
+ }],
|
|
|
+ bank_account: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入银行卡号',
|
|
|
}]
|
|
|
}
|
|
|
|
|
|
@@ -122,12 +180,30 @@ const doWithDrawWarning = () => {
|
|
|
|
|
|
const formSubmit = () => {
|
|
|
const obj: { [key: string]: unknown } = Object.create({})
|
|
|
+ // 拓展信息
|
|
|
configs.value.forEach((e) => {
|
|
|
if (e.value) {
|
|
|
obj[e.fieldcode] = e.value
|
|
|
}
|
|
|
})
|
|
|
- formData.extendInfo = JSON.stringify(obj)
|
|
|
+
|
|
|
+ if (channel_code.value != 'autobank') {
|
|
|
+ const hybrid: { [key: string]: unknown } = Object.create({})
|
|
|
+ // 拓展信息
|
|
|
+ hybrid['channel_code'] = channel_code.value
|
|
|
+ hybrid['bank_code'] = bank_code.value
|
|
|
+
|
|
|
+ const receiver: { [key: string]: unknown } = Object.create({})
|
|
|
+ receiver['bank_account'] = onboard.bank_account
|
|
|
+ receiver['cert_no'] = onboard.cert_no
|
|
|
+ receiver['phone_number'] = onboard.phone_number
|
|
|
+ receiver['name'] = sign.value.bankaccountname
|
|
|
+ receiver['receiver_type'] = onboard.receiver_type
|
|
|
+ hybrid['receiver_onboard'] = receiver
|
|
|
+
|
|
|
+ obj['hybrid'] = hybrid
|
|
|
+ }
|
|
|
+
|
|
|
fullloading((hideLoading) => {
|
|
|
let isComplete = false // 请求是否结束
|
|
|
const complete = () => {
|
|
|
@@ -139,6 +215,7 @@ const formSubmit = () => {
|
|
|
|
|
|
// 请求等待可能会超过30秒导致请求超时,所以2秒内没回应直接提示成功
|
|
|
const t = setTimeout(() => complete(), 2000)
|
|
|
+ formData.extendInfo = JSON.stringify(obj)
|
|
|
|
|
|
onSubmit().then(() => {
|
|
|
if (!isComplete) {
|
|
|
@@ -156,6 +233,7 @@ const formSubmit = () => {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|