//手机号判断
judgementmobile: function (mobile) {
var that = this;
if (mobile.length == 0) {
wx.showToast({
title: '请输入手机号!',
icon: 'success',
duration: 1500
})
return false;
}
if (mobile.length != 11) {
wx.showToast({
title: '手机号长度有误!',
icon: 'success',
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: 'success',
duration: 1500
})
return false;
}
return true;
},
手机号正则表达式判断
最新推荐文章于 2022-01-27 22:52:35 发布

573

被折叠的 条评论
为什么被折叠?



