|
@@ -56,7 +56,12 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnShown();
|
|
|
_valueBarController.OnShown();
|
|
|
+ _ui.m_c1.selectedIndex = 0;
|
|
|
+ _ui.m_comTab.m_c1.selectedIndex = 0;
|
|
|
_ui.m_list.numItems = RechargeCfgArray.Instance.dataArray.Length;
|
|
|
+ _ui.m_listExchange.numItems = ShopExchangeCfgArray.Instance.dataArray.Length;
|
|
|
+ UpdateGiftBagList();
|
|
|
+ OnTabChange();
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -72,9 +77,6 @@ namespace GFGGame
|
|
|
private void OnComTabChange()
|
|
|
{
|
|
|
_ui.m_c1.selectedIndex = _ui.m_comTab.m_c1.selectedIndex;
|
|
|
- _ui.m_list.numItems = RechargeCfgArray.Instance.dataArray.Length;
|
|
|
- _ui.m_listExchange.numItems = ShopExchangeCfgArray.Instance.dataArray.Length;
|
|
|
- UpdateGiftBagList();
|
|
|
|
|
|
}
|
|
|
private void OnTabChange()
|
|
@@ -104,8 +106,9 @@ namespace GFGGame
|
|
|
item.m_btnBuy.target.data = index;
|
|
|
item.m_txtName.text = string.Format("{0}{1}", itemData.itemNum, itemData.name);
|
|
|
item.m_txtDesc.text = string.Format("首充赠送+{0}{1}", itemData.itemNum, itemData.name);
|
|
|
- item.m_imgDouble.visible = RechargeDataManager.Instance.GetRechargeBuyNumById(itemData.id) <= itemData.doubleTimes;
|
|
|
- item.m_txtDesc.visible = RechargeDataManager.Instance.GetRechargeBuyNumById(itemData.id) <= itemData.doubleTimes; ;
|
|
|
+ bool isDouble = RechargeDataManager.Instance.GetRechargeBuyNumById(itemData.id) < itemData.doubleTimes;
|
|
|
+ item.m_imgDouble.visible = isDouble;
|
|
|
+ item.m_txtDesc.visible = isDouble;
|
|
|
item.m_icon.url = "ui://RechargeStore/sc_zizhuan_" + itemData.id;
|
|
|
|
|
|
UI_StoreListItem.ProxyEnd();
|
|
@@ -118,7 +121,7 @@ namespace GFGGame
|
|
|
item.m_txtName.text = cfg.name;
|
|
|
item.m_icon.url = string.Format("ui://RechargeStore/{0}", cfg.res);
|
|
|
|
|
|
- item.m_txtDesc.SetVar("count", cfg.desc);
|
|
|
+ item.m_txtDesc.SetVar("count", cfg.desc).FlushVars(); ;
|
|
|
item.m_grpDiscount.visible = cfg.desc != "";
|
|
|
|
|
|
item.m_txtEndTime.text = RechargeDataManager.Instance.GetEndTime(cfg.id);
|
|
@@ -136,8 +139,9 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
int buyNum = RechargeDataManager.Instance.GetGiftBuyNumById(cfg.id);
|
|
|
- item.m_txtLimit.text = string.Format("每{0}限购({1}/{2})", RechargeDataManager.Instance.refreshType[cfg.refreshType], StringUtil.GetColorText(buyNum.ToString(), "#DA8870"), cfg.maxBuyNum);
|
|
|
- if (cfg.refreshType == RefreshType.NONE) item.m_txtLimit.text = "永久限购";
|
|
|
+ item.m_txtLimit.text = string.Format("{0}({1}/{2})", RechargeDataManager.Instance.refreshType[cfg.refreshType], StringUtil.GetColorText(buyNum.ToString(), "#DA8870"), cfg.maxBuyNum);
|
|
|
+ item.m_txtLimit.visible = cfg.maxBuyNum > 0;
|
|
|
+ // if (cfg.refreshType == RefreshType.NONE) item.m_txtLimit.text = "永久限购";
|
|
|
// UI_Button14 btn = UI_Button14.Proxy(item.m_btnBuy);
|
|
|
item.m_c1.selectedIndex = cfg.maxBuyNum == 0 || buyNum < cfg.maxBuyNum ? 0 : 1;
|
|
|
if (item.m_c1.selectedIndex == 0)
|
|
@@ -181,6 +185,13 @@ namespace GFGGame
|
|
|
private void OnBtnBuyClick(EventContext context)
|
|
|
{
|
|
|
GObject btn = context.sender as GObject;
|
|
|
+ int giftId = (int)btn.data;
|
|
|
+ GiftBagCfg cfg = GiftBagCfgArray.Instance.GetCfg(giftId);
|
|
|
+ if (cfg.maxBuyNum != 0 && RechargeDataManager.Instance.GetGiftBuyNumById(giftId) == cfg.maxBuyNum)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("已售罄");
|
|
|
+ return;
|
|
|
+ }
|
|
|
ViewManager.Show<GiftBagBuyView>(btn.data);
|
|
|
}
|
|
|
|