|
|
@@ -6,37 +6,31 @@
|
|
|
</template>
|
|
|
<div class="g-form__container">
|
|
|
<CellGroup inset>
|
|
|
- <Cell title="姓名" :value="formData.name" />
|
|
|
+ <Cell title="姓名" :value="formData.username" />
|
|
|
<Cell title="手机号码" :value="formData.mobile" />
|
|
|
- <Cell title="证件类型" :value="getAQCertificateTypeListName(formData.idCardType ?? 1)" />
|
|
|
- <Cell title="证件号码" :value="formData.idCard" />
|
|
|
+ <Cell title="证件类型" :value="getAQCertificateTypeListName(formData.cardtype ?? 1)" />
|
|
|
+ <Cell title="证件号码" :value="formData.cardnum" />
|
|
|
<Cell title="证件正面照片">
|
|
|
<template #value>
|
|
|
- <Image fit="contain" :src="idCardPhoto" width="100" height="100" />
|
|
|
+ <Image fit="contain" :src="cardfrontphotourl" width="100" height="100" />
|
|
|
</template>
|
|
|
</Cell>
|
|
|
<Cell title="证件反面照片">
|
|
|
<template #value>
|
|
|
- <Image fit="contain" :src="idCardPhotoBackURL" width="100" height="100" />
|
|
|
+ <Image fit="contain" :src="cardbackphotourl" width="100" height="100" />
|
|
|
</template>
|
|
|
</Cell>
|
|
|
</CellGroup>
|
|
|
<CellGroup inset>
|
|
|
- <template v-for="(item, index) in secondStepList" :key="index">
|
|
|
+ <template v-for="(item, index) in dataList" :key="index">
|
|
|
<Cell :title="item.templatename" :icon="iconName(item.recordstatus)" @click="signer(item)"
|
|
|
is-link />
|
|
|
</template>
|
|
|
- <template v-if="secondStepList.every(e => e.recordstatus === 3)">
|
|
|
- <template v-for="(item, index) in thirdStepList" :key="index">
|
|
|
- <Cell title="视频认证" :icon="iconName(item.recordstatus)" @click="faceAuth(item.recordstatus)"
|
|
|
- :is-link="item.recordstatus !== 3" />
|
|
|
- </template>
|
|
|
- </template>
|
|
|
</CellGroup>
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
<div class="g-form__footer inset">
|
|
|
- <Button type="danger" :disabled="dataList.some((e) => e.recordstatus !== 3)" @click="onSubmit()" round
|
|
|
+ <Button type="danger" :disabled="dataList.some((e) => e.recordstatus !== 3)" @click="closed(true)" round
|
|
|
block>提交认证</Button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -47,31 +41,37 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, computed, PropType } from 'vue'
|
|
|
import { CellGroup, Button, Cell, showFailToast, Image, showToast } from 'vant'
|
|
|
-import { fullloading, dialog } from '@/utils/vant';
|
|
|
+import { fullloading } from '@/utils/vant';
|
|
|
import { getAQCertificateTypeListName } from "@/constants/account";
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
-import { queryUserESignRecord } from '@/services/api/account';
|
|
|
-import { useRequestCreateContractAndAddSigner, useRequestSignCompleted, useRequestWillFace } from '@/business/user/account';
|
|
|
+import { queryTencentUsereSignRecords } from '@/services/api/account';
|
|
|
+import { useRequestCreateFlowByTemplateDirectly } from '@/business/user/account';
|
|
|
import plus from '@/utils/h5plus'
|
|
|
import eventBus from '@/services/bus'
|
|
|
import { getFileUrl } from '@/filters';
|
|
|
import AppModal from '@/components/base/modal/index.vue'
|
|
|
+import { getUserId, getMemberUserId } from '@/services/methods/user'
|
|
|
+import { useUserStore } from '@/stores'
|
|
|
|
|
|
const showModal = shallowRef(true)
|
|
|
// 是否刷新父组件数据
|
|
|
const refresh = shallowRef(false)
|
|
|
-const { createSigner, templateNoFormData } = useRequestCreateContractAndAddSigner()
|
|
|
-/// 意愿视频认证
|
|
|
-const { willFace, willFaceFormData } = useRequestWillFace()
|
|
|
-const { signCompleted } = useRequestSignCompleted()
|
|
|
-
|
|
|
+/// 创建电子签合同
|
|
|
+const { createTemplate, templateFormData } = useRequestCreateFlowByTemplateDirectly()
|
|
|
+/// 电子签合同信息
|
|
|
+const dataList = shallowRef<Model.TencentUsereSignRecordsRsq[]>([])
|
|
|
/// 查询
|
|
|
-const { run, dataList } = useRequest(queryUserESignRecord)
|
|
|
-
|
|
|
-// 步骤2列表
|
|
|
-const secondStepList = computed(() => dataList.value.filter(obj => obj.templatetype === 2))
|
|
|
-// 步骤3列表
|
|
|
-const thirdStepList = computed(() => dataList.value.filter(obj => obj.templatetype === 3))
|
|
|
+const { run } = useRequest(queryTencentUsereSignRecords, {
|
|
|
+ params: {
|
|
|
+ userId: getUserId(),
|
|
|
+ memberUserId: getMemberUserId()
|
|
|
+ },
|
|
|
+ onSuccess: (res) => {
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ dataList.value = res.data
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
const iconName = (type: number) => {
|
|
|
switch (type) {
|
|
|
@@ -83,16 +83,16 @@ const iconName = (type: number) => {
|
|
|
}
|
|
|
|
|
|
// 正面照
|
|
|
-const idCardPhoto = computed(() => {
|
|
|
- const idCardPhoto = props.formData.idCardPhoto ?? ''
|
|
|
- const image = idCardPhoto.split(',')[0]
|
|
|
+const cardfrontphotourl = computed(() => {
|
|
|
+ const cardfrontphotourl = props.formData.cardfrontphotourl ?? ''
|
|
|
+ const image = cardfrontphotourl.split(',')[0]
|
|
|
return getFileUrl(image)
|
|
|
})
|
|
|
|
|
|
// 背面照
|
|
|
-const idCardPhotoBackURL = computed(() => {
|
|
|
- const idCardPhotoBackURL = props.formData.idCardPhotoBackURL ?? ''
|
|
|
- const image = idCardPhotoBackURL.split(',')[0]
|
|
|
+const cardbackphotourl = computed(() => {
|
|
|
+ const cardbackphotourl = props.formData.cardbackphotourl ?? ''
|
|
|
+ const image = cardbackphotourl.split(',')[0]
|
|
|
return getFileUrl(image)
|
|
|
})
|
|
|
|
|
|
@@ -114,12 +114,12 @@ const openWebview = (url: string) => {
|
|
|
|
|
|
const props = defineProps({
|
|
|
formData: {
|
|
|
- type: Object as PropType<Model.AddUserReq>,
|
|
|
+ type: Object as PropType<Model.AddAuthReq>,
|
|
|
required: true,
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const signer = (item: Model.UserESignRecordRsq) => {
|
|
|
+const signer = (item: Model.TencentUsereSignRecordsRsq) => {
|
|
|
/// 如果是已签署
|
|
|
if (item.recordstatus === 2) {
|
|
|
item.signurl ? openWebview(item.signurl) : showFailToast('合同地址错误')
|
|
|
@@ -128,9 +128,23 @@ const signer = (item: Model.UserESignRecordRsq) => {
|
|
|
item.contractfileaddr ? plus.openURL(fileUrl) : showFailToast('合同地址错误')
|
|
|
} else {
|
|
|
fullloading((hideLoading) => {
|
|
|
- templateNoFormData.templateNo = item.templateno
|
|
|
+ const userinfotype = useUserStore().userInfo.userinfotype
|
|
|
+ templateFormData.userESignRecordID = item.recordid
|
|
|
+ templateFormData.userType = userinfotype
|
|
|
+ /// 个人信息
|
|
|
+ if (userinfotype === 1) {
|
|
|
+ templateFormData.personInfo = {
|
|
|
+ idCardNumber: props.formData.cardnum,
|
|
|
+ mobile: props.formData.mobile,
|
|
|
+ name: props.formData.username
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ templateFormData.organizationInfo = {
|
|
|
+ name: props.formData.username
|
|
|
+ }
|
|
|
+ }
|
|
|
/// 创建合同
|
|
|
- createSigner().then((res) => {
|
|
|
+ createTemplate().then((res) => {
|
|
|
hideLoading()
|
|
|
openWebview(res.data.signUrl)
|
|
|
}).catch((err) => {
|
|
|
@@ -140,52 +154,6 @@ const signer = (item: Model.UserESignRecordRsq) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 视频认证
|
|
|
-const faceAuth = (status: number) => {
|
|
|
- if (status !== 3) {
|
|
|
- plus.requestPermissionCamera({
|
|
|
- onSuccess: () => {
|
|
|
- plus.requestPermissionRecordAudio({
|
|
|
- onSuccess: () => {
|
|
|
- /// 进行视频认证
|
|
|
- willFaceFormData.idCardNo = props.formData.idCard
|
|
|
- willFaceFormData.realName = props.formData.name
|
|
|
- /// loading
|
|
|
- fullloading((hideLoading) => {
|
|
|
- willFace().then((res) => {
|
|
|
- hideLoading()
|
|
|
- openWebview(res.data.faceUrl)
|
|
|
- }).catch((err) => {
|
|
|
- hideLoading(err, 'fail')
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- onError: (err) => {
|
|
|
- showFailToast(err)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- onError: (err) => {
|
|
|
- showFailToast(err)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/// 最终提交
|
|
|
-const onSubmit = () => {
|
|
|
- fullloading((hideLoading) => {
|
|
|
- signCompleted().then(() => {
|
|
|
- hideLoading()
|
|
|
- dialog('实名认证提交请求成功').then(() => {
|
|
|
- closed(true)
|
|
|
- })
|
|
|
- }).catch((err) => {
|
|
|
- hideLoading(err, 'fail')
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// 接收窗口页面状态通知
|
|
|
const documentVisibilityStateNotify = eventBus.$on('DocumentVisibilityStateNotify', (state) => {
|
|
|
if (state === 'visible') {
|