浏览代码

月卡红点

zhaoyang 2 年之前
父节点
当前提交
19f94ecb33

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Constant/ConstStoreSubId.cs

@@ -4,7 +4,7 @@ namespace GFGGame
     {
     {
         public const int STORE_CHARGE = 0;//充值
         public const int STORE_CHARGE = 0;//充值
         public const int STORE_CHARGE_ADDUP = 1;//累计充值
         public const int STORE_CHARGE_ADDUP = 1;//累计充值
-        public const int STORE_MONTH_GLOAD_CARD = 0;//金卡
+        public const int STORE_MONTH_GOLD_CARD = 0;//金卡
         public const int STORE_MONTH_BLACK_CARD = 1;//黑金卡
         public const int STORE_MONTH_BLACK_CARD = 1;//黑金卡
         public const int STORE_GIFT_BAG_ACTIVITY = 0;//活动
         public const int STORE_GIFT_BAG_ACTIVITY = 0;//活动
         public const int STORE_GIFT_BAG_TIME_LIMIT = 1;//限时活动
         public const int STORE_GIFT_BAG_TIME_LIMIT = 1;//限时活动

+ 28 - 3
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -319,8 +319,16 @@ namespace GFGGame
             return itemHas >= itemNeed && costHas >= costNeed;
             return itemHas >= itemNeed && costHas >= costNeed;
         }
         }
 
 
+        /// <summary>
+        /// 商城
+        /// </summary>
+        /// <returns></returns>
+        public bool GetShopRed()
+        {
+            return GetChargeAddUpRewardRed() || GetGiftBagRewardRed() || GetGoldCardRewardRed() || GetBlackCardRewardRed();
+        }
         //商店-充值-会员中心
         //商店-充值-会员中心
-        public bool GetChargeAddUpReward()
+        public bool GetChargeAddUpRewardRed()
         {
         {
             VipCfg[] vipCfgs = VipCfgArray.Instance.dataArray;
             VipCfg[] vipCfgs = VipCfgArray.Instance.dataArray;
 
 
@@ -335,7 +343,7 @@ namespace GFGGame
                    RoleDataManager.vipLv > 0;
                    RoleDataManager.vipLv > 0;
         }
         }
         //商店-礼包-活动礼包
         //商店-礼包-活动礼包
-        public bool GetGiftBagReward()
+        public bool GetGiftBagRewardRed()
         {
         {
             List<ShopCfg> shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY);
             List<ShopCfg> shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY);
             shopCfgs = ShopDataManager.Instance.RemoveNotOpenCfg(shopCfgs);
             shopCfgs = ShopDataManager.Instance.RemoveNotOpenCfg(shopCfgs);
@@ -346,6 +354,22 @@ namespace GFGGame
             return false;
             return false;
         }
         }
         /// <summary>
         /// <summary>
+        /// 商城-月卡-金卡
+        /// </summary>
+        /// <returns></returns>
+        public bool GetGoldCardRewardRed()
+        {
+            return RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold) && GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardGoldReward) <= 0;
+        }
+        /// <summary>
+        /// 商城-月卡-黑金卡
+        /// </summary>
+        /// <returns></returns>
+        public bool GetBlackCardRewardRed()
+        {
+            return RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold) && GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardBlackGoldReward) <= 0;
+        }
+        /// <summary>
         /// 联盟-成员申请
         /// 联盟-成员申请
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
@@ -399,7 +423,7 @@ namespace GFGGame
         {
         {
             return !LimitedTimeGiftBoxDataManager.Instance.IsOpenMeiRiTeHui;
             return !LimitedTimeGiftBoxDataManager.Instance.IsOpenMeiRiTeHui;
         }
         }
-        
+
         /// <summary>
         /// <summary>
         /// 背包中存在礼包就一直给主界面 背包 红点
         /// 背包中存在礼包就一直给主界面 背包 红点
         /// </summary>
         /// </summary>
@@ -427,5 +451,6 @@ namespace GFGGame
         //
         //
         //     return false;
         //     return false;
         // }
         // }
+
     }
     }
 }
 }

+ 2 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/ShopSProxy.cs

@@ -69,7 +69,7 @@ namespace GFGGame
             {
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                 {
-                    int[][] bonus = VipCfgArray.Instance.GetCfg(vipLv-1).bonusOnceArr;
+                    int[][] bonus = VipCfgArray.Instance.GetCfg(vipLv - 1).bonusOnceArr;
                     BonusController.TryShowBonusList(bonus);
                     BonusController.TryShowBonusList(bonus);
                     return true;
                     return true;
                 }
                 }
@@ -104,6 +104,7 @@ namespace GFGGame
             {
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                 {
+                    EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
                     return true;
                     return true;
                 }
                 }
             }
             }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpView.cs

@@ -207,7 +207,7 @@ namespace GFGGame
             if (_ui.m_comboBox.selectedIndex == currentIndex) return;
             if (_ui.m_comboBox.selectedIndex == currentIndex) return;
             if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
             if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
             {
             {
-                ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GLOAD_CARD });
+                ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GOLD_CARD });
                 _ui.m_comboBox.selectedIndex = currentIndex;
                 _ui.m_comboBox.selectedIndex = currentIndex;
                 return;
                 return;
             }
             }

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

@@ -1007,7 +1007,7 @@ namespace GFGGame
             RedDotController.Instance.SetComRedDot(_btnYouJian, RedDotDataManager.Instance.GetMailRed());
             RedDotController.Instance.SetComRedDot(_btnYouJian, RedDotDataManager.Instance.GetMailRed());
             RedDotController.Instance.SetComRedDot(_btnTuJian, RedDotDataManager.Instance.GetFieldGuideRed() || RedDotDataManager.Instance.GetTravelGuideRed());
             RedDotController.Instance.SetComRedDot(_btnTuJian, RedDotDataManager.Instance.GetFieldGuideRed() || RedDotDataManager.Instance.GetTravelGuideRed());
             RedDotController.Instance.SetComRedDot(_btnHaoYou, RedDotDataManager.Instance.GetFriendRed());
             RedDotController.Instance.SetComRedDot(_btnHaoYou, RedDotDataManager.Instance.GetFriendRed());
-            RedDotController.Instance.SetComRedDot(_btnStore, RedDotDataManager.Instance.GetChargeAddUpReward() || RedDotDataManager.Instance.GetGiftBagReward());
+            RedDotController.Instance.SetComRedDot(_btnStore, RedDotDataManager.Instance.GetShopRed());
             RedDotController.Instance.SetComRedDot(_ui.m_btnField.target, RedDotDataManager.Instance.GetFieldRed(), "", 10);
             RedDotController.Instance.SetComRedDot(_ui.m_btnField.target, RedDotDataManager.Instance.GetFieldRed(), "", 10);
             RedDotController.Instance.SetComRedDot(_ui.m_btnStudio.target, RedDotDataManager.Instance.GetStudioFilingRed(), "", -38);
             RedDotController.Instance.SetComRedDot(_ui.m_btnStudio.target, RedDotDataManager.Instance.GetStudioFilingRed(), "", -38);
             RedDotController.Instance.SetComRedDot(_ui.m_headBar.target, RedDotDataManager.Instance.GetHeadRed() || RedDotDataManager.Instance.GetHeadBorderRed(), "", 5, 7);
             RedDotController.Instance.SetComRedDot(_ui.m_headBar.target, RedDotDataManager.Instance.GetHeadRed() || RedDotDataManager.Instance.GetHeadBorderRed(), "", 5, 7);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/RoleInfoView.cs

@@ -136,7 +136,7 @@ namespace GFGGame
             if (RoleInfoManager.GetPosType(index) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
             if (RoleInfoManager.GetPosType(index) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
             {
             {
                 // PromptController.Instance.ShowFloatTextPrompt("金卡开启");
                 // PromptController.Instance.ShowFloatTextPrompt("金卡开启");
-                ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GLOAD_CARD });
+                ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GOLD_CARD });
                 return;
                 return;
             }
             }
             if (RoleInfoManager.GetPosType(index) == MonthCardType.BlackGold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold))
             if (RoleInfoManager.GetPosType(index) == MonthCardType.BlackGold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold))

+ 11 - 2
GameClient/Assets/Game/HotUpdate/Views/Store/StoreMonthView.cs

@@ -12,6 +12,7 @@ namespace GFGGame
         private UI_StoreMonthUI _ui;
         private UI_StoreMonthUI _ui;
         private ValueBarController _valueBarController;
         private ValueBarController _valueBarController;
         private List<ShopCfg> _shopCfgs;
         private List<ShopCfg> _shopCfgs;
+        private int menu2;
 
 
         public override void Dispose()
         public override void Dispose()
         {
         {
@@ -48,6 +49,7 @@ namespace GFGGame
         {
         {
             base.AddEventListener();
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.SHOP_BUY, UpdateView);
             EventAgent.AddEventListener(ConstMessage.SHOP_BUY, UpdateView);
+            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
 
 
         }
         }
         protected override void OnShown()
         protected override void OnShown()
@@ -56,6 +58,7 @@ namespace GFGGame
 
 
             _valueBarController.OnShown();
             _valueBarController.OnShown();
             UpdateView();
             UpdateView();
+            UpdateRedDot();
         }
         }
 
 
 
 
@@ -68,6 +71,7 @@ namespace GFGGame
         {
         {
             base.RemoveEventListener();
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.SHOP_BUY, UpdateView);
             EventAgent.RemoveEventListener(ConstMessage.SHOP_BUY, UpdateView);
+            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
         }
         }
         private void OnBtnBlackRewardClick()
         private void OnBtnBlackRewardClick()
         {
         {
@@ -75,7 +79,7 @@ namespace GFGGame
         }
         }
         private void UpdateView()
         private void UpdateView()
         {
         {
-            int menu2 = (int)this.viewData;
+            menu2 = (int)this.viewData;
             _shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_MONTH_CARD, menu2);
             _shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_MONTH_CARD, menu2);
             _shopCfgs = ShopDataManager.Instance.RemoveNotOpenCfg(_shopCfgs);
             _shopCfgs = ShopDataManager.Instance.RemoveNotOpenCfg(_shopCfgs);
             _shopCfgs = ShopDataManager.Instance.SortShopGoodsCfgs(_shopCfgs);
             _shopCfgs = ShopDataManager.Instance.SortShopGoodsCfgs(_shopCfgs);
@@ -91,7 +95,7 @@ namespace GFGGame
             MonthlyCardCfg monthCfg = null;
             MonthlyCardCfg monthCfg = null;
             switch (menu2)
             switch (menu2)
             {
             {
-                case ConstStoreSubId.STORE_MONTH_GLOAD_CARD:
+                case ConstStoreSubId.STORE_MONTH_GOLD_CARD:
                     iconUrl = "ui://Store/MonthCard_Icon";
                     iconUrl = "ui://Store/MonthCard_Icon";
                     monthCfg = MonthlyCardCfgArray.Instance.GetCfg(MonthCardType.Gold);
                     monthCfg = MonthlyCardCfgArray.Instance.GetCfg(MonthCardType.Gold);
                     isFirstBuy = GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardGoldFirstBuy) <= 0;
                     isFirstBuy = GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardGoldFirstBuy) <= 0;
@@ -188,5 +192,10 @@ namespace GFGGame
                 }
                 }
             }
             }
         }
         }
+
+        private void UpdateRedDot()
+        {
+            RedDotController.Instance.SetComRedDot(_ui.m_btnGet, menu2 == ConstStoreSubId.STORE_MONTH_GOLD_CARD && RedDotDataManager.Instance.GetGoldCardRewardRed() || menu2 == ConstStoreSubId.STORE_MONTH_BLACK_CARD && RedDotDataManager.Instance.GetBlackCardRewardRed());
+        }
     }
     }
 }
 }

+ 19 - 4
GameClient/Assets/Game/HotUpdate/Views/Store/StoreView.cs

@@ -201,11 +201,26 @@ namespace GFGGame
         }
         }
         private void UpdateRedDot()
         private void UpdateRedDot()
         {
         {
-            RedDotController.Instance.SetComRedDot(_ui.m_comTab.m_btn0.target, RedDotDataManager.Instance.GetChargeAddUpReward());
-            RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_CHARGE_ADDUP).asCom, RedDotDataManager.Instance.GetChargeAddUpReward() && (_ui.m_comTab.m_c1.selectedIndex == ConstStoreTabId.STORE_CHARGE));
+            RedDotController.Instance.SetComRedDot(_ui.m_comTab.m_btn0.target, RedDotDataManager.Instance.GetChargeAddUpRewardRed());
+            if (_ui.m_comTab.m_c1.selectedIndex == ConstStoreTabId.STORE_CHARGE)
+            {
+                RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_CHARGE_ADDUP).asCom, RedDotDataManager.Instance.GetChargeAddUpRewardRed());
+            }
+
+            RedDotController.Instance.SetComRedDot(_ui.m_comTab.m_btn1.target, RedDotDataManager.Instance.GetGoldCardRewardRed() || RedDotDataManager.Instance.GetBlackCardRewardRed());
+            if (_ui.m_comTab.m_c1.selectedIndex == ConstStoreTabId.STORE_MONTH_CARD)
+            {
+                RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_MONTH_GOLD_CARD).asCom, RedDotDataManager.Instance.GetGoldCardRewardRed());
+                RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_MONTH_BLACK_CARD).asCom, RedDotDataManager.Instance.GetBlackCardRewardRed());
+            }
+
+            RedDotController.Instance.SetComRedDot(_ui.m_comTab.m_btn2.target, RedDotDataManager.Instance.GetGiftBagRewardRed());
+            if (_ui.m_comTab.m_c1.selectedIndex == ConstStoreTabId.STORE_GIFT_BAG)
+            {
+                RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY).asCom, RedDotDataManager.Instance.GetGiftBagRewardRed());
+            }
+
 
 
-            RedDotController.Instance.SetComRedDot(_ui.m_comTab.m_btn2.target, RedDotDataManager.Instance.GetGiftBagReward());
-            RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY).asCom, RedDotDataManager.Instance.GetGiftBagReward() && (_ui.m_comTab.m_c1.selectedIndex == ConstStoreTabId.STORE_GIFT_BAG));
         }
         }
     }
     }
 }
 }