From c743612b8129a6221c13b865fcd0b112b84afc38 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 19 八月 2025 15:25:58 +0800
Subject: [PATCH] fix: bug

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

diff --git a/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue b/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
new file mode 100644
index 0000000..2b4b5d1
--- /dev/null
+++ b/apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
@@ -0,0 +1,188 @@
+<template>
+  <ContentScrollView :paddingH="false">
+    <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"
+          >
+            <Uploader
+              v-model:file-list="form.legalPersonIdFrontImgUrl"
+              :maximum="1"
+              :limitFileSize="10"
+              class="bole-uploader nopaddingtop"
+              @my-success="handleFrontImgUrlChange"
+            >
+              <template #upload-icon>
+                <div class="photograph-wrapper">
+                  <Photograph color="#808080" />
+                  <div>韬唤璇佷汉鍍忛潰</div>
+                </div>
+              </template>
+            </Uploader>
+          </nut-form-item>
+          <nut-form-item
+            label=" "
+            class="bole-form-item"
+            prop="legalPersonIdBackImgUrl"
+            label-width="0px"
+          >
+            <Uploader
+              v-model:file-list="form.legalPersonIdBackImgUrl"
+              :maximum="1"
+              :limitFileSize="10"
+              class="bole-uploader nopaddingtop"
+            >
+              <template #upload-icon>
+                <div class="photograph-wrapper">
+                  <Photograph color="#808080" />
+                  <div>韬唤璇佸浗寰介潰</div>
+                </div>
+              </template>
+            </Uploader>
+          </nut-form-item>
+        </div>
+
+        <div class="pro-form-item-tips">
+          璇蜂笂浼犺韩浠借瘉鐨勬鍙嶉潰鐓х墖锛岀‘淇濊韩浠借瘉娓呮櫚鍙锛屾敮鎸乸ng/jpg/jpeg鏍煎紡锛屾枃浠跺ぇ灏忎笉瓒呰繃10MB
+        </div>
+      </ProFormItemCell>
+      <nut-form-item label="濮撳悕:" class="bole-form-item" prop="name" required>
+        <nut-input
+          v-model.trim="form.name"
+          class="nut-input-text bole-input-text"
+          placeholder="璇峰~鍐欏鍚�"
+          type="text"
+        />
+      </nut-form-item>
+      <nut-form-item label="韬唤璇佸彿:" class="bole-form-item" prop="idNumber" required>
+        <nut-input
+          v-model.trim="form.idNumber"
+          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>
+    </nut-form>
+  </ContentScrollView>
+  <PageFooter :isOnlyAction="false">
+    <PageFooterBtn type="primary" @click="handleSubmit()" :loading="loading"
+      >鎻愪氦璁よ瘉</PageFooterBtn
+    >
+  </PageFooter>
+</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 { 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';
+
+defineOptions({
+  name: 'InnerPage',
+});
+
+const form = reactive({
+  legalPersonIdFrontImgUrl: [] as FileItem[],
+  legalPersonIdBackImgUrl: [] as FileItem[],
+  name: '',
+  idNumber: '',
+  contactPhone: '',
+  verificationCode: '',
+});
+
+const formRef = ref<any>(null);
+const loading = ref(false);
+
+const rules: FormRules = {
+  name: [{ required: true, message: '璇峰~鍐欏鍚�' }],
+  legalPersonIdFrontImgUrl: [
+    { required: true, message: '璇蜂笂浼犺韩浠借瘉浜哄儚闈�', validator: FormValidator.validatorArray },
+  ],
+  legalPersonIdBackImgUrl: [
+    { required: true, message: '璇蜂笂浼犺韩浠借瘉鍥藉窘闈�', validator: FormValidator.validatorArray },
+  ],
+  idNumber: [
+    { required: true, message: '璇峰~鍐欒韩浠借瘉鍙风爜' },
+    { message: '璇疯緭鍏ユ纭殑韬唤璇佸彿鐮�', validator: FormValidator.validatorIDCard },
+  ],
+  legalPersonContactPhone: [
+    { required: true, message: '璇峰~鍐欐墜鏈哄彿鐮�' },
+    { message: '璇疯緭鍏ユ纭殑鎵嬫満鍙风爜', validator: FormValidator.validatorPhoneNumber },
+  ],
+  verificationCode: [{ required: true, message: '璇疯緭鍏ラ獙璇佺爜' }],
+};
+
+async function onGetCaptcha(phoneNumber: string) {
+  await commonServices.sendPhoneCertificationVerificationCode(
+    {
+      name: form.name,
+      identity: form.idNumber,
+      mobile: form.contactPhone,
+      businessType: VerificationCodeBusinessType.UserCertificationPhoneCertification,
+    },
+    { showLoading: false }
+  );
+}
+
+function handleFrontImgUrlChange(response: FileItem) {
+  // userCredentialVerifyOcrIDCard(response, {
+  //   onSuccess(res) {
+  //     if (res.realName) form.legalPersonName = res.realName;
+  //     if (res.idcardNum) form.legalPersonIdNumber = res.idcardNum;
+  //   },
+  // });
+}
+
+function handleSubmit() {
+  if (!formRef.value) return;
+  formRef.value.validate().then(({ valid, errors }: any) => {
+    if (valid) {
+      // submit();
+    }
+  });
+}
+</script>
+
+<style lang="scss">
+@import '@/styles/common.scss';
+
+.authenticationRealName-page-wrapper {
+  .photograph-wrapper {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+  }
+}
+</style>

--
Gitblit v1.9.1