// 手机号
let validateelephone = (rule, value, callback) => {
let regx = /^(?:(?:(?:13[0-9])|(?:14[57])|(?:15[0-35-9])|(?:17[36-8])|(?:18[0-9]))\d{8})|(?:170[057-9]\d{7})$/
if (value !== '') {
if (!regx.test(value)) {
callback(new Error('格式不正确'))
}
}
callback()
}
// 固定电话
let validateLand = (rule, value, callback) => {
let regx = /^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/
if (value !== '') {
if (!regx.test(value)) {
callback(new Error('格式不正确'))
}
}
callback()
}
网友评论