export default {
  methods: {
    validateCustomerId(cid) {
      if(cid){
        //只能是数字的验证
        let cidboolean = new RegExp('^[0-9]*[1-9][0-9]*$')
        .test(cid);
        return cidboolean;
      }
    },
    validatePhone(cphone) {
      if(cphone){
        //电话号码验证
        let cpboolean = new RegExp('^[1][3,4,5,6,7,8,9][0-9]{9}$')
        .test(cphone);
        return cpboolean;
      }
    },
    validateMoney(money) {
        if(money){
            //金额验证
            let mboolean = new RegExp('^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$')
            .test(money);
            return mboolean;
        }
    },
    validateidCard(idcard) {
      if(idcard){
          //身份证验证
          let cardboolean = new RegExp( /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2]\d)|(3[0-1]))((\d{4})|(\d{3}[Xx]))$/)
          .test(idcard);
          return cardboolean;
      }
  },
  },
}
