let reg = /^[1][3,4,5,7,8,9][0-9]{9}$/
if (!this.oldPhone) { //判断如果手机号为空,提示用户输入手机号
uni.showToast({
title: '请输入手机号码',
icon: 'none'
})
return
} else if (!reg.test(this.oldPhone)) { //判断手机号格式时候正确
uni.showToast({
title: '手机号码不正确',
icon: 'none'
})
}
uniapp手机号校验正则表达式
猜你喜欢
转载自blog.csdn.net/weixin_57607714/article/details/124443838
今日推荐
周排行