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 | 36 ++++++++++++++++++++++++++----------
1 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue b/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
index f1c3fe3..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,16 +156,17 @@
}
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() {
- console.log('type: ', type);
if (!formRef.value) return;
formRef.value.validate().then(({ valid, errors }: any) => {
if (valid) {
@@ -204,11 +211,20 @@
};
let res = await electronSignServices.personalUserFaceReal(params);
if (res) {
- const encodedUrl = encodeURIComponent(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