Browse Source

商城兑换礼包没有物品时不显示

huangxiaoyue 1 year ago
parent
commit
ca06500791

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Data/ShopDataManager.cs

@@ -351,9 +351,9 @@ namespace GFGGame
         /// <summary>
         /// 返回活动商城是否显示
         /// /// </summary>
-        public bool GetShopActivityIsShow(int menuType)
+        public bool GetShopActivityIsShow(int shopType,int menuType)
         {
-            List<ShopCfg> shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, menuType);
+            List<ShopCfg> shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(shopType, menuType);
             if (ShopDataManager.Instance.RemoveNotOpenCfg(shopCfgs).Count == 0)
                 return false;
             else

+ 21 - 3
GameClient/Assets/Game/HotUpdate/Views/Store/StoreView.cs

@@ -78,7 +78,11 @@ namespace GFGGame
             _ui.m_comTab.target.scrollPane.SetPercX((float)(_curTabIndex - 1) / (float)StoreTabCfgArray.Instance.dataArray.Length, false);
 
             _curSubTabIndex = this.viewData == null ? 0 : (int)(this.viewData as object[])[1];
-            if (_curTabIndex == ConstStoreTabId.STORE_GIFT_BAG && _curSubTabIndex > 0 && !ShopDataManager.Instance.GetShopActivityIsShow(ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY)) {
+            if (_curTabIndex == ConstStoreTabId.STORE_GIFT_BAG && _curSubTabIndex > 0 && !ShopDataManager.Instance.GetShopActivityIsShow(ConstStoreTabId.STORE_GIFT_BAG,ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY)) {
+                _curSubTabIndex -= 1;
+            }
+            if (_curTabIndex == ConstStoreTabId.STORE_EXCHANGE && _curSubTabIndex > 0 && !ShopDataManager.Instance.GetShopActivityIsShow(ConstStoreTabId.STORE_EXCHANGE,ConstStoreSubId.STORE_ACTIVITY_EXCHANGE))
+            {
                 _curSubTabIndex -= 1;
             }
             if (_ui.m_listSubTab.numItems > _curSubTabIndex)
@@ -139,7 +143,19 @@ namespace GFGGame
                         int menu2 = int.Parse(tabCfg.subTabArr[i][1]);
                         if (menu2 == ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY)
                         {
-                            if (!ShopDataManager.Instance.GetShopActivityIsShow(menu2)) continue;
+                            if (!ShopDataManager.Instance.GetShopActivityIsShow(tabCfg.index,menu2)) continue;
+                        }
+                        _storeTabCfgs.Add(tabCfg.subTabArr[i]);
+                    }
+                }
+                else if (tabCfg.index == ConstStoreTabId.STORE_EXCHANGE)
+                {
+                    for (int i = 0; i < tabCfg.subTabArr.Length; i++)
+                    {
+                        int menu2 = int.Parse(tabCfg.subTabArr[i][1]);
+                        if (menu2 == ConstStoreSubId.STORE_ACTIVITY_EXCHANGE)
+                        {
+                            if (!ShopDataManager.Instance.GetShopActivityIsShow(tabCfg.index, menu2)) continue;
                         }
                         _storeTabCfgs.Add(tabCfg.subTabArr[i]);
                     }
@@ -234,7 +250,9 @@ namespace GFGGame
                 RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY).asCom,RedDotDataManager.Instance.GetGiftBagRewardRed());
 
                 int needSub = 0;
-                if (!ShopDataManager.Instance.GetShopActivityIsShow(ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY))
+                if (!ShopDataManager.Instance.GetShopActivityIsShow(ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY))
+                    needSub = 1;
+                if (!ShopDataManager.Instance.GetShopActivityIsShow(ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_ACTIVITY_EXCHANGE))
                     needSub = 1;
 
                 RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_GIFT_BAG_REBATE - needSub).asCom,RedDotDataManager.Instance.GetGiftBagRebateRed());