getCode() {
        if (this.mobile === '') {
          this.$vux.toast.show({
            type: 'text',
            text: '请输入手机号',
            time: 2000
          });
          this.selected = true;
        } else {
          if (!/^((1[3,5,8,7,9][0-9])|(14[5,7])|(17[0,6,7,8])|(19[1,7]))\d{8}$/.test(this.mobile)) {
            this.$vux.toast.show({
              type: 'text',
              width: '10em',
              text: '手机号格式不正确',
              time: 2000
            })
          } else {
           this.$vux.toast.show({
              type: 'text',
              width: '10em',
              text: '手机号格式正确',
              time: 2000
            })
          }
        }
      },

由于运营商的号段在不断增加,不及时更新请见谅~

 

Logo

前往低代码交流专区

更多推荐