|
|
@@ -3,7 +3,7 @@
|
|
|
<template #header>
|
|
|
<app-navbar title="实名认证" />
|
|
|
</template>
|
|
|
- <Form ref="formRef" class="g-form__container" @submit="onSubmit" :loading="loading">
|
|
|
+ <Form ref="formRef" class="g-form__container" @submit="onCheckCardNum" :loading="loading">
|
|
|
<CellGroup inset>
|
|
|
<Field v-model="formData.name" name="name" label="姓名" placeholder="请输入用户姓名"
|
|
|
:rules="formRules.name" />
|
|
|
@@ -48,7 +48,7 @@ import { fullloading, dialog } from '@/utils/vant';
|
|
|
import { getAQCertificateTypeList } from "@/constants/account";
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryUserESignRecord } from '@/services/api/account';
|
|
|
-import { adddUserReq } from '@/business/user/account';
|
|
|
+import { adddUserReq, useCheckCardNum } from '@/business/user/account';
|
|
|
import { validateRules } from '@/constants/regex';
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useUserStore } from '@/stores'
|
|
|
@@ -66,6 +66,8 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
|
|
|
})
|
|
|
const mobile2 = useUserStore().userInfo?.mobile2 ?? ''
|
|
|
|
|
|
+const { checkCardNumFormData, checkCardNum} = useCheckCardNum()
|
|
|
+
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
['certification-next', defineAsyncComponent(() => import('./components/certification-next/Index.vue'))], // 爱签-实名认证第二步
|
|
|
])
|
|
|
@@ -90,6 +92,10 @@ const { loading } = useRequest(queryUserESignRecord, {
|
|
|
openComponent('certification-next')
|
|
|
}
|
|
|
}
|
|
|
+ }, onError: (err) => {
|
|
|
+ showFailToast(err)
|
|
|
+ /// 报错返回
|
|
|
+ router.back()
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -137,6 +143,25 @@ const formRules: { [key in keyof Model.AddUserReq]?: FieldRule[] } = {
|
|
|
}],
|
|
|
}
|
|
|
|
|
|
+const onCheckCardNum = () => {
|
|
|
+ fullloading((hideLoading) => {
|
|
|
+ /// 证件号码
|
|
|
+ checkCardNumFormData.cardnum = formData.idCard
|
|
|
+ /// 请求校验
|
|
|
+ checkCardNum().then((res) => {
|
|
|
+ hideLoading()
|
|
|
+ /// 提交
|
|
|
+ if (res.code === 0) {
|
|
|
+ onSubmit()
|
|
|
+ } else {
|
|
|
+ showFailToast(res.message ?? '未知错误')
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ showFailToast(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
const onSubmit = () => {
|
|
|
fullloading((hideLoading) => {
|
|
|
/// 手机号码
|