EnduringGiftBoxView.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using ET;
  5. using FairyGUI;
  6. using UI.EnduringGiftBox;
  7. using UnityEngine;
  8. namespace GFGGame
  9. {
  10. public class EnduringGiftBoxView : BaseWindow
  11. {
  12. private UI_EnduringGiftBoxUI _ui;
  13. private int _itemId; //道具id,该页面目前只给:体力,金币使用
  14. private int _count; //本次购买次数
  15. private int _buyTimes = 0; //已购次数
  16. private int _type = 0; //0从别的地方跳转过来. 1从点击TOP菜单栏icon跳转过来
  17. private Action _onSuccess;
  18. private int _maxTimes = 0;
  19. private string _message = "";
  20. private List<ShopCfg> _shopCfgList = new List<ShopCfg>();
  21. private GameObject _gameObject1;
  22. private GameObject _gameObject2;
  23. private GameObject _gameObject3;
  24. private GameObject _gameObject4;
  25. private GoWrapper _wrapper1;
  26. private GoWrapper _wrapper2;
  27. private GoWrapper _wrapper3;
  28. private GoWrapper _wrapper4;
  29. protected override void OnInit()
  30. {
  31. base.OnInit();
  32. packageName = UI_EnduringGiftBoxUI.PACKAGE_NAME;
  33. _ui = UI_EnduringGiftBoxUI.Create();
  34. this.viewCom = _ui.target;
  35. this.viewCom.Center();
  36. this.modal = true;
  37. viewAnimationType = EnumViewAnimationType.None;
  38. _ui.m_btnSure.onClick.Add(OnClickBtnSure);
  39. _ui.m_btnCancel.onClick.Add(OnClickBtnCancel);
  40. _ui.m_btnBack.onClick.Add(OnClickBtnCancel);
  41. }
  42. public override void Dispose()
  43. {
  44. SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
  45. SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
  46. SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
  47. SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
  48. if (_ui != null)
  49. {
  50. _ui.Dispose();
  51. _ui = null;
  52. }
  53. EnduringGiftBoxController.Dispose();
  54. base.Dispose();
  55. }
  56. protected override void OnShown()
  57. {
  58. base.OnShown();
  59. AddEffect();
  60. _ui.m_t1.Play();
  61. _ui.m_t2.Play();
  62. UpdateView();
  63. }
  64. protected override void AddEventListener()
  65. {
  66. base.AddEventListener();
  67. EventAgent.AddEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT_SHOP_BUY, UpDayRebateAndView);
  68. EventAgent.AddEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT, UpdateView);
  69. }
  70. protected override void RemoveEventListener()
  71. {
  72. EventAgent.RemoveEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT_SHOP_BUY, UpDayRebateAndView);
  73. EventAgent.RemoveEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT, UpdateView);
  74. base.RemoveEventListener();
  75. }
  76. private void AddEffect()
  77. {
  78. string resPath3;
  79. if (_itemId == ConstItemID.POWER)
  80. {
  81. resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_people02");
  82. }
  83. else
  84. {
  85. resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_people01");
  86. }
  87. //小人
  88. SceneController.AddObjectToView(null, null, _ui.m_holderBaby, resPath3,
  89. out _gameObject3, out _wrapper3);
  90. //爆发,大泡泡
  91. string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_baofa");
  92. SceneController.AddObjectToView(null, null, _ui.m_holderPaoMax, resPath1,
  93. out _gameObject1, out _wrapper1);
  94. //持续的小泡泡
  95. string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_chixu");
  96. SceneController.AddObjectToView(null, null, _ui.m_holderPaoMin, resPath2,
  97. out _gameObject2, out _wrapper2);
  98. //爆发时候的发光
  99. string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_glow");
  100. SceneController.AddObjectToView(null, null, _ui.m_holderFg, resPath4,
  101. out _gameObject4, out _wrapper4);
  102. }
  103. public void SetParams(int itemId, int count, Action onSuccess, string message = "", int type = 0)
  104. {
  105. _itemId = itemId;
  106. _count = count;
  107. _onSuccess = onSuccess;
  108. _message = message;
  109. _type = type;
  110. }
  111. private void UpdateView()
  112. {
  113. _buyTimes = ItemDataManager.GetItemExchangeTimes(_itemId);
  114. ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, _buyTimes, _count, out int costId, out int coustNum,
  115. out int buyNum);
  116. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemId);
  117. ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(costId);
  118. _ui.m_txtNeed.text = string.Format("是否花费{0}{1} 购买{2}{3}", coustNum, costCfg.name, buyNum, itemCfg.name);
  119. _maxTimes = ItemExchangeCfgArray.Instance.GetCfg(_itemId).maxLimit;
  120. string showTxt = string.Empty;
  121. _shopCfgList.Clear();
  122. //常驻礼包
  123. if (_itemId == ConstItemID.POWER)
  124. {
  125. //体力礼包
  126. _shopCfgList = ShopCfgArray.Instance
  127. .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_POWER)
  128. .OrderBy(a => a.refreshType).ToList();
  129. _ui.m_txtNeed.align = AlignType.Center;
  130. int maxLimit = ItemExchangeCfgArray.Instance.GetCfg(ConstItemID.POWER).maxLimit;
  131. int lastBuyCount = maxLimit - ItemDataManager.GetItemExchangeTimes(ConstItemID.POWER);
  132. showTxt = string.Format("每5分钟回复1点体力\n今日剩余购买次数{0}/{1}次", lastBuyCount, maxLimit);
  133. }
  134. else
  135. {
  136. //金币礼包
  137. _shopCfgList = ShopCfgArray.Instance
  138. .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_GOLD)
  139. .OrderBy(a => a.refreshType).ToList();
  140. _ui.m_txtNeed.align = AlignType.Right;
  141. if (_maxTimes != 0)
  142. {
  143. showTxt = string.Format("今日剩余购买次数{0}/{1}", _maxTimes - _buyTimes, _maxTimes);
  144. }
  145. }
  146. _ui.m_txtNum.text = showTxt;
  147. _ui.m_txtPromptExt.text = string.Format("除了上述购买{0}的途径,我们还提供了更多的优惠礼包选择", itemCfg.name);
  148. _ui.m_list.itemRenderer = ListItemRender;
  149. _ui.m_list.numItems = _shopCfgList.Count;
  150. _ui.m_list.visible = true;
  151. }
  152. // ReSharper disable Unity.PerformanceAnalysis
  153. private void ListItemRender(int index, GObject obj)
  154. {
  155. ShopCfg shopCfg = _shopCfgList[index];
  156. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId); //购买的物品-礼包
  157. UI_ComCurSupplyItem item = UI_ComCurSupplyItem.Proxy(obj);
  158. item.target.data = shopCfg;
  159. //返利包
  160. item.m_txtTitle.text = itemCfg.name;
  161. item.m_txtWeekPrompt.visible = false;
  162. item.m_btnIcoWeekPromptTag.visible = false;
  163. if (itemCfg.param2Arr.Length != 0)
  164. {
  165. item.m_txtWeekPrompt.visible = true;
  166. item.m_btnIcoWeekPromptTag.visible = true;
  167. item.m_txtWeekPrompt.text = string.Format("连续{0}天每日获得", itemCfg.param2Arr[0]);
  168. }
  169. int numItems;
  170. var childItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
  171. var remainBuyNum = shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.id);
  172. item.m_comLeftGiftBox.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
  173. item.m_btnBuy.m_txtOldPrice.text = $"{shopCfg.originalPrice}";
  174. item.m_btnBuy.m_loaIcon.visible = false;
  175. string mTxtOldPrice = string.Empty;
  176. if (shopCfg.costType == CostType.ITEM)
  177. {
  178. //货币
  179. ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
  180. item.m_btnBuy.m_loaIcon.visible = true;
  181. item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetIconPath(costCfg);
  182. }
  183. else if (shopCfg.costType == CostType.RMB)
  184. {
  185. //人民币
  186. mTxtOldPrice = "元";
  187. }
  188. else
  189. {
  190. //免费
  191. mTxtOldPrice = $"免费";
  192. item.m_btnBuy.m_txtOldPrice.text = "";
  193. item.m_btnBuy.m_txtNewPrice.align = AlignType.Left;
  194. item.m_btnBuy.m_txtNewPrice.x = 90;
  195. }
  196. item.m_btnBuy.m_txtNewPrice.text = $"{shopCfg.price + mTxtOldPrice}";
  197. item.m_comLeftGiftBox.target.data = itemCfg;
  198. item.m_comLeftGiftBox.m_loaIcon.onClick.Add(OnListSelectorItemClick);
  199. if (shopCfg.originalPrice != shopCfg.price)
  200. {
  201. var roundedNumStr = NumberUtil.CalculateDiscount(shopCfg.originalPrice, shopCfg.price);
  202. item.m_comLeftGiftBox.m_comDiscount.target.visible = true;
  203. item.m_comLeftGiftBox.m_comDiscount.m_txtDiscountNum.text = $"{roundedNumStr}折"; //之后再计算赋值
  204. }
  205. else
  206. {
  207. item.m_comLeftGiftBox.m_comDiscount.target.visible = false;
  208. }
  209. if (shopCfg.refreshType == RefreshType.DAY) //也可以换成人民币来做条件
  210. {
  211. //日刷
  212. item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = false;
  213. item.m_txtUrc.text = string.Format("今日剩余{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
  214. item.m_txtLrc.text = string.Format("可获得{0}会员积分", shopCfg.price * 10);
  215. item.m_txtWeekPrompt.visible = false;
  216. item.m_btnIcoWeekPromptTag.visible = false;
  217. numItems = childItemCfg.itemsArr.Length;
  218. if (remainBuyNum == 0)
  219. {
  220. //已售完
  221. item.m_btnBuy.target.visible = true;
  222. item.m_btnCurReceive.target.visible = false;
  223. item.m_btnBuy.m_bagYellow.visible = false;
  224. item.m_btnBuy.m_bagGrey.visible = true;
  225. }
  226. else
  227. {
  228. //未售完
  229. item.m_btnBuy.target.visible = true;
  230. item.m_btnCurReceive.target.visible = false;
  231. item.m_btnBuy.m_bagYellow.visible = true;
  232. item.m_btnBuy.m_bagGrey.visible = false;
  233. }
  234. }
  235. else
  236. {
  237. //周刷
  238. var weekGiftBoxState = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(shopCfg.itemId);
  239. item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = true;
  240. var itemArr = itemCfg.itemsArr[0];
  241. ItemCfg getItemCfg = ItemCfgArray.Instance.GetCfg(itemArr[0]); //及时获得的物品,读取第一个显示ICON
  242. item.m_comLeftGiftBox.m_comGouMaiGetText.m_loaIcon.url = ResPathUtil.GetIconPath(getItemCfg);
  243. item.m_comLeftGiftBox.m_comGouMaiGetText.m_txtGetGold.text = itemArr[1].ToString();
  244. item.m_txtUrc.text = string.Format("每周限购{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
  245. int rebateDay = EnduringGiftBoxDataManager.Instance.GetItemRebateDay(itemCfg.id);
  246. string mTxtLrc = string.Empty;
  247. if (rebateDay != 0)
  248. {
  249. mTxtLrc = string.Format("剩余{0}天", rebateDay);
  250. }
  251. item.m_txtLrc.text = mTxtLrc;
  252. item.m_txtWeekPrompt.visible = true;
  253. item.m_txtWeekPrompt.text =
  254. string.Format("连续{0}天每日获得",
  255. itemCfg.param2Arr[0] + 1); //NumberUtil.GetChiniseNumberText(itemCfg.param2Arr[0])
  256. item.m_btnIcoWeekPromptTag.visible = true;
  257. numItems = childItemCfg.param1Arr.Length;
  258. //是否需要领取
  259. if (weekGiftBoxState)
  260. {
  261. item.m_btnBuy.target.visible = false;
  262. item.m_btnCurReceive.target.visible = true;
  263. item.m_btnCurReceive.m_receive.visible = true;
  264. item.m_btnCurReceive.m_received.visible = false;
  265. item.m_btnCurReceive.m_txtRec.text = "领取";
  266. }
  267. else
  268. {
  269. //是否能购买
  270. if (remainBuyNum == 0)
  271. {
  272. //已经领取
  273. if (EnduringGiftBoxDataManager.Instance.DayRebateItemIds.Contains(shopCfg.itemId))
  274. {
  275. item.m_btnBuy.target.visible = false;
  276. item.m_btnCurReceive.target.visible = true;
  277. item.m_btnCurReceive.m_receive.visible = false;
  278. item.m_btnCurReceive.m_received.visible = true;
  279. item.m_btnCurReceive.m_txtRec.text = "已领取";
  280. }
  281. else
  282. {
  283. item.m_btnCurReceive.target.visible = false;
  284. item.m_btnBuy.target.visible = true;
  285. item.m_btnBuy.m_bagGrey.visible = true;
  286. item.m_btnBuy.m_bagYellow.visible = false;
  287. }
  288. }
  289. else
  290. {
  291. //未售完
  292. item.m_btnBuy.target.visible = true;
  293. item.m_btnBuy.m_bagGrey.visible = false;
  294. item.m_btnBuy.m_bagYellow.visible = true;
  295. item.m_btnCurReceive.target.visible = false;
  296. }
  297. }
  298. }
  299. item.m_btnIcoWeekPromptTag.onClick.Add(RuleController.ShowRuleView);
  300. item.m_btnIcoWeekPromptTag.data = 300013;
  301. //领取按钮点击事件
  302. item.m_btnCurReceive.target.onClick.Add(OnBtnCurReceiveClick);
  303. //购买按钮点击事件
  304. item.m_btnBuy.target.onClick.Add(OnBtnBuyClick);
  305. item.m_list.data = shopCfg;
  306. item.m_list.itemRenderer = ChildListItemRender;
  307. item.m_list.numItems = numItems;
  308. }
  309. //领取按钮点击事件
  310. // ReSharper disable Unity.PerformanceAnalysis
  311. private void OnBtnCurReceiveClick(EventContext context)
  312. {
  313. GObject sender = context.sender as GObject;
  314. GObject obj = sender.parent;
  315. ShopCfg cfg = obj.data as ShopCfg;
  316. bool isSellOut = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(cfg.itemId);
  317. if (isSellOut)
  318. {
  319. EnduringGiftBoxSProxy.ReqGetGiftBagRebate(cfg.id).Coroutine();
  320. }
  321. else
  322. {
  323. PromptController.Instance.ShowFloatTextPrompt("无法领取");
  324. }
  325. }
  326. //购买按钮点击事件
  327. // ReSharper disable Unity.PerformanceAnalysis
  328. private void OnBtnBuyClick(EventContext context)
  329. {
  330. GObject sender = context.sender as GObject;
  331. GObject obj = sender.parent;
  332. ShopCfg cfg = obj.data as ShopCfg;
  333. bool isSellOut = cfg.maxBuyNum > 0 &&
  334. cfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(cfg.id) <= 0;
  335. if (isSellOut)
  336. {
  337. PromptController.Instance.ShowFloatTextPrompt("已售罄");
  338. return;
  339. }
  340. if (!ShopDataManager.Instance.GetShopGoodsStateById(cfg.id))
  341. {
  342. PromptController.Instance.ShowFloatTextPrompt(ShopDataManager.Instance.GetShopGoodsStateTips(cfg.id));
  343. return;
  344. }
  345. if (cfg.costType == CostType.FREE)
  346. {
  347. ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
  348. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
  349. }
  350. else
  351. {
  352. ViewManager.Show<ItemExchangeView>(cfg.id);
  353. }
  354. }
  355. // ReSharper disable Unity.PerformanceAnalysis
  356. private void ChildListItemRender(int index, GObject obj)
  357. {
  358. UI_ComRewardIconItem uiItemChild = UI_ComRewardIconItem.Proxy(obj);
  359. var shopCfg = uiItemChild.target.parent.data as ShopCfg;
  360. var itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
  361. // uiItemChild.m_showRreceives.visible = false;
  362. //var curGiftBoxState = EnduringGiftBoxDataManager.GiftBoxStateDic[shopCfg.id];
  363. int[][] result;
  364. if (shopCfg.refreshType == RefreshType.DAY)
  365. {
  366. result = itemCfg.itemsArr;
  367. uiItemChild.m_bagYellow.visible = false;
  368. uiItemChild.m_bagBlue.visible = true;
  369. uiItemChild.m_bagYellowEx.visible = false;
  370. uiItemChild.m_bagBlueEx.visible = true;
  371. }
  372. else
  373. {
  374. //周刷
  375. result = itemCfg.param1Arr;
  376. uiItemChild.m_bagYellow.visible = true;
  377. uiItemChild.m_bagBlue.visible = false;
  378. uiItemChild.m_bagYellowEx.visible = true;
  379. uiItemChild.m_bagBlueEx.visible = false;
  380. }
  381. // if (curGiftBoxState == EnduringGiftBoxBuyStatus.YesGet)
  382. // {
  383. // uiItemChild.m_showRreceives.visible = true;
  384. // }
  385. // else if (curGiftBoxState == EnduringGiftBoxBuyStatus.NoGet)
  386. // {
  387. // uiItemChild.m_showRreceives.visible = false;
  388. // }
  389. var itemArr = result[index];
  390. var itemCfgChild = ItemCfgArray.Instance.GetCfg(itemArr[0]);
  391. uiItemChild.m_loaIcon.onClick.Add(OnListSelectorItemClick);
  392. uiItemChild.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfgChild);
  393. uiItemChild.m_num.text = itemArr[1].ToString();
  394. uiItemChild.target.data = itemCfgChild;
  395. UI_ComRewardIconItem.ProxyEnd();
  396. }
  397. //弹出物品详细描述框
  398. private void OnListSelectorItemClick(EventContext context)
  399. {
  400. GObject sender = context.sender as GObject;
  401. GObject obj = sender.parent;
  402. ItemCfg itemCfg = obj.data as ItemCfg;
  403. GoodsItemTipsController.ShowItemTips(itemCfg.id);
  404. }
  405. // ReSharper disable Unity.PerformanceAnalysis
  406. // ReSharper disable Unity.PerformanceAnalysis
  407. private async void OnClickBtnSure()
  408. {
  409. if (_maxTimes > 0 && (_buyTimes + _count) > _maxTimes)
  410. {
  411. PromptController.Instance.ShowFloatTextPrompt("购买次数不足");
  412. return;
  413. }
  414. ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, _buyTimes, _count, out int costId, out int coustNum,
  415. out int buyNum);
  416. Debug.Log(costId + "数量:" + ItemDataManager.GetItemNum(costId));
  417. if (ItemDataManager.GetItemNum(costId) < coustNum)
  418. {
  419. ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(costId);
  420. if (_itemId == ConstItemID.DIAMOND_PURPLE)
  421. {
  422. PromptController.Instance.ShowFloatTextPrompt(string.Format("{0}不足,请前往商城选购", costCfg.name));
  423. }
  424. else
  425. {
  426. AlertUI.Show(costCfg.name + "不足,是否前往购买?").SetLeftButton(true).SetRightButton(true, "确认",
  427. (AlertWindow.AlertCallback)((object data) =>
  428. {
  429. long costNeedCount = coustNum - ItemDataManager.GetItemNum(costId);
  430. BuyItemConteoller.Show(costId, costNeedCount, ConstBuyType.TYPE_ITEM, null, true, true,
  431. GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
  432. }));
  433. OnClickBtnCancel();
  434. }
  435. return;
  436. }
  437. bool result = await ItemExchangeSProxy.ItemExchange(_itemId, _count);
  438. if (result)
  439. {
  440. PromptController.Instance.ShowFloatTextPrompt("购买成功", MessageType.SUCCESS);
  441. if (_onSuccess != null)
  442. {
  443. _onSuccess();
  444. }
  445. }
  446. UpdateView();
  447. //判断一下是不是从主要界面进来的
  448. if (_type == 0)
  449. {
  450. this.Hide();
  451. }
  452. }
  453. //购买连续礼包之后,更新数据+更新界面
  454. // ReSharper disable Unity.PerformanceAnalysis
  455. private void UpDayRebateAndView(EventContext context)
  456. {
  457. ShopCfg shopCfg = context.data as ShopCfg;
  458. var itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
  459. if (itemCfg.itemType == ConstItemType.USEABLE &&
  460. itemCfg.funType == ConstItemFuncType.CONTINUOUS_REWARD_GIFT)
  461. {
  462. int dayNum = EnduringGiftBoxDataManager.Instance.GetItemRebateDay(itemCfg.id);
  463. int totalDayNum = dayNum + itemCfg.param2Arr[0];
  464. EnduringGiftBoxDataManager.Instance.UpDayAllRebateItemDic(itemCfg.id, totalDayNum);
  465. EnduringGiftBoxDataManager.Instance.AddDayRebateItemIds(itemCfg.id);
  466. }
  467. UpdateView();
  468. }
  469. protected override void OnHide()
  470. {
  471. this.RemoveEventListener();
  472. Dispose();
  473. base.Hide();
  474. _onSuccess = null;
  475. }
  476. private void OnClickBtnCancel()
  477. {
  478. // Dispose();
  479. this.Hide();
  480. }
  481. }
  482. }