|
@@ -13,8 +13,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
private UI_SpecialOfferGiftBoxUI _ui;
|
|
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> _effectUIList = new List<EffectUI>();
|
|
private List<EffectUI> _effect1UIList = new List<EffectUI>();
|
|
private List<EffectUI> _effect1UIList = new List<EffectUI>();
|
|
|
|
|
|
@@ -33,13 +32,22 @@ namespace GFGGame
|
|
this.modal = true;
|
|
this.modal = true;
|
|
viewAnimationType = EnumViewAnimationType.None;
|
|
viewAnimationType = EnumViewAnimationType.None;
|
|
|
|
|
|
|
|
+ _ui.m_listGift.itemRenderer = RenderListGiftItem;
|
|
|
|
+
|
|
_ui.m_back.onClick.Add(OnBtnCancelClick);
|
|
_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()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
|
|
+ EffectUIPool.Recycle(_effectUI1);
|
|
|
|
+ _effectUI1 = null;
|
|
|
|
+ EffectUIPool.Recycle(_effectUI2);
|
|
|
|
+ _effectUI2 = null;
|
|
|
|
+ EffectUIPool.Recycle(_effectUI3);
|
|
|
|
+ _effectUI3 = null;
|
|
|
|
|
|
if (_ui != null)
|
|
if (_ui != null)
|
|
{
|
|
{
|
|
@@ -53,119 +61,53 @@ namespace GFGGame
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
GameGlobal.AutoSpecialOfferGiftBoxView = false;
|
|
GameGlobal.AutoSpecialOfferGiftBoxView = false;
|
|
- AddEffect();
|
|
|
|
_ui.m_t0.Play();
|
|
_ui.m_t0.Play();
|
|
- InitPageInex();
|
|
|
|
-
|
|
|
|
|
|
+
|
|
UpViewNone();
|
|
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();
|
|
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);
|
|
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 shopCfgId = shopCfgIds[index];
|
|
var shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
|
|
var shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
|
|
var shopItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
|
|
var shopItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
|
|
@@ -176,21 +118,13 @@ namespace GFGGame
|
|
string mTxtUrc = string.Empty;
|
|
string mTxtUrc = string.Empty;
|
|
string mTxtNewPrice;
|
|
string mTxtNewPrice;
|
|
if (shopCfg.refreshType == RefreshType.DAY)
|
|
if (shopCfg.refreshType == RefreshType.DAY)
|
|
- {
|
|
|
|
mTxtUrc = $"每日限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
mTxtUrc = $"每日限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
- }
|
|
|
|
else if (shopCfg.refreshType == RefreshType.WEEK)
|
|
else if (shopCfg.refreshType == RefreshType.WEEK)
|
|
- {
|
|
|
|
mTxtUrc = $"每周限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
mTxtUrc = $"每周限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
- }
|
|
|
|
else if (shopCfg.refreshType == RefreshType.MONTH)
|
|
else if (shopCfg.refreshType == RefreshType.MONTH)
|
|
- {
|
|
|
|
mTxtUrc = $"每月限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
mTxtUrc = $"每月限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
- }
|
|
|
|
else
|
|
else
|
|
- {
|
|
|
|
mTxtUrc = $"永久限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
mTxtUrc = $"永久限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
- }
|
|
|
|
|
|
|
|
uiItem.m_btnBuy.m_txtOldPrice.text = shopCfg.originalPrice.ToString();
|
|
uiItem.m_btnBuy.m_txtOldPrice.text = shopCfg.originalPrice.ToString();
|
|
if (shopCfg.costType == CostType.ITEM)
|
|
if (shopCfg.costType == CostType.ITEM)
|
|
@@ -260,81 +194,42 @@ namespace GFGGame
|
|
_effectUIList.Add(_effectUI);
|
|
_effectUIList.Add(_effectUI);
|
|
uiItem.m_t0.Play();
|
|
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.onClickItem.Add(OnListSelectorItemClick);
|
|
uiItem.m_list.numItems = shopItemCfg.itemsArr.Length;
|
|
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);
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
}
|
|
}
|