Handy_Cao 3 anos atrás
pai
commit
86d240b3fc

+ 0 - 1
src/business/common/index.ts

@@ -3,7 +3,6 @@ import { useStore } from '@/stores'
 import { tokenCheck } from '@/services/api/account'
 import eventBus from '@/services/bus'
 import socket from '@/services/socket'
-import { uploadFile } from '@/services/api/common'
 
 /**
  * 退出登录

+ 4 - 0
src/constants/regex.ts

@@ -25,5 +25,9 @@ export const validateRules = {
     cardno: {
         validate: (val: string) => /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(val),
         message: '身份证号码不合规',
+    },
+    bankcardno: {
+        validate: (val: string) => /^([1-9]{1})(\d{15}|\d{16}|\d{18})$/.test(val),
+        message: '银行卡号码不合规',
     }
 }

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

@@ -99,6 +99,12 @@ const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
         required: true,
         message: '请输入用户姓名',
     }],
+    cardtype: [{
+        message: '请选择证件类型',
+        validator:()=>{
+            return !!formData.cardtype
+        }
+    }],
     cardnum: [{
         required: true,
         message: '请输入证件号码',

+ 7 - 0
src/packages/mobile/views/bank/sign/components/edit/index.vue

@@ -29,6 +29,7 @@ import { fullloading, dialog } from '@/utils/vant'
 import { doBankSign, } from '@/business/bank'
 import { useNavigation } from '@/hooks/navigation'
 import AppSelect from '@mobile/components/base/select/index.vue'
+import { validateRules } from '@/constants/regex'
 
 const {router}=useNavigation()
 const { formData, onSubmit, cusSignBank } = doBankSign()
@@ -52,6 +53,12 @@ const formRules: { [key in keyof Proto.t2bBankSignReq]?: FieldRule[] } = {
     BankAccountNo: [{
         required: true,
         message: '请输入银行卡账号',
+        validator: (val) => {
+            if (validateRules.bankcardno.validate(val)) {
+                return true
+            }
+            return validateRules.bankcardno.message
+        }
     }],
     BankAccountName: [{
         required: true,