Handy_Cao 9 mesiacov pred
rodič
commit
0eab566098

+ 1 - 1
oem/tss/config/appconfig.json

@@ -3,7 +3,7 @@
   "appName": "TCE",
   "version": "1.0.46",
   "versionCode": "100046",
-  "apiUrl": "http://192.168.31.210:8080/cfg?key=test_210",
+  "apiUrl": "http://192.168.31.136:8080/cfg?key=test_136",
   "tradeChannel": "ws",
   "showLoginAlert": true,
   "modules": [

+ 43 - 4
src/business/bank/index.ts

@@ -14,7 +14,8 @@ import {
     YJF_WithholdInApply,
     YJF_WithholdSignInSMS,
     YJF_WithholdSignOut,
-    queryMemberCusBankInfo
+    queryMemberCusBankInfo,
+    getHybridConfigs
 } from '@/services/api/bank'
 import { SignStatus } from '@/constants/bank'
 import { decryptAES } from '@/services/websocket/package/crypto'
@@ -31,6 +32,9 @@ export function useDoWithdraw() {
     const loading = shallowRef(false)
     /// 获取当前是否已签约
     const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
+    const hybrids = shallowRef<Model.PaymentCenterHybridConfigs[]>([])
+    const bank_code = shallowRef('')
+    const channel_code = shallowRef('')
 
     const sign = computed<Partial<Model.BankAccountSignRsp>>(() => {
         if (bankAccountSign.value.length) {
@@ -60,8 +64,21 @@ export function useDoWithdraw() {
         }
     })
 
+    // 获取支付中心混合支付渠道配置信息列表 泰商所采用
+    getHybridConfigs().then((res) => {
+        if (res.data.length) {
+            hybrids.value = res.data.filter(e => e.can_amt_out === 1)
+            if (hybrids.value.length) {
+                channel_code.value = hybrids.value[0].channel_code ?? ''
+            }
+            if (hybrids.value[0].bank_infos.length) {
+                bank_code.value = hybrids.value[0].bank_infos[0].bank_code
+            }
+        }
+    }) 
+
     const onSubmit = async () => {
-        await request
+        await request,
         loading.value = true
 
         return t2bBankWithdraw({
@@ -78,7 +95,10 @@ export function useDoWithdraw() {
         loading,
         onSubmit,
         formData,
-        sign
+        sign,
+        hybrids,
+        bank_code,
+        channel_code
     }
 }
 
@@ -87,6 +107,9 @@ export function useDoDeposit(userid?: number) {
     const loading = shallowRef(false)
     /// 获取当前是否已签约
     const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
+    const hybrids = shallowRef<Model.PaymentCenterHybridConfigs[]>([])
+    const bank_code = shallowRef('')
+    const channel_code = shallowRef('')
 
     const sign = computed<Partial<Model.BankAccountSignRsp>>(() => {
         if (bankAccountSign.value.length) {
@@ -114,6 +137,19 @@ export function useDoDeposit(userid?: number) {
         }
     })
 
+    // 获取支付中心混合支付渠道配置信息列表 泰商所采用
+    getHybridConfigs().then((res) => {
+        if (res.data.length) {
+            hybrids.value = res.data.filter(e => e.can_amt_in === 1)
+            if (hybrids.value.length) {
+                channel_code.value = hybrids.value[0].channel_code ?? ''
+            }
+            if (hybrids.value[0].bank_infos.length) {
+                bank_code.value = hybrids.value[0].bank_infos[0].bank_code
+            }
+        }
+    })    
+
     const onSubmit = async () => {
         await request
         loading.value = true
@@ -131,7 +167,10 @@ export function useDoDeposit(userid?: number) {
         loading,
         onSubmit,
         formData,
-        sign
+        sign,
+        hybrids,
+        bank_code,
+        channel_code
     }
 }
 

+ 41 - 5
src/packages/tss/views/bank/wallet/components/deposit/Index.vue

@@ -1,3 +1,4 @@
+<!-- 充值-界面 -->
 <template>
     <app-view class="g-form bank-wallet-deposit">
         <Form ref="formRef" class="g-form__container" @submit="doDepositWarning">
@@ -28,9 +29,21 @@
                 <Cell :title="$t('mine.balance')" :value="currentAccount.currentbalance?.toFixed(2)" />
                 <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')"
+                <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" 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" 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>
             </CellGroup>
             <CellGroup>
                 <Cell :title="$t('banksign.wallet.deposit.platformdepositbankname')" v-if="msg_320">
@@ -83,12 +96,13 @@ import { useDoDeposit, useDoCusBankExtendConfigs } from '@/business/bank'
 import { getServerTime } from '@/services/api/common'
 import { useUserStore, useAccountStore, i18n } from '@/stores'
 import { useComponent } from '@/hooks/component'
+import { handleNoneValue } from '@/filters'
 import Stepper from '@mobile/components/base/stepper/index.vue'
+import AppSelect from '@mobile/components/base/select/index.vue'
 import moment from 'moment'
-import { handleNoneValue } from '@/filters'
 
 const formRef = shallowRef<FormInstance>()
-const { formData, onSubmit, sign } = useDoDeposit()
+const { formData, onSubmit, sign, hybrids, channel_code, bank_code } = useDoDeposit()
 const { getSystemParamValue } = useUserStore()
 const { configs, cusBank, startTime, endTime } = useDoCusBankExtendConfigs(2)
 const certificate_photo_url = ref('')
@@ -97,6 +111,9 @@ const { global: { t } } = i18n
 
 const accountStore = useAccountStore()
 const { currentAccount } = accountStore.$toRefs()
+const { mobile2 } = userStore.userInfo
+
+const channel_banks = shallowRef<Model.HybridBank[]>([])
 
 const msg_320 = getSystemParamValue('320')
 const msg_321 = getSystemParamValue('321')
@@ -118,6 +135,13 @@ const onRadioChange = (value: number) => {
     formData.Amount = value
 }
 
+const onHibirdChange = (code: string) => {
+    // 银行信息
+    channel_banks.value = hybrids.value.find(e => e.channel_code === code)?.bank_infos.filter(e => e.out_in_flag === 1 && e.is_enabled === 1) ?? []
+    // 默认选中第一个
+    if(channel_banks.value.length) { bank_code.value = channel_banks.value[0].bank_code ?? '' }
+}
+
 // 表单验证规则
 const formRules: { [key: string]: FieldRule[] } = {
     Amount: [{
@@ -170,13 +194,22 @@ const onCopy = (status: boolean) => {
 const formSubmit = () => {
     fullloading((hideLoading) => {
         const obj: { [key: string]: unknown } = Object.create({})
+        const hybrid: { [key: string]: unknown } = Object.create({})
         configs.value.forEach((e) => {
             if (e.value) {
                 obj[e.fieldcode] = e.value
             }
         })
+        // 拓展信息
+        hybrid['channel_code'] = channel_code.value
+        hybrid['bank_code'] = bank_code.value
         obj['certificate_photo_url'] = certificate_photo_url.value
-        formData.extendInfo = JSON.stringify(obj)
+        obj['hybrid'] = hybrid
+        if (channel_code.value === 'chillpay') {
+            const personinfo: { [key: string]: unknown } = Object.create({})
+            personinfo['phone_number'] = mobile2
+            hybrid['person_info'] = personinfo
+        }
 
         let isComplete = false // 请求是否结束
         const complete = () => {
@@ -190,7 +223,10 @@ const formSubmit = () => {
 
         // 请求等待可能会超过30秒导致请求超时,所以2秒内没回应直接提示成功
         const t = setTimeout(() => complete(), 2000)
+        formData.extendInfo = JSON.stringify(obj)
 
+        console.log(formData.extendInfo)
+        
         onSubmit().then(() => {
             if (!isComplete) {
                 complete()

+ 28 - 5
src/packages/tss/views/bank/wallet/components/withdraw/Index.vue

@@ -1,3 +1,4 @@
+<!-- 提现-界面 -->
 <template>
     <app-view class="g-form bank-wallet-withdraw">
         <Form ref="formRef" class="g-form__container" @submit="doWithDrawWarning">
@@ -23,9 +24,20 @@
             <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')"
+                <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" 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" 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>
             </CellGroup>
             <CellGroup v-if="msg_317">
                 <Cell :title="$t('common.tips')">
@@ -62,10 +74,11 @@ import { useDoWithdraw, useAccountFundInfo, useDoCusBankExtendConfigs } from '@/
 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 } = useDoWithdraw()
 const { configs, cusBank, startTime, endTime } = useDoCusBankExtendConfigs(3)
 /// 资金账户信息
 const { fund } = useAccountFundInfo()
@@ -74,9 +87,19 @@ const formRef = shallowRef<FormInstance>()
 const { getSystemParamValue } = useUserStore()
 const msg = getSystemParamValue('302')
 const msg_317 = getSystemParamValue('317')
-const userStore = useUserStore()
+const userStore = useUserStore() 
 const { global: { t } } = i18n
 
+const channel_banks = shallowRef<Model.HybridBank[]>([])
+
+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 = channel_banks.value[0].bank_code ?? ''
+    }
+}
+
 // 表单验证规则
 const formRules: { [key: string]: FieldRule[] } = {
     Amount: [{

+ 20 - 0
src/services/api/bank/index.ts

@@ -259,4 +259,24 @@ export function queryMemberCusBankInfo(config: RequestConfig<Model.BankAccountSi
             ...config.data
         },
     })
+}
+
+/**
+ * 获取支付中心混合支付渠道配置信息列表
+ */
+export function getHybridConfigs(config: RequestConfig = {}) {
+    return http.commonRequest<Model.PaymentCenterHybridConfigs[]>({
+        url: '/Bank/GetHybridConfigs',
+        params: config.data,
+    })
+}
+
+/**
+ * 查询混合支付出金接收者信息
+ */
+export function queryHybridReceiverOnboards(config: RequestConfig = {}) {
+    return http.commonRequest<Model.HybridReceiverOnboard[]>({
+        url: '/Bank/QueryHybridReceiverOnboards',
+        params: config.data,
+    })
 }

+ 32 - 0
src/types/model/bank.d.ts

@@ -23,6 +23,7 @@ declare namespace Model {
         exchbankid: string; // 交易所开户银行ID
         exchpaybankaccname: string; // 交易所支出结算账户户名
         exchpaybankaccno: string; // 交易所支出结算账户
+        ismix: number; // 是否混合渠道 - 0:否 1:是
         isneedcheck: number; // 是否需要对账 - 0:需要 1:不需要 [不需要界面配置]
         isneedclear: number; // 是否需要清算 - 0:不需要 1:需要
         lastcheckstatus: number; // 最后对账状态 - 对账状态 - 1:未对账 2:对账成功 3:对账失败
@@ -84,6 +85,7 @@ declare namespace Model {
         direct: number;//方向(可以判断那方先发起的签约)
         exchticket: string;//最后一次签约成功的流水号
         extendinfo: string;//扩展信息(JSON字符串)
+        ismix: number; // 是否混合渠道 - 0:否 1:是
         mobilephone: string;//手机号
         mobilephone2: string;//手机号 - 密文
         netaddr: string;//调转网址
@@ -566,4 +568,34 @@ declare namespace Model {
         /// 用户ID
         userid: number
     }
+
+    interface PaymentCenterHybridConfigs {
+        bank_infos: HybridBank[]
+        can_amt_in: number   // 入金是否可用 0-不可用 1-可用
+        can_amt_out: number  // 出金是否可用 0-不可用 1-可用
+        channel_code: string // 渠道代码
+        channel_name: string // 渠道名称
+    }
+
+    interface HybridBank {
+        bank_code: string    // 银行代码
+        bank_name: string    // 银行名称
+        channel_code: string // 渠道代码
+        is_enabled: number  // 是否可用 0-未可用 1-可用
+        method_type: string // 方式类型
+        out_in_flag: number // 出入金标志 0-出金 1-入金
+        remark: string // 备注
+    }
+
+    interface HybridReceiverOnboard {
+        accountid: string    // 资金账户ID
+        bank_account: string    // 银行卡号
+        bank_code: string // 银行代码
+        bank_name: number  // 银行名称
+        cert_no: string // 证件号码
+        channel_code: number // 渠道代码
+        name: string // 名称 / 企业名称
+        phone_number: string // 电话号码
+        receiver_type: string // 接收者类型 // 个人-Individual 企业-Organization
+    }
 }