Browse Source

隐藏好友排行

smallqiang 5 years ago
parent
commit
7e3b2e8d6d
1 changed files with 9 additions and 1 deletions
  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);
     },