li.shaoyi 4 月之前
父節點
當前提交
7446244e31

+ 6 - 6
src/packages/mobile/views/account/certification/Index.vue

@@ -158,14 +158,17 @@ useRequest(getWskhOpenAccountConfigs, {
 
 const b_afterRead = (filePath: string) => {
     formData.cardfrontphotourl = filePath
+    formRef.value?.validate('cardfrontphotourl')
 }
 
 const f_afterRead = (filePath: string) => {
     formData.cardbackphotourl = filePath
+    formRef.value?.validate('cardbackphotourl')
 }
 
 const h_afterRead = (filePath: string) => {
     formData.halfbodyphotourl = filePath
+    formRef.value?.validate('halfbodyphotourl')
 }
 
 // 表单验证规则
@@ -179,7 +182,6 @@ const formRules: { [key: string]: FieldRule[] } = {
         validator: () => formData.cardtype !== undefined
     }],
     cardnum: [{
-        required: true,
         message: t("user.authentication.pleaseenterthecardnum"),
         validator: (val) => {
             // 待优化
@@ -193,18 +195,16 @@ const formRules: { [key: string]: FieldRule[] } = {
         }
     }],
     cardbackphotourl: [{
-        required: true,
         message: t("user.authentication.pleaseuploadthecardbackphoto"),
+        validator: () => !!formData.cardbackphotourl
     }],
     cardfrontphotourl: [{
-        required: true,
         message: t("user.authentication.pleaseuploadthecardfrontphoto"),
+        validator: () => !!formData.cardfrontphotourl
     }],
     bankid: [{
         message: t('banksign.Pleaseselectyourbank'),
-        validator: () => {
-            return !!formData.bankid
-        }
+        validator: () => !!formData.bankid
     }],
     bankaccount: [{
         required: true,

+ 2 - 2
src/packages/mobile/views/user/register/Index.vue

@@ -74,7 +74,7 @@
 
 <script lang="ts" setup>
 import { reactive, shallowRef, ref, computed, onMounted, useAttrs } from 'vue'
-import { CellGroup, Cell, Button, Field, Form, FormInstance, Checkbox, showFailToast, showToast, FieldRule, Popup, Picker, PickerConfirmEventParams, showSuccessToast } from 'vant'
+import { CellGroup, Cell, Button, Field, Form, FormInstance, Checkbox, showFailToast, showToast, FieldRule, showSuccessToast } from 'vant'
 import { useCountDown } from '@vant/use'
 import { fullloading, dialog } from '@/utils/vant'
 import { validateRules } from '@/constants/regex'
@@ -229,7 +229,7 @@ const formRules: { [key: string]: FieldRule[] } = {
 const routerAction = () => {
   // 追踪注册结果
   trackEvent('CompleteRegistration')
-  
+
   logEvent('af_complete_registration', {
     af_registration_method: 'Mobile'
   })

+ 6 - 3
src/packages/sbyj/views/account/certification/Index.vue

@@ -113,14 +113,17 @@ const { loading: buttonLoading } = useRequest(queryTencentUsereSignRecords, {
 
 const b_afterRead = (filePath: string) => {
     formData.cardbackphotourl = filePath
+    formRef.value?.validate('cardbackphotourl')
 }
 
 const f_afterRead = (filePath: string) => {
     formData.cardfrontphotourl = filePath
+    formRef.value?.validate('cardfrontphotourl')
 }
 
 const h_afterRead = (filePath: string) => {
     formData.halfbodyphotourl = filePath
+    formRef.value?.validate('halfbodyphotourl')
 }
 
 const onUpload = (filePath: string) => {
@@ -167,16 +170,16 @@ const formRules: { [key: string]: FieldRule[] } = {
         }
     }],
     cardbackphotourl: [{
-        required: true,
         message: '请上传证件反面照片',
+        validator: () => !!formData.cardbackphotourl
     }],
     cardfrontphotourl: [{
-        required: true,
         message: '请上传证件正面照片',
+        validator: () => !!formData.cardfrontphotourl
     }],
     halfbodyphotourl: [{
-        required: true,
         message: () => '请上传'+halfBodyPhotoTitle.value,
+        validator: () => !!formData.halfbodyphotourl
     }],
     shopbrief: [{
         required: true,