wupengfei
昨天 acfb2642072dcfd1d5cf789af3cc5cbf3b7cb51e
fix: bug
6个文件已添加
3个文件已修改
302 ■■■■■ 已修改文件
apps/cMiniApp/src/app.config.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/constants/router.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/authentication/authenticationFace/InnerPage.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/authentication/authenticationFace/authenticationFace.config.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/authentication/authenticationFace/authenticationFace.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/authentication/authenticationHome/InnerPage.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/authentication/authenticationRealName/authenticationRealName.config.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/authentication/authenticationRealName/authenticationRealName.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/app.config.ts
@@ -64,6 +64,8 @@
        'authenticationFaRen/authenticationFaRen',
        'authenticationJBR/authenticationJBR',
        'authenticationResult/authenticationResult',
        'authenticationRealName/authenticationRealName',
        'authenticationFace/authenticationFace',
      ],
    },
    {
apps/cMiniApp/src/constants/router.ts
@@ -27,6 +27,8 @@
  authenticationResult = '/subpackages/authentication/authenticationResult/authenticationResult',
  authenticationFaRen = '/subpackages/authentication/authenticationFaRen/authenticationFaRen',
  authenticationJBR = '/subpackages/authentication/authenticationJBR/authenticationJBR',
  authenticationRealName = '/subpackages/authentication/authenticationRealName/authenticationRealName',
  authenticationFace = '/subpackages/authentication/authenticationFace/authenticationFace',
  citySelect = '/subpackages/city/citySelect/citySelect',
  mineSign = '/subpackages/mine/mineSign/mineSign',
apps/cMiniApp/src/subpackages/authentication/authenticationFace/InnerPage.vue
New file
@@ -0,0 +1,41 @@
<template>
  <ContentScrollView :paddingH="false">
    <nut-form :model-value="form" ref="formRef">
      <nut-form-item label="刷脸:" class="bole-form-item alignTop" prop="licenseUrl" required>
      </nut-form-item>
    </nut-form>
  </ContentScrollView>
  <PageFooter :isOnlyAction="false">
    <PageFooterBtn type="primary" @click="handleSubmit()" :loading="loading"
      >刷脸认证</PageFooterBtn
    >
  </PageFooter>
</template>
<script setup lang="ts">
import Taro from '@tarojs/taro';
defineOptions({
  name: 'InnerPage',
});
const form = reactive({
  licenseUrl: [],
});
const formRef = ref<any>(null);
const loading = ref(false);
function handleSubmit() {
  if (!formRef.value) return;
  formRef.value.validate().then(({ valid, errors }: any) => {
    if (valid) {
      // submit();
    }
  });
}
</script>
<style lang="scss">
@import '@/styles/common.scss';
</style>
apps/cMiniApp/src/subpackages/authentication/authenticationFace/authenticationFace.config.ts
New file
@@ -0,0 +1,3 @@
export default definePageConfig({
  disableScroll: true,
});
apps/cMiniApp/src/subpackages/authentication/authenticationFace/authenticationFace.vue
New file
@@ -0,0 +1,14 @@
<template>
  <PageLayout title="实人认证" class="authenticationFace-page-wrapper" hasBorder developing>
    <InnerPage />
  </PageLayout>
</template>
<script setup lang="ts">
import { PageLayout } from '@/components';
import InnerPage from './InnerPage.vue';
defineOptions({
  name: 'authenticationFace',
});
</script>
apps/cMiniApp/src/subpackages/authentication/authenticationHome/InnerPage.vue
@@ -2,26 +2,18 @@
  <ContentScrollView class="authenticationHome-page-view">
    <div class="authenticationHome-page-title">实名认证</div>
    <authenticationHomeItem
      title="企业法人认证"
      title="个人实名认证"
      :icon="IconFaren"
      :info="[['企业营业执照照片', '法人身份证照片'], ['法人手机号码(接收短信验证码进行短信核验)']]"
      @click="goFaRen"
      :info="[['身份证照片'], ['手机号码(接收短信验证码进行短信核验)']]"
      @click="goRealName"
    ></authenticationHomeItem>
    <authenticationHomeItem
      title="企业经办人认证"
      title="实人认证"
      isJBR
      :icon="IconJBR"
      :info="[
        ['企业授权书', '企业营业执照照片', '经办人身份证照片'],
        ['经办人手机号码(接收短信验证码进行短信核验)'],
      ]"
      @click="goJBR"
      :info="[['实人扫脸认证']]"
      @click="goFace"
    >
      <template #title-extra>
        <div class="authenticationHome-page-title-btn" @click.stop="downloadPowerAttorneyTemplate">
          下载授权书模版
        </div>
      </template>
    </authenticationHomeItem>
  </ContentScrollView>
</template>
@@ -31,21 +23,18 @@
import IconFaren from '@/assets/authentication/icon-faren.png';
import IconJBR from '@/assets/authentication/icon-jbr.png';
import Taro from '@tarojs/taro';
import { useDownloadPowerAttorneyTemplate } from '../hooks';
defineOptions({
  name: 'InnerPage',
});
function goFaRen() {
  Taro.navigateTo({ url: RouterPath.authenticationFaRen });
function goRealName() {
  Taro.navigateTo({ url: RouterPath.authenticationRealName });
}
function goJBR() {
  Taro.navigateTo({ url: RouterPath.authenticationJBR });
function goFace() {
  Taro.navigateTo({ url: RouterPath.authenticationFace });
}
const { downloadPowerAttorneyTemplate } = useDownloadPowerAttorneyTemplate();
</script>
<style lang="scss">
@@ -55,6 +44,10 @@
  .authenticationHome-page-view {
    padding-top: 48px;
    background-color: transparent;
    .authentication-home-item-info {
      flex-direction: column;
    }
  }
  .authenticationHome-page-title {
apps/cMiniApp/src/subpackages/authentication/authenticationRealName/InnerPage.vue
New file
@@ -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">
          请上传身份证的正反面照片,确保身份证清晰可见,支持png/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>
apps/cMiniApp/src/subpackages/authentication/authenticationRealName/authenticationRealName.config.ts
New file
@@ -0,0 +1,3 @@
export default definePageConfig({
  disableScroll: true,
});
apps/cMiniApp/src/subpackages/authentication/authenticationRealName/authenticationRealName.vue
New file
@@ -0,0 +1,14 @@
<template>
  <PageLayout title="实名认证" class="authenticationRealName-page-wrapper" hasBorder>
    <InnerPage />
  </PageLayout>
</template>
<script setup lang="ts">
import { PageLayout } from '@/components';
import InnerPage from './InnerPage.vue';
defineOptions({
  name: 'authenticationRealName',
});
</script>