|
@@ -38,16 +38,11 @@ namespace GFGGame
|
|
|
this.viewCom = _ui.target;
|
|
|
this.viewCom.Center();
|
|
|
this.modal = true;
|
|
|
- viewAnimationType = EnumViewAnimationType.ZOOM_CENTER; //先这样写,后面再改
|
|
|
-
|
|
|
- //测试数据
|
|
|
- EnduringGiftBoxDataManager.GiftBoxStateDic[110001] = 1;
|
|
|
- EnduringGiftBoxDataManager.GiftBoxStateDic[110002] = 1;
|
|
|
- EnduringGiftBoxDataManager.GiftBoxStateDic[110003] = 1;
|
|
|
- EnduringGiftBoxDataManager.GiftBoxStateDic[110004] = 1;
|
|
|
-
|
|
|
+ viewAnimationType = EnumViewAnimationType.None;
|
|
|
+
|
|
|
_ui.m_btnSure.onClick.Add(OnClickBtnSure);
|
|
|
_ui.m_btnCancel.onClick.Add(OnClickBtnCancel);
|
|
|
+ _ui.m_btnBack.onClick.Add(OnClickBtnCancel);
|
|
|
}
|
|
|
|
|
|
public override void Dispose()
|
|
@@ -70,9 +65,23 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnShown();
|
|
|
AddEffect();
|
|
|
+ _ui.m_t1.Play();
|
|
|
+ _ui.m_t2.Play();
|
|
|
UpdateView();
|
|
|
}
|
|
|
|
|
|
+ protected override void AddEventListener()
|
|
|
+ {
|
|
|
+ base.AddEventListener();
|
|
|
+ EventAgent.AddEventListener(ConstMessage.SHOP_BUY, UpdateView);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void RemoveEventListener()
|
|
|
+ {
|
|
|
+ base.RemoveEventListener();
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.SHOP_BUY, UpdateView);
|
|
|
+ }
|
|
|
+
|
|
|
private void AddEffect()
|
|
|
{
|
|
|
string resPath3;
|
|
@@ -183,7 +192,9 @@ namespace GFGGame
|
|
|
item.m_comLeftGiftBox.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
|
item.m_btnBuy.m_txtOldPrice.text = $"{shopCfg.originalPrice}";
|
|
|
item.m_btnBuy.m_txtNewPrice.text = $"{shopCfg.price}元";
|
|
|
-
|
|
|
+ item.m_comLeftGiftBox.target.data = itemCfg;
|
|
|
+ item.m_comLeftGiftBox.m_loaIcon.onClick.Add(OnListSelectorItemClick);
|
|
|
+
|
|
|
if (shopCfg.refreshType == RefreshType.DAY) //也可以换成人民币来做条件
|
|
|
{
|
|
|
//日刷
|
|
@@ -195,7 +206,7 @@ namespace GFGGame
|
|
|
item.m_txtWeekPrompt.visible = false;
|
|
|
item.m_icoWeekPromptTag.visible = false;
|
|
|
numItems = childItemCfg.itemsArr.Length;
|
|
|
-
|
|
|
+
|
|
|
if (remainBuyNum == 0)
|
|
|
{
|
|
|
//已售完
|
|
@@ -216,7 +227,7 @@ namespace GFGGame
|
|
|
else
|
|
|
{
|
|
|
//周刷
|
|
|
- var weekGiftBoxState = EnduringGiftBoxDataManager.GiftBoxStateDic[shopCfg.id];
|
|
|
+ var weekGiftBoxState = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(shopCfg.itemId);
|
|
|
item.m_comLeftGiftBox.m_comDiscount.target.visible = false;
|
|
|
item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = true;
|
|
|
var itemArr = itemCfg.itemsArr[0];
|
|
@@ -231,9 +242,9 @@ namespace GFGGame
|
|
|
item.m_icoWeekPromptTag.visible = true;
|
|
|
|
|
|
numItems = childItemCfg.param1Arr.Length;
|
|
|
-
|
|
|
+
|
|
|
//是否需要领取
|
|
|
- if (weekGiftBoxState == EnduringGiftBoxBuyStatus.NoGet)
|
|
|
+ if (weekGiftBoxState)
|
|
|
{
|
|
|
item.m_btnBuy.target.visible = false;
|
|
|
item.m_btnCurReceive.target.visible = true;
|
|
@@ -246,25 +257,38 @@ namespace GFGGame
|
|
|
//是否能购买
|
|
|
if (remainBuyNum == 0)
|
|
|
{
|
|
|
- //已售完
|
|
|
- item.m_btnBuy.target.visible = false;
|
|
|
- item.m_btnCurReceive.target.visible = true;
|
|
|
- item.m_btnCurReceive.m_receive.visible = false;
|
|
|
- item.m_btnCurReceive.m_received.visible = true;
|
|
|
- item.m_btnCurReceive.m_txtRec.text = "已领取";
|
|
|
+ //已经领取
|
|
|
+ if (EnduringGiftBoxDataManager.Instance.DayRebateItemIds.Contains(shopCfg.itemId))
|
|
|
+ {
|
|
|
+ item.m_btnBuy.target.visible = false;
|
|
|
+ item.m_btnCurReceive.target.visible = true;
|
|
|
+ item.m_btnCurReceive.m_receive.visible = false;
|
|
|
+ item.m_btnCurReceive.m_received.visible = true;
|
|
|
+ item.m_btnCurReceive.m_txtRec.text = "已领取";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ item.m_btnCurReceive.target.visible = false;
|
|
|
+ item.m_btnBuy.target.visible = true;
|
|
|
+ item.m_btnBuy.m_bagGrey.visible = true;
|
|
|
+ item.m_btnBuy.m_bagYellow.visible = false;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//未售完
|
|
|
item.m_btnBuy.target.visible = true;
|
|
|
+ item.m_btnBuy.m_bagGrey.visible = false;
|
|
|
+ item.m_btnBuy.m_bagYellow.visible = true;
|
|
|
item.m_btnCurReceive.target.visible = false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//领取按钮点击事件
|
|
|
//购买按钮点击事件
|
|
|
item.m_btnBuy.target.onClick.Add(OnBtnBuyClick);
|
|
|
-
|
|
|
+
|
|
|
item.m_list.data = shopCfg;
|
|
|
item.m_list.itemRenderer = ChildListItemRender;
|
|
|
item.m_list.numItems = numItems;
|
|
@@ -311,7 +335,7 @@ namespace GFGGame
|
|
|
var itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
|
|
|
// uiItemChild.m_showRreceives.visible = false;
|
|
|
|
|
|
- var curGiftBoxState = EnduringGiftBoxDataManager.GiftBoxStateDic[shopCfg.id];
|
|
|
+ //var curGiftBoxState = EnduringGiftBoxDataManager.GiftBoxStateDic[shopCfg.id];
|
|
|
int[][] result;
|
|
|
if (shopCfg.refreshType == RefreshType.DAY)
|
|
|
{
|
|
@@ -330,7 +354,7 @@ namespace GFGGame
|
|
|
uiItemChild.m_bagYellowEx.visible = true;
|
|
|
uiItemChild.m_bagBlueEx.visible = false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// if (curGiftBoxState == EnduringGiftBoxBuyStatus.YesGet)
|
|
|
// {
|
|
|
// uiItemChild.m_showRreceives.visible = true;
|
|
@@ -408,6 +432,7 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnCancel()
|
|
|
{
|
|
|
+ Dispose();
|
|
|
this.Hide();
|
|
|
}
|
|
|
}
|