bug修改

This commit is contained in:
姚亚男
2021-10-22 18:03:14 +08:00
parent dcc0e8b1fa
commit c15d7ca29b
16 changed files with 137 additions and 128 deletions
+24 -41
View File
@@ -16,50 +16,23 @@ Page({
rsaPublicKey: '', // 公钥
},
showOld: true,
typeOld: 'password',
show: true, // 默认显示的是闭眼睛
showVerify: true,
type: 'password',
typeVerify: 'password'
},
showPasswordOld(){
if(this.data.showOld){ // 显示睁开眼睛的时候 type="text"
this.setData({
typeOld: 'text',
showOld: false
})
}else{
this.setData({
typeOld: 'password',
showOld: true
})
}
this.setData({
showOld: !this.data.showOld
})
},
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) {
@@ -74,7 +47,7 @@ Page({
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
if(!pattern.test(e.detail.value.oldpassword)){
wx.showToast({
title: '旧密码由8位数字、大小写字母和特殊符号组成!',
title: '旧密码由8位及以上数字、大小写字母和特殊符号组成!',
icon: 'none'
})
this.data.flag = false
@@ -94,7 +67,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
@@ -114,7 +87,7 @@ Page({
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
if(!pattern.test(e.detail.value.confirmpassword)){
wx.showToast({
title: '密码由8位数字、大小写字母和特殊符号组成!',
title: '确认新密码由8位及以上数字、大小写字母和特殊符号组成!!',
icon: 'none'
})
this.data.flag = false
@@ -153,9 +126,19 @@ Page({
setTimeout(() => {
wx.navigateBack()
}, 2000);
}else{
wx.showToast({
title: res.message,
icon: 'none',
duration: 2000
})
}
}).catch(err => {
wx.hideToast()
}).catch(err=>{
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
}
},
+4 -4
View File
@@ -4,7 +4,7 @@
<view class="form-item">
<view class="text-label">旧密码</view>
<view class="text-value">
<input name="oldpassword" value="{{oldpassword}}" type="{{typeOld}}" placeholder="请输入旧密码" />
<input name="oldpassword" value="{{oldpassword}}" password="{{showOld}}" placeholder="请输入旧密码" />
<image src="../../assets/images/show.png" class="show" wx:if="{{!showOld}}" bindtap="showPasswordOld"></image>
<image src="../../assets/images/none.png" class="show" wx:if="{{showOld}}" bindtap="showPasswordOld"></image>
</view>
@@ -12,7 +12,7 @@
<view class="form-item">
<view class="text-label">新密码</view>
<view class="text-value">
<input name="password" value="{{password}}" type="{{type}}" 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>
@@ -20,13 +20,13 @@
<view class="form-item">
<view class="text-label">确认新密码</view>
<view class="text-value">
<input name="confirmpassword" value="{{confirmpassword}}" type="{{typeVerify}}" placeholder="请确认新密码" />
<input name="confirmpassword" value="{{confirmpassword}}" 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">
<button type="primary" formType="submit">登录</button>
<button type="primary" formType="submit">确定</button>
</view>
</form>
</view>
+1 -1
View File
@@ -1,6 +1,6 @@
/* pages/meeting/meeting.wxss */
.form-box{
transform: translateY(110pt);
transform: translateY(20%);
}
.text-label {
width: 80px !important;