bug修改
This commit is contained in:
@@ -13,35 +13,17 @@ Page({
|
||||
rsaPublicKey: '',
|
||||
flag: false,
|
||||
show: true, // 默认显示的是闭眼睛
|
||||
showVerify: true,
|
||||
type: 'password',
|
||||
typeVerify: 'password'
|
||||
showVerify: true
|
||||
},
|
||||
showPassword(){
|
||||
if(this.data.show){ // 显示睁开眼睛的时候 type="text"
|
||||
this.setData({
|
||||
type: 'text',
|
||||
show: false
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
type: 'password',
|
||||
show: true
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
show: !this.data.show
|
||||
})
|
||||
},
|
||||
showPasswordVerify(){
|
||||
if(this.data.showVerify){ // 显示睁开眼睛的时候 type="text"
|
||||
this.setData({
|
||||
typeVerify: 'text',
|
||||
showVerify: false
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
typeVerify: 'password',
|
||||
showVerify: true
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
showVerify: !this.data.showVerify
|
||||
})
|
||||
},
|
||||
// 登录
|
||||
formSubmit(e) {
|
||||
@@ -57,7 +39,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.newPassword)){
|
||||
wx.showToast({
|
||||
title: '密码由8位数字、大小写字母和特殊符号组成!',
|
||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
@@ -77,7 +59,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.verifyPassword)){
|
||||
wx.showToast({
|
||||
title: '密码由8位数字、大小写字母和特殊符号组成!',
|
||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
@@ -98,9 +80,9 @@ Page({
|
||||
}
|
||||
if (this.data.flag) {
|
||||
let params = {
|
||||
password: this.data.password,
|
||||
newPassword: encrypt(this.data.rsaPublicKey, e.detail.value.newPassword),
|
||||
verifyPassword: encrypt(this.data.rsaPublicKey, e.detail.value.verifyPassword),
|
||||
password: this.data.password, // token
|
||||
newPassword: encrypt(this.data.rsaPublicKey, e.detail.value.newPassword), // 密码
|
||||
verifyPassword: encrypt(this.data.rsaPublicKey, e.detail.value.verifyPassword), // 确认密码
|
||||
rsaPublicKey: this.data.rsaPublicKey
|
||||
}
|
||||
// 请求短信登录start
|
||||
@@ -122,7 +104,7 @@ Page({
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '登录失败',
|
||||
title: res.message,
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "设置密码",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<view class="form-item">
|
||||
<view class="text-label">密码</view>
|
||||
<view class="text-value">
|
||||
<input name="newPassword" bindblur="bindBlurInput" value="{{newPassword}}" type="{{type}}" placeholder="请输入密码" />
|
||||
<input name="newPassword" bindblur="bindBlurInput" value="{{newPassword}}" password="{{show}}" placeholder="请输入密码" />
|
||||
<image src="../../assets/images/show.png" class="show" wx:if="{{!show}}" bindtap="showPassword"></image>
|
||||
<image src="../../assets/images/none.png" class="show" wx:if="{{show}}" bindtap="showPassword"></image>
|
||||
</view>
|
||||
@@ -13,7 +13,7 @@
|
||||
<view class="form-item">
|
||||
<view class="text-label">确认密码</view>
|
||||
<view class="text-value">
|
||||
<input name="verifyPassword" bindblur="bindBlurInput" value="{{verifyPassword}}" type="{{typeVerify}}" placeholder="请确认密码" />
|
||||
<input name="verifyPassword" bindblur="bindBlurInput" value="{{verifyPassword}}" password="{{showVerify}}" placeholder="请输入确认密码" />
|
||||
<image src="../../assets/images/show.png" class="show" wx:if="{{!showVerify}}" bindtap="showPasswordVerify"></image>
|
||||
<image src="../../assets/images/none.png" class="show" wx:if="{{showVerify}}" bindtap="showPasswordVerify"></image>
|
||||
</view>
|
||||
|
||||
@@ -5,7 +5,7 @@ page {
|
||||
color: #333;
|
||||
}
|
||||
.form-box{
|
||||
transform: translateY(100%);
|
||||
transform: translateY(20%);
|
||||
}
|
||||
.text-value{
|
||||
position: relative;
|
||||
|
||||
Reference in New Issue
Block a user