Parcourir la source

隐藏好友排行

smallqiang il y a 5 ans
Parent
commit
7e3b2e8d6d
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  1. 9 1
      assets/scripts/rank/GameRank.js

+ 9 - 1
assets/scripts/rank/GameRank.js

@@ -88,6 +88,9 @@ cc.Class({
 
     init(index = 0) {
         this.tabIndex = index;
+        if (window.tt != undefined) {
+            this.tabIndex = 1;
+        }
         this._initTab();
     },
 
@@ -96,7 +99,7 @@ cc.Class({
     },
 
     onDestroy() {
-        if (window.wx != undefined) {
+        if (CC_WECHATGAME && window.tt == undefined) {
             window.wx.postMessage({
                 messageType: 4
             });
@@ -116,6 +119,11 @@ cc.Class({
         for(let i = 0; i < this.rankTab.length; i++) {
             this.rankTab[i] = this.rankTab[i].getComponent('GameTab');
             this.rankTab[i].init();
+            if (window.tt != undefined) {
+                if (i == 0 || i == 2) {
+                    this.rankTab[i].node.active = false;
+                }
+            }
         }
         this.handleTab(null, this.tabIndex);
     },