|
@@ -1,8 +1,15 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
- <view class="row b-b" v-if="type == 2">
|
|
|
- <text class="tit">原密码</text>
|
|
|
- <input class="input" v-model="oldPassword" type="text" placeholder="请填写原密码" placeholder-class="placeholder" />
|
|
|
+ <view class="row b-b">
|
|
|
+ <text class="tit">手机号</text>
|
|
|
+ <input class="input" v-model="account" type="text" placeholder="请填写手机号" placeholder-class="placeholder" />
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view class="row b-b">
|
|
|
+ <text class="tit">验证码</text>
|
|
|
+ <input class="input" v-model="captcha" type="text" placeholder="请填写验证码" placeholder-class="placeholder" />
|
|
|
+ <view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="row b-b">
|
|
|
<text class="tit">新密码</text>
|
|
@@ -24,7 +31,9 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
type: 1,
|
|
|
- oldPassword: '', //老密码
|
|
|
+ account: '', //手机号
|
|
|
+ captcha: '', //验证码
|
|
|
+ countDown: 0, //倒计时
|
|
|
password: '', //新密码
|
|
|
yzpassword: '', //重复输入
|
|
|
loding: false //是否载入中
|
|
@@ -50,6 +59,35 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ verification() {
|
|
|
+ let obj = this;
|
|
|
+ if (this.account == '') {
|
|
|
+ this.$api.msg('请输入电话号码');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!/(^1[2|3|4|5|6|7|8|9][0-9]{9}$)/.test(this.account)) {
|
|
|
+ this.$api.msg('请输入正确的手机号');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 判断是否在倒计时
|
|
|
+ if (obj.countDown > 0) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ obj.countDown = 60;
|
|
|
+ obj.time = setInterval(() => {
|
|
|
+ obj.countDown--;
|
|
|
+ }, 1000);
|
|
|
+ //调用验证码接口
|
|
|
+ verify({
|
|
|
+ phone: obj.account,
|
|
|
+ type: 'BDING_CODE'
|
|
|
+ })
|
|
|
+ .then(({ data }) => {})
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
confirm(e) {
|
|
|
const reg = /^[0-9]{6}$/;
|
|
|
console.log(this.yzpassword);
|
|
@@ -73,7 +111,8 @@ export default {
|
|
|
transaction({
|
|
|
type: this.type,
|
|
|
payment: this.password,
|
|
|
- old_payment: this.oldPassword
|
|
|
+ phone: this.account,
|
|
|
+ captcha: this.captcha
|
|
|
})
|
|
|
.then(({ data }) => {
|
|
|
this.loding = false;
|
|
@@ -147,7 +186,7 @@ page {
|
|
|
background-color: $color-gray;
|
|
|
}
|
|
|
.code {
|
|
|
- color: #5dbc7c;
|
|
|
+ color: #dc262b;
|
|
|
font-size: 23rpx;
|
|
|
border-left: 1px solid #eeeeee;
|
|
|
width: 150rpx;
|