手机号限制11位

This commit is contained in:
shijingjing
2022-12-06 14:38:18 +08:00
parent 1cb5da5e52
commit 0b745a0745
2 changed files with 11 additions and 11 deletions

View File

@@ -287,21 +287,21 @@ export default {
this.form.arriveTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`
},
travelTypeSelect(value) {
const index = this.travelType.indexOf(value)
if (index === -1) {
this.travelType.push(value)
} else {
this.travelType.splice(index, 1)
}
},
// travelTypeSelect(value) {
// const index = this.travelType.indexOf(value)
// if (index === -1) {
// this.travelType.push(value)
// } else {
// this.travelType.splice(index, 1)
// }
// },
getInfo(id) {
this.$instance.post(`/app/appepidemicpreventionregisterinfo/queryDetailById?id=${id}`).then(res => {
if (res?.data) {
this.form = res.data
this.people = res.data.companionList
this.travelType = res.data.travelType?.split(',')
// this.travelType = res.data.travelType?.split(',')
this.form.arriveTime = res.data.arriveTime.substr(0, res.data.arriveTime.length - 3)
this.startAreaId = res.data.startAreaId
this.startAreaName = res.data.startAreaName
@@ -370,7 +370,7 @@ 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)) {
if (!this.$reg.phone(this.form.phone) || this.form.phone.length != 11) {
return this.$toast('请输入正确的手机号')
}

View File

@@ -455,7 +455,7 @@ 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)) {
if (!this.$reg.phone(this.form.phone) || this.form.phone.length != 11) {
return this.$toast('请输入正确的手机号')
}