Bläddra i källkod

实名认证请求增加手机号功能

Handy_Cao 1 år sedan
förälder
incheckning
8033945c9f

+ 1 - 0
src/packages/mobile/views/account/authresult/Index.vue

@@ -9,6 +9,7 @@
                 <Cell :title="$t('user.authentication.cardtype')"
                     :value="getCertificateTypeCodeName(userInfo.cardtypeid)" />
                 <Cell :title="$t('user.authentication.cardnum')" :value="userInfo.cardnum" />
+                <Cell v-if="userInfo.mobile2 != ''" :title="$t('banksign.mobilephone')" :value="userInfo.mobile2" />
                 <Cell :title="$t('banksign.bankname1')" :value="userInfo.bankbankname" v-if="userInfo.bankbankname" />
                 <Cell :title="$t('banksign.bankno')" :value="userInfo.bankaccount" v-if="userInfo.bankaccount" />
                 <Cell :title="$t('user.authentication.cardfrontphoto')">

+ 51 - 3
src/packages/mobile/views/account/certification/Index.vue

@@ -16,6 +16,29 @@
                 </Field>
                 <Field v-model="formData.cardnum" name="cardnum" :label="$t('user.authentication.cardnum')"
                     :placeholder="$t('user.authentication.pleaseenterthecardnum')" :rules="formRules.cardnum" />
+                <Field v-if="formData.mobilephone != ''" name="mobilephone" v-model="formData.mobilephone" :label="$t('user.register.mobile')" readonly />
+                <Field v-else v-model="formData.mobilephone" type="digit" name="mobilephone" :placeholder="$t('user.register.tips1')" :rules="formRules.mobilephone">
+                    <template #label>
+                        <span>{{ $t('user.register.mobile') }}</span>
+                        <span style="margin-left: 10px;" @click="show = true">{{ countryCode }}</span>
+                        <Popup v-model:show="show" position="bottom" teleport="body" round>
+                            <Picker :columns="datalist" @cancel="onCancel" @confirm="onConfirm"
+                                :confirm-button-text="$t('operation.confirm')" :cancel-button-text="$t('operation.cancel')">
+                                <template #option="{ text, index }">
+                                <slot name="option" :row="datalist[index]" :index="index">
+                                    {{ text }}
+                                </slot>
+                                </template>
+                            </Picker>
+                        </Popup>
+                    </template>
+                </Field>
+                <Field name="bankid" :label="$t('banksign.OpenBankAccId')" :rules="formRules.bankid" is-link>
+                    <template #input>
+                        <app-select v-model="formData.bankid" :placeholder="$t('banksign.Pleaseselectyourbank')"
+                            :options="banklist" :optionProps="{ label: 'bankname', value: 'bankid' }" />
+                    </template>
+                </Field>
                 <Field name="bankid" :label="$t('banksign.OpenBankAccId')" :rules="formRules.bankid" is-link>
                     <template #input>
                         <app-select v-model="formData.bankid" :placeholder="$t('banksign.Pleaseselectyourbank')"
@@ -57,8 +80,8 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
-import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule } from 'vant'
+import { shallowRef, computed, ref, onMounted } from 'vue'
+import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule, Popup, Picker, PickerConfirmEventParams } from 'vant'
 import { addAuthReq } from '@/business/user'
 import { fullloading, dialog } from '@/utils/vant'
 import { getCerTypePersonList } from "@/constants/account"
@@ -68,7 +91,8 @@ import { validateRules } from '@/constants/regex'
 import { useRequest } from '@/hooks/request'
 import { getWskhOpenAccountConfigs } from '@/services/api/account'
 import { useQueryCusBankSignBank } from '@/business/bank'
-import { i18n } from '@/stores'
+import { getCountryCodeList } from '@/constants/unit'
+import { i18n, useUserStore } from '@/stores'
 import AppUploader from '@mobile/components/base/uploader/index.vue'
 import AppSelect from '@mobile/components/base/select/index.vue'
 import service from '@/services'
@@ -78,6 +102,17 @@ const { formData, formSubmit, modifyremark } = addAuthReq()
 const { router } = useNavigation()
 const { global: { t } } = i18n
 
+const userStore = useUserStore()
+
+// 是否弹出选择器
+const show = shallowRef(false) 
+const datalist = computed(() => {
+  return getCountryCodeList().map(e => {
+    return { text: e.value, value: e.value }
+  })
+})
+const countryCode = ref(datalist.value[0]?.value.toString() ?? '')
+
 const showHalfBodyPhoto = shallowRef('0')
 const showCardBackPhoto = shallowRef('0')
 const halfBodyPhotoTitle = shallowRef(t('user.authentication.halfbodyphoto'))
@@ -86,6 +121,15 @@ const oem = service.getConfig('oem')
 
 const { banklist } = useQueryCusBankSignBank()
 
+const onCancel = () => {
+  show.value = false
+}
+
+const onConfirm = ({ selectedValues: [value] }: PickerConfirmEventParams) => {
+  show.value = false
+  countryCode.value = value.toString()
+}
+
 // 获取网上开户配置
 useRequest(getWskhOpenAccountConfigs, {
     params: {
@@ -172,4 +216,8 @@ const onSubmit = () => {
         })
     })
 }
+
+onMounted(() => {
+    formData.mobilephone = userStore.userInfo.mobile2
+})
 </script>

+ 1 - 1
src/services/http/index.ts

@@ -266,7 +266,7 @@ export default new (class {
                     return Promise.resolve(res)
                 }
                 const { getErrorInfoByCode } = useErrorInfoStore()
-                const msg = getErrorInfoByCode(res.RetCode ?? res.Status) + `[${res.RetCode}]`
+                const msg = getErrorInfoByCode(res.RetCode ?? res.Status) + (res.RetCode != undefined ? `[${res.RetCode}]` : '')
                 const error = String(res.RetDesc || res.RetCode || res.Status)
                 return Promise.reject(msg ?? error)
             }

+ 5 - 3
src/types/model/user.d.ts

@@ -244,11 +244,13 @@ declare namespace Model {
         // 半身照
         halfbodyphotourl?: string;
         /// 手机号码
-        mobile?: string
+        mobilephone?: string
         // 用户类型
         userinfotype?: number;
-        bankid?; //银行编码
-        bankaccount?; //银行帐号
+        //银行编码
+        bankid?; 
+        //银行帐号
+        bankaccount?; 
     }
 
     interface AddAuthRsp {