6 changed files with 2 additions and 129 deletions
Split View
Diff Options
-
3app.json
-
2pages/article/feedback/index.js
-
87pages/bank/password/index.js
-
5pages/bank/password/index.json
-
33pages/bank/password/index.wxml
-
1pages/bank/password/index.wxss
@ -1,87 +0,0 @@ |
|||
// pages/bank/password/index.js
|
|||
import { udpatePayPassword } from "../../../api/saas" |
|||
import { sendCaptcha } from "../../../api/ztb" |
|||
const util = require('../../../utils/util') |
|||
import { $wuxCountDown } from '../../../components/index' |
|||
|
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
second: null, |
|||
codeEnable: true, |
|||
form: { |
|||
mobile: null, |
|||
captcha: null, |
|||
payPassword: null |
|||
}, |
|||
requesting: false |
|||
}, |
|||
bindForm: function (e) { |
|||
this.data.form[e.target.id] = e.detail.value |
|||
}, |
|||
fetchCode: function () { |
|||
if (util.isEmpty(this.data.form.mobile)) { |
|||
util.showToast('请输入手机号码') |
|||
return |
|||
} |
|||
if (this.second && this.second.interval) return !1 |
|||
wx.showLoading({ title: '正在获取', mask: true }) |
|||
sendCaptcha({ account: this.data.form.mobile, accountType: 'MOBILE', purpose: 'RECYCLE_CLIENT_UPDATE_PAY_PASSWORD' }).then(result => { |
|||
wx.hideLoading() |
|||
this.setData({ codeEnable: false }) |
|||
util.showToast('验证码已经发送') |
|||
this.wuxCountDown = new $wuxCountDown({ |
|||
date: +(new Date) + 60000, |
|||
onEnd() { |
|||
this.setData({ second: '重新获取验证码', codeEnable: true }) |
|||
}, |
|||
render(date) { |
|||
const sec = this.leadingZeros(date.sec, 2) + ' 秒 ' |
|||
date.sec !== 0 && this.setData({ second: sec }) |
|||
}, |
|||
}) |
|||
}).catch(error => { |
|||
wx.hideLoading() |
|||
util.showToast(error) |
|||
}) |
|||
}, |
|||
submitForm: function () { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
if (util.isEmpty(this.data.form.mobile)) { |
|||
util.showToast('请输入手机号码') |
|||
return |
|||
} |
|||
if (util.isEmpty(this.data.form.payPassword)) { |
|||
util.showToast('请输入密码') |
|||
return |
|||
} |
|||
// this.data.form.payPassword = md5.hexMD5(this.data.form.payPassword).toUpperCase()
|
|||
if (util.isEmpty(this.data.form.captcha)) { |
|||
util.showToast('请输入验证码') |
|||
return |
|||
} |
|||
this.data.form.verifyCode = this.data.form.captcha |
|||
wx.showLoading({ title: '处理中', mask: true }) |
|||
this.data.requesting = true |
|||
udpatePayPassword(this.data.form).then(res => { |
|||
wx.hideLoading() |
|||
util.showBackToast('设置成功') |
|||
}).catch(error => { |
|||
wx.hideLoading() |
|||
this.data.requesting = false |
|||
util.showToast(error) |
|||
}) |
|||
}, |
|||
onUnload: function(){ |
|||
if(this.wuxCountDown){ |
|||
this.wuxCountDown.stop() |
|||
this.wuxCountDown = null |
|||
} |
|||
} |
|||
|
|||
}) |
|||
@ -1,5 +0,0 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"wux-button": "/components/button/index" |
|||
} |
|||
} |
|||
@ -1,33 +0,0 @@ |
|||
<!--pages/bank/password/index.wxml--> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">支付密码</view> |
|||
</cu-custom> |
|||
|
|||
<view class="cu-list menu no-card sm-border margin-top"> |
|||
<view class="cu-item"> |
|||
<view class="flex content cu-item" style="font-size:28rpx"> |
|||
<view style="min-width:170rpx">支付密码:</view> |
|||
<input id="payPassword" maxlength="6" type="password" placeholder="请输入6位数字支付密码" bindinput="bindForm"></input> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="cu-list menu no-card sm-border margin-top"> |
|||
<view class="cu-item"> |
|||
<view class="flex content cu-item" style="font-size:28rpx"> |
|||
<view style="min-width:170rpx">手机号:</view> |
|||
<input id="mobile" maxlength="11" type="number" placeholder="请输入当前登录手机号码" bindinput="bindForm"></input> |
|||
</view> |
|||
</view> |
|||
<view class="cu-item"> |
|||
<view class="flex content cu-item" style="font-size:28rpx"> |
|||
<view style="min-width:170rpx">验证码:</view> |
|||
<input id="captcha" maxlength="6" type="number" placeholder="请输入验证码" bindinput="bindForm"></input> |
|||
</view> |
|||
<wux-button outline type="positive" size="code" disabled="{{!codeEnable}}" bind:click="fetchCode">{{ second || '获取验证码' }}</wux-button> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="flex flex-direction" style="padding:80rpx 32rpx"> |
|||
<wux-button block type="positive" bind:click="submitForm">提交</wux-button> |
|||
</view> |
|||
@ -1 +0,0 @@ |
|||
/* pages/bank/password/index.wxss */ |
|||
Write
Preview
Loading…
Cancel
Save