From 3a6f47aae0ca4566a7f39c98c30bcc5545dd1216 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期四, 21 八月 2025 09:58:32 +0800
Subject: [PATCH] feat: 实名

---
 apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue |   36 ++++++++++++++++++++++++++++--------
 1 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue b/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
index 3436e64..277373a 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">
@@ -99,6 +100,8 @@
 import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types';
 import { FormValidator } from '@12333/utils';
 import Taro from '@tarojs/taro';
+import { userCredentialVerifyOcrIDCard } from '@12333/hooks';
+import { EnumOcrAccess } from '@12333/constants';
 
 defineOptions({
   name: 'InnerPage',
@@ -150,12 +153,15 @@
 }
 
 function handleFrontImgUrlChange(response: FileItem) {
-  // userCredentialVerifyOcrIDCard(response, {
-  //   onSuccess(res) {
-  //     if (res.realName) form.legalPersonName = res.realName;
-  //     if (res.idcardNum) form.legalPersonIdNumber = res.idcardNum;
-  //   },
-  // });
+  userCredentialVerifyOcrIDCard({
+    response: response,
+    access: EnumOcrAccess.Baidu,
+    isOssUrl: true,
+    onSuccess(res) {
+      if (res.model?.name) form.name = res.model?.name;
+      if (res.model?.identity) form.identity = res.model?.identity;
+    },
+  });
 }
 
 function handleSubmit() {
@@ -176,7 +182,7 @@
   }
 }
 
-async function personalUserFaceReal() {
+async function personalUserIdentity3Real() {
   try {
     let params: API.PersonalUserIdentity3RealCommand = {
       name: form.name,
@@ -187,10 +193,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 +208,19 @@
       identityBackImg: form.identityBackImg?.[0]?.path ?? '',
     };
     let res = await electronSignServices.personalUserFaceReal(params);
+    if (res) {
+      const encodedUrl = encodeURIComponent(res);
+      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