Эх сурвалжийг харах

feat: 微信登录限制app版本号2

zhangyuhan 3 сар өмнө
parent
commit
571a0c06a7

+ 30 - 14
src/jfw/modules/app/src/web/staticres/jyapp/me/js/account.js

@@ -31,7 +31,23 @@ var account = {
                     if(r.data.showWxBind) {
                         // 手机号用户
                         $('#wxInfo').hide();
-                        $('#bindWX').show();
+                        // 判断APP版本
+                        // 如果app版本号大于等于3.1.2则展示
+                        var currentVersion = ''
+                        var targetVersion = '3.1.2'
+                        try {
+                          currentVersion = JyObj.getVersion()
+                          if (currentVersion) {
+                            var c = compareVersion(currentVersion, targetVersion)
+                            this.fastButtonShow(!c)
+                            if (c) {
+                              $('#bindWX').show();
+                            }
+                          }
+                        } catch (error) {
+                          console.log(error)
+                        }
+
                         $('#bindPhone').show();
                         $('#phoneInfo').hide();
                     } else {
@@ -167,7 +183,7 @@ var account = {
                                             }
                                         });
                                     }else{
-                                        weui.toast(r.error_msg,{ 
+                                        weui.toast(r.error_msg,{
                                             duration: 2000,
                                             className: 'j-toast',
                                         });
@@ -244,7 +260,7 @@ function loginByWeixinCallBack(wxSign) {
                     }
                 }
             } else {
-                weui.toast('您选择的微信号已被绑定,请更换后重试',{ 
+                weui.toast('您选择的微信号已被绑定,请更换后重试',{
                     duration: 2000,
                     className: 'j-toast',
                 });
@@ -252,23 +268,23 @@ function loginByWeixinCallBack(wxSign) {
         },
         error: function(){
             loading.hide()
-            weui.toast('登录超时',{ 
+            weui.toast('登录超时',{
                 duration: 2000,
                 className: 'j-toast',
             });
         }
     });
 }
-$(function () {   
+$(function () {
     var u = navigator.userAgent;
     var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
-    var isPageHide = false;   
-    window.addEventListener('pageshow', function () {   
-        if (isPageHide && isiOS) {   
-        window.location.reload();   
-        }   
-    });   
-    window.addEventListener('pagehide', function () {   
-        isPageHide = true;   
+    var isPageHide = false;
+    window.addEventListener('pageshow', function () {
+        if (isPageHide && isiOS) {
+        window.location.reload();
+        }
+    });
+    window.addEventListener('pagehide', function () {
+        isPageHide = true;
     });
-}) 
+})

+ 1 - 1
src/jfw/modules/app/src/web/templates/me/account.html

@@ -77,7 +77,7 @@
                             </div>
                             <i class="van-icon van-icon-arrow van-cell__right-icon"></i>
                         </div>
-                        <div role="button" class="van-cell van-cell--clickable van-cell--center" id="bindWX">
+                        <div role="button" class="van-cell van-cell--clickable van-cell--center" id="bindWX" style="display: none">
                             <div class="weixin">
                                 <span class="wx-img"></span>
                             </div>

+ 1 - 1
src/jfw/modules/app/src/web/templates/me/login.html

@@ -195,7 +195,7 @@
 	    <div class="footer-container">
         <div class="third-and-fast-login-container">
             <div class="fast-login-item">
-              <a href="javascript:void(0)" class="fast-login-open-link" style="display: none;">本机号码一键登录</a>
+              <a href="javascript:void(0)" class="fast-login-open-link no-right-line" style="display: none;">本机号码一键登录</a>
             </div>
             <div class="fast-login-item wx" style="display: none;">
               <div class=" third_wx">