@@ -12,12 +12,13 @@ Page({ | |||||
navigationBarHeight, | navigationBarHeight, | ||||
tabIndex: 0, | tabIndex: 0, | ||||
pdwSwitch: 0, | pdwSwitch: 0, | ||||
isShowPwd: false, | |||||
isChangePhone: false, | isChangePhone: false, | ||||
code: "", | code: "", | ||||
name: "叶文沁", | name: "叶文沁", | ||||
phone: "1379****591", | phone: "1379****591", | ||||
tempPhone: '', | tempPhone: '', | ||||
password: '', | |||||
password: '' | |||||
}, | }, | ||||
// 兑换 | // 兑换 | ||||
@@ -46,7 +47,7 @@ Page({ | |||||
// 输入密码 | // 输入密码 | ||||
pwdInput(e) { | pwdInput(e) { | ||||
this.setData({ | this.setData({ | ||||
password: e.detail.value | |||||
password: e.detail.value, | |||||
}) | }) | ||||
}, | }, | ||||
@@ -110,6 +111,26 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
setPwdShow() { | |||||
const isShowPwd = this.data.isShowPwd | |||||
this.setData({ | |||||
isShowPwd: !isShowPwd | |||||
}) | |||||
}, | |||||
submit() { | |||||
const thisData = this.data | |||||
const data = { | |||||
name: thisData.name, | |||||
phone: thisData.phone, | |||||
pdwSwitch: thisData.pdwSwitch, | |||||
password: thisData.password, | |||||
} | |||||
console.log(data, 'submitData'); | |||||
}, | |||||
goGive() { }, | |||||
// 检查用户登录状态 | // 检查用户登录状态 | ||||
checkPhoneStatus() { | checkPhoneStatus() { | ||||
let that = this; | let that = this; | ||||
@@ -40,15 +40,24 @@ | |||||
<label> | <label> | ||||
<radio value="0" checked="true" />无验证 | <radio value="0" checked="true" />无验证 | ||||
</label> | </label> | ||||
</radio-group> | </radio-group> | ||||
</view> | </view> | ||||
<view wx:if="{{pdwSwitch && tabIndex == 0}}" class="pwdBox"> | <view wx:if="{{pdwSwitch && tabIndex == 0}}" class="pwdBox"> | ||||
<input type="text" placeholder="请设置密码" placeholder-class="pwdBoxInside" focus="true" bindinput="pwdInput"/> | |||||
<view wx:if="{{!isShowPwd}}" style="margin-bottom: 0;"> | |||||
<input type="password" placeholder="请设置密码" placeholder-class="pwdBoxInside" focus="true" bindinput="pwdInput" value="{{password}}" /> | |||||
<image class=" eye" src="../../assets/images/password-show.png" bindtap="setPwdShow"></image> | |||||
</view> | |||||
<view wx:if="{{isShowPwd}}" style="margin-bottom: 0;"> | |||||
<input type="text" placeholder="请设置密码" placeholder-class="pwdBoxInside" value="{{password}}" bindinput="pwdInput" /> | |||||
<image class="eye" src="../../assets/images/password-close.png" bindtap="setPwdShow"></image> | |||||
</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="btns"> | <view class="btns"> | ||||
<button wx:if="{{tabIndex == 0}}" type="primary" bindtap="checkPhoneStatus">确认绑定</button> | |||||
<button wx:if="{{tabIndex == 1}}" type="primary" bindtap="checkPhoneStatus">去转赠</button> | |||||
<!-- 绑定 --> | |||||
<button wx:if="{{tabIndex == 0}}" type="primary" bindtap="submit">确认绑定</button> | |||||
<!-- 转赠 --> | |||||
<button wx:if="{{tabIndex == 1}}" type="primary" bindtap="goGive">去转赠</button> | |||||
</view> | </view> |
@@ -110,9 +110,20 @@ | |||||
} | } | ||||
.infoCard .pwdBox { | .infoCard .pwdBox { | ||||
position: relative; | |||||
border: 1px solid #5c5c5c; | border: 1px solid #5c5c5c; | ||||
padding: 15rpx; | padding: 15rpx; | ||||
border-radius: 15rpx; | border-radius: 15rpx; | ||||
line-height: 100%; | |||||
} | |||||
.infoCard .pwdBox .eye { | |||||
position: absolute; | |||||
right: 25rpx; | |||||
bottom: 5rpx; | |||||
width: 60rpx; | |||||
height: 60rpx; | |||||
z-index: 999; | |||||
} | } | ||||
.btns { | .btns { | ||||