bug修改
This commit is contained in:
@@ -10,7 +10,9 @@ Page({
|
||||
confirmPassword: '',
|
||||
count: 60,
|
||||
rsaPublicKey: '',
|
||||
showGetCaptcha: true
|
||||
showGetCaptcha: true,
|
||||
show: true, // 默认显示的是闭眼睛
|
||||
showVerify: true,
|
||||
},
|
||||
|
||||
bindInputPhone(e) {
|
||||
@@ -18,6 +20,16 @@ Page({
|
||||
phone: e.detail.value
|
||||
})
|
||||
},
|
||||
showPassword(){
|
||||
this.setData({
|
||||
show: !this.data.show
|
||||
})
|
||||
},
|
||||
showPasswordVerify(){
|
||||
this.setData({
|
||||
showVerify: !this.data.showVerify
|
||||
})
|
||||
},
|
||||
// 获取验证码
|
||||
getVerCode() {
|
||||
countdown = 60
|
||||
@@ -116,7 +128,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.password)){
|
||||
wx.showToast({
|
||||
title: '新密码由8位数字、大小写字母和特殊符号组成!',
|
||||
title: '新密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
@@ -128,7 +140,7 @@ Page({
|
||||
if(!e.detail.value.verifyPassword){
|
||||
this.data.flag = false
|
||||
wx.showToast({
|
||||
title: '请输入确认新密码',
|
||||
title: '请输入确认密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -136,7 +148,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
|
||||
@@ -163,16 +175,22 @@ Page({
|
||||
rsaPublicKey: this.data.rsaPublicKey
|
||||
}
|
||||
// 修改密码
|
||||
UserApi.updatePassword(params).then(res => {
|
||||
UserApi.forgetPassword(params).then(res => {
|
||||
wx.showToast({
|
||||
title: '加载中...',
|
||||
icon: 'loading'
|
||||
})
|
||||
if (res.success) {
|
||||
// 跳转登录页
|
||||
wx.redirectTo({
|
||||
url: '../login/login',
|
||||
wx.showToast({
|
||||
title: '修改成功',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
// 跳转登录页
|
||||
wx.redirectTo({
|
||||
url: '../login/login',
|
||||
})
|
||||
}, 2000);
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
@@ -180,6 +198,12 @@ Page({
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
wx.showToast({
|
||||
title: err.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
},
|
||||
// 绑定微信
|
||||
|
||||
@@ -17,13 +17,17 @@
|
||||
<view class="form-item">
|
||||
<view class="text-label">新密码</view>
|
||||
<view class="text-value">
|
||||
<input name="password" type="password" value="{{password}}" placeholder="请输入新密码" />
|
||||
<input name="password" value="{{password}}" 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>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">确认密码</view>
|
||||
<view class="text-value">
|
||||
<input name="verifyPassword" type="password" value="{{verifyPassword}}" 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>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
|
||||
@@ -5,4 +5,15 @@ page {
|
||||
}
|
||||
.form-box{
|
||||
transform: translateY(50%);
|
||||
}
|
||||
.text-value{
|
||||
position: relative;
|
||||
}
|
||||
.show{
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 8px;
|
||||
z-index: 9;
|
||||
}
|
||||
Reference in New Issue
Block a user