浏览代码

月卡奖励弹窗

zhaoyang 2 年之前
父节点
当前提交
c96c2a1961

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

@@ -12,6 +12,25 @@ namespace ET
             ShopSProxy.OnBuySuccess(message.BuyId, message.Times, message.TotalTimes, dTime <= 5000);
         }
     }
+    public class NoticeMonthCardOpen : AMHandler<S2C_NoticeMonthCardOpen>
+    {
+        protected override async ETTask Run(Session session, S2C_NoticeMonthCardOpen message)
+        {
+            MonthlyCardPrivilegeCfg privilegeCfg = MonthlyCardPrivilegeCfgArray.Instance.GetCfg(MonthCardPrivilegeType.Privilege1);
+            int[][] itemData = null;
+
+            if (message.MonthCardType == MonthCardType.Gold)
+            {
+                itemData = new int[][] { new int[] { privilegeCfg.paramsArr[0], privilegeCfg.value1Arr[0] } };
+            }
+            else if (message.MonthCardType == MonthCardType.BlackGold)
+            {
+                itemData = new int[][] { new int[] { privilegeCfg.paramsArr[0], privilegeCfg.value2Arr[0] } };
+            }
+            BonusController.TryShowBonusList(itemData);
+            await ETTask.CompletedTask;
+        }
+    }
 }
 
 namespace GFGGame
@@ -67,7 +86,7 @@ namespace GFGGame
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
 
             EventAgent.DispatchEvent(ConstMessage.CONTINUOUS_REBATE_GIFT_SHOP_BUY, shopCfg);
-            if(showItems)
+            if (showItems)
             {
                 //判断倍数
                 var multiple = 1;
@@ -75,7 +94,7 @@ namespace GFGGame
                 {
                     multiple = 2;
                 }
-                List<ItemData> itemDatas = ItemUtil.CreateItemDataList(itemCfg.id, times * shopCfg.itemNum* multiple);
+                List<ItemData> itemDatas = ItemUtil.CreateItemDataList(itemCfg.id, times * shopCfg.itemNum * multiple);
                 BonusController.TryShowBonusList(itemDatas);
             }
             EventAgent.DispatchEvent(ConstMessage.SHOP_BUY);

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

@@ -160,26 +160,12 @@ namespace GFGGame
             _ui.m_btnGet.text = isGot ? "已领取" : "领取";
             _ui.m_btnGet.data = monthCfg.type; ;
         }
-        private async void OnBtnBuyCardClick(EventContext context)
+        private void OnBtnBuyCardClick(EventContext context)
         {
             GObject obj = context.sender as GObject;
             int goodsId = (int)obj.data;
-            bool result = await ShopSProxy.ReqShopBuy(goodsId);
-            if (result)
-            {
-                MonthlyCardPrivilegeCfg privilegeCfg = MonthlyCardPrivilegeCfgArray.Instance.GetCfg(MonthCardPrivilegeType.Privilege1);
-                int[][] itemData = null;
+            ShopSProxy.ReqShopBuy(goodsId).Coroutine();
 
-                if (menu2 == ConstStoreSubId.STORE_MONTH_GOLD_CARD)
-                {
-                    itemData = new int[][] { new int[] { privilegeCfg.paramsArr[0], privilegeCfg.value1Arr[0] } };
-                }
-                else if (menu2 == ConstStoreSubId.STORE_MONTH_GOLD_CARD)
-                {
-                    itemData = new int[][] { new int[] { privilegeCfg.paramsArr[0], privilegeCfg.value2Arr[0] } };
-                }
-                BonusController.TryShowBonusList(itemData);
-            }
         }
         private async void OnBtnGetClick(EventContext context)
         {