Handy_Cao 2 년 전
부모
커밋
71789f3fe6
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/packages/sbyj/views/account/certification/Index.vue

+ 4 - 1
src/packages/sbyj/views/account/certification/Index.vue

@@ -45,7 +45,7 @@
 import { shallowRef, onMounted } from 'vue'
 import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule, Image } from 'vant'
 import { fullloading, dialog } from '@/utils/vant';
-import { getFileUrl } from '@/filters';
+import { getFileUrl, getIdCardAge } from '@/filters';
 import { getCerTypePersonList } from "@/constants/account";
 import { useRequest } from '@/hooks/request'
 import { queryTencentUsereSignRecords, requestCheckCardNum } from '@/services/api/account';
@@ -106,6 +106,9 @@ const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
             if (validateRules.cardno.validate(val)) {
                 return true
             }
+            if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                return '开户失败,您的年龄不符合开户要求'
+            }
             return validateRules.cardno.message
         }
     }],