|
@@ -39,6 +39,7 @@ Page({
|
|
|
let that = this
|
|
|
wx.request({
|
|
|
url: getApp().globalData.postHeadAgreement + '/restapi/wechat/vcodeInfo',
|
|
|
+ // 场景(LOGIN:登录;LN_PHONE:绑定手机;UN_PHONE:解绑手机;FORGET_PWD:忘记密码;REGIST:注册;MDF_PWD:修改密码)
|
|
|
data: {
|
|
|
scene,
|
|
|
},
|
|
@@ -46,7 +47,7 @@ Page({
|
|
|
success(res) {
|
|
|
that.setData({
|
|
|
vcodeInfo:false,
|
|
|
- vcodeTimeOut:res.data.result.expire,
|
|
|
+ // vcodeTimeOut:res.data.result.expire,
|
|
|
vcodeTimeOutDefault:res.data.result.expire,
|
|
|
vcodeLen:res.data.result.len
|
|
|
})
|
|
@@ -213,9 +214,11 @@ Page({
|
|
|
})
|
|
|
return false;
|
|
|
}
|
|
|
- this.setData({
|
|
|
- vcodeFlag:true
|
|
|
- })
|
|
|
+ if(this.data.vcodeTimeOut<=0){
|
|
|
+ this.setData({
|
|
|
+ vcodeFlag:true,
|
|
|
+ })
|
|
|
+ }
|
|
|
return true;
|
|
|
},
|
|
|
checkMail() {
|
|
@@ -257,18 +260,23 @@ Page({
|
|
|
errorMsg: ''
|
|
|
});
|
|
|
}
|
|
|
- that.setData({
|
|
|
- vcodeTimeOut:this.data.vcodeTimeOutDefault
|
|
|
- })
|
|
|
+
|
|
|
|
|
|
let phone = that.data.phone;
|
|
|
+
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ vcodeTimeOut:that.data.vcodeTimeOutDefault
|
|
|
+ })
|
|
|
let vcodeInterval = setInterval(that.vcodeFun,1000);
|
|
|
that.setData({
|
|
|
vcodeInterval
|
|
|
})
|
|
|
|
|
|
+
|
|
|
wx.request({
|
|
|
url: getApp().globalData.postHeadAgreement + '/restapi/wechat/sendPhoneVcodeUnique',
|
|
|
+ // url: getApp().globalData.postHeadAgreement + '/restapi/wechat/sendPhoneVcode',
|
|
|
data: {
|
|
|
scene: that.data.scene,
|
|
|
terminal: phone,
|
|
@@ -278,6 +286,11 @@ Page({
|
|
|
//console.log(res1);
|
|
|
//console.log(res1.data.code == 1);
|
|
|
if (res.data.code == 1) {
|
|
|
+ this.setData({
|
|
|
+ vcodeTimeOut:0,
|
|
|
+ vcodeFlag:true,
|
|
|
+ vcode_button_text:'获取验证码'
|
|
|
+ })
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content:res.data.msg,
|
|
@@ -285,13 +298,18 @@ Page({
|
|
|
confirmColor:'#4359b5'
|
|
|
});
|
|
|
}else if (res.data.code == 2) {
|
|
|
+ this.setData({
|
|
|
+ vcodeTimeOut:0,
|
|
|
+ vcodeFlag:true,
|
|
|
+ vcode_button_text:'获取验证码'
|
|
|
+ })
|
|
|
// 跳转
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '手机号已绑定账户,请检查手机号是否填写正确或联系客服',
|
|
|
showCancel:true,
|
|
|
- confirmText: '去登陆',
|
|
|
- confirmColor:'#36a9a6',
|
|
|
+ confirmText: '去登录',
|
|
|
+ confirmColor:'#00aadd',
|
|
|
success: function (res1) {
|
|
|
if (res1.confirm) {
|
|
|
let url = '/pages/login/login';
|
|
@@ -303,7 +321,7 @@ Page({
|
|
|
|
|
|
});
|
|
|
}else{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
});
|