Browse Source

短信验证码登录

zhengjinyi 2 năm trước cách đây
mục cha
commit
80a14df6b2

+ 27 - 3
src/main/resources/static/css/account/bind.css

@@ -5,13 +5,37 @@ li{list-style:none}
  */
 @media screen and (min-width:768px){
     footer .footTop{display:none;}
-    .signAccount.bind {width: 968px;margin: 0 auto;}
+    .signAccount.bind {width: 968px;margin: 40px auto;background: #FFFFFF;}
     .signAccount.bind .title {height: 42px;font-size: 24px;line-height: 42px;font-weight: normal;color: #22272e;padding: 10px 0;text-align: left;}
     .signAccount.bind .title.center {text-align: center;padding: 20px 0;font-size:32px;}
     .signAccount.bind .title-tips{margin-bottom: 32px;width: 968px;height: 60px;box-sizing: border-box;background-image: linear-gradient(270deg,rgba(255,255,255,0.1) 0%,rgba(255,86,11,0.1) 51%,rgba(255,255,255,0.1) 100%);}
     .signAccount.bind .title-tips p{width: 968px;height: 60px;font-family: Microsoft YaHei;font-size: 14px;font-weight: normal;font-stretch: normal;line-height: 60px;letter-spacing: 1px;color: #e15616;text-align: center;}
-    .signAccount.bind .registerClub{width:498px;margin:0 auto;min-height: 900px;}
+    .signAccount.bind .registerClub{width:400px;margin:0 auto;}
+    .form-step{width: 160px;height: 1px;background: #E2E2E2;margin: 60px auto;position: relative;}
+    .form-step .step{display: block;width: 32px;height: 32px;line-height: 32px;border-radius: 50%;background: #E2E2E2;font-size: 18px;color: #FFFFFF;text-align: center;position: absolute;}
+    .form-step .step.one{top: -15px;left: -37px;}
+    .form-step .step.two{top: -15px;right:-37px;}
+    .form-step .step.active{background: #E15621;}
+    .formLine-tabs{ width: 100%;height: 66px;box-sizing: border-box;padding: 21px 0;float: left;margin-bottom: 10px;}
+    .formLine-tabs .tabs-item{ width: 50%;height: 24px;box-sizing: border-box;float: left;display: block;line-height: 24px;font-size: 18px;color: #22272E;position: relative;text-align: center;}
+    .formLine-tabs .tabs-item:before{content: '';width: 24px;height: 4px;background: #FFFFFF;position: absolute;bottom: -5px;left: 50%;margin-left: -12px;}
+    .formLine-tabs .tabs-item.current{font-weight: bold;color: #E15621;}
+    .formLine-tabs .tabs-item.current:before{background: #E15621;}
+    .formLine{width: 100%;float: left;}
+    .formLine .code-btn{width: 120px;height: 44px;line-height: 44px;text-align: center;background: #E15621;font-size: 14px;color: #FFFFFF;position: absolute;right: 0;top: 31px;}
+    .formLine .code-btn.disabled{background: rgba(225,86,33,0.7);}
+    .formLine input{height:44px;line-height:44px;}
+    .formLine input.smscode{padding-right: 120px;box-sizing: border-box;}
+    .subLine{width: 100%;float: left;margin: 40px 0;}
+    .subLine .btn.disabled{background: #E2E2E2;}
 
+    .foot{width:100%;height:96px;background:#262626;margin-top:0px;}
+    .footer{width:1185px;margin:0 auto;text-align:center;height: 96px;box-sizing: border-box;padding: 20px 0;}
+    .footer p{line-height: 30px;color: #FFFFFF;}
+    .footer p span{margin:0 5px}
+    .footer p span a{color: #FFFFFF;}
+    .footer p span a:hover{color: #E15621;}
+    .footer p span img.icp{width: 18px;height: 18px;display: inline-block;}
 }
 
 /**
@@ -25,5 +49,5 @@ li{list-style:none}
     .signAccount.bind .title.center {text-align: center;padding: 4vw 0;font-size:4vw;}
     .signAccount.bind .title-tips{margin-bottom: 4vw;width:100%;height: 12vw;box-sizing: border-box;padding: 2vw 0;background-image: linear-gradient(270deg,rgba(255,255,255,0.1) 0%,rgba(255,86,11,0.1) 51%,rgba(255,255,255,0.1) 100%);}
     .signAccount.bind .title-tips p{width:100%;height:4vw;font-family: Microsoft YaHei;font-size: 3vw;font-weight: normal;font-stretch: normal;line-height:4vw;color: #e15616;text-align: center;}
-
+    .foot{display: block;}
 }

+ 2 - 0
src/main/resources/static/css/account/login.css

@@ -20,6 +20,7 @@ li{list-style:none}
  .loginForm form{margin-top:10px;}
  .loginForm .formLine{width: 100%; height:70px;padding:0;float: left;position: relative;}
  .loginForm .formLine .code-btn{width: 96px;height: 48px;line-height: 48px;text-align: center;background: #E15621;font-size: 14px;color: #FFFFFF;position: absolute;right: 0;top: 0;}
+ .loginForm .formLine .code-btn.disabled{background: rgba(225,86,33,0.7);}
  .loginForm input{height:48px;line-height:48px;}
  .loginForm input.smscode{padding-right: 96px;box-sizing: border-box;}
  .loginForm .checked{top:14px;}
@@ -95,6 +96,7 @@ li{list-style:none}
  .loginForm .formLine{height:16.4vw;padding:0;position: relative;}
  .loginForm input{height:11.2vw;line-height:6vw;padding: 2.6vw 0;box-sizing: border-box;}
  .loginForm .formLine .code-btn{width: 24.8vw;height:11.2vw;line-height: 11.2vw;text-align: center;background: #E15621;font-size:3.4vw;color: #FFFFFF;position: absolute;right: 0;top: 0;}
+ .loginForm .formLine .code-btn.disabled{background: rgba(225,86,33,0.7);}
  .loginForm input.smscode{padding-right: 24.8vw;box-sizing: border-box;}
  .loginForm .checked{top:3.6vw;right:3.6vw;}
  .loginForm .forget{text-align:right;color:#4a4f58;font-size:3.4vw;line-height:3.4vw;margin-bottom:4.8vw}

+ 154 - 20
src/main/resources/static/js/account/bind.js

@@ -10,33 +10,169 @@ var bindPage = new Vue({
         codeImagePath:'',
         codeImageToken:'',
         imageCode:'',
-        user: {
+        activeNum:0,
+        loginTabs:0,
+        userParams: {
             mobileOrEmail :'',
             password : '',
             mobile : '',
             linkName :'',
             smsCode :'',
             unionId:'',
+            companyMobile:'',
+            passOrNote:0
         },
         rule:{
             mobileOrEmail: '(^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$)|(^\\d{6,12}$)',
             name: '^[a-zA-Z\\u4e00-\\u9fa5]{2,}$',
             phone: '^\\d{6,12}$',
             code: '^\\d{6}$',
-            password: "^[^\\u4e00-\\u9fa5]{8,16}$"
-        }
+            password: "^[^\\u4e00-\\u9fa5]{8,16}$",
+            mobile:'^1[1-9][0-9]{9}$'
+        },
+        mobilCount1:0,
+        mobileCodeText1:'获取验证码',
+        mobilTime1:null,
+        isMobileDisabled1:false,
+        codeParams:{
+            mobile:'',
+            code:''
+        },
+        smsCodeParams:{// 获取手机短信验证码
+            mobile: '', //用户登录手机号
+        },
+        bindCodeParams:{// 获取运营人员手机验证码
+            mobile: '',
+            bindMobile: '',
+            platformType:0,
+            isCheckCaptcha:0,
+            imgCode:'',
+            token:''
+        },
+        isDisabled:true,
+        isSubDisabled:true
     },
     computed: {
 
     },
     methods: {
-        BindConfirmFn: function(){ //手机号找回密码
+        handleStepNext(){// 账号密码 下一步
+            if(this.isDisabled){ return }
+            if(this.loginTabs === 0){
+                this.activeNum = 1;
+            }else{
+                this.userLoginVerification();
+            }
+        },
+        userLoginVerification(){// 校验短信验证码
+            var _self = this;
+            UserApi.userLoginVerification(this.codeParams,function(response){
+                if(response.code === 0){
+                    _self.activeNum = 1;
+                }else{
+                    CAIMEI.Alert(response.msg,'确定',false);
+                }
+            });
+        },
+        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;
+            this.handldeCheckInput();
+        },
+        handleInputPassword(e){
+            this.userParams.password = e.target.value;
+            this.handldeCheckInput();
+        },
+        handleInputPhone(e){
+            this.codeParams.mobile = this.smsCodeParams.mobile = this.userParams.companyMobile = e.target.value;
+            this.handldeCheckInput();
+        },
+        handleInputSmsCode(e){
+            this.codeParams.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){
+            this.userParams.linkName = e.target.value;
+            this.handldeCheckInput1();
+        },
+        handleInputMobile(e){
+            this.userParams.mobile = e.target.value;
+            this.handldeCheckInput1();
+        },
+        handleInputSmsCodee(e){
+            this.userParams.smsCode = e.target.value;
+            this.handldeCheckInput1();
+        },
+        handldeCheckInput1(){// 控制提交按钮高亮
+            if(this.userParams.linkName !== "" && this.userParams.mobile !=="" && this.userParams.smsCode !==""){
+                this.isSubDisabled =false;
+            }else{
+                this.isSubDisabled =true;
+            }
+        },
+        handleMobileCode(){// 点击获取短信验证码
             var _self = this;
-            var pass = verifyForm();
-            if (_self.loginLoading) { return false; }
-            if (!pass) {return false;}
+            if( this.isMobileDisabled1){ return }
+            this.$nextTick(function() {
+                if (!verifyCheack('.codeParamsMobile')) { return false; }
+                UserApi.userLoginCode(_self.smsCodeParams,function (response) {
+                    if(response.code == 0){
+                        CAIMEI.dialog('获取验证码成功~',false,function () {});
+                        var TIME_COUNT = 60;
+                        if (!_self.mobilTime1) {
+                            _self.mobilCount1 = TIME_COUNT;
+                            _self.isMobileDisabled1 = true;
+                            _self.mobilTime1 = setInterval(function(){
+                                if (_self.mobilCount1 > 1 && _self.mobilCount1 <= TIME_COUNT) {
+                                    _self.mobilCount1--;
+                                    _self.mobileCodeText1 = _self.mobilCount1 +'s';
+                                } else {
+                                    _self.isMobileDisabled1 = false;
+                                    clearInterval(_self.mobilTime1);
+                                    _self.mobilTime1 = null;
+                                    _self.mobileCodeText1 = '获取验证码';
+                                }
+                            },1000)
+                        }
+                    }else{
+                        CAIMEI.Alert(response.msg,'确定',false);
+                        _self.isMobileDisabled1 = false;
+                    }
+                })
+            })
+        },
+        handleBindConfirm(){ //绑定运营人员
+            var _self = this;
+            if(this.isSubDisabled){ return }
+            if (this.loginLoading) { return false; }
+            if (!verifyForm()) {return false;}
             _self.loginLoading = true;
-            UserApi.BindOrganization(_self.user,function (response) {
+            UserApi.BindOrganization(_self.userParams,function (response) {
                 if(response.code === 0){
                     var _userIdentity = response.data.userIdentity;
                     CAIMEI.dialog('绑定成功!',true,function () {
@@ -80,9 +216,9 @@ var bindPage = new Vue({
                 if (!pass) { return false; }
                 PublicApi.getImgVerifyCode({platformType: 0},function(response){
                     if(response.code == 0){
-                        _self.imageCode = '';
+                        _self.bindCodeParams.imgCode = '';
                         _self.codeImagePath = response.data.baseImage;
-                        _self.codeImageToken = response.data.token;
+                        _self.bindCodeParams.token = response.data.token;
                         _self.isCodeModel = true;
                     }else{
                         CAIMEI.Alert(response.msg,'确定',false);
@@ -92,20 +228,18 @@ var bindPage = new Vue({
         },
         getMobileCodeFn:function(){//机构注册获取注册短信验证码
             var _self = this;
-            if(_self.imageCode == ''){
+            if(this.bindCodeParams.imgCode == ''){
                 CAIMEI.dialog('请输入图形验证码',false,function () {});
                 return
             }
-            var params = {
-                    mobile: _self.user.mobile,
-                    bindMobile: _self.user.mobileOrEmail,
-                    platformType:0,
-                    isCheckCaptcha:0,
-                    imgCode:_self.imageCode,
-                    token:_self.codeImageToken
-            };
+            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(params,function (response) {
+            UserApi.getNoteSMScode(this.bindCodeParams,function (response) {
                 if(response.code == 0){
                     _self.isCodeModel = false;
                     CAIMEI.dialog('验证短信已发送',false,function () {});

+ 148 - 91
src/main/resources/static/js/account/login.js

@@ -4,13 +4,12 @@ var loginPage = new Vue({
         maxtime:60,
         loginLoading: false,
         qrCodeLogin: false,
-        loginAccount: '',
-        loginPassword: '',
         rule:{
             account: "(^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$)|(^\\d{6,12}$)",
             password: "^[^\\u4e00-\\u9fa5]{6,30}$",
             phone: '^\\d{6,12}$',
             code: '^\\d{6}$',
+            mobile:'^1[1-9][0-9]{9}$'
         },
         userData: {
             account: '',
@@ -31,6 +30,17 @@ var loginPage = new Vue({
             shopId: '',
             token:'',
         },
+        accountParams: {// 账号密码登录
+            mobileOrEmail: '', //用户登录账号
+            password: '', //用户登录密码
+        },
+        codeParams:{// 验证码登录
+            mobile:'',
+            code:''
+        },
+        smsCodeParams:{// 获取手机短信验证码
+            mobile: '', //用户登录手机号
+        },
         isWeChat: false,
         text:'',
         stautsfalse:false,
@@ -41,42 +51,145 @@ var loginPage = new Vue({
         mobileCodeText:'获取验证码',
         mobilTime:null,
         isMobileDisabled:false,
-        codeParams:{
-            mobile:'',
-            smsCode:''
-        }
     },
     computed: {
 
     },
     methods: {
-        getMobileImage(){
-
-        },
         handleTabsClick(index){
             this.loginTabs = index;
+            clearAllErrorTxt($('input'));
         },
-        hideBg:function(){
+        handleHideBg(){
             this.stautsfalse=false;
         },
-        information:function(){
-            window.location.href='/supplier/information.html';
-            this.SetSoragesInfo( this.applyUse);
+        handleCodeMobileInput(e){// 监听输入手机号
+            this.codeParams.mobile = this.smsCodeParams.mobile = e.target.value;
+        },
+        handleSubLogin(){// 点击登录
+            if(this.loginTabs === 0){
+                this.userPasswordLogin();
+            }else{
+                this.userCodeLogin();
+            }
+        },
+        userCodeLogin(){// 短信验证码登录
+            var _self = this;
+            if (this.loginLoading) { return false; }
+            this.$nextTick(function(){
+                if (!verifyForm()) { return false; }
+                _self.loginLoading = true;
+                UserApi.userCodeLogin(_self.codeParams,function(response){
+                    _self.userUpdataeStatus(response)
+                });
+            });
+        },
+        userPasswordLogin(){// 账号登录
+            var _self = this;
+            if (this.loginLoading) { return false; }
+            this.$nextTick(function(){
+                if (!verifyForm()) { return false; }
+                _self.loginLoading = true;
+                UserApi.PostLoginAccount(_self.accountParams,function(response){
+                    _self.userUpdataeStatus(response)
+                });
+            });
+        },
+        userUpdataeStatus(response){// 更新登录
+            var _self = this;
+            _self.loginLoading = false;
+            if(response.code === 0){
+                _self.userData = {
+                    account: response.data.account,
+                    email: response.data.email,
+                    phone: response.data.bindMobile,
+                    name: response.data.name,
+                    userName: response.data.userName,
+                    userId: response.data.userId,
+                    spId: response.data.serviceProviderId,
+                    clubId: response.data.clubId,
+                    shopId: response.data.shopId,
+                    userIdentity: response.data.userIdentity,
+                    permission: response.data.userPermission,
+                    token: response.data.token,
+                    vipFlag: response.data.vipFlag,
+                    firstClubType: response.data.firstClubType,
+                    listingFee:response.data.listingFee
+                };
+                _self.setStorages( _self.userData);
+                // 登录成功页面跳转
+                var loginBeforePath = getBaseCookie("loginBeforePath");
+                if (loginBeforePath && loginBeforePath!='undefined' && loginBeforePath.indexOf('.html')>0) {
+                    delBaseCookie("loginBeforePath");
+                    window.location.href = loginBeforePath;
+                } else if (_self.userData.userIdentity*1 === 3) {
+                    location.href = '/supplier/dashboard.html';
+                } else if (_self.userData.userIdentity*1 === 2 || _self.userData.userIdentity*1 === 4) {
+                    location.href = '/user/dashboard.html';
+                } else {
+                    location.href="/index.html";
+                }
+            } else if(response.code == '-3'){//审核未通过
+                _self.text =response.msg;
+                _self.stautsfalse = true;
+                _self.infofalse = true;
+                _self.applyUse = {
+                    userId: response.data.userId,
+                    shopId: response.data.shopId,
+                    token: response.data.token
+                };
+            }else if(response.code == '-2'){
+                _self.stautsfalse = true;
+                _self.text =response.msg;
+            }else {// 登录失败
+                CAIMEI.Alert(response.msg,'确定',false);
+            }
+        },
+        handleMobileCode(){// 点击获取短信验证码
+            var _self = this;
+            if( this.isMobileDisabled){ return }
+            this.$nextTick(function() {
+                if (!verifyCheack('.massageBtn')) { return false; }
+                UserApi.userOperateCode(_self.smsCodeParams,function (response) {
+                    if(response.code == 0){
+                        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{
+                        CAIMEI.Alert(response.msg,'确定',false);
+                        _self.isMobileDisabled = false;
+                    }
+                })
+            })
         },
-        toQrCodeLogin: function(){//切换微信登录二维码
+        toQrCodeLogin(){//切换微信登录二维码
             var _self = this;
             var timeClock = null;
             this.qrCodeLogin = true;
             UserApi.ToWechatLogin({},function(response){
                 var wxLogin = new WxLogin({
-                        self_redirect: true,
-                        id: "qrCodeWrap",
-                        appid: response.data.appId,
-                        scope: 'snsapi_login',
-                        redirect_uri: response.data.redirectUri,
-                        state: response.data.state,
-                        style: "black",
-                        href: "https://www.caimei365.com/css/base/base.pc.css"
+                    self_redirect: true,
+                    id: "qrCodeWrap",
+                    appid: response.data.appId,
+                    scope: 'snsapi_login',
+                    redirect_uri: response.data.redirectUri,
+                    state: response.data.state,
+                    style: "black",
+                    href: "https://www.caimei365.com/css/base/base.pc.css"
                 });
                 timeClock = setInterval(function(){
                     _self.maxtime--;
@@ -87,7 +200,7 @@ var loginPage = new Vue({
                 _self.getWrchatStatusData({state:response.data.state})
             });
         },
-        getWrchatStatusData:function(params){//轮询查询用户是否扫描过二维码登录
+        getWrchatStatusData(params){//轮询查询用户是否扫描过二维码登录
             var _self = this;
             var timer = null;
             UserApi.ToWechatPolling(params,function(response){
@@ -174,13 +287,13 @@ var loginPage = new Vue({
                         _self.stautsfalse = true;
                         _self.text ='您的供应商账号正在加速审核中,审核通过后即可登录';
                     }else{
-                         CAIMEI.Alert(response.msg,'确定',false);
+                        CAIMEI.Alert(response.msg,'确定',false);
                     }
                 }
             });
         },
-        // 微信公众号授权登录
-        weChatLogin: function(){
+        handleWeChatLogin(){
+            // 微信公众号授权登录
             if (this.isWeChat) {
                 // 微信浏览器自动授权登录
                 var urlForWeChat = 'https://www.caimei365.com/we_chat/redirect_uri.html';
@@ -192,10 +305,10 @@ var loginPage = new Vue({
                 });
             }
         },
-        toNormalLogin: function(){
+        toNormalLogin(){
             this.qrCodeLogin = false;
         },
-        showPassword: function(event) {
+        showPassword(event) {
             var el = event.currentTarget;
             var pwdEle = $(el).siblings('input');
             if(pwdEle.attr('type') === 'password') {
@@ -206,75 +319,19 @@ var loginPage = new Vue({
                 pwdEle.attr('type','password');
             }
         },
-        blurHandle: function(event) {  // 失去焦点校验
+        blurHandle(event) {  // 失去焦点校验
             var el = event.currentTarget;
             verifyHandle(el);
         },
-        loginSubmit: function () {  // 账号登录
-            var _self = this;
-            var pass = verifyForm();
-            if (this.loginLoading) { return false; }
-            this.$nextTick(function(){
-                if (!pass) { return false; }
-                _self.loginLoading = true;
-                var params =  {mobileOrEmail: _self.loginAccount,password: _self.loginPassword};
-                UserApi.PostLoginAccount(params,function(response){
-                    _self.loginLoading = false;
-                    if(response.code === 0){
-                        console.log(response);
-                        _self.userData = {
-                            account: response.data.account,
-                            email: response.data.email,
-                            phone: response.data.bindMobile,
-                            name: response.data.name,
-                            userName: response.data.userName,
-                            userId: response.data.userId,
-                            spId: response.data.serviceProviderId,
-                            clubId: response.data.clubId,
-                            shopId: response.data.shopId,
-                            userIdentity: response.data.userIdentity,
-                            permission: response.data.userPermission,
-                            token: response.data.token,
-                            vipFlag: response.data.vipFlag,
-                            firstClubType: response.data.firstClubType,
-                            listingFee:response.data.listingFee
-                        };
-                        _self.setStorages( _self.userData);
-                        // 登录成功页面跳转
-                        var loginBeforePath = getBaseCookie("loginBeforePath");
-                        if (loginBeforePath && loginBeforePath!='undefined' && loginBeforePath.indexOf('.html')>0) {
-                            delBaseCookie("loginBeforePath");
-                            window.location.href = loginBeforePath;
-                        } else if (_self.userData.userIdentity*1 === 3) {
-                            location.href = '/supplier/dashboard.html';
-                        } else if (_self.userData.userIdentity*1 === 2 || _self.userData.userIdentity*1 === 4) {
-                            location.href = '/user/dashboard.html';
-                        } else {
-                            location.href="/index.html";
-                        }
-                    } else if(response.code == '-3'){//审核未通过
-                        _self.text =response.msg;
-                        _self.stautsfalse = true;
-                        _self.infofalse = true;
-                        _self.applyUse = {
-                            userId: response.data.userId,
-                            shopId: response.data.shopId,
-                            token: response.data.token
-                        };
-                    }else if(response.code == '-2'){
-                        _self.stautsfalse = true;
-                        _self.text =response.msg;
-                    }else {// 登录失败
-                        CAIMEI.Alert(response.msg,'确定',false);
-                    }
-                });
-            });
-        },
-        SetSoragesInfo:function(data){
+        SetSoragesInfo(data){
             localStorage.setItem('APPLY_INFO',JSON.stringify(data));
         },
-        setStorages:function(data){//存储本地数据
+        setStorages(data){//存储本地数据
             localStorage.setItem('userInfo',JSON.stringify(data));
+        },
+        information(){
+            window.location.href='/supplier/information.html';
+            this.SetSoragesInfo( this.applyUse);
         }
     },
     created: function () {

+ 4 - 0
src/main/resources/static/js/base.js

@@ -810,6 +810,10 @@ function clearErrorTxt(obj) {
     $(obj).siblings('.errTips').removeClass("show");
     $(obj).parent().removeClass("error").find('.checked').addClass("show");
 }
+function clearAllErrorTxt(obj) {
+    $(obj).siblings('.errTips').removeClass("show");
+    $(obj).parent().removeClass("error");
+}
 // 提交时验证表单
 function verifyForm() {
     $("[needverify]:visible").each(function (index, ele) {

+ 48 - 0
src/main/resources/static/js/common/serviceapi/user.service.js

@@ -16,6 +16,54 @@ var UserApi = {
                 callback(res)
             });
         },
+        userCodeLogin : function (params,callback) {//短信验证码登录
+            Http.AjaxService({
+                url:'/user/login/codeLogin',
+                type:'post',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res)
+            });
+        },
+        userLoginCode : function (params,callback) {//获取登录短信验证码
+            Http.AjaxService({
+                url:'/user/login/code',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res)
+            });
+        },
+        userOperateCode : function (params,callback) {//获取绑定运营人员手机短信验证码
+            Http.AjaxService({
+                url:'/user/operate/code',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res)
+            });
+        },
+        userLoginVerification : function (params,callback) {//绑定运营人员校验手机验证码
+            Http.AjaxService({
+                url:'/user/login/verification',
+                type:'post',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res)
+            });
+        },
         ToWechatLogin : function (params,callback) {//获取扫码登录参数
             Http.AjaxService({
                 url:'/user/login/auth/parameters',

+ 72 - 37
src/main/resources/templates/account/bind.html

@@ -21,42 +21,77 @@
         </div>
         <div class="registerClub clear">
             <form>
-                <div class="title">公司账号</div>
-                <div class="formLine">
-                    <p><em>*</em>账号:</p>
-                    <input class="mobileOrEmail" type="text" v-model.trim="user.mobileOrEmail" placeholder="请输入邮箱/手机号" :rule="rule.mobileOrEmail" maxlength="50" @blur="blurHandle($event)" needverify>
-                    <i class="checked icon mIcon"></i>
-                    <span class="errTips icon mIcon" tips="请输入邮箱/手机号"></span>
-                </div>
-                <div class="formLine">
-                    <p><em>*</em>登录密码:</p>
-                    <input type="password" v-model.trim="user.password" autocomplete="new-password" placeholder="请输入8-16位数字和字母组合" :rule="rule.password" maxlength="32" @blur="blurHandle($event)" needverify>
-                    <i class="checked icon mIcon"></i>
-                    <span class="errTips icon mIcon" tips="8-16位数字或字母或字符"></span>
-                </div>
-                <div class="title">运营人员信息</div>
-                <div class="formLine">
-                    <p><em>*</em>姓名:</p>
-                    <input type="text" v-model.trim="user.linkName" placeholder="请输入真实姓名" :rule="rule.name" maxlength="50" @blur="blurHandle($event)" needverify>
-                    <i class="checked icon mIcon"></i>
-                    <span class="errTips icon mIcon" tips="请输入正确的联系人姓名"></span>
-                </div>
-                <div class="formLine" >
-                    <p><em>*</em>手机号:</p>
-                    <input  class="massageBtn"  type="text" v-model.trim="user.mobile" placeholder="请输入您的常用手机号" :rule="rule.phone" maxlength="11" @blur="blurHandle($event)" needverify>
-                    <i class="checked icon mIcon"></i>
-                    <span class="errTips icon mIcon" tips="请输入有效电话号码"></span>
-                </div>
-                <div class="formLine code">
-                    <p><em>*</em>短信验证码:</p>
-                    <input type="text" v-model.trim="user.smsCode" autocomplete="off" placeholder="请输入短信验证码" :rule="rule.code"  maxlength="6" @blur="blurHandle($event)" needverify>
-                    <i class="checked icon mIcon"></i>
-                    <span class="errTips icon mIcon" tips="请输入有效短信验证码"></span>
-                    <a class="getCode" href="javascript:void(0);" @click="getMobileImage" :class="[isMobileDisabled  ? 'disabled' : '']">{{ mobileCodeText }}</a>
-                </div>
-                <div class="subLine">
-                    <button class="btn" type="button" :class="loginLoading ? 'disabled':''"  @click="BindConfirmFn()">提交</button>
+                <div class="form-step">
+                    <span class="step one active">1</span>
+                    <span class="step two" :class="activeNum == 1 ? 'active':''">2</span>
                 </div>
+                <template v-if="activeNum === 0">
+                    <div class="title">确认公司账号</div>
+                    <div class="formLine-tabs">
+                        <a class="tabs-item" :class="{ current: loginTabs === 0 }" href="javascript:void(0);" @click="handleTabsClick(0)">账号密码确认</a>
+                        <a class="tabs-item" :class="{ current: loginTabs === 1 }" href="javascript:void(0);" @click="handleTabsClick(1)">验证码确认</a>
+                    </div>
+                    <template v-if="loginTabs === 0">
+                        <div class="formLine">
+                            <p><em>*</em>账号:</p>
+                            <input class="mobileOrEmail" type="text" autocomplete="off" v-model.trim="userParams.mobileOrEmail" placeholder="请输入邮箱/手机号" @input="handleInputMobileOrEmail" :rule="rule.mobileOrEmail" maxlength="50" @blur="blurHandle($event)" needverify>
+                            <i class="checked icon mIcon"></i>
+                            <span class="errTips icon mIcon" tips="请输入邮箱/手机号"></span>
+                        </div>
+                        <div class="formLine">
+                            <p><em>*</em>登录密码:</p>
+                            <input type="password" v-model.trim="userParams.password" autocomplete="new-password" placeholder="请输入8-16位数字和字母组合" @input="handleInputPassword" :rule="rule.password" maxlength="32" @blur="blurHandle($event)" needverify>
+                            <i class="checked icon mIcon"></i>
+                            <span class="errTips icon mIcon" tips="8-16位数字或字母或字符"></span>
+                        </div>
+                        <div class="subLine">
+                            <button class="btn" type="button" :class="isDisabled ? 'disabled' : ''"  @click="handleStepNext">下一步</button>
+                        </div>
+                    </template>
+                    <template v-if="loginTabs === 1">
+                        <div class="formLine" >
+                            <p><em>*</em>手机号:</p>
+                            <input  class="codeParamsMobile"  type="text" autocomplete="off" v-model.trim="codeParams.mobile" placeholder="请输入已注册的手机号" @input="handleInputPhone" :rule="rule.mobile" maxlength="11" @blur="blurHandle($event)" needverify>
+                            <i class="checked icon mIcon"></i>
+                            <span class="errTips icon mIcon" tips="请输入正确格式的手机号"></span>
+                        </div>
+                        <div class="formLine">
+                            <p><em>*</em>验证码:</p>
+                            <input type="text" class="smscode" v-model.trim="codeParams.code" autocomplete="off" placeholder="请输入短信验证码" @input="handleInputSmsCode" :rule="rule.code"  maxlength="6" @blur="blurHandle($event)" needverify>
+                            <i class="checked icon mIcon"></i>
+                            <span class="errTips icon mIcon" tips="请输入短信验证码"></span>
+                            <a class="code-btn" href="javascript:void(0);" @click="handleMobileCode" :class="[isMobileDisabled1  ? 'disabled' : '']">{{ mobileCodeText1 }}</a>
+                        </div>
+                        <div class="subLine">
+                            <button class="btn" type="button" :class="isDisabled ? 'disabled' : ''"  @click="handleStepNext">下一步</button>
+                        </div>
+                    </template>
+                </template>
+                <template v-if="activeNum === 1">
+                    <div class="title">填写运营人员信息</div>
+                    <div class="formLine">
+                        <p><em>*</em>姓名:</p>
+                        <input type="text" v-model.trim="userParams.linkName" @input="handleInputLinkName" placeholder="请输入真实姓名" :rule="rule.name" maxlength="50" @blur="blurHandle($event)" needverify>
+                        <i class="checked icon mIcon"></i>
+                        <span class="errTips icon mIcon" tips="请输入正确的联系人姓名"></span>
+                    </div>
+                    <div class="formLine" >
+                        <p><em>*</em>手机号:</p>
+                        <input  class="massageBtn"  type="text" autocomplete="off" @input="handleInputMobile" v-model.trim="userParams.mobile" placeholder="请输入您的常用手机号" :rule="rule.phone" maxlength="11" @blur="blurHandle($event)" needverify>
+                        <i class="checked icon mIcon"></i>
+                        <span class="errTips icon mIcon" tips="请输入有效电话号码"></span>
+                    </div>
+                    <div class="formLine">
+                        <p><em>*</em>短信验证码:</p>
+                        <input class="smscode" type="text" v-model.trim="userParams.smsCode" @input="handleInputSmsCodee"  placeholder="请输入短信验证码" :rule="rule.code"  maxlength="6" @blur="blurHandle($event)" needverify>
+                        <i class="checked icon mIcon"></i>
+                        <span class="errTips icon mIcon" tips="请输入有效短信验证码"></span>
+                        <a class="code-btn" href="javascript:void(0);" @click="getMobileImage" :class="[isMobileDisabled  ? 'disabled' : '']">{{ mobileCodeText }}</a>
+                    </div>
+                    <div class="subLine">
+                        <button class="btn" type="button" :class="isSubDisabled ? 'disabled':''"  @click="handleBindConfirm">提交</button>
+                    </div>
+                </template>
             </form>
         </div>
     </div>
@@ -65,7 +100,7 @@
             <div class="model-title"><p>获取短信验证码</p><i class="icon mIcon icon-close"  @click="closeCodeModel"></i></div>
             <div class="model-content">
                 <div class="model-form">
-                    <input class="input" type="text" placeholder="请输入图形验证码" v-model="imageCode" maxlength="4">
+                    <input class="input" type="text" placeholder="请输入图形验证码" v-model="bindCodeParams.imgCode" maxlength="4">
                     <div class="image"><img :src="codeImagePath" alt=""></div>
                     <div class="refresh" @click="refreshCodeImage">
                         <i class="icon mIcon"></i>
@@ -80,7 +115,7 @@
     </div>
 </div>
 <!-- 引入底部 -->
-<template th:replace="components/footer"></template>
+<template th:replace="article/components/article-footer"></template>
 <template th:replace="components/foot-link"></template>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/user.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/account/bind.js(v=${version})}"></script>

+ 10 - 10
src/main/resources/templates/account/login.html

@@ -30,12 +30,12 @@
                 </div>
                 <template v-if="loginTabs === 0">
                     <div class="formLine">
-                        <input type="text" v-model.trim="loginAccount" placeholder="请输入邮箱或手机号" :rule="rule.account" maxlength="30" @blur="blurHandle($event)" needverify>
+                        <input type="text" v-model.trim="accountParams.mobileOrEmail" placeholder="请输入邮箱或手机号" :rule="rule.account" maxlength="30" @blur="blurHandle($event)" needverify>
                         <i class="checked icon mIcon"></i>
                         <span class="errTips icon mIcon" tips="请提供正确的邮箱或手机号码"></span>
                     </div>
                     <div class="formLine">
-                        <input type="password" v-model.trim="loginPassword" placeholder="请输入密码" :rule="rule.password" maxlength="30" @blur="blurHandle($event)" needverify>
+                        <input type="password" v-model.trim="accountParams.password" placeholder="请输入密码" :rule="rule.password" maxlength="30" @blur="blurHandle($event)" needverify>
                         <i class="checked icon mIcon"></i>
                         <span class="errTips icon mIcon" tips="请输入正确的密码"></span>
                         <i class="icon showPwd" @click="showPassword($event)"></i>
@@ -43,21 +43,21 @@
                 </template>
                 <template v-if="loginTabs === 1">
                     <div class="formLine" >
-                        <input  class="massageBtn"  type="text" v-model.trim="codeParams.mobile" placeholder="请输入手机号码" :rule="rule.phone" maxlength="11" @blur="blurHandle($event)" needverify>
+                        <input  class="massageBtn"  type="text" @input="handleCodeMobileInput" v-model.trim="codeParams.mobile" placeholder="请输入手机号码" :rule="rule.mobile" maxlength="11" @blur="blurHandle($event)" needverify>
                         <i class="checked icon mIcon"></i>
-                        <span class="errTips icon mIcon" tips="请提供正确的邮箱或手机号码"></span>
+                        <span class="errTips icon mIcon" tips="请输入正确格式的手机号"></span>
                     </div>
                     <div class="formLine">
-                        <input type="text" class="smscode" v-model.trim="codeParams.smsCode" autocomplete="off" placeholder="请输入短信验证码" :rule="rule.code"  maxlength="6" @blur="blurHandle($event)" needverify>
+                        <input type="text" class="smscode" v-model.trim="codeParams.code" autocomplete="off" placeholder="请输入短信验证码" :rule="rule.code"  maxlength="6" @blur="blurHandle($event)" needverify>
                         <i class="checked icon mIcon"></i>
-                        <span class="errTips icon mIcon" tips="请提供正确的邮箱或手机号码"></span>
-                        <a class="code-btn" href="javascript:void(0);" @click="getMobileImage" :class="[isMobileDisabled  ? 'disabled' : '']">{{ mobileCodeText }}</a>
+                        <span class="errTips icon mIcon" tips="请输入短信验证码"></span>
+                        <a class="code-btn" href="javascript:void(0);" @click="handleMobileCode" :class="[isMobileDisabled  ? 'disabled' : '']">{{ mobileCodeText }}</a>
                     </div>
                 </template>
                 <!-- 滑动验证 -->
                 <div class="verify-wrap" id="verify-wrap"></div>
                 <div class="submit clear">
-                    <button class="btn" type="button" @click="loginSubmit()" :disabled="isSlideFinishState" :class="[isSlideFinishState ?'disabled':'']">登录</button>
+                    <button class="btn" type="button" @click="handleSubLogin" :disabled="isSlideFinishState" :class="[isSlideFinishState ?'disabled':'']">登录</button>
                 </div>
                 <div class="forget">
                     <a class="btn" href="/register.html" rel="nofollow" onclick="_czc.push(['_trackEvent','登录页面','注册','点击','','Um_Event_Regirster'])">免费注册</a>
@@ -68,7 +68,7 @@
                         <span>第三方登录</span>
                     </div>
                     <div class="submit clear">
-                        <a class="weChat" @click="weChatLogin" href="javascript:void(0);">
+                        <a class="weChat" @click="handleWeChatLogin" href="javascript:void(0);">
                             <i class="mIcon"></i>
                         </a>
                     </div>
@@ -93,7 +93,7 @@
     </div>
     <div class="bg" v-if="stautsfalse" :style="stautsfalse?'opacity:1':''">
         <div class="bg-content">
-            <div class="bg-tittle"><p>提示</p><p class="icon mIcon" @click="hideBg"></p></div>
+            <div class="bg-tittle"><p>提示</p><p class="icon mIcon" @click="handleHideBg"></p></div>
             <div class="text-conten">
                 <p class="status">{{text}}</p>
                 <p class="tip-p">联系电话:0755-22907771</p>