Переглянути джерело

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP20_WEB_GLOBAL

li.shaoyi 2 роки тому
батько
коміт
938ff57b58

+ 23 - 0
src/packages/pc/views/account/sign/components/certification-aq/index.vue

@@ -0,0 +1,23 @@
+<!-- 账户管理-实名认证-爱签 -->
+<template>
+    <app-drawer title="实名认证" v-model:show="show" :refresh="refresh">
+        <div class="g-text-message">请前往手机App进行实名认证</div>
+        <template #footer>
+            <el-button type="info" @click="onCancel(false)">确认</el-button>
+        </template>
+    </app-drawer>
+</template>  
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+
+const show = ref(true)
+const refresh = ref(false)
+
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+</script>

+ 5 - 2
src/packages/pc/views/account/sign/index.vue

@@ -6,8 +6,10 @@
             <el-button type="primary"
                 v-if="authStatus === AuthStatus.Certified && ![SignStatus.Audit, SignStatus.Signed].includes(signStatus)"
                 @click="openComponent('sign')">添加签约账户</el-button>
+            <!-- <el-button type="warning" v-if="authStatus === AuthStatus.Uncertified"
+                @click="openComponent('certification')">实名认证</el-button> -->
             <el-button type="warning" v-if="authStatus === AuthStatus.Uncertified"
-                @click="openComponent('certification')">实名认证</el-button>
+                @click="openComponent('certification-aq')">实名认证</el-button>
         </template>
         <!-- 证件类型 -->
         <template #cardtype="{ value }">
@@ -46,7 +48,8 @@ import AppTable from '@pc/components/base/table/index.vue'
 const componentMap = new Map<string, unknown>([
     ['cancel', defineAsyncComponent(() => import('./components/cancel/index.vue'))],
     ['sign', defineAsyncComponent(() => import('./components/sign/index.vue'))],
-    ['certification', defineAsyncComponent(() => import('./components/certification/index.vue'))], // 实名认证
+    ['certification', defineAsyncComponent(() => import('./components/certification/index.vue'))], // 实名认证,
+    ['certification-aq', defineAsyncComponent(() => import('./components/certification-aq/index.vue'))], // 实名认证
 ])
 
 const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态

+ 32 - 12
src/packages/qxst/views/account/certification/Index.vue

@@ -7,8 +7,7 @@
             <CellGroup inset>
                 <Field v-model="formData.name" name="name" label="姓名" placeholder="请输入用户姓名"
                     :rules="formRules.name" />
-                <Field v-model="formData.mobile" name="mobile" label="手机号码" placeholder="请输入手机号码"
-                    :rules="formRules.mobile" />
+                <Field v-model="mobile2" name="mobile" label="手机号码" placeholder="请输入手机号码" />
                 <Field name="idCardType" label="证件类型" :rules="formRules.idCardType" is-link>
                     <template #input>
                         <app-select v-model="formData.idCardType" placeholder="请选择证件类型" :options="enums" />
@@ -48,30 +47,48 @@ import { queryUserESignRecord } from '@/services/api/account';
 import { adddUserReq } from '@/business/user/account';
 import { validateRules } from '@/constants/regex';
 import { useComponent } from '@/hooks/component'
+import { useUserStore } from '@/stores'
 import AppSelect from '../../../components/base/select/index.vue'
 import AppUploader from '../../../components/base/uploader/index.vue'
+import { useNavigation } from '../../../router/navigation'
 
+const { router } = useNavigation()
 const formRef = shallowRef<FormInstance>()
 const { formData, formSubmit } = adddUserReq()
 const error = shallowRef(false)
 const canAdd = shallowRef(false)
-const { componentRef, componentId, openComponent, closeComponent } = useComponent()
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+    router.back()
+})
+const mobile2 = useUserStore().userInfo?.mobile2 ?? ''
 
 const componentMap = new Map<string, unknown>([
     ['certification-next', defineAsyncComponent(() => import('./components/certification-next/Index.vue'))], // 爱签-实名认证第二步
 ])
 
 /// 查询记录
-const { loading  } = useRequest(queryUserESignRecord, {
-    onSuccess: (res) => {
-        res.data.map(obj => {
-            if (obj.templatetype === 1 && obj.recordstatus === 1) {
-                canAdd.value = true
-            }
-        })
-    },
+const { loading, dataList  } = useRequest(queryUserESignRecord, {
     onError: () => {
         error.value = true
+    }, 
+    onFinally: () => {
+        dataList.value.map(obj => {
+            if (obj.templatetype === 1 && obj.recordstatus === 1) {
+                canAdd.value = true
+            } else if (obj.templatetype === 1 && obj.recordstatus === 3) {
+                canAdd.value = false
+                const { name, idCard, idCardPhoto, idCardPhotoBackURL, mobile, idCardType } = JSON.parse(obj.authinfo)
+                formData.name = name
+                formData.idCard = idCard
+                formData.idCardPhoto = idCardPhoto
+                formData.idCardPhotoBackURL = idCardPhotoBackURL
+                formData.idCardType = idCardType
+                formData.mobile = mobile
+                /// 进行下一步
+                openComponent('certification-next')
+            } 
+        }) 
     }
 })
 
@@ -124,9 +141,12 @@ const formRules: { [key in keyof Model.AddUserReq]?: FieldRule[] } = {
 
 const onSubmit = () => {
     fullloading((hideLoading) => {
+        /// 手机号码
+        formData.mobile = mobile2
+
         formSubmit().then(() => {
             hideLoading()
-            dialog('实名认证提交请求成功').then(() => {
+            dialog('提交请求成功').then(() => {
                 /// 进行下一步
                 openComponent('certification-next')
             })

+ 24 - 15
src/packages/qxst/views/account/certification/components/certification-next/Index.vue

@@ -2,7 +2,7 @@
     <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
         <app-view class="g-form account-certification">
             <template #header>
-                <app-navbar title="实名认证" />
+                <app-navbar title="实名认证" @back="closed" />
             </template>
             <CellGroup inset>
                 <Cell title="姓名" :value="formData.name" />
@@ -11,20 +11,20 @@
                 <Cell title="证件号码" :value="formData.idCard" />
                 <Field name="idCardPhoto" label="证件正面照片">
                     <template #input>
-                        <image :src="idCardPhoto"></image>
+                        <Image :src="idCardPhoto" />
                     </template>
                 </Field>
                 <Field name="idCardPhotoBackURL" label="证件反面照片">
                     <template #input>
-                        <image :src="idCardPhotoBackURL"></image>
+                        <Image :src="idCardPhotoBackURL" />
                     </template>
                 </Field>
             </CellGroup>
             <CellGroup inset>
                 <Cell v-for="(item, index) in dataList" :key="index" @click="signer(item)">
                     <template #title>
-                        <Icon color="#00CCFF" :name="iconName(item.recordstatus)"></Icon>
-                        <Button :disable="item.recordstatus === 2" :text="true">{{ item.templatename }}</Button>
+                        <Icon color="#CC0000" :name="iconName(item.recordstatus)"></Icon>
+                        <Button :disable="item.recordstatus === 2">{{ item.templatename }}</Button>
                     </template>
                 </Cell>
             </CellGroup>
@@ -39,7 +39,7 @@
 
 <script lang="ts" setup>
 import { shallowRef, computed, PropType} from 'vue'
-import { CellGroup, Button, Cell, Field, Icon, showFailToast } from 'vant'
+import { CellGroup, Button, Cell, Field, Icon, showFailToast, Image } from 'vant'
 import { fullloading, dialog } from '@/utils/vant';
 import { getAQCertificateTypeListName } from "@/constants/account";
 import { useRequest } from '@/hooks/request'
@@ -62,27 +62,25 @@ const canAdd = shallowRef(false)
 
 const iconName = (type: number) => {
     switch (type) {
-        case 1:
-            return 'circle'
-        case 2:
-            return 'circle'
+        case 4:
+            return 'close'
         case 3:
             return 'passed'
         default:
-            return 'close'
+            return 'circle'
     }
 }
 
 // 正面照
 const idCardPhoto = computed(() => {
     const idCardPhoto = props.formData.idCardPhoto ?? ''
-    return idCardPhoto.split(',').map((path) => getFileUrl(path))
+    return idCardPhoto.split(',').map((path) => getFileUrl(path))[0]
 })
 
 // 背面照
 const idCardPhotoBackURL = computed(() => {
     const idCardPhotoBackURL = props.formData.idCardPhotoBackURL ?? ''
-    return idCardPhotoBackURL.split(',').map((path) => getFileUrl(path))
+    return idCardPhotoBackURL.split(',').map((path) => getFileUrl(path))[0]
 })
 
 const openURL = (url: string) => {
@@ -101,7 +99,7 @@ const completed = () => {
         signCompleted().then(() => {
             hideLoading()
             dialog('实名认证提交请求成功').then(() => {
-                // router.back()
+                closed(true)
             })
         }).catch((err) => {
             showFailToast(err)
@@ -123,7 +121,7 @@ const signer = (item: Model.UserESignRecordRsq) => {
             /// 创建合同
             createSigner().then((res) => {
                 hideLoading()
-                openURL(res.data.data)
+                openURL(res.data.signUrl)
             }).catch((err) => {
                 showFailToast(err)
             })
@@ -148,4 +146,15 @@ onMounted(() => {
         }
     })
 })
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
 </script>

+ 2 - 6
src/types/model/bank.d.ts

@@ -360,11 +360,7 @@ declare namespace Model {
 
     /// 上传待签署文件和添加签署方-回应
     interface ContractAndAddSignerRsq {
-        /// code
-        code: number
-        /// data
-        data: string
-        /// msg
-        msg: string
+        /// 文件路径
+        signUrl: string
     }
 }