From 67c0ab8210e64da6c820bfe72180a698a4cdd310 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Tue, 8 Oct 2024 10:14:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E9=A1=B5=E9=9D=A2=20?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=90=8D=E7=A7=B0=E8=A1=A8=E5=8D=95=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B1=89=E5=AD=97=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/register.vue | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pages/home/register.vue b/pages/home/register.vue index 2d4ecac..ba2296a 100644 --- a/pages/home/register.vue +++ b/pages/home/register.vue @@ -58,21 +58,25 @@ export default { password: "", }, rules:{ - name:{required:true, message:"企业名称必填!", trigger:"blur"}, + name:{required:true, validator(rule,val,call){ + if(!val)call(new Error("请输入企业名称!")); + else if(!/^[\u4e00-\u9fa5]+$/.test(val))call(new Error('请输入汉字!')); + else call(); + }, trigger:"blur"}, creditCode:{required:true, validator(rule, val, call){ - if(!val)call(new Error('统一社会信用代码必填!')); + if(!val)call(new Error('请输入统一社会信用代码!')); else if(!/^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/.test(val))call(new Error('请输入正确的统一社会信用代码格式!')); else call() }, trigger:"blur"}, - type:{required:true, message:"企业类型必选!", trigger:"blur"}, - connectUser:{required:true, message:"企业联系人必填!", trigger:"blur"}, + type:{required:true, message:"请选择企业类型!", trigger:"blur"}, + connectUser:{required:true, message:"请输入企业联系人!", trigger:"blur"}, connectPhone:{required:true, validator(rule, val, call){ - if(!val)call(new Error("手机号码必填!")); + if(!val)call(new Error("请输入手机号码!")); else if(!/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(val))call(new Error("请输入正确的手机号码格式!")); else call() }, trigger:"blur"}, password:{required:true, validator(rule,val,call){ - if(!val)call(new Error('密码必填!')); + if(!val)call(new Error('请输入密码!')); else if(!/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^\da-zA-Z\s]).+$/.test(val))call(new Error('密码格式为(大小写字母、数字、特殊字符)!')); else call(); }, trigger:"blur"},