小程序 手机号验证

//-----------------------------
// 表单手机号
blurPhone: function (e) {
var phone = e.detail.value;
if (!(/^1[34578]\d{9}$/.test(phone))) {

this.setData({
ajxtrue: false
})
if (phone.length >= 11) {
wx.showToast({
title: '手机号有误',
icon: 'success',
duration: 2000
})
}
} else {
this.setData({
ajxtrue: true
})
}
},
posted @ 2017-10-27 16:41  ThisCall  阅读(9506)  评论(1编辑  收藏  举报