|
@@ -133,7 +133,8 @@ export function cardid(code) {
|
|
|
};
|
|
|
if (!validatenull(code)) {
|
|
|
if (code.length == 18) {
|
|
|
- if (!code || !/(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(code)) {
|
|
|
+ // if (!code || !/(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(code)) {
|
|
|
+ if (!code || !/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(code)) {
|
|
|
msg = "证件号码格式错误";
|
|
|
} else if (!city[code.substr(0, 2)]) {
|
|
|
msg = "地址编码错误";
|
|
@@ -178,10 +179,12 @@ export function isvalidatemobile(phone) {
|
|
|
let list = [];
|
|
|
let result = true;
|
|
|
let msg = '';
|
|
|
- var isPhone = /^0\d{2,3}-?\d{7,8}$/;
|
|
|
+ // var isPhone = /^0\d{2,3}-?\d{7,8}$/;
|
|
|
+ var isPhone = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/
|
|
|
//增加134 减少|1349[0-9]{7},增加181,增加145,增加17[678]
|
|
|
if (!validatenull(phone)) {
|
|
|
if (phone.length == 11) {
|
|
|
+ console.log(isPhone.test(phone),'isPhone.test(phone)');
|
|
|
if (isPhone.test(phone)) {
|
|
|
msg = '手机号码格式不正确';
|
|
|
} else {
|