Browse Source

支付密码

master
jiazhipeng 1 year ago
parent
commit
c384413756
  1. 14
      pages/order/pay/index.js
  2. 14
      pages/order/pay/index.wxml
  3. 15
      pages/user/profile/index.js
  4. 6
      pages/user/profile/index.wxml
  5. 21
      subPackages/password/overview/overview.js
  6. 5
      subPackages/password/overview/overview.wxml
  7. 18
      subPackages/password/setting/setting.js
  8. 2
      subPackages/password/setting/setting.wxml

14
pages/order/pay/index.js

@ -45,6 +45,8 @@ Page({
sendFlag:true,
regToken:null,
codeId:null,
inputAreaHeight: 0,
heightTimer: null,
},
/**
@ -359,6 +361,7 @@ Page({
this.setData({
SBMask: true,
inputData: inputData,
haveSBPassword: false,
})
}
})
@ -520,6 +523,17 @@ Page({
})
},
inputfocus: function () {
clearTimeout(this.data.heightTimer)
this.setData({inputAreaHeight: 600})
},
inputblur: function () {
let _this = this
this.data.heightTimer = setTimeout(()=>{
_this.setData({inputAreaHeight: 0})
},300)
},
/**
* 生命周期函数--监听页面隐藏
*/

14
pages/order/pay/index.wxml

@ -130,7 +130,7 @@
<view wx:if="{{haveSBPassword}}">
<view class="passward-box-container">
<input type="number" value="{{vcode}}" password="true" maxlength="6" focus="{{isFoucs}}"
bindinput="passwordChange" class="passward-box" cursor-spacing="20"/>
bindinput="passwordChange" class="passward-box" cursor-spacing="100"/>
<input type="number" password="true" class="show-code" wx:for="{{6}}" disabled
wx:key="index" value="{{vcode[index]}}" catch:tap="handleFoucs"/>
@ -141,25 +141,25 @@
</view>
</view>
<view wx:else>
<view class="bind-box">
<view wx:else style="min-height: {{inputAreaHeight}}px;">
<view class="bind-box" >
<view class="bind-item" >
<view class="bind-item-left">手机号</view>
<input type="number" bindinput="inputChange" value="{{inputData.phone}}" data-keyname="phone" class="weui-input" auto-focus placeholder="请输入您的手机号" />
<input type="number" bindinput="inputChange" bindfocus="inputfocus" bindblur="inputblur" value="{{inputData.phone}}" data-keyname="phone" class="weui-input" disabled placeholder="请输入您的手机号" />
</view>
<view class="bind-item" >
<view class="bind-item-left">验证码</view>
<input type="number" bindinput="inputChange" data-keyname="code" class="weui-input" placeholder="请输入验证码" />
<input type="number" bindinput="inputChange" bindfocus="inputfocus" bindblur="inputblur" data-keyname="code" class="weui-input" placeholder="请输入验证码" />
<button class="vaild-number" type="primary" size="mini" bindtap="getCode">{{buttonText}}</button>
</view>
<view class="bind-item" >
<view class="bind-item-left">设置支付密码</view>
<input type="number" password="true" maxlength="6" bindinput="inputChange" data-keyname="password" class="weui-input" placeholder="请设置您的支付密码" />
<input type="number" password="true" maxlength="6" bindfocus="inputfocus" bindblur="inputblur" bindinput="inputChange" data-keyname="password" class="weui-input" placeholder="请设置您的支付密码" />
</view>
<view class="bind-item">
<view class="bind-item-left">再次填写密码</view>
<input type="number" password="true" maxlength="6" bindinput="inputChange" data-keyname="confirmPassword" class="weui-input" placeholder="再次填写您的支付密码" />
<input type="number" password="true" maxlength="6" bindfocus="inputfocus" bindblur="inputblur" bindinput="inputChange" data-keyname="confirmPassword" class="weui-input" placeholder="再次填写您的支付密码" />
</view>
</view>
<view class="btn {{canSubmit?'':'disabled'}}" bindtap="submit">确 定</view>

15
pages/user/profile/index.js

@ -159,6 +159,19 @@ Page({
})
},
goOverview () {
if (this.data.info && this.data.info.mobile) {
wx.navigateTo({
url: '/subPackages/password/overview/overview',
})
} else {
wx.showToast({
title: '请先绑定手机号',
icon: 'none'
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
@ -181,6 +194,8 @@ Page({
sexIndex:1
})
}
console.log(this.data.info)
})
},

6
pages/user/profile/index.wxml

@ -23,7 +23,7 @@
</navigator>
<navigator url="../bindtel/index" class="profile-item" wx:if="{{info}}">
<text>手机号</text>
<view class="info">{{info.mobile}}</view>
<view class="info">{{info.mobile?info.mobile:''}}</view>
<view class="iconfont icon-you"></view>
</navigator>
<view class="profile-item">
@ -48,11 +48,11 @@
</view>
<view class="iconfont icon-you"></view>
</view>
<navigator url="/subPackages/password/overview/overview" class="profile-item">
<view bind:tap="goOverview" url="/subPackages/password/overview/overview" class="profile-item">
<text>支付密码</text>
<view class="info"></view>
<view class="iconfont icon-you"></view>
</navigator>
</view>
<navigator url="../logout/index" class="profile-item">
<text>注销账号</text>
<view class="info">注销后账号无法恢复,请谨慎操作</view>

21
subPackages/password/overview/overview.js

@ -33,9 +33,24 @@ Page({
})
return
}
wx.navigateTo({
url: '/subPackages/password/setting/setting?type='+type,
})
if (type == 'reset') {
commonApi.user_post("pay_password/checkLocked",{}).then(res=>{
if (res.code!=1) {
return
} else {
wx.navigateTo({
url: '/subPackages/password/setting/setting?type='+type,
})
}
})
} else {
wx.navigateTo({
url: '/subPackages/password/setting/setting?type='+type,
})
}
},

5
subPackages/password/overview/overview.wxml

@ -5,14 +5,15 @@
<view bindtap="goSetting" data-type="add" class="profile-item" >
<text>设置支付密码</text>
<view class="info" wx:if="{{havePassword}}">已设置</view>
<view class="iconfont icon-you" wx:else></view>
</view>
<view bindtap="goSetting" data-type="edit" class="profile-item" >
<view bindtap="goSetting" data-type="edit" class="profile-item" wx:if="{{havePassword}}">
<text>修改密码</text>
<view class="info"></view>
<view class="iconfont icon-you"></view>
</view>
<view bindtap="goSetting" data-type="reset" class="profile-item">
<view bindtap="goSetting" data-type="reset" class="profile-item" wx:if="{{havePassword}}">
<text>忘记密码</text>
<view class="info"></view>
<view class="iconfont icon-you"></view>

18
subPackages/password/setting/setting.js

@ -44,14 +44,6 @@ Page({
title: options.type=='reset'?'忘记密码':options.type=='edit'?'修改密码':'设置支付密码',
editConfrim: options.type == 'edit'?true:false
})
let userinfo = wx.getStorageSync('jstrip_userInfo')
if (userinfo && userinfo.mobile) {
this.data.inputData.phone = userinfo.mobile
this.setData({
inputData: this.data.inputData
})
}
},
// 编辑时输入原密码
@ -237,7 +229,15 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
commonApi.user_post("user/getMyInfo",{}).then(res=>{
let userinfo = res.data
if (userinfo && userinfo.mobile) {
this.data.inputData.phone = userinfo.mobile
this.setData({
inputData: this.data.inputData
})
}
})
},
/**

2
subPackages/password/setting/setting.wxml

@ -17,7 +17,7 @@
<view class="bind-box">
<view class="bind-item" wx:if="{{type!='edit'}}">
<view class="bind-item-left">手机号</view>
<input type="number" bindinput="inputChange" value="{{inputData.phone}}" data-keyname="phone" class="weui-input" auto-focus placeholder="请输入您的手机号" />
<input type="number" bindinput="inputChange" disabled value="{{inputData.phone}}" data-keyname="phone" class="weui-input" placeholder="请输入您的手机号" />
</view>
<view class="bind-item" wx:if="{{type!='edit'}}">
<view class="bind-item-left">验证码</view>

Loading…
Cancel
Save