手机号码校验

This commit is contained in:
shijingjing
2022-11-29 15:50:41 +08:00
parent 6545570ecd
commit b11adc40c8
2 changed files with 8 additions and 0 deletions

View File

@@ -550,6 +550,10 @@ export default {
return this.$toast('请输入手机号码')
}
if(!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(this.form.phone)) {
return this.$toast('请输入正确的手机号')
}
if (!this.form.name) {
return this.$toast('请输入姓名')
}

View File

@@ -479,6 +479,10 @@ export default {
return this.$toast('请输入手机号码')
}
if(!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(this.form.phone)) {
return this.$toast('请输入正确的手机号')
}
// if (!this.form.type) {
// return this.$toast('请选择人员类别')
// }