|
|
@@ -33,7 +33,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, computed, PropType} from 'vue'
|
|
|
+import { shallowRef, computed, PropType } from 'vue'
|
|
|
import { CellGroup, Button, Cell, Field, showFailToast, Image } from 'vant'
|
|
|
import { fullloading, dialog } from '@/utils/vant';
|
|
|
import { getAQCertificateTypeListName } from "@/constants/account";
|
|
|
@@ -41,11 +41,10 @@ import { useRequest } from '@/hooks/request'
|
|
|
import { queryUserESignRecord } from '@/services/api/account';
|
|
|
import { useRequestCreateContractAndAddSigner, useRequestSignCompleted } from '@/business/user/account';
|
|
|
import plus from '@/utils/h5plus'
|
|
|
-import { onMounted } from 'vue';
|
|
|
+import eventBus from '@/services/bus'
|
|
|
import { getFileUrl } from '@/filters';
|
|
|
import AppModal from '@/components/base/modal/index.vue'
|
|
|
|
|
|
-const error = shallowRef(false)
|
|
|
const showModal = shallowRef(true)
|
|
|
// 是否刷新父组件数据
|
|
|
const refresh = shallowRef(false)
|
|
|
@@ -55,6 +54,19 @@ const { signCompleted} = useRequestSignCompleted()
|
|
|
/// 可以认证
|
|
|
const canAdd = shallowRef(false)
|
|
|
|
|
|
+/// 查询
|
|
|
+const { run } = useRequest(queryUserESignRecord, {
|
|
|
+ onSuccess: (res) => {
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ dataList.value = res.data.filter(obj => {
|
|
|
+ return obj.templatetype === 2
|
|
|
+ })
|
|
|
+ }
|
|
|
+ /// 只有全部签署才可以进行下一步
|
|
|
+ canAdd.value = dataList.value.some(obj => { [1, 4].includes(obj.recordstatus) })
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
const iconName = (type: number) => {
|
|
|
switch (type) {
|
|
|
case 2:
|
|
|
@@ -71,13 +83,15 @@ const iconName = (type: number) => {
|
|
|
// 正面照
|
|
|
const idCardPhoto = computed(() => {
|
|
|
const idCardPhoto = props.formData.idCardPhoto ?? ''
|
|
|
- return idCardPhoto.split(',').map((path) => getFileUrl(path))[0]
|
|
|
+ const image = idCardPhoto.split(',')[0]
|
|
|
+ return getFileUrl(image)
|
|
|
})
|
|
|
|
|
|
// 背面照
|
|
|
const idCardPhotoBackURL = computed(() => {
|
|
|
const idCardPhotoBackURL = props.formData.idCardPhotoBackURL ?? ''
|
|
|
- return idCardPhotoBackURL.split(',').map((path) => getFileUrl(path))[0]
|
|
|
+ const image = idCardPhotoBackURL.split(',')[0]
|
|
|
+ return getFileUrl(image)
|
|
|
})
|
|
|
|
|
|
const openURL = (url: string) => {
|
|
|
@@ -132,28 +146,18 @@ const signer = (item: Model.UserESignRecordRsq) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
- /// 查询
|
|
|
- useRequest(queryUserESignRecord, {
|
|
|
- onSuccess: (res) => {
|
|
|
- if (res.data.length != 0) {
|
|
|
- dataList.value = res.data.filter(obj => {
|
|
|
- return obj.templatetype === 2
|
|
|
- })
|
|
|
- }
|
|
|
- /// 只有全部签署才可以进行下一步
|
|
|
- canAdd.value = dataList.value.some(obj => { [1, 4].includes(obj.recordstatus) })
|
|
|
- },
|
|
|
- onError: () => {
|
|
|
- error.value = true
|
|
|
- }
|
|
|
- })
|
|
|
+// 接收窗口页面状态通知
|
|
|
+const documentVisibilityStateNotify = eventBus.$on('DocumentVisibilityStateNotify', (state) => {
|
|
|
+ if (state === 'visible') {
|
|
|
+ run()
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
// 关闭弹窗
|
|
|
const closed = (isRefresh = false) => {
|
|
|
refresh.value = isRefresh
|
|
|
showModal.value = false
|
|
|
+ documentVisibilityStateNotify.cancel()
|
|
|
}
|
|
|
|
|
|
// 暴露组件属性给父组件调用
|