手机号正则表达

时间:2021-05-12 14:55:37   收藏:0   阅读:17
 
    async postphoneBinding(User, phone) {
      let temp = await http.phoneBinding(User, phone);
      let tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(
        this.phone
      );
      if (temp == null && tel) {
        // console.log(‘验证码已发送‘)
        alert("验证码已发送");
      } else if (this.phone == "") {
        alert("请输入手机号");
        return false;
      } else if (!tel) {
        alert("手机号不正确");
      }
      console.log(temp);
    },

原文:https://www.cnblogs.com/zjxzhj/p/14758567.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!