Browse Source

登录商城弹出购买物品改成数组

huangxiaoyue 1 year ago
parent
commit
7b61a21a40

+ 9 - 5
GameClient/Assets/Game/HotUpdate/Data/ShopDataManager.cs

@@ -360,16 +360,20 @@ namespace GFGGame
                 return true;
         }
 
-        public bool GetShopIdCanBuyInShop(int menuType,int shopId)
+        public bool GetShopIdCanBuyInShop(int menuType,List<int> shopListId)
         {
             List<ShopCfg> shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, menuType);
             if (ShopDataManager.Instance.RemoveNotOpenCfg(shopCfgs).Count == 0)
                 return false;
 
-            int buyNum = ShopDataManager.Instance.GetGoodsBuyNumById(shopId);
-            foreach (var cfg in shopCfgs) { 
-                if(cfg.id == shopId && buyNum < cfg.maxBuyNum)
-                    return true;
+            foreach (var shopId in shopListId)
+            {
+                int buyNum = ShopDataManager.Instance.GetGoodsBuyNumById(shopId);
+                foreach (var cfg in shopCfgs)
+                {
+                    if (cfg.id == shopId && buyNum < cfg.maxBuyNum)
+                        return true;
+                }
             }
             return false;
         }

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -1085,7 +1085,8 @@ namespace GFGGame
             }
             if (GameGlobal.AutoStoreView)
             {
-                if (ShopDataManager.Instance.GetShopIdCanBuyInShop(ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY,40057))
+                List<int> shopListId = new List<int>() { 40012, 40013 };
+                if (ShopDataManager.Instance.GetShopIdCanBuyInShop(ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY, shopListId))
                 {
                     ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY });
                     return;