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
+20 -33
View File
@@ -2,7 +2,6 @@
import UserApi from '../../assets/js/http/userApi'
import { encrypt } from '../../assets/js/jsencrypt/rsa'
import { wxBind } from '../../assets/js/common'
// var countdown = 60; // 倒计时秒数
Page({
@@ -11,7 +10,6 @@ Page({
*/
data: {
show: true, // 默认显示的是闭眼睛
type: 'password',
form: {
currdatetime: '',
requestCodeSuccess: true,
@@ -21,17 +19,9 @@ Page({
flag: false
},
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
})
},
back(){
wx.navigateBack({
@@ -64,7 +54,8 @@ Page({
this.data.flag = false
wx.showToast({
title: '请输入手机号',
icon: 'none'
icon: 'none',
duration: 2000
})
return
} else {
@@ -72,7 +63,8 @@ Page({
if(!pattern.test(e.detail.value.phone)){
wx.showToast({
title: '请输入正确的手机号!',
icon: 'none'
icon: 'none',
duration: 2000
})
this.data.flag = false
return
@@ -84,34 +76,25 @@ Page({
this.data.flag = false
wx.showToast({
title: '请输入密码',
icon: 'none'
icon: 'none',
duration: 2000
})
return
} else {
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
if(!pattern.test(e.detail.value.password)){
wx.showToast({
title: '密码由8位数字、大小写字母和特殊符号组成!',
icon: 'none'
})
this.data.flag = false
return
} else {
this.data.flag = true
}
this.data.flag = true
}
if(!e.detail.value.captcha){
this.data.flag = false
wx.showToast({
title: '请输入验证码',
icon: 'none'
icon: 'none',
duration: 2000
})
return
}else{
this.data.flag = true
}
console.log('form发生了submit事件,携带数据为:', e.detail.value)
// const time = new Date().getTime()
let params = {
username: encrypt(this.data.rsaPublicKey, e.detail.value.phone),
password: encrypt(this.data.rsaPublicKey, e.detail.value.password),
@@ -126,7 +109,7 @@ Page({
wx.showToast({
title: '首次登录请用验证码方式登录',
icon: 'none',
duration: 2000
duration: 3000
})
setTimeout(() => {
wx.navigateBack()
@@ -153,12 +136,16 @@ Page({
wx.showToast({
title: res.message,
icon: 'none',
duration: 2000
duration: 3000
})
this.handleChangeCheckCode()
}
}).catch(err => {
wx.hideToast()
}).catch(err=>{
wx.showToast({
title: err.message,
icon: 'none',
duration: 3000
})
})
}
},
+1 -1
View File
@@ -10,7 +10,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>
+1 -1
View File
@@ -1,6 +1,6 @@
/* pages/meeting/meeting.wxss */
.form-box{
transform: translateY(110pt);
transform: translateY(25%);
}
.text-label {