zhaoyang 2 жил өмнө
parent
commit
81286fe81b

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

@@ -107,14 +107,16 @@ namespace GFGGame
         //移除未上架商品
         public List<ShopCfg> RemoveNotOpenCfg(List<ShopCfg> shop)
         {
+            List<ShopCfg> shopCfgs = new List<ShopCfg>();
             for (int i = shop.Count - 1; i >= 0; i--)
             {
                 if (!string.IsNullOrEmpty(shop[i].startTime) && !TimeUtil.IsBeforeCurTime(shop[i].startTime) || !string.IsNullOrEmpty(shop[i].endTime) && !TimeUtil.IsLaterCurTime(shop[i].endTime))
                 {
-                    shop.RemoveAt(i);
+                    continue;
                 }
+                shopCfgs.Add(shop[i]);
             }
-            return shop;
+            return shopCfgs;
         }
         //商品排序
         public List<ShopCfg> SortShopGoodsCfgs(List<ShopCfg> shopCfgs)

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

@@ -14,6 +14,8 @@ namespace GFGGame
         private UI_StoreUI _ui;
         // private ValueBarController _valueBarController;
         private List<List<string>> _arenaSubTab = new List<List<string>>();
+
+        private List<string[]> _storeTabCfgs = new List<string[]>();
         private int _curTabIndex = 0;
         private int _curSubTabIndex = 0;
         private string _curViewName = "";
@@ -38,19 +40,14 @@ namespace GFGGame
             isfullScreen = true;
             this.bringToFontOnClick = false;
 
-            StoreTabCfg charge = StoreTabCfgArray.Instance.GetCfgByfunctionId(ConstFunctionId.STORE_CHARGE);
-            Debug.Log("charge[0]" + charge.subTabArr[0][0]);
-            Debug.Log("charge[0]" + charge.subTabArr[0][1]);
-            Debug.Log("charge[0]" + charge.subTabArr[0][2]);
-            Debug.Log("charge[1]" + charge.subTabArr[1][0]);
-            Debug.Log("charge[1]" + charge.subTabArr[1][1]);
-            Debug.Log("charge[1]" + charge.subTabArr[1][2]);
-            StoreTabCfg arenaTab = StoreTabCfgArray.Instance.GetCfgByfunctionId(ConstFunctionId.STORE_ARENA);
-            _arenaSubTab.Add(new List<string>() { arenaTab.subTabArr[0][0], arenaTab.subTabArr[0][1], arenaTab.subTabArr[0][2] });
-            for (int i = ArenaDataManager.Instance.SeasonId; i > 0; i--)
-            {
-                _arenaSubTab.Add(new List<string>() { string.Format("第{0}赛季", i), i.ToString(), "StoreArenaView" });
-            }
+            // StoreTabCfg charge = StoreTabCfgArray.Instance.GetCfgByfunctionId(ConstFunctionId.STORE_CHARGE);
+            // Debug.Log("charge[0]" + charge.subTabArr[0][0]);
+            // Debug.Log("charge[0]" + charge.subTabArr[0][1]);
+            // Debug.Log("charge[0]" + charge.subTabArr[0][2]);
+            // Debug.Log("charge[1]" + charge.subTabArr[1][0]);
+            // Debug.Log("charge[1]" + charge.subTabArr[1][1]);
+            // Debug.Log("charge[1]" + charge.subTabArr[1][2]);
+
 
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("sc_beijing");
 
@@ -68,11 +65,16 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            //this.viewData[functionId][subTabIndex]
+            StoreTabCfg arenaTab = StoreTabCfgArray.Instance.GetCfgByfunctionId(ConstFunctionId.STORE_ARENA);
+            _arenaSubTab.Clear();
+            _arenaSubTab.Add(new List<string>() { arenaTab.subTabArr[0][0], arenaTab.subTabArr[0][1], arenaTab.subTabArr[0][2] });
+            for (int i = ArenaDataManager.Instance.SeasonId; i > 0; i--)
+            {
+                _arenaSubTab.Add(new List<string>() { string.Format("第{0}赛季", i), i.ToString(), "StoreArenaView" });
+            }
+
             _curTabIndex = this.viewData == null ? ConstStoreTabId.STORE_CHARGE : (int)(this.viewData as object[])[0];
 
-            // StoreTabCfg tabCfg = StoreTabCfgArray.Instance.GetCfg(tabIndex);
-            // _curTabIndex = tabCfg == null ? 1 : tabCfg.index;
             _ui.m_comTab.m_c1.selectedIndex = _curTabIndex;
             _ui.m_comTab.target.scrollPane.SetPercX((float)(_curTabIndex - 1) / (float)StoreTabCfgArray.Instance.dataArray.Length, false);
 
@@ -118,7 +120,26 @@ namespace GFGGame
             }
             else
             {
-                _ui.m_listSubTab.numItems = tabCfg.subTabArr.Length;
+                _storeTabCfgs.Clear();
+                if (tabCfg.index == ConstStoreTabId.STORE_GIFT_BAG)
+                {
+                    for (int i = 0; i < tabCfg.subTabArr.Length; i++)
+                    {
+                        int menu2 = int.Parse(tabCfg.subTabArr[i][1]);
+                        if (menu2 == ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY)
+                        {
+                            List<ShopCfg> shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, menu2);
+                            if (ShopDataManager.Instance.RemoveNotOpenCfg(shopCfgs).Count == 0) continue;
+                        }
+                        _storeTabCfgs.Add(tabCfg.subTabArr[i]);
+                    }
+
+                }
+                else
+                {
+                    _storeTabCfgs = new List<string[]>(tabCfg.subTabArr);
+                }
+                _ui.m_listSubTab.numItems = _storeTabCfgs.Count;
             }
             _ui.m_listSubTab.selectedIndex = 0;
             _curSubTabIndex = 0;
@@ -136,8 +157,8 @@ namespace GFGGame
             }
             else
             {
-                item.title = tabCfg.subTabArr[index][0];
-                menu2 = int.Parse(tabCfg.subTabArr[index][1]);
+                item.title = _storeTabCfgs[index][0];
+                menu2 = int.Parse(_storeTabCfgs[index][1]);
             }
             item.data = index;
             if (menu2 == ConstStoreSubId.STORE_CHARGE_ADDUP)
@@ -165,8 +186,8 @@ namespace GFGGame
             }
             else
             {
-                menu2 = int.Parse(tabCfg.subTabArr[index][1]);
-                viewName = tabCfg.subTabArr[index][2];
+                menu2 = int.Parse(_storeTabCfgs[index][1]);
+                viewName = _storeTabCfgs[index][2];
             }
             if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(viewName))
             {