|
@@ -35,16 +35,14 @@
|
|
|
<img src="../../../assets/images/certification.png" />
|
|
<img src="../../../assets/images/certification.png" />
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<div class="g-form__footer inset">
|
|
<div class="g-form__footer inset">
|
|
|
- <Button type="danger" :loading="buttonLoading" @click="onSubmit" round block>提交实名认证</Button>
|
|
|
|
|
|
|
+ <Button type="danger" :loading="buttonLoading" @click="onCheckCardNum" round block>提交实名认证</Button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <component ref="componentRef" v-bind="{ formData }" :is="componentMap.get(componentId)" @closed="closeComponent"
|
|
|
|
|
- v-if="componentId" />
|
|
|
|
|
</app-view>
|
|
</app-view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, defineAsyncComponent, onMounted, computed } from 'vue'
|
|
|
|
|
|
|
+import { shallowRef, onMounted } from 'vue'
|
|
|
import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule, Image } from 'vant'
|
|
import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule, Image } from 'vant'
|
|
|
import { fullloading, dialog } from '@/utils/vant';
|
|
import { fullloading, dialog } from '@/utils/vant';
|
|
|
import { getFileUrl } from '@/filters';
|
|
import { getFileUrl } from '@/filters';
|
|
@@ -53,47 +51,25 @@ import { useRequest } from '@/hooks/request'
|
|
|
import { queryTencentUsereSignRecords, requestCheckCardNum } from '@/services/api/account';
|
|
import { queryTencentUsereSignRecords, requestCheckCardNum } from '@/services/api/account';
|
|
|
import { addAuthReq } from '@/business/user/account';
|
|
import { addAuthReq } from '@/business/user/account';
|
|
|
import { validateRules } from '@/constants/regex';
|
|
import { validateRules } from '@/constants/regex';
|
|
|
-import { useComponent } from '@/hooks/component'
|
|
|
|
|
import { useUserStore } from '@/stores'
|
|
import { useUserStore } from '@/stores'
|
|
|
import AppSelect from '@mobile/components/base/select/index.vue'
|
|
import AppSelect from '@mobile/components/base/select/index.vue'
|
|
|
import AppUploader from '@mobile/components/base/uploader/index.vue'
|
|
import AppUploader from '@mobile/components/base/uploader/index.vue'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { getUserId, getMemberUserId } from '@/services/methods/user'
|
|
import { getUserId, getMemberUserId } from '@/services/methods/user'
|
|
|
|
|
|
|
|
-const componentMap = new Map<string, unknown>([
|
|
|
|
|
- ['certification-next', defineAsyncComponent(() => import('./components/certification-next/Index.vue'))], // 爱签-实名认证第二步
|
|
|
|
|
-])
|
|
|
|
|
-
|
|
|
|
|
const { router } = useNavigation()
|
|
const { router } = useNavigation()
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const { formData, formSubmit, loading } = addAuthReq()
|
|
const { formData, formSubmit, loading } = addAuthReq()
|
|
|
|
|
|
|
|
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
|
|
- router.back()
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-const isReadonly = computed(() => userESignRecords.value.some((e) => e.templatetype === 1 && e.recordstatus === 3))
|
|
|
|
|
|
|
+const isReadonly = false//computed(() => userESignRecords.value.some((e) => e.recordstatus === 3))
|
|
|
|
|
|
|
|
/// 查询记录
|
|
/// 查询记录
|
|
|
-const { loading: buttonLoading, dataList: userESignRecords, run: getTencentQianNotice } = useRequest(queryTencentUsereSignRecords, {
|
|
|
|
|
- manual: true,
|
|
|
|
|
|
|
+const { loading: buttonLoading, dataList: userESignRecords } = useRequest(queryTencentUsereSignRecords, {
|
|
|
params: {
|
|
params: {
|
|
|
userId: getUserId(),
|
|
userId: getUserId(),
|
|
|
memberUserId: getMemberUserId()
|
|
memberUserId: getMemberUserId()
|
|
|
},
|
|
},
|
|
|
- onSuccess: (res) => {
|
|
|
|
|
- const record = res.data.find((e) => e.templatetype === 1 && e.recordstatus === 3)
|
|
|
|
|
- if (record) {
|
|
|
|
|
- const { customername, cardnum, cardfrontphotourl, cardbackphotourl, mobile2, cardtypeid } = userStore.userInfo
|
|
|
|
|
- formData.username = customername
|
|
|
|
|
- formData.cardnum = cardnum
|
|
|
|
|
- formData.cardbackphotourl = cardfrontphotourl
|
|
|
|
|
- formData.cardbackphotourl = cardbackphotourl
|
|
|
|
|
- formData.cardtype = cardtypeid
|
|
|
|
|
- formData.mobile = mobile2
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
onError: (err) => {
|
|
onError: (err) => {
|
|
|
showFailToast(err)
|
|
showFailToast(err)
|
|
|
}
|
|
}
|
|
@@ -152,29 +128,12 @@ const onCheckCardNum = () => {
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
formSubmit().then(() => {
|
|
formSubmit().then(() => {
|
|
|
hideLoading()
|
|
hideLoading()
|
|
|
- /// 查询电子签合同
|
|
|
|
|
- getTencentQianNotice()
|
|
|
|
|
dialog('提交请求成功').then(() => {
|
|
dialog('提交请求成功').then(() => {
|
|
|
/// 进行下一步
|
|
/// 进行下一步
|
|
|
- openComponent('certification-next')
|
|
|
|
|
|
|
+ router.push({name: 'account-protocol', query: { memberUserId: getMemberUserId().toString() }})
|
|
|
})
|
|
})
|
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
|
- switch (err) {
|
|
|
|
|
- case '100020':
|
|
|
|
|
- hideLoading('个人三要素信息验证失败', 'fail')
|
|
|
|
|
- break
|
|
|
|
|
- case '100021':
|
|
|
|
|
- hideLoading('用户已存在', 'fail')
|
|
|
|
|
- break
|
|
|
|
|
- case '100726':
|
|
|
|
|
- hideLoading('该条实名记录为核验记录,无法用于添加用户', 'fail')
|
|
|
|
|
- break
|
|
|
|
|
- case '100727':
|
|
|
|
|
- hideLoading('实名认证类型和添加用户类型不匹配', 'fail')
|
|
|
|
|
- break
|
|
|
|
|
- default:
|
|
|
|
|
- hideLoading(err, 'fail')
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ hideLoading(err, 'fail')
|
|
|
})
|
|
})
|
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
|
hideLoading(err, 'fail')
|
|
hideLoading(err, 'fail')
|
|
@@ -182,14 +141,14 @@ const onCheckCardNum = () => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const onSubmit = () => {
|
|
|
|
|
- const isInclude = userESignRecords.value.some((e) => e.templatetype === 1 && e.recordstatus === 1)
|
|
|
|
|
- if (!userESignRecords.value.length || isInclude) {
|
|
|
|
|
- formRef.value?.submit()
|
|
|
|
|
- } else {
|
|
|
|
|
- openComponent('certification-next')
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// const onSubmit = () => {
|
|
|
|
|
+// const isInclude = userESignRecords.value.some((e) => e.recordstatus === 1)
|
|
|
|
|
+// if (!userESignRecords.value.length || isInclude) {
|
|
|
|
|
+// formRef.value?.submit()
|
|
|
|
|
+// } else {
|
|
|
|
|
+// openComponent('certification-next')
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
formData.mobile = userStore.userInfo?.mobile2 ?? ''
|
|
formData.mobile = userStore.userInfo?.mobile2 ?? ''
|