GiftBagBuyView.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using System.Threading.Tasks;
  2. using ET;
  3. using FairyGUI;
  4. using UI.Store;
  5. namespace GFGGame
  6. {
  7. public class GiftBagBuyView : BaseWindow
  8. {
  9. // private UI_GiftBagBuyUI _ui;
  10. // private int _goodsId;
  11. // public override void Dispose()
  12. // {
  13. // if (_ui != null)
  14. // {
  15. // _ui.Dispose();
  16. // }
  17. // _ui = null;
  18. // base.Dispose();
  19. // }
  20. // protected override void OnHide()
  21. // {
  22. // base.OnHide();
  23. // }
  24. // protected override void OnInit()
  25. // {
  26. // base.OnInit();
  27. // packageName = UI_GiftBagBuyUI.PACKAGE_NAME;
  28. // _ui = UI_GiftBagBuyUI.Create();
  29. // this.viewCom = _ui.target;
  30. // this.viewCom.Center();
  31. // this.modal = true;
  32. // viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
  33. // _ui.m_btnBuy.onClick.Add(OnBtnBuyClick);
  34. // _ui.m_list.itemRenderer = ListItemRender;
  35. // }
  36. // protected override void OnShown()
  37. // {
  38. // base.OnShown();
  39. // _goodsId = (int)this.viewData;
  40. // ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId);
  41. // ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
  42. // _ui.m_txtName.text = itemCfg.name;
  43. // _ui.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);//string.Format("ui://RechargeStore/{0}", cfg.res);
  44. // _ui.m_list.numItems = itemCfg.itemsArr.Length;
  45. // _ui.m_c1.selectedIndex = ShopDataManager.Instance.GetShopGoodsStateById(_goodsId) ? 0 : 1;
  46. // _ui.m_txtLock.text = ShopDataManager.Instance.GetShopGoodsStateTips(cfg.id);
  47. // int buyNum = ShopDataManager.Instance.GetGoodsBuyNumById(cfg.id);
  48. // _ui.m_txtLimit.text = string.Format("{0}({1}/{2})", ShopDataManager.Instance.refreshType[cfg.refreshType], StringUtil.GetColorText(buyNum.ToString(), "#DA8870"), cfg.maxBuyNum);
  49. // // if (cfg.refreshType == RefreshType.NONE) _ui.m_txtLimit.text = "永久限购";
  50. // _ui.m_txtEndTime.text = ShopDataManager.Instance.GetEndTime(cfg.id);
  51. // _ui.m_grpEndTime.visible = cfg.endTime != "";
  52. // _ui.m_txtOriginalPrice.text = NumberUtil.ChangeNumberUnit(cfg.originalPrice);// cfg.originalPrice.ToString();
  53. // if (cfg.price > 0 && cfg.costType != CostType.FREE)
  54. // {
  55. // _ui.m_grpOriginalPrice.visible = cfg.originalPrice > 0;
  56. // _ui.m_grpIcon.visible = true;
  57. // _ui.m_txtPrice.text = NumberUtil.ChangeNumberUnit(cfg.price);// cfg.price.ToString();
  58. // if (cfg.costType == CostType.RMB)
  59. // {
  60. // _ui.m_loaPriceIcon.visible = false;
  61. // _ui.m_txtIcon.visible = true;
  62. // _ui.m_txtIcon.text = "¥";
  63. // }
  64. // else
  65. // {
  66. // ItemCfg itemCostCfg = ItemCfgArray.Instance.GetCfg(cfg.costId);
  67. // _ui.m_loaPriceIcon.url = ResPathUtil.GetIconPath(itemCostCfg);
  68. // _ui.m_loaPriceIcon.visible = true;
  69. // _ui.m_txtIcon.visible = false;
  70. // }
  71. // }
  72. // else
  73. // {
  74. // _ui.m_grpIcon.visible = false;
  75. // _ui.m_grpOriginalPrice.visible = false;
  76. // _ui.m_txtPrice.text = "免费";
  77. // }
  78. // }
  79. // private void ListItemRender(int index, GObject item)
  80. // {
  81. // ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId);
  82. // ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
  83. // ItemData itemData = ItemUtil.createItemData(itemCfg.itemsArr[index]);
  84. // if (item.data == null)
  85. // {
  86. // item.data = new ItemView(item as GComponent);
  87. // }
  88. // (item.data as ItemView).SetData(itemData);
  89. // }
  90. // private async void OnBtnBuyClick()
  91. // {
  92. // ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId);
  93. // ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
  94. // if (cfg.costType == CostType.ITEM)
  95. // {
  96. // long hasNum = ItemDataManager.GetItemNum(cfg.costId);
  97. // if (hasNum < cfg.price)
  98. // {
  99. // PromptController.Instance.ShowFloatTextPrompt("道具不足");
  100. // return;
  101. // }
  102. // }
  103. // bool result = await RechargeSProxy.ReqBuyGiftBag(_goodsId);
  104. // if (result)
  105. // {
  106. // LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
  107. // this.Hide();
  108. // if (cfg.costType == CostType.RMB)
  109. // {
  110. // PromptController.Instance.ShowFloatTextPrompt("虚拟充值购买成功");
  111. // }
  112. // }
  113. // }
  114. }
  115. }