idCard: [
{ required: true, message: ‘请输入身份证号’, trigger: ‘blur’ },
{ required: true,
pattern: new RegExp(/1\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/, ‘g’),
message: ‘请输入正确的身份证号’,
trigger: ‘blur’
}
phone: [
{ required: true, message: ‘请输入电话’, trigger: ‘blur’ },
{ required: true,
pattern: new RegExp(/^((13\d)|(14[5,7,9])|(15[0-3,5-9])|(166)|(17[0,1,3,5,7,8])|(18[0-9])|(19[8,9]))\d{8}/),
message: ‘请输入正确的电话’,
trigger: ‘blur’
}
],
//手机号校验
function phoneVerify(phone){
var reg = /^((13\d)|(14[5,7,9])|(15[0-3,5-9])|(166)|(17[0,1,3,5,7,8])|(18[0-9])|(19[8,9]))\d{8}/;
if (reg.test(phone)) {
return true;
}else{
return false;
}
}
1-9 ↩︎