From 69df67681eab7c7526cb81b4b0d308b7cf66cb09 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期三, 20 八月 2025 11:22:07 +0800
Subject: [PATCH] feat: 实名

---
 apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue |  143 ++++++++++++++++++++++++++++-------------------
 1 files changed, 86 insertions(+), 57 deletions(-)

diff --git a/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue b/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
index 2b4b5d1..3436e64 100644
--- a/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
+++ b/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
@@ -3,14 +3,9 @@
     <nut-form :model-value="form" ref="formRef" :rules="rules">
       <ProFormItemCell label="韬唤璇佺収鐗�:" required>
         <div class="id-imgUrl-wrapper">
-          <nut-form-item
-            label=" "
-            class="bole-form-item"
-            prop="legalPersonIdFrontImgUrl"
-            label-width="0px"
-          >
+          <nut-form-item label=" " class="bole-form-item" prop="identityImg" label-width="0px">
             <Uploader
-              v-model:file-list="form.legalPersonIdFrontImgUrl"
+              v-model:file-list="form.identityImg"
               :maximum="1"
               :limitFileSize="10"
               class="bole-uploader nopaddingtop"
@@ -24,14 +19,9 @@
               </template>
             </Uploader>
           </nut-form-item>
-          <nut-form-item
-            label=" "
-            class="bole-form-item"
-            prop="legalPersonIdBackImgUrl"
-            label-width="0px"
-          >
+          <nut-form-item label=" " class="bole-form-item" prop="identityBackImg" label-width="0px">
             <Uploader
-              v-model:file-list="form.legalPersonIdBackImgUrl"
+              v-model:file-list="form.identityBackImg"
               :maximum="1"
               :limitFileSize="10"
               class="bole-uploader nopaddingtop"
@@ -58,38 +48,40 @@
           type="text"
         />
       </nut-form-item>
-      <nut-form-item label="韬唤璇佸彿:" class="bole-form-item" prop="idNumber" required>
+      <nut-form-item label="韬唤璇佸彿:" class="bole-form-item" prop="identity" required>
         <nut-input
-          v-model.trim="form.idNumber"
+          v-model.trim="form.identity"
           class="nut-input-text bole-input-text"
           placeholder="璇峰~鍐欒韩浠借瘉鍙风爜"
           type="text"
         />
       </nut-form-item>
-      <nut-form-item label="鎵嬫満鍙�:" class="bole-form-item" prop="contactPhone" required>
-        <nut-input
-          v-model.trim="form.contactPhone"
-          class="nut-input-text bole-input-text"
-          placeholder="璇峰~鍐欐墜鏈哄彿鐮�"
-          type="text"
-        >
-          <template #right>
-            <ProFormCaptcha
-              :onGetCaptcha="() => onGetCaptcha(form.contactPhone)"
-              :phonePropName="['contactPhone', 'name', 'idNumber']"
-              :validateField="formRef?.validate"
-            ></ProFormCaptcha>
-          </template>
-        </nut-input>
-      </nut-form-item>
-      <nut-form-item label="鐭俊楠岃瘉鐮�:" class="bole-form-item" prop="verificationCode" required>
-        <nut-input
-          v-model.trim="form.verificationCode"
-          class="nut-input-text bole-input-text"
-          placeholder="璇疯緭鍏ラ獙璇佺爜"
-          type="number"
-        />
-      </nut-form-item>
+      <template v-if="type === 'realName'">
+        <nut-form-item label="鎵嬫満鍙�:" class="bole-form-item" prop="phoneNumber" required>
+          <nut-input
+            v-model.trim="form.phoneNumber"
+            class="nut-input-text bole-input-text"
+            placeholder="璇峰~鍐欐墜鏈哄彿鐮�"
+            type="text"
+          >
+            <template #right>
+              <ProFormCaptcha
+                :onGetCaptcha="() => onGetCaptcha(form.phoneNumber)"
+                :phonePropName="['phoneNumber', 'name', 'identity']"
+                :validateField="formRef?.validate"
+              ></ProFormCaptcha>
+            </template>
+          </nut-input>
+        </nut-form-item>
+        <nut-form-item label="鐭俊楠岃瘉鐮�:" class="bole-form-item" prop="verifyCode" required>
+          <nut-input
+            v-model.trim="form.verifyCode"
+            class="nut-input-text bole-input-text"
+            placeholder="璇疯緭鍏ラ獙璇佺爜"
+            type="number"
+          />
+        </nut-form-item>
+      </template>
     </nut-form>
   </ContentScrollView>
   <PageFooter :isOnlyAction="false">
@@ -100,25 +92,28 @@
 </template>
 
 <script setup lang="ts">
-import { VerificationCodeBusinessType } from '@12333/constants';
 import { ProFormCaptcha, ProFormItemCell } from 'senin-mini/components';
-import * as commonServices from '@12333/services/api/Common';
+import * as electronSignServices from '@12333/services/apiV2/electronSign';
 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 Taro from '@tarojs/taro';
 
 defineOptions({
   name: 'InnerPage',
 });
 
+const router = Taro.useRouter();
+const type = router.params?.type ?? '';
+
 const form = reactive({
-  legalPersonIdFrontImgUrl: [] as FileItem[],
-  legalPersonIdBackImgUrl: [] as FileItem[],
+  identityImg: [] as FileItem[],
+  identityBackImg: [] as FileItem[],
   name: '',
-  idNumber: '',
-  contactPhone: '',
-  verificationCode: '',
+  identity: '',
+  phoneNumber: '',
+  verifyCode: '',
 });
 
 const formRef = ref<any>(null);
@@ -126,30 +121,29 @@
 
 const rules: FormRules = {
   name: [{ required: true, message: '璇峰~鍐欏鍚�' }],
-  legalPersonIdFrontImgUrl: [
+  identityImg: [
     { required: true, message: '璇蜂笂浼犺韩浠借瘉浜哄儚闈�', validator: FormValidator.validatorArray },
   ],
-  legalPersonIdBackImgUrl: [
+  identityBackImg: [
     { required: true, message: '璇蜂笂浼犺韩浠借瘉鍥藉窘闈�', validator: FormValidator.validatorArray },
   ],
-  idNumber: [
+  identity: [
     { required: true, message: '璇峰~鍐欒韩浠借瘉鍙风爜' },
     { message: '璇疯緭鍏ユ纭殑韬唤璇佸彿鐮�', validator: FormValidator.validatorIDCard },
   ],
-  legalPersonContactPhone: [
+  phoneNumber: [
     { required: true, message: '璇峰~鍐欐墜鏈哄彿鐮�' },
     { message: '璇疯緭鍏ユ纭殑鎵嬫満鍙风爜', validator: FormValidator.validatorPhoneNumber },
   ],
-  verificationCode: [{ required: true, message: '璇疯緭鍏ラ獙璇佺爜' }],
+  verifyCode: [{ required: true, message: '璇疯緭鍏ラ獙璇佺爜' }],
 };
 
 async function onGetCaptcha(phoneNumber: string) {
-  await commonServices.sendPhoneCertificationVerificationCode(
+  await electronSignServices.sendPersonalUserIdentity3RealSms(
     {
       name: form.name,
-      identity: form.idNumber,
-      mobile: form.contactPhone,
-      businessType: VerificationCodeBusinessType.UserCertificationPhoneCertification,
+      identity: form.identity,
+      phoneNumber: form.phoneNumber,
     },
     { showLoading: false }
   );
@@ -168,10 +162,45 @@
   if (!formRef.value) return;
   formRef.value.validate().then(({ valid, errors }: any) => {
     if (valid) {
-      // submit();
+      submit();
     }
   });
 }
+
+function submit() {
+  if (type === 'realName') {
+    personalUserIdentity3Real();
+  }
+  if (type === 'face') {
+    personalUserFaceReal();
+  }
+}
+
+async function personalUserFaceReal() {
+  try {
+    let params: API.PersonalUserIdentity3RealCommand = {
+      name: form.name,
+      phoneNumber: form.phoneNumber,
+      identity: form.identity,
+      identityImg: form.identityImg?.[0]?.path ?? '',
+      identityBackImg: form.identityBackImg?.[0]?.path ?? '',
+      verifyCode: form.verifyCode,
+    };
+    let res = await electronSignServices.personalUserIdentity3Real(params);
+  } catch (error) {}
+}
+
+async function personalUserIdentity3Real() {
+  try {
+    let params: API.PersonalUserFaceRealCommand = {
+      name: form.name,
+      identity: form.identity,
+      identityImg: form.identityImg?.[0]?.path ?? '',
+      identityBackImg: form.identityBackImg?.[0]?.path ?? '',
+    };
+    let res = await electronSignServices.personalUserFaceReal(params);
+  } catch (error) {}
+}
 </script>
 
 <style lang="scss">

--
Gitblit v1.9.1