小程序判断是不是手机号

news/2024/7/19 14:25:42 标签: js
    if (mobile.length == 0) {
      wx.showToast({
        title: '请输入手机号!',
        icon: 'none',
        duration: 1500
      })
      return false;
    }
    if (mobile.length != 11) {
      wx.showToast({
        title: '手机号长度有误!',
        icon: 'none',
        duration: 1500
      })
      return false;
    }
    var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;
    if (!myreg.test(mobile)) {
      wx.showToast({
        title: '手机号有误!',
        icon: 'none',
        duration: 1500
      })
      return false;
    }

http://www.niftyadmin.cn/n/957947.html

相关文章

问题记录:link()和src有什么区别

<van-tabbar-item icon"notes-o" click"link(/home)"

小程序获取页面总高度

可以先把真个页面写在一个view里面 定义一个id 比如 <view id"zong"> 所有内容 </view>js 在onLoad里面写入即可获取页面总高度var query wx.createSelectorQuery();query.select(#zong).boundingClientRect(function (rect) {that.setData({juligao:…

HttpClient配置SSL绕过https证书以及双向认证HttpClient配置SSL绕过https证书

原文地址: https://www.cnblogs.com/ywbmaster/p/14684968.html (推荐) https://blog.csdn.net/irokay/article/details/78801307

kafka 并发数配置过程中踩到的坑 InstanceAlreadyExistsException Error registering AppInfo mbean

java 服务器 kafka 并发数配置过程中踩到的坑 InstanceAlreadyExistsException 2017-07-05 13:09:15.460 [kafka_spout:7-MultipleThreadSpoutExecutors] WARN o.a.kafka.common.utils.AppInfoParser - Error registering AppInfo mbean javax.management.InstanceAlreadyExi…

vue.js获取目标标签距离顶部的距离,获得距离后滚到到目标标签位置

动态获得目标高度 <div ref"pronbit"><div>我的动态高度</div> </div> mounted(){window.addEventListener(scroll,this.handleScrollx,true) }, methods: {handleScrollx() {console.log(滚动高度,window.pageYOffset)console.log(距离顶部…

IDEA可视化Log理解Git仓库\历史状态\commit\分支

IDEA可视化Log理解Git仓库\历史状态\commit\分支 from&#xff1a;https://github.com/tintinng/advanced-git/tree/master fork from&#xff1a;https://github.com/hcsp/advanced-git ref:https://xiedaimala.com/courses 什么是仓库&#xff1f; 仓库是指一个历史可追溯&a…

尼克发的可以运行,我的就不行,登录注册页面出不来,不知道是为什么

怎么办&#xff0c;重新倒回去试一遍&#xff1f; 还是两个一起比一下&#xff0c;比得眼睛都绿了 好慢啊&#xff0c;太慢了

vue循环定时器可用

beforeDestroy() {clearInterval(this.timer);},created () {this.timer setInterval(() > {this.autoPlay() //你的方法}, 1000)},