import { Notify  } from 'vant';
let testPhone = (phone)=>{
    let reg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ ;
    return new Promise((resolve,reject)=>{
        if(reg.test(phone)){
            resolve()
        }else{
            Notify({ type: 'warning', message: '请输入正确格式的手机号码' });
            reject()
        }
    })
}
let regIDNumber = (IdNumber)=>{
    let reg =   /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
    return new Promise((resolve,reject)=>{
        if(reg.test(IdNumber)){
            resolve()
        }else{
            Notify({ type: 'warning', message: '请输入正确格式的身份证号码' });
            reject()
        }
    })
}
export default {
    testPhone,regIDNumber
}