欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序 功能函數(shù)小結(jié)(手機(jī)號(hào)驗(yàn)證*、密碼驗(yàn)證*、獲取驗(yàn)證碼*)

 更新時(shí)間:2017年12月08日 09:35:35   投稿:mrr  
這篇文章主要介紹了微信小程序功能函數(shù)手機(jī)號(hào)驗(yàn)證、密碼驗(yàn)證,獲取驗(yàn)證碼*的相關(guān)代碼,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

下面一小段代碼給大家介紹微信小程序 功能函數(shù) 密碼驗(yàn)證*,具體代碼如下所示:

//登錄輸入密碼
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位由數(shù)字和26個(gè)英文字母混合而成',
showCancel: false,
success: function (res) {
that.setData({
truePwd: false
})
}
})
}
},

下面給大家介紹微信小程序 功能函數(shù) 手機(jī)號(hào)驗(yàn)證*,具體代碼如下所示:

// 登錄手機(jī)驗(yàn)證
loginPhone: 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: '手機(jī)號(hào)有誤',
icon: 'success',
duration: 2000
})
}
} else {
this.setData({
ajxtrue: true
})
}
},

下面一段代碼給大家介紹微信小程序 功能函數(shù) 獲取驗(yàn)證碼*,具體代碼如下所示:

yanZhengInput: function (e) {
var that = this;
var yanzheng = e.detail.value;
var huozheng = this.data.huozheng
console.log(e.detail.value)
that.setData({
yanzheng: yanzheng,
zhengTrue: false,
})
if (yanzheng.length >= 4) {
if (yanzheng == huozheng) {
that.setData({
zhengTrue: true,
})
} else {
that.setData({
zhengTrue: false,
})
wx.showModal({
content: '輸入驗(yàn)證碼有誤',
showCancel: false,
success: function (res) {
}
})
}
}
},
yanzhengBtn: function () {
// console.log(app.globalData.userId);
var getChange = this.data.getChange
var n = 59;
var that = this;
var phone = this.data.linPhone;
console.log(phone)
var user = wx.getStorageSync('user');
if (!(/^1[34578]\d{9}$/.test(phone))) {
wx.showToast({
title: '手機(jī)號(hào)有誤',
icon: 'success',
duration: 2000
})
} else {
if (getChange) {
this.setData({
getChange: false
})
var time = setInterval(function () {
var str = '(' + n + ')' + '重新獲取'
that.setData({
getText: str
})
if (n <= 0) {
that.setData({
getChange: true,
getText: '重新獲取'
})
clearInterval(time);
}
n--;
}, 1000);
wx.request({
url: 'https://www.didu86.com/Clothes-manager-web/codenum',
data: {
tel: phone,
},
header: {
'content-type': 'application/json'
},
success: function (res) {
var result = res.data.code;
console.log(result)
that.setData({
huozheng: result,
})
}
})
}
}
},

總結(jié)

以上所述是小編給大家介紹的微信小程序 功能函數(shù) 手機(jī)號(hào)、密碼驗(yàn)證*、獲取驗(yàn)證碼*,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論