有关密码框都加上小眼睛控制密码显隐

This commit is contained in:
姚亚男
2021-10-22 11:09:47 +08:00
parent 8a819d829e
commit dcc0e8b1fa
12 changed files with 181 additions and 88 deletions
+37 -3
View File
@@ -11,10 +11,37 @@ Page({
newPassword: '', // 密码
verifyPassword: '', // 确认密码
rsaPublicKey: '',
flag: false
flag: false,
show: true, // 默认显示的是闭眼睛
showVerify: true,
type: 'password',
typeVerify: 'password'
},
bindBlurInput(e){
showPassword(){
if(this.data.show){ // 显示睁开眼睛的时候 type="text"
this.setData({
type: 'text',
show: false
})
}else{
this.setData({
type: 'password',
show: true
})
}
},
showPasswordVerify(){
if(this.data.showVerify){ // 显示睁开眼睛的时候 type="text"
this.setData({
typeVerify: 'text',
showVerify: false
})
}else{
this.setData({
typeVerify: 'password',
showVerify: true
})
}
},
// 登录
formSubmit(e) {
@@ -84,6 +111,10 @@ Page({
key: 'X-Access-Token',
data: that.data.password
})
wx.setStorage({
key: 'userInfo',
data: this.data.userInfo
})
// 绑定微信
this.wxBindPhone()
wx.switchTab({
@@ -111,6 +142,9 @@ Page({
UserApi.wxBind(params).then(res=>{})
})
},
onLoad(options){
this.data.userInfo = JSON.parse(options.userInfo)
},
/**
* 生命周期函数--监听页面显示
*/