微信小程序 功能函数 密码验证*

//登录输入密码
userPasswordInput: function (e) {
var that = this;

this.setData({
userPassword: e.detail.value
})
// console.log(e.detail.value.length)
// console.log(e.detail.value);
var value = e.detail.value
var strkong = /^[0-9a-zA-Z]{0,25}$/g;
if (strkong.test(value)) {
that.setData({
truePwd: true
})
} else {
// console.log("cwoca")
wx.showModal({
title: '提示',
content: '密码由0~25位由数字和26个英文字母混合而成',
showCancel: false,
success: function (res) {
that.setData({
truePwd: false
})
}

})

}
},
posted @ 2017-12-08 09:27  ThisCall  阅读(2257)  评论(0编辑  收藏  举报