|
@@ -235,19 +235,20 @@ namespace GFGGame
|
|
|
item.m_c1.selectedIndex = isSellOut ? 1 : 0;
|
|
|
if (item.target.data == null)
|
|
|
{
|
|
|
- item.target.onClick.Add(() =>
|
|
|
- {
|
|
|
- bool isSellOut = cfg.maxLimit > 0 && cfg.maxLimit - RechargeDataManager.Instance.GetExchangeBuyNumById(cfg.id) <= 0;
|
|
|
- if (isSellOut)
|
|
|
- {
|
|
|
- PromptController.Instance.ShowFloatTextPrompt("已售罄");
|
|
|
- return;
|
|
|
- }
|
|
|
- ViewManager.Show<ItemExchangeView>(cfg.id);
|
|
|
- });
|
|
|
+ // item.target.onClick.Add(() =>
|
|
|
+ // {
|
|
|
+ // bool isSellOut = cfg.maxLimit > 0 && cfg.maxLimit - RechargeDataManager.Instance.GetExchangeBuyNumById(cfg.id) <= 0;
|
|
|
+ // if (isSellOut)
|
|
|
+ // {
|
|
|
+ // PromptController.Instance.ShowFloatTextPrompt("已售罄");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // ViewManager.Show<ItemExchangeView>(cfg.id);
|
|
|
+ // });
|
|
|
+ item.target.onClick.Add(OnBtnBugItem);
|
|
|
}
|
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
|
|
|
- item.target.data = cfg.id;
|
|
|
+ item.target.data = cfg;
|
|
|
item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costId).res);
|
|
|
item.m_txtName.text = itemCfg.name;
|
|
|
item.m_txtDesc.text = string.Format("剩余:{0}", cfg.maxLimit - RechargeDataManager.Instance.GetExchangeBuyNumById(cfg.id));
|
|
@@ -257,5 +258,17 @@ namespace GFGGame
|
|
|
|
|
|
UI_StoreListItem.ProxyEnd();
|
|
|
}
|
|
|
+ private void OnBtnBugItem(EventContext context)
|
|
|
+ {
|
|
|
+ ShopExchangeCfg cfg = (context.sender as GObject).data as ShopExchangeCfg;
|
|
|
+ bool isSellOut = cfg.maxLimit > 0 && cfg.maxLimit - RechargeDataManager.Instance.GetExchangeBuyNumById(cfg.id) <= 0;
|
|
|
+ if (isSellOut)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("已售罄");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ViewManager.Show<ItemExchangeView>(cfg.id);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|