You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.1 KiB
56 lines
1.1 KiB
// pages/home/password/index.js
|
|
import $wuxCountDown from '../../../utils/countdown/index'
|
|
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
second: null,
|
|
pwdType: 'password',
|
|
pwd_icon: 'attention'
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
|
|
},
|
|
|
|
BindPwd: function (e) {
|
|
this.setData({ password: e.detail.value })
|
|
},
|
|
|
|
changePwd: function (e) {
|
|
if (this.data.pwdType === 'password') {
|
|
this.setData({ pwdType: 'text' })
|
|
this.setData({ pwd_icon: 'attentionforbid' })
|
|
} else {
|
|
this.setData({ pwdType: 'password' })
|
|
this.setData({ pwd_icon: 'attention' })
|
|
}
|
|
},
|
|
|
|
fetchCode: function (e) {
|
|
if (this.second && this.second.interval) return !1
|
|
this.second = new $wuxCountDown({
|
|
date: +(new Date) + 60000,
|
|
onEnd() {
|
|
this.setData({
|
|
second: '重新获取验证码',
|
|
})
|
|
},
|
|
render(date) {
|
|
const sec = this.leadingZeros(date.sec, 2) + ' 秒 '
|
|
date.sec !== 0 && this.setData({ second: sec, })
|
|
},
|
|
})
|
|
},
|
|
|
|
|
|
resetPassword: function (e) {
|
|
|
|
}
|
|
})
|