Эх сурвалжийг харах

雅集福利可单独领取

zhaoyang 2 жил өмнө
parent
commit
e0e94434e2

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Data/ShopViewManager.cs

@@ -26,6 +26,7 @@ namespace GFGGame
             com.m_txtLv.text = RoleDataManager.vipLv.ToString();
             int level = RoleDataManager.vipLv;
             ET.Log.Debug("vipLv:" + level);
+            ET.Log.Debug("vipExp:" + RoleDataManager.vipExp);
             VipCfg vipCfg = VipCfgArray.Instance.GetCfg(RoleDataManager.vipLv);
             VipCfg nextVipCfg = VipCfgArray.Instance.GetCfg(RoleDataManager.vipLv + 1);
             com.m_txtTipsFull.visible = RoleDataManager.vipExp >= vipCfg.num && nextVipCfg == null;

+ 7 - 5
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -292,7 +292,8 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     LeagueDataManager.Instance.Type = response.Type;
-                    if (response.Type == 1)//1:已经加入军团
+
+                    if (LeagueDataManager.Instance.Type == 1)//1:已经加入军团
                     {
                         LeagueDataManager.Instance.LeagueData = GetLeagueData(response.LeagueDetailInfo);
                         int myPos = LeagueDataManager.Instance.LeagueData.LeagueMemberDatas[RoleDataManager.roleId].Pos;
@@ -302,7 +303,7 @@ namespace GFGGame
                             ReqLeagueJoinQuitLog().Coroutine();
                         }
                     }
-                    else if (response.Type == 2)//2:未加入军团
+                    else if (LeagueDataManager.Instance.Type == 2)//2:未加入军团
                     {
                         LeagueDataManager.Instance.ListDatas.Clear();
                         for (int i = 0; i < response.list.Count; i++)
@@ -584,15 +585,16 @@ namespace GFGGame
             return false;
         }
         //领取联盟福利//LeagueWelfareType
-        public static async ETTask<bool> ReqGetLeagueWelfare()
+        public static async ETTask<bool> ReqGetLeagueWelfare(int type)
         {
             S2C_GetLeagueWelfare response = null;
-            response = (S2C_GetLeagueWelfare)await MessageHelper.SendToServer(new C2S_GetLeagueWelfare());
+            response = (S2C_GetLeagueWelfare)await MessageHelper.SendToServer(new C2S_GetLeagueWelfare() { LeagueWelfareType = type });
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    // PromptController.Instance.ShowFloatTextPrompt("购买成功");
+                    List<ItemData> itemDatas = ItemUtil.CreateItemDataList(response.Bonus);
+                    BonusController.TryShowBonusList(itemDatas);
                     return true;
                 }
             }

+ 10 - 7
GameClient/Assets/Game/HotUpdate/Views/League/LeagueGiftView.cs

@@ -38,6 +38,7 @@ namespace GFGGame
 
             _ui.m_btnBack.onClick.Add(OnBtnBackClick);
             _ui.m_btnGet.onClick.Add(OnBtnGetClick);
+            _ui.m_btnGet.data = LeagueWelfareType.ALL;
             _ui.m_btnRule.onClick.Add(RuleController.ShowRuleView);
             _ui.m_btnRule.data = 300003;
             _ui.m_listBuy.itemRenderer = RenderListBuyItem;
@@ -109,6 +110,11 @@ namespace GFGGame
             item.m_comItem.m_loaType.url = string.Format("ui://League/lm_biaoqian_{0}", _getDatas[index].GiftCfg.type);
             item.m_comItem.m_listGift.data = _getDatas[index].GiftCfg.bonusArr;
             item.m_comItem.m_listGift.numItems = _getDatas[index].GiftCfg.bonusArr.Length;
+            if (item.target.data == null)
+            {
+                item.target.onClick.Add(OnBtnGetClick);
+            }
+            item.target.data = _getDatas[index].Type;
             UI_ListGiftGetItemTop.ProxyEnd();
         }
         private void RenderListBuyItem(int index, GObject obj)
@@ -215,14 +221,11 @@ namespace GFGGame
             LeagueSproxy.ReqBuyLeagueWelfare(buyData.GiftCfg.type).Coroutine();
 
         }
-        private void OnBtnGetClick()
+        private void OnBtnGetClick(EventContext context)
         {
-            // bool result = await LeagueSproxy.ReqGetLeagueWelfare();
-            // if (result)
-            // {
-            //     UpdateGetList();
-            // }
-            LeagueSproxy.ReqGetLeagueWelfare().Coroutine();
+            GObject obj = context.sender as GObject;
+            int type = (int)obj.data;
+            LeagueSproxy.ReqGetLeagueWelfare(type).Coroutine();
         }
     }
 }