|
@@ -199,69 +199,66 @@ var bindPage = new Vue({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getMobileImage:function() {//获取图形验证码
|
|
|
+ handleShowImage:function() { //获取图形验证码
|
|
|
const _self = this;
|
|
|
- if (_self.isMobileDisabled) { return false; }
|
|
|
- this.$nextTick(function() {
|
|
|
- if (!verifyCheack('.mobileOrEmail')) { return false; }
|
|
|
- if (!verifyCheack('.massageBtn')) { return false; }
|
|
|
- PublicApi.getImgVerifyCode({platformType: 0},function(response){
|
|
|
- if(response.code === 0){
|
|
|
- _self.bindCodeParams.imgCode = '';
|
|
|
- _self.codeImagePath = response.data.baseImage;
|
|
|
- _self.bindCodeParams.token = response.data.token;
|
|
|
- _self.isCodeModel = true;
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- }
|
|
|
- })
|
|
|
- });
|
|
|
+ if (!verifyCheack('.mobileOrEmail')) { return false; }
|
|
|
+ if (!verifyCheack('.massageBtn')) { return false; }
|
|
|
+ if (this.isMobileDisabled) { return false; }
|
|
|
+ PublicApi.getImgVerifyCode({platformType: 0},function(response){
|
|
|
+ if(response.code === 0){
|
|
|
+ _self.bindCodeParams.imgCode = '';
|
|
|
+ _self.codeImagePath = response.data.baseImage;
|
|
|
+ _self.bindCodeParams.token = response.data.token;
|
|
|
+ _self.isCodeModel = true;
|
|
|
+ }else{
|
|
|
+ CAIMEI.Alert(response.msg,'确定',false);
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
getMobileCodeFn:function(){//机构注册获取注册短信验证码
|
|
|
const _self = this;
|
|
|
- if(this.bindCodeParams.imgCode === ''){
|
|
|
- CAIMEI.dialog('请输入图形验证码',false,function () {});
|
|
|
- return
|
|
|
- }
|
|
|
if(this.loginTabs === 0){
|
|
|
this.bindCodeParams.bindMobile = this.userParams.mobileOrEmail
|
|
|
}else{
|
|
|
this.bindCodeParams.bindMobile = this.codeParams.mobile
|
|
|
}
|
|
|
this.bindCodeParams.mobile = this.userParams.mobile
|
|
|
- _self.isMobileDisabled = true;
|
|
|
- UserApi.getNoteSMScode(this.bindCodeParams,function (response) {
|
|
|
- if(response.code === 0){
|
|
|
- _self.isCodeModel = false;
|
|
|
- CAIMEI.dialog('验证短信已发送',false,function () {});
|
|
|
- var TIME_COUNT = 60;
|
|
|
- if (!_self.mobilTime) {
|
|
|
- _self.mobilCount = TIME_COUNT;
|
|
|
- _self.isMobileDisabled = true;
|
|
|
- _self.mobilTime = setInterval(function(){
|
|
|
- if (_self.mobilCount > 1 && _self.mobilCount <= TIME_COUNT) {
|
|
|
- _self.mobilCount--;
|
|
|
- _self.mobileCodeText = _self.mobilCount +'s重新发送';
|
|
|
- } else {
|
|
|
- _self.isMobileDisabled = false;
|
|
|
- clearInterval(_self.mobilTime);
|
|
|
- _self.mobilTime = null;
|
|
|
- _self.mobileCodeText = '获取验证码';
|
|
|
- }
|
|
|
- },1000)
|
|
|
+ if( this.isMobileDisabled){ return }
|
|
|
+ this.$nextTick(function() {
|
|
|
+ if (!verifyCheack('.codeMsgButton')) {return false; }
|
|
|
+ UserApi.getNoteSMScode(this.bindCodeParams,function (response) {
|
|
|
+ if(response.code === 0){
|
|
|
+ _self.isCodeModel = false;
|
|
|
+ CAIMEI.dialog('验证短信已发送',false,function () {});
|
|
|
+ var TIME_COUNT = 60;
|
|
|
+ if (!_self.mobilTime) {
|
|
|
+ _self.mobilCount = TIME_COUNT;
|
|
|
+ _self.isMobileDisabled = true;
|
|
|
+ _self.mobilTime = setInterval(function(){
|
|
|
+ if (_self.mobilCount > 1 && _self.mobilCount <= TIME_COUNT) {
|
|
|
+ _self.mobilCount--;
|
|
|
+ _self.mobileCodeText = _self.mobilCount +'s重新发送';
|
|
|
+ } else {
|
|
|
+ _self.isMobileDisabled = false;
|
|
|
+ clearInterval(_self.mobilTime);
|
|
|
+ _self.mobilTime = null;
|
|
|
+ _self.mobileCodeText = '获取验证码';
|
|
|
+ }
|
|
|
+ },1000)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ _self.handleShowImage();
|
|
|
+ _self.isMobileDisabled = false;
|
|
|
+ setErrorTxt($('.codeMsgButton'),response.msg);
|
|
|
}
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- _self.isMobileDisabled = false;
|
|
|
- _self.isCodeModel = false;
|
|
|
- }
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
setStorages:function(data){//存储本地数据
|
|
|
localStorage.setItem('userInfo',JSON.stringify(data));
|
|
|
},
|
|
|
- refreshCodeImage:function(){
|
|
|
- this.getMobileImage()
|
|
|
+ handleRefreshCodeImage:function(){
|
|
|
+ this.handleShowImage()
|
|
|
},
|
|
|
closeCodeModel:function(){
|
|
|
this.isCodeModel = false;
|