手机号正则:暂支持13,14,15,16,17,18,19开头的手机号
/^[1][3,4,5,6,7,8,9][0-9]{9}$/
const validateMobile = (rule, value, callback) => {
if (!!value && !/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(value)) {
callback(new Error('请输入正确格式的手机号!'))
} else {
callback()
}
}
validateCellphone() {
const cellphoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/gm; // 手机号正则
return !!this.car.ownerPhone.match(cellphoneReg);
},
if(this.car.ownerPhone!=''&&!this.validateCellphone()) {
return this.$showTip('请输入正确的手机号!')
}