|
@@ -49,6 +49,13 @@ var bindPage = new Vue({
|
|
|
imgCode:'',
|
|
|
token:''
|
|
|
},
|
|
|
+ verifiParams:{
|
|
|
+ mobileOrEmail :'',
|
|
|
+ password : '',
|
|
|
+ mobile:'',
|
|
|
+ code:'',
|
|
|
+ codeType:0
|
|
|
+ },
|
|
|
isDisabled:true,
|
|
|
isSubDisabled:true
|
|
|
},
|
|
@@ -56,17 +63,25 @@ var bindPage = new Vue({
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- handleStepNext(){// 账号密码 下一步
|
|
|
- if(this.isDisabled){ return }
|
|
|
- if(this.loginTabs === 0){
|
|
|
- this.activeNum = 1;
|
|
|
+ handleTabsClick(index){// tabs切换
|
|
|
+ this.loginTabs = this.userParams.passOrNote = this.verifiParams.codeType = index;
|
|
|
+ this.isDisabled = true;
|
|
|
+ if(this.loginTabs === 1){
|
|
|
+ this.userParams.mobileOrEmail = '';
|
|
|
+ this.userParams.password = '';
|
|
|
}else{
|
|
|
- this.userLoginVerification();
|
|
|
+ this.userParams.companyMobile = '';
|
|
|
+ this.codeParams.mobile = '';
|
|
|
+ this.codeParams.code = '';
|
|
|
}
|
|
|
},
|
|
|
+ handleStepNext(){// 账号密码 下一步
|
|
|
+ if(this.isDisabled){ return }
|
|
|
+ this.userLoginVerification();
|
|
|
+ },
|
|
|
userLoginVerification(){// 校验短信验证码
|
|
|
var _self = this;
|
|
|
- UserApi.userLoginVerification(this.codeParams,function(response){
|
|
|
+ UserApi.userLoginVerification(this.verifiParams,function(response){
|
|
|
if(response.code === 0){
|
|
|
_self.activeNum = 1;
|
|
|
}else{
|
|
@@ -74,65 +89,43 @@ var bindPage = new Vue({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- handleTabsClick(index){// tabs切换
|
|
|
- this.loginTabs = this.userParams.passOrNote = index;
|
|
|
- if(this.loginTabs === 1){
|
|
|
- this.userParams.mobileOrEmail = '';
|
|
|
- this.userParams.password = '';
|
|
|
- }else{
|
|
|
- this.userParams.companyMobile = '';
|
|
|
- this.codeParams.mobile = '';
|
|
|
- this.codeParams.code = '';
|
|
|
- }
|
|
|
- },
|
|
|
- handleInputMobileOrEmail(e){
|
|
|
- this.userParams.mobileOrEmail = e.target.value;
|
|
|
+ handleInputMobileOrEmail(e){// 账号输入
|
|
|
+ this.userParams.mobileOrEmail = this.verifiParams.mobileOrEmail = e.target.value;
|
|
|
this.handldeCheckInput();
|
|
|
},
|
|
|
- handleInputPassword(e){
|
|
|
- this.userParams.password = e.target.value;
|
|
|
+ handleInputPassword(e){// 密码输入
|
|
|
+ this.userParams.password = this.verifiParams.password = e.target.value;
|
|
|
this.handldeCheckInput();
|
|
|
},
|
|
|
- handleInputPhone(e){
|
|
|
- this.codeParams.mobile = this.smsCodeParams.mobile = this.userParams.companyMobile = e.target.value;
|
|
|
+ handleInputPhone(e){// 已注册手机号输入
|
|
|
+ this.codeParams.mobile = this.smsCodeParams.mobile = this.verifiParams.mobile = this.userParams.companyMobile = e.target.value;
|
|
|
this.handldeCheckInput();
|
|
|
},
|
|
|
- handleInputSmsCode(e){
|
|
|
- this.codeParams.code = e.target.value;
|
|
|
+ handleInputSmsCode(e){// 短信验证码输入
|
|
|
+ this.codeParams.code = this.verifiParams.code = e.target.value;
|
|
|
this.handldeCheckInput();
|
|
|
},
|
|
|
- handldeCheckInput(){// 控制下一步按钮高亮
|
|
|
- if(this.loginTabs === 0){
|
|
|
- if(this.userParams.mobileOrEmail !== "" && this.userParams.password !==""){
|
|
|
- this.isDisabled =false;
|
|
|
- }else{
|
|
|
- this.isDisabled =true;
|
|
|
- }
|
|
|
- }else{
|
|
|
- if(this.codeParams.mobile !== "" && this.codeParams.code !==""){
|
|
|
- this.isDisabled =false;
|
|
|
- }else{
|
|
|
- this.isDisabled =true;
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- handleInputLinkName(e){
|
|
|
+ handleInputLinkName(e){// 运营人员输入
|
|
|
this.userParams.linkName = e.target.value;
|
|
|
- this.handldeCheckInput1();
|
|
|
+ this.handldeCheckInput();
|
|
|
},
|
|
|
- handleInputMobile(e){
|
|
|
+ handleInputMobile(e){// 运营人员手机号输入
|
|
|
this.userParams.mobile = e.target.value;
|
|
|
- this.handldeCheckInput1();
|
|
|
+ this.handldeCheckInput();
|
|
|
},
|
|
|
- handleInputSmsCodee(e){
|
|
|
+ handleInputSmsCodee(e){// 运营人员手机验证码输入
|
|
|
this.userParams.smsCode = e.target.value;
|
|
|
- this.handldeCheckInput1();
|
|
|
+ this.handldeCheckInput();
|
|
|
},
|
|
|
- handldeCheckInput1(){// 控制提交按钮高亮
|
|
|
- if(this.userParams.linkName !== "" && this.userParams.mobile !=="" && this.userParams.smsCode !==""){
|
|
|
- this.isSubDisabled =false;
|
|
|
+ handldeCheckInput(){// 控制按钮高亮
|
|
|
+ if(this.activeNum === 1){
|
|
|
+ this.isSubDisabled = !(this.userParams.linkName !== '' && this.userParams.mobile !== '' && this.userParams.smsCode !== '');
|
|
|
}else{
|
|
|
- this.isSubDisabled =true;
|
|
|
+ if(this.loginTabs === 0){
|
|
|
+ this.isDisabled = !(this.userParams.mobileOrEmail !== '' && this.userParams.password !== '');
|
|
|
+ }else{
|
|
|
+ this.isDisabled = !(this.codeParams.mobile !== '' && this.codeParams.code !== '');
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
handleMobileCode(){// 点击获取短信验证码
|
|
@@ -141,7 +134,7 @@ var bindPage = new Vue({
|
|
|
this.$nextTick(function() {
|
|
|
if (!verifyCheack('.codeParamsMobile')) { return false; }
|
|
|
UserApi.userLoginCode(_self.smsCodeParams,function (response) {
|
|
|
- if(response.code == 0){
|
|
|
+ if(response.code === 0){
|
|
|
CAIMEI.dialog('获取验证码成功~',false,function () {});
|
|
|
var TIME_COUNT = 60;
|
|
|
if (!_self.mobilTime1) {
|
|
@@ -194,9 +187,9 @@ var bindPage = new Vue({
|
|
|
_self.setStorages( _self.userData);
|
|
|
_self.loginLoading = false;
|
|
|
// 绑定成功后跳转
|
|
|
- if(_userIdentity == 4 || _userIdentity ==2){
|
|
|
+ if(_userIdentity === 4 || _userIdentity ===2){
|
|
|
window.location.href = '/user/dashboard.html';
|
|
|
- }else if(_userIdentity == 3){
|
|
|
+ }else if(_userIdentity === 3){
|
|
|
window.location.href = '/supplier/dashboard.html';
|
|
|
}
|
|
|
});
|
|
@@ -215,7 +208,7 @@ var bindPage = new Vue({
|
|
|
if (!mobile) { return false; }
|
|
|
if (!pass) { return false; }
|
|
|
PublicApi.getImgVerifyCode({platformType: 0},function(response){
|
|
|
- if(response.code == 0){
|
|
|
+ if(response.code === 0){
|
|
|
_self.bindCodeParams.imgCode = '';
|
|
|
_self.codeImagePath = response.data.baseImage;
|
|
|
_self.bindCodeParams.token = response.data.token;
|
|
@@ -228,7 +221,7 @@ var bindPage = new Vue({
|
|
|
},
|
|
|
getMobileCodeFn:function(){//机构注册获取注册短信验证码
|
|
|
var _self = this;
|
|
|
- if(this.bindCodeParams.imgCode == ''){
|
|
|
+ if(this.bindCodeParams.imgCode === ''){
|
|
|
CAIMEI.dialog('请输入图形验证码',false,function () {});
|
|
|
return
|
|
|
}
|
|
@@ -240,7 +233,7 @@ var bindPage = new Vue({
|
|
|
this.bindCodeParams.mobile = this.userParams.mobile
|
|
|
_self.isMobileDisabled = true;
|
|
|
UserApi.getNoteSMScode(this.bindCodeParams,function (response) {
|
|
|
- if(response.code == 0){
|
|
|
+ if(response.code === 0){
|
|
|
_self.isCodeModel = false;
|
|
|
CAIMEI.dialog('验证短信已发送',false,function () {});
|
|
|
var TIME_COUNT = 60;
|