From c2463c02a17f92df55ec77ed2da3fb724290c072 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 20 十月 2025 17:34:30 +0800
Subject: [PATCH] fix: bug
---
apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue | 44 ++++++++++++++++++++++++++++++++++----------
1 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue b/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
index 3436e64..6e5dda9 100644
--- a/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
+++ b/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
@@ -10,6 +10,7 @@
:limitFileSize="10"
class="bole-uploader nopaddingtop"
@my-success="handleFrontImgUrlChange"
+ @delete="handleFrontImgUrlDelete"
>
<template #upload-icon>
<div class="photograph-wrapper">
@@ -45,6 +46,7 @@
v-model.trim="form.name"
class="nut-input-text bole-input-text"
placeholder="璇峰~鍐欏鍚�"
+ :formatter="filterNotCN"
type="text"
/>
</nut-form-item>
@@ -79,6 +81,7 @@
class="nut-input-text bole-input-text"
placeholder="璇疯緭鍏ラ獙璇佺爜"
type="number"
+ :max-length="6"
/>
</nut-form-item>
</template>
@@ -97,13 +100,16 @@
import { FileItem } from '@nutui/nutui-taro/dist/types/__VUE/uploader/type';
import { Photograph } from '@nutui/icons-vue-taro';
import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types';
-import { FormValidator } from '@12333/utils';
+import { FormValidator, filterNotCN } from '@12333/utils';
import Taro from '@tarojs/taro';
+import { userCredentialVerifyOcrIDCard } from '@12333/hooks';
+import { EnumOcrAccess } from '@12333/constants';
defineOptions({
name: 'InnerPage',
});
+const { userDetail, updateUserInfo } = useUser();
const router = Taro.useRouter();
const type = router.params?.type ?? '';
@@ -112,7 +118,7 @@
identityBackImg: [] as FileItem[],
name: '',
identity: '',
- phoneNumber: '',
+ phoneNumber: userDetail.value?.contactPhoneNumber,
verifyCode: '',
});
@@ -150,12 +156,14 @@
}
function handleFrontImgUrlChange(response: FileItem) {
- // userCredentialVerifyOcrIDCard(response, {
- // onSuccess(res) {
- // if (res.realName) form.legalPersonName = res.realName;
- // if (res.idcardNum) form.legalPersonIdNumber = res.idcardNum;
- // },
- // });
+ userCredentialVerifyOcrIDCard({
+ url: response?.url,
+ access: EnumOcrAccess.Baidu,
+ onSuccess(res) {
+ if (res.model?.name) form.name = res.model?.name;
+ if (res.model?.identity) form.identity = res.model?.identity;
+ },
+ });
}
function handleSubmit() {
@@ -176,7 +184,7 @@
}
}
-async function personalUserFaceReal() {
+async function personalUserIdentity3Real() {
try {
let params: API.PersonalUserIdentity3RealCommand = {
name: form.name,
@@ -187,10 +195,13 @@
verifyCode: form.verifyCode,
};
let res = await electronSignServices.personalUserIdentity3Real(params);
+ if (res) {
+ Taro.navigateTo({ url: `${RouterPath.authenticationResult}` });
+ }
} catch (error) {}
}
-async function personalUserIdentity3Real() {
+async function personalUserFaceReal() {
try {
let params: API.PersonalUserFaceRealCommand = {
name: form.name,
@@ -199,8 +210,21 @@
identityBackImg: form.identityBackImg?.[0]?.path ?? '',
};
let res = await electronSignServices.personalUserFaceReal(params);
+ if (res) {
+ // 涓轰簡鍏煎鏃х増鏈殑api res鐩存帴鏄痜aceUrl
+ const encodedUrl = encodeURIComponent(typeof res === 'string' ? res : res.faceUrl);
+ updateUserInfo();
+ Taro.navigateTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` });
+ }
} catch (error) {}
}
+
+function handleFrontImgUrlDelete({ files, fileList, index }) {
+ if (fileList?.length === 0) {
+ form.name = '';
+ form.identity = '';
+ }
+}
</script>
<style lang="scss">
--
Gitblit v1.9.1