Jelajahi Sumber

微信登录3

chao 4 tahun lalu
induk
melakukan
dbd41f26e6

+ 7 - 10
src/main/resources/static/css/account/login.css

@@ -46,6 +46,7 @@ footer .footTop{display:none;}
 @media screen and (max-width:768px){
 body{background:#FFF}
 footer{display:none}
+.loginForm .showPwd{display:none;}
 .loginForm{padding-top:4vw;text-align:center;background:#FFF url(/img/account/login_m.png) no-repeat center 25vw;background-size:57vw 43.2vw}
 .loginForm h1{color:#22272e;font-size:6.4vw;font-weight:bold;line-height:10vw}
 .loginForm h2{font-size:3.1vw;font-weight:normal;line-height:5.4vw;color:#627386}
@@ -54,17 +55,13 @@ footer{display:none}
 .loginForm input{height:11.2vw;line-height:6vw;padding: 2.6vw 0;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}
-.loginForm .submit .btn,.loginForm .submit .weChat{display:inline-block;box-sizing:border-box;width:100%;height:11.2vw;line-height:11.2vw;background-color:#ffe6dc;border-radius:2px;border:solid 1px #e15616;text-align:center;color:#e15616;font-size:3.4vw;margin-bottom:4.8vw}
-.loginForm .submit button.btn{background-color:#e15616;color:#FFF;margin-bottom:4.8vw}
-.loginForm .showPwd{display:none;}
+.loginForm .submit{line-height:11.2vw;font-size:3.4vw;text-align:center;color:#22272e;}
+.loginForm .submit .btn{display:inline-block;box-sizing:border-box;width:100%;height:11.2vw;border:solid 1px #b8bfca;border-radius:2px;margin-bottom:4.8vw}
+.loginForm .submit button.btn{border-color:#e15616;background:#e15616;color:#FFF;}
+.loginForm .submit .weChat{display:block;margin:6vw auto;width:50vw;color:#627386;line-height:8vw}
+.loginForm .submit .weChat span{display:inline-block;width:100%}
+.loginForm .submit .weChat .mIcon:before{width:12vw;height:12vw;background-position:0 -77.8vw}
 
-.loginForm .submit .weChat{
-    background: #00bc0c;
-    border-color: #00bc0c;
-    text-align:center;
-    overflow: hidden;
-}
-.loginForm .submit .weChat img{height:100%}
 
 
 }

TEMPAT SAMPAH
src/main/resources/static/img/base/icon_m.png


+ 0 - 12
src/main/resources/static/js/account/login.js

@@ -121,18 +121,6 @@ var loginPage = new Vue({
                 });
             }
         },
-        /*weChatAutoLogin: function(){
-            if (this.isWeChat && Number(getBaseCookie("weChatAutoLogin"))!==1) {
-                // 微信浏览器自动授权登录
-                var urlForWeChat = 'https://www.caimei365.com/we_chat/redirect_uri.html';
-                $.get(spiServer+'/user/authorizationLink?redirectUri='+urlForWeChat, function(r){
-                    if(r.code===0 && r.data){
-                        setBaseCookie("weChatAutoLogin", 1);
-                        window.location.href = r.data;
-                    }
-                });
-            }
-        },*/
         toNormalLogin: function(){
             this.qrCodeLogin = false;
         },

+ 2 - 2
src/main/resources/static/js/base.js

@@ -12,7 +12,8 @@ if(localStorage.getItem('userInfo')){
     GLOBAL_USER_IDENTITY = globalUserData.userIdentity*1;
     GLOBAL_SHOP_ID = globalUserData.shopId*1;
 } else {
-    if(Number(getBaseCookie("weChatAutoLogin"))!==1){
+    var weChatLoginFlag = (Number(getBaseCookie("weChatAutoLogin"))===1 || Number(getBaseCookie("weChatAutoLogin"))===2);
+    if(!weChatLoginFlag){
         var userAgent = navigator.userAgent.toLowerCase();
         if (userAgent.match(/MicroMessenger/i)) {
             // 微信浏览器自动授权登录
@@ -571,7 +572,6 @@ function setProductPrice(productList, productIds, userId, callback){
                     }
                 });
             });
-            console.log(productList)
         }
         return callback();
     }).fail(function(){

+ 3 - 1
src/main/resources/templates/account/login.html

@@ -38,7 +38,9 @@
                     <a v-if="isPC" class="btn" href="/register.html">免费注册</a>
                     <button class="btn" type="button" @click="loginSubmit()">登录</button>
                     <a v-if="!isPC" class="btn" href="/register.html">免费注册</a>
-                    <a v-if="!isPC" class="weChat" @click="weChatLogin()" href="javascript:void(0);"><img src="/img/base/wechat_login.png" alt="微信公众号授权登录"></a>
+                    <a v-if="!isPC" class="weChat" @click="weChatLogin()" href="javascript:void(0);">
+                        <span>微信授权登录</span><i class="mIcon"></i>
+                    </a>
                 </div>
                 <a v-if="isPC" href="javascript:void(0);" class="codeBtn icon" @click="toQrCodeLogin()"></a>
             </form>