فهرست منبع

1元礼包修改显示规则

huangxiaoyue 1 سال پیش
والد
کامیت
e3cb83fdb9

+ 56 - 89
GameClient/Assets/Game/HotUpdate/Data/LimitedTimeGiftBoxDataManager.cs

@@ -10,10 +10,6 @@ namespace GFGGame
         //每日特惠每次登录没有打开过就给红点
         private bool _isOpenMeiRiTeHui = false;
         public bool IsOpenMeiRiTeHui => _isOpenMeiRiTeHui;
-        
-        //列表数据3--等级条件的数据
-        private List<LimitedTimeGiftBoxItemData> _ltgGbItemData3 = new List<LimitedTimeGiftBoxItemData>();
-        public List<LimitedTimeGiftBoxItemData> LtgGbItemData3 => _ltgGbItemData3;
 
         //圆形样式数据4--等级条件的数据 
         private List<LimitedTimeGiftBoxItemYxData> _ltgGbItemData4 = new List<LimitedTimeGiftBoxItemYxData>();
@@ -25,7 +21,6 @@ namespace GFGGame
 
         public void Clear()
         {
-            _ltgGbItemData3.Clear();
             _ltgGbItemData4.Clear();
             _ltgGbItemData5.Clear();
             _isOpenMeiRiTeHui = false;
@@ -37,71 +32,6 @@ namespace GFGGame
             EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
         }
 
-        public void UpLtgGbItemData3()
-        {
-            _ltgGbItemData3.Clear();
-            foreach (ActivityInfo activityInfo in ActivityGlobalDataManager.Instance.GetActivityInfoByType(
-                         ActivityType.XSLB1))
-            {
-                if (activityInfo.EndTime >= TimeInfo.Instance.ServerNow())
-                {
-                    ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(activityInfo.ActivityId);
-                    var paramsArr = activityOpenCfg.paramsArr;
-                    Array.Sort(paramsArr);
-                    foreach (var shopCfgId in paramsArr)
-                    {
-                        ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
-
-                        if (shopCfg == null)
-                        {
-                            Log.Error("shopCfg is null");
-                            continue;
-                        }
-
-                        LimitedTimeGiftBoxItemData ltgGbItemData =
-                            _ltgGbItemData3.FirstOrDefault(a => a.IndexType == shopCfg.menu2);
-                        if (ltgGbItemData != null)
-                        {
-                            var index = _ltgGbItemData3.IndexOf(ltgGbItemData);
-                            ltgGbItemData.EndTime = activityInfo.EndTime;
-                            if (ltgGbItemData.ShopCfgIds != null)
-                            {
-                                if (ltgGbItemData.ShopCfgIds.Count < 3)
-                                {
-                                    ltgGbItemData.ShopCfgIds.Add(shopCfgId);
-                                }
-                            }
-                            else
-                            {
-                                ltgGbItemData.ShopCfgIds = new List<int> { shopCfgId };
-                            }
-
-                            _ltgGbItemData3[index] = ltgGbItemData;
-                        }
-                        else
-                        {
-                            ltgGbItemData = new LimitedTimeGiftBoxItemData
-                            {
-                                IndexType = shopCfg.menu2,
-                                ShopCfgIds = new List<int> { shopCfgId },
-                                EndTime = activityInfo.EndTime
-                            };
-
-                            _ltgGbItemData3.Add(ltgGbItemData);
-                        }
-                    }
-                }
-            }
-
-            //排序
-            foreach (var item in _ltgGbItemData3)
-            {
-                item.ShopCfgIds = item.ShopCfgIds.OrderBy(id => id).ToList();
-            }
-
-            _ltgGbItemData3 = _ltgGbItemData3.OrderBy(a => a.IndexType).ToList();
-        }
-
         public void UpLtgGbItemData4()
         {
             _ltgGbItemData4.Clear();
@@ -178,31 +108,68 @@ namespace GFGGame
 
         public bool SpecialOfferGiftBoxCanBuy()
         {
-            LimitedTimeGiftBoxDataManager.Instance.UpLtgGbItemData3();
-            if (SpecialOfferGiftBoxCanTypeBuy(ListUtil.NavigateType.None))
-                return true;
-            if (SpecialOfferGiftBoxCanTypeBuy(ListUtil.NavigateType.Next))
-                return true;
-
-            return false;
+            var activityInfoByTypeList =
+              ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLB1);
+            var list = activityInfoByTypeList
+                .Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
+            return list.Count == 0;
         }
 
-        public bool SpecialOfferGiftBoxCanTypeBuy(ListUtil.NavigateType type)
+        //获得特惠礼包展示的列表id
+        public List<int> TryShopCfg()
         {
-            var list = LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData3;
-            list = list.Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
-            if (list.Count == 0)
-                return false;
+            int activityId = 0;
+            foreach (ActivityInfo activityInfo in ActivityGlobalDataManager.Instance.GetActivityInfoByType(
+                       ActivityType.XSLB1))
+            {
+                if (activityInfo.EndTime >= TimeInfo.Instance.ServerNow()) { 
+                    activityId = activityInfo.ActivityId;
+                    break;
+                }
+            }
+            ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(activityId);
+            List<int> shopCfgIds = new List<int>();
+            bool same = false;
+            int sellShowId = 0;
+            var paramsArr = activityOpenCfg.paramsArr;
+            var params2Arr = activityOpenCfg.params2Arr;
+            for (int j = 0; j < params2Arr.Length; j++)
+            {
+                for (int i = 0; i < paramsArr.Length; i++)
+                {
+                    if (params2Arr[j] == paramsArr[i])
+                    {
+                        var shopCfg = ShopCfgArray.Instance.GetCfg(paramsArr[i]);
+                        bool isSellOut = shopCfg.maxBuyNum > 0 &&
+                            shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.id) <= 0;
+                        if (!isSellOut)
+                            sellShowId = paramsArr[i];
+                        break;
+                    }
+                }
+                if (sellShowId > 0)
+                    break;
+            }
+            if (sellShowId <= 0)
+                sellShowId = params2Arr[params2Arr.Length - 1];
 
-            var data = ListUtil.Navigate(list, type, 0, out int newIndex);
-            foreach (var shopCfgId in data.ShopCfgIds)
+            shopCfgIds.Add(sellShowId);
+            for (int i = 0; i < paramsArr.Length; i++)
             {
-                var shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
-                var remainBuyNum = shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.id);
-                if (remainBuyNum > 0)
-                    return true;
+                same = false;
+                for (int j = 0; j < params2Arr.Length; j++)
+                {
+                    if (params2Arr[j] == paramsArr[i])
+                    {
+                        same = true;
+                        break;
+                    }
+                }
+                if (!same)
+                    shopCfgIds.Add(paramsArr[i]);
             }
-            return false;
+            return shopCfgIds;
         }
+
     }
 }

+ 3 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_SpecialOfferGiftBoxUI.cs

@@ -10,7 +10,7 @@ namespace UI.EnduringGiftBox
         public GGraph m_holderBaby;
         public GGraph m_holderChiXuTx;
         public GTextField m_txtBoxResidueTime;
-        public GList m_list;
+        public GList m_listGift;
         public GComponent m_btnUp;
         public GComponent m_btnNext;
         public GComponent m_back;
@@ -66,7 +66,7 @@ namespace UI.EnduringGiftBox
             m_holderBaby = (GGraph)comp.GetChild("holderBaby");
             m_holderChiXuTx = (GGraph)comp.GetChild("holderChiXuTx");
             m_txtBoxResidueTime = (GTextField)comp.GetChild("txtBoxResidueTime");
-            m_list = (GList)comp.GetChild("list");
+            m_listGift = (GList)comp.GetChild("listGift");
             m_btnUp = (GComponent)comp.GetChild("btnUp");
             m_btnNext = (GComponent)comp.GetChild("btnNext");
             m_back = (GComponent)comp.GetChild("back");
@@ -78,7 +78,7 @@ namespace UI.EnduringGiftBox
             m_holderBaby = null;
             m_holderChiXuTx = null;
             m_txtBoxResidueTime = null;
-            m_list = null;
+            m_listGift = null;
             m_btnUp = null;
             m_btnNext = null;
             m_back = null;

+ 156 - 194
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/SpecialOfferGiftBoxView.cs

@@ -13,8 +13,7 @@ namespace GFGGame
     {
         private UI_SpecialOfferGiftBoxUI _ui;
 
-        private int _pageIndex; //当前页码,需要显示的数据的索引
-        private List<GGraph> _graphList = new List<GGraph>();
+        //private int _pageIndex; //当前页码,需要显示的数据的索引
         private List<EffectUI> _effectUIList = new List<EffectUI>();
         private List<EffectUI> _effect1UIList = new List<EffectUI>();
         
@@ -33,13 +32,22 @@ namespace GFGGame
             this.modal = true;
             viewAnimationType = EnumViewAnimationType.None;
 
+            _ui.m_listGift.itemRenderer = RenderListGiftItem;
+
             _ui.m_back.onClick.Add(OnBtnCancelClick);
-            _ui.m_btnUp.onClick.Add(OnBtnPreviousClick);
-            _ui.m_btnNext.onClick.Add(OnBtnNextClick);
+            AddEffect();
+            //_ui.m_btnUp.onClick.Add(OnBtnPreviousClick);
+            //_ui.m_btnNext.onClick.Add(OnBtnNextClick);
         }
 
         public override void Dispose()
         {
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+            EffectUIPool.Recycle(_effectUI3);
+            _effectUI3 = null;
 
             if (_ui != null)
             {
@@ -53,119 +61,53 @@ namespace GFGGame
         {
             base.OnShown();
             GameGlobal.AutoSpecialOfferGiftBoxView = false;
-            AddEffect();
             _ui.m_t0.Play();
-            InitPageInex();
-
+           
             UpViewNone();
+            //InitPageInex();
         }
 
-        protected override void AddEventListener()
+        private void OnBtnCancelClick()
         {
-            base.AddEventListener();
-            EventAgent.AddEventListener(ConstMessage.ACTIVITY_REMOVE, UpViewNone);
-            EventAgent.AddEventListener(ConstMessage.ACTIVITY_ADD, UpViewNone);
-            EventAgent.AddEventListener(ConstMessage.SHOP_BUY, UpViewNone); 
-            EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_TIME, UpTime);
+            this.Hide();
         }
 
-        protected override void RemoveEventListener()
+        protected override void OnHide()
         {
-            EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_REMOVE, UpViewNone);
-            EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_ADD, UpViewNone);
-            EventAgent.RemoveEventListener(ConstMessage.SHOP_BUY, UpViewNone);
-            EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_TIME, UpTime);
-            base.RemoveEventListener();
+            DestroyObjectFromView();
+
+            this.RemoveEventListener();
+            base.Hide();
         }
 
-        private void AddEffect()
+        private void DestroyObjectFromView()
         {
-            if (_effectUI1 == null)
-            {
-                _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderBaby, "ui_Activity", "Prefer_person");
-            }
-            if (_effectUI2 == null)
+            for (int i = 0; i < _effectUIList.Count; i++)
             {
-                _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderChiXuTx, "ui_Activity", "Prefer_chixu_tx");
-            }
-
-            if (_effectUI3 == null)
-            {
-                _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holderOneTx, "ui_Activity", "Prefer_one_tx");
+                EffectUIPool.Recycle(_effectUIList[i]);
+                _effectUIList[i] = null;
             }
-        }
-
-        public void UpTime()
-        {
-            //筛选一条数据用来界面渲染
-            var list = LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData3;
+            _effectUIList.Clear();
 
-            list = list.Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
-            if (list.Count == 0)
+            for (int i = 0; i < _effect1UIList.Count; i++)
             {
-                PromptController.Instance.ShowFloatTextPrompt("活动已结束");
-                this.Hide();
-                return;
+                EffectUIPool.Recycle(_effect1UIList[i]);
+                _effect1UIList[i] = null;
             }
-
-            _ui.m_txtBoxResidueTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
-        }
-
-        //实例化索引
-        private void InitPageInex()
-        {
-            _pageIndex = 0;
+            _effect1UIList.Clear();
         }
 
-        private void UpdateView(ListUtil.NavigateType type)
+        private void UpViewNone()
         {
-            //筛选一条数据用来界面渲染
-            var list = LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData3;
-
-            list = list.Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
-            if (list.Count == 0)
-            {
-                PromptController.Instance.ShowFloatTextPrompt("活动已结束");
-                this.Hide();
-                return;
-            }
-
-            var data = ListUtil.Navigate(list, type, _pageIndex, out int newIndex);
-            _pageIndex = newIndex;
-
-            _ui.m_btnUp.visible = true;
-            _ui.m_btnNext.visible = true;
-            if (list.Count == 1)
-            {
-                _ui.m_btnUp.visible = false;
-                _ui.m_btnNext.visible = false;
-            }
-            else
-            {
-                //翻页翻到了最后一条数据
-                if (list.Count == _pageIndex + 1)
-                {
-                    _ui.m_btnNext.visible = false;
-                }
-
-                if (_pageIndex == 0)
-                {
-                    _ui.m_btnUp.visible = false;
-                }
-            }
-
-            _ui.m_txtBoxResidueTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), data.EndTime);
-            _ui.m_list.data = data.ShopCfgIds;
-            _ui.m_list.itemRenderer = ListItemRender;
+            var shopCfgIds = LimitedTimeGiftBoxDataManager.Instance.TryShopCfg();
             DestroyObjectFromView();
-            _ui.m_list.numItems = data.ShopCfgIds.Count;
-            _ui.m_list.visible = true;
+            _ui.m_listGift.numItems = shopCfgIds.Count;
         }
 
-        private void ListItemRender(int index, GObject obj)
+        private void RenderListGiftItem(int index, GObject obj)
         {
             UI_ComSpecialOfferGiftBoxItem uiItem = UI_ComSpecialOfferGiftBoxItem.Proxy(obj);
-            var shopCfgIds = uiItem.target.parent.data as List<int>;
+            var shopCfgIds = LimitedTimeGiftBoxDataManager.Instance.TryShopCfg();
             var shopCfgId = shopCfgIds[index];
             var shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
             var shopItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
@@ -176,21 +118,13 @@ namespace GFGGame
             string mTxtUrc = string.Empty;
             string mTxtNewPrice;
             if (shopCfg.refreshType == RefreshType.DAY)
-            {
                 mTxtUrc = $"每日限购{remainBuyNum}/{shopCfg.maxBuyNum}";
-            }
             else if (shopCfg.refreshType == RefreshType.WEEK)
-            {
                 mTxtUrc = $"每周限购{remainBuyNum}/{shopCfg.maxBuyNum}";
-            }
             else if (shopCfg.refreshType == RefreshType.MONTH)
-            {
                 mTxtUrc = $"每月限购{remainBuyNum}/{shopCfg.maxBuyNum}";
-            }
             else
-            {
                 mTxtUrc = $"永久限购{remainBuyNum}/{shopCfg.maxBuyNum}";
-            }
 
             uiItem.m_btnBuy.m_txtOldPrice.text = shopCfg.originalPrice.ToString();
             if (shopCfg.costType == CostType.ITEM)
@@ -260,81 +194,42 @@ namespace GFGGame
             _effectUIList.Add(_effectUI);
             uiItem.m_t0.Play();
 
-            //子列表
-            uiItem.m_list.itemRenderer = ChildListItemRender;
+            ////子列表
+            if(uiItem.m_list.data == null)
+                uiItem.m_list.itemRenderer = ChildListItemRender;
+
+            uiItem.m_list.data = 1;
             uiItem.m_list.onClickItem.Add(OnListSelectorItemClick);
             uiItem.m_list.numItems = shopItemCfg.itemsArr.Length;
-            uiItem.m_list.visible = true;
-        }
-
-        private void ChildListItemRender(int index, GObject obj)
-        {
-            UI_ComItem uiItemChild = UI_ComItem.Proxy(obj);
-            var shopCfg = uiItemChild.target.parent.parent.data as ShopCfg;
-            var itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
-
-            int[][] result;
-            // if (shopCfg.refreshType == RefreshType.DAY)
-            // {
-            result = itemCfg.itemsArr;
-            //uiItemChild.m_bagYellow.visible = false;
-            //uiItemChild.m_bagBlue.visible = true;
-            //uiItemChild.m_bagYellowEx.visible = false;
-            //uiItemChild.m_bagBlueEx.visible = true;
-            // }
-            // else
-            // {
-            //周刷
-            // result = itemCfg.param1Arr;
-            // uiItemChild.m_bagYellow.visible = true;
-            // uiItemChild.m_bagBlue.visible = false;
-            // uiItemChild.m_bagYellowEx.visible = true;
-            // uiItemChild.m_bagBlueEx.visible = false;
-            // }
-
-            var itemArr = result[index];
-            var itemCfgChild = ItemCfgArray.Instance.GetCfg(itemArr[0]);
-            uiItemChild.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfgChild);
-            uiItemChild.m_txtCount.text = itemArr[1].ToString();
-            uiItemChild.target.data = itemCfgChild;
-            uiItemChild.m_QualityType.selectedIndex = itemCfgChild.rarity - 1;
-
-            //if (!_graphList.Contains(uiItemChild.m_holderItem))
-            //{
-            //    EffectUI _effectUI = EffectUIPool.CreateEffectUI(uiItemChild.m_holderItem, "ui_Activity", "Prefer_kuang");
-            //    _graphList.Add(uiItemChild.m_holderItem);
-            //    _effectUIList.Add(_effectUI);
-            //}
-
-            //uiItemChild.m_t0.Play();
-
-            UI_ComItem.ProxyEnd();
-        }
-
-        //弹出物品详细描述框
-        private void OnListSelectorItemClick(EventContext context)
-        {
-            GComponent item = context.data as GComponent;
-            ItemCfg itemCfg = item.data as ItemCfg;
-            GoodsItemTipsController.ShowItemTips(itemCfg.id);
+            UI_ComSpecialOfferGiftBoxItem.ProxyEnd();
         }
 
-        private void UpViewNone()
+        private void AddEffect()
         {
-            LimitedTimeGiftBoxDataManager.Instance.UpLtgGbItemData3();
-            UpdateView(ListUtil.NavigateType.None);
+            if (_effectUI1 == null)
+                _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderBaby, "ui_Activity", "Prefer_person");
+            if (_effectUI2 == null)
+                _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderChiXuTx, "ui_Activity", "Prefer_chixu_tx");
+            if (_effectUI3 == null)
+                _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holderOneTx, "ui_Activity", "Prefer_one_tx");
         }
 
-        //上一条
-        private void OnBtnPreviousClick()
+        protected override void AddEventListener()
         {
-            UpdateView(ListUtil.NavigateType.Previous);
+            base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.ACTIVITY_REMOVE, UpViewNone);
+            EventAgent.AddEventListener(ConstMessage.ACTIVITY_ADD, UpViewNone);
+            EventAgent.AddEventListener(ConstMessage.SHOP_BUY, UpViewNone);
+            EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_TIME, UpTime);
         }
 
-        //下一条
-        private void OnBtnNextClick()
+        protected override void RemoveEventListener()
         {
-            UpdateView(ListUtil.NavigateType.Next);
+            EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_REMOVE, UpViewNone);
+            EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_ADD, UpViewNone);
+            EventAgent.RemoveEventListener(ConstMessage.SHOP_BUY, UpViewNone);
+            EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_TIME, UpTime);
+            base.RemoveEventListener();
         }
 
         //购买按钮点击事件
@@ -368,42 +263,109 @@ namespace GFGGame
             }
         }
 
-        private void DestroyObjectFromView()
+        private void ChildListItemRender(int index, GObject obj)
         {
-            for (int i = 0; i < _effectUIList.Count; i++) {
-                EffectUIPool.Recycle(_effectUIList[i]);
-                _effectUIList[i] = null;
-            }
-            _effectUIList.Clear();
-
-            for (int i = 0; i < _effect1UIList.Count; i++)
-            {
-                EffectUIPool.Recycle(_effect1UIList[i]);
-                _effect1UIList[i] = null;
-            }
-            _effect1UIList.Clear();
-            
-            _graphList.Clear();
+            UI_ComItem uiItemChild = UI_ComItem.Proxy(obj);
+            var shopCfg = uiItemChild.target.parent.parent.data as ShopCfg;
+            var itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
+            int[][] result;
+            result = itemCfg.itemsArr;
+            var itemArr = result[index];
+            var itemCfgChild = ItemCfgArray.Instance.GetCfg(itemArr[0]);
+            uiItemChild.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfgChild);
+            uiItemChild.m_txtCount.text = itemArr[1].ToString();
+            uiItemChild.target.data = itemCfgChild;
+            uiItemChild.m_QualityType.selectedIndex = itemCfgChild.rarity - 1;
+            UI_ComItem.ProxyEnd();
         }
 
-        protected override void OnHide()
+        //弹出物品详细描述框
+        private void OnListSelectorItemClick(EventContext context)
         {
-            EffectUIPool.Recycle(_effectUI1);
-            _effectUI1 = null;
-            EffectUIPool.Recycle(_effectUI2);
-            _effectUI2 = null;
-            EffectUIPool.Recycle(_effectUI3);
-            _effectUI3 = null;
-           
-            DestroyObjectFromView();
-
-            this.RemoveEventListener();
-            base.Hide();
+            GComponent item = context.data as GComponent;
+            ItemCfg itemCfg = item.data as ItemCfg;
+            GoodsItemTipsController.ShowItemTips(itemCfg.id);
         }
 
-        private void OnBtnCancelClick()
+        public void UpTime()
         {
-            this.Hide();
+            var activityInfoByTypeList =
+                ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLB1);
+            var list = activityInfoByTypeList
+                .Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
+            if (list.Count == 0)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("活动已结束");
+                this.Hide();
+                return;
+            }
+            _ui.m_txtBoxResidueTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
         }
+
+        //    //实例化索引
+        //    private void InitPageInex()
+        //    {
+        //        _pageIndex = 0;
+        //    }
+
+        //    private void UpdateView(ListUtil.NavigateType type)
+        //    {
+        //        //筛选一条数据用来界面渲染
+        //var list = LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData3;
+
+        //        list = list.Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
+        //        if (list.Count == 0)
+        //        {
+        //            PromptController.Instance.ShowFloatTextPrompt("活动已结束");
+        //            this.Hide();
+        //            return;
+        //        }
+
+        //        var data = ListUtil.Navigate(list, type, _pageIndex, out int newIndex);
+        //        _pageIndex = newIndex;
+
+        //        _ui.m_btnUp.visible = true;
+        //        _ui.m_btnNext.visible = true;
+        //        if (list.Count == 1)
+        //        {
+        //            _ui.m_btnUp.visible = false;
+        //            _ui.m_btnNext.visible = false;
+        //        }
+        //        else
+        //        {
+        //            //翻页翻到了最后一条数据
+        //            if (list.Count == _pageIndex + 1)
+        //                _ui.m_btnNext.visible = false;
+
+        //            if (_pageIndex == 0)
+        //                _ui.m_btnUp.visible = false;
+        //        }
+
+        //        _ui.m_txtBoxResidueTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), data.EndTime);
+        //        _ui.m_list.data = data.ShopCfgIds;
+        //        _ui.m_list.itemRenderer = ListItemRender;
+        //        DestroyObjectFromView();
+        //        _ui.m_list.numItems = data.ShopCfgIds.Count;
+        //        _ui.m_list.visible = true;
+        //    }
+
+
+        //    private void UpViewNone()
+        //    {
+        //        LimitedTimeGiftBoxDataManager.Instance.UpLtgGbItemData3();
+        //        UpdateView(ListUtil.NavigateType.None);
+        //    }
+
+        //    //上一条
+        //    private void OnBtnPreviousClick()
+        //    {
+        //        UpdateView(ListUtil.NavigateType.Previous);
+        //    }
+
+        //    //下一条
+        //    private void OnBtnNextClick()
+        //    {
+        //        UpdateView(ListUtil.NavigateType.Next);
+        //    }
     }
 }

+ 46 - 4
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -183,6 +183,11 @@ namespace GFGGame
             else
                 comBox.m_showActivityType.selectedIndex = 0;
 
+            //if (cfg.costNumfifty > 0)
+            //    comBox.m_comLuckBoxBtn.m_btnNumberType.selectedIndex = 1;
+            //else
+                comBox.m_comLuckBoxBtn.m_btnNumberType.selectedIndex = 0;
+
             if (_luckyBoxCtrl.ContainsKey(boxId))
             {
                 _luckyBoxCtrl[boxId].OnHide();
@@ -214,6 +219,10 @@ namespace GFGGame
 
             comBox.m_comLuckBoxBtn.m_comCostTen.m_txtCost.text = cfg.costNumTen.ToString();
             comBox.m_comLuckBoxBtn.m_comCostTen.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
+
+            comBox.m_comLuckBoxBtn.m_comCostFifty.m_txtCost.text = cfg.costNumfifty.ToString();
+            comBox.m_comLuckBoxBtn.m_comCostFifty.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
+
             if (comBox.m_comLuckBoxBtn.m_btnBuyOne.data == null)
             {
                 comBox.m_comLuckBoxBtn.m_btnBuyOne.onClick.Add(OnClickBtnBuyOne);
@@ -232,6 +241,13 @@ namespace GFGGame
             }
             comBox.m_comLuckBoxBtn.m_btnBuyTen.data = boxId;
 
+            if (comBox.m_comLuckBoxBtn.m_btnBuyFifty.data == null)
+            {
+                comBox.m_comLuckBoxBtn.m_btnBuyFifty.onClick.Add(OnClickBtnBuyFifty);
+            }
+            comBox.m_comLuckBoxBtn.m_btnBuyFifty.data = boxId;
+            
+
             if (comBox.m_btnPreview.data == null)
             {
                 comBox.m_btnPreview.onClick.Add(OnClickBtnPreview);
@@ -312,13 +328,13 @@ namespace GFGGame
                 _luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnHide();
 
             _curIndex = _ui.m_listBg.GetFirstChildInView();
-
             LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
-            if (LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3)
+            if (LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3) {
                 _valueBarController.Controller(3);
-            else
+            }
+            else {
                 _valueBarController.Controller(4);
-
+            }
             _valueBarController.UpdateCJ();
 
             _luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnShown(LuckyBoxDataManager.Instance.currentBoxId);
@@ -335,6 +351,7 @@ namespace GFGGame
                 RedDotController.Instance.SetComRedDot(comBox.m_btnReward, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy), "", -21, 18);
 
                 comBox.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastTsyDrawCount.ToString()).FlushVars();
+                UI_ComBox1.ProxyEnd();
             }
         }
 
@@ -546,6 +563,31 @@ namespace GFGGame
             });
         }
 
+        private void OnClickBtnBuyFifty(EventContext context)
+        {
+            GetSuitItemController.showSingle = true;
+            GObject obj = context.sender as GObject;
+            int boxId = (int)obj.data;
+            LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
+            int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
+
+            if (boughtCount + LuckyBoxDataManager.FIFTY_TIME > luckyBoxCfg.maxCount)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
+                return;
+            }
+            LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.FIFTY_TIME, async () =>
+            {
+                bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.FIFTY_TIME, false, 0);
+                if (result)
+                {
+                    BonusController.TryShowBonusList(LuckyBoxDataManager.Instance.RewardList);
+                    LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 3);
+                    GetSuitItemController.showSingle = false;
+                }
+            });
+        }
+
         protected override void OnHide()
         {
             base.OnHide();

BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_fui.bytes