|
@@ -9,6 +9,7 @@ namespace GFGGame
|
|
|
public class ChargeStoreView : BaseWindow
|
|
|
{
|
|
|
private UI_ChargeUI _ui;
|
|
|
+ private List<ShopCfg> _shopCfgs;
|
|
|
|
|
|
public override void Dispose()
|
|
|
{
|
|
@@ -40,7 +41,8 @@ namespace GFGGame
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
- _ui.m_list.numItems = RechargeCfgArray.Instance.dataArray.Length;
|
|
|
+ _shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_CHARGE, ConstStoreSubId.STORE_CHARGE);
|
|
|
+ _ui.m_list.numItems = _shopCfgs.Count;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -55,31 +57,43 @@ namespace GFGGame
|
|
|
|
|
|
private void ListItemRenderer(int index, GObject obj)
|
|
|
{
|
|
|
- RechargeCfg itemData = RechargeCfgArray.Instance.dataArray[index];
|
|
|
- UI_StoreListItem item = UI_StoreListItem.Proxy(obj);
|
|
|
- item.m_txtExchangeCount.visible = false;
|
|
|
+ ShopCfg itemData = _shopCfgs[index];
|
|
|
+ UI_ListChargeItem item = UI_ListChargeItem.Proxy(obj);
|
|
|
item.m_btnBuy.m_c1.selectedIndex = 1;
|
|
|
item.m_btnBuy.m_txtTitle.text = itemData.price.ToString();
|
|
|
if (item.target.data == null)
|
|
|
{
|
|
|
- item.target.onClick.Add(() =>
|
|
|
- {
|
|
|
- if (!AntiAddictionController.CheckAntiAddictionRecharge(itemData.price))
|
|
|
- {
|
|
|
- RechargeSProxy.ReqRecharge(itemData.id).Coroutine();
|
|
|
- LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
|
|
|
- }
|
|
|
- });
|
|
|
+ item.target.onClick.Add(OnClickBtnBuy);
|
|
|
+ // item.target.onClick.Add(() =>
|
|
|
+ // {
|
|
|
+ // if (!AntiAddictionController.CheckAntiAddictionRecharge(itemData.price))
|
|
|
+ // {
|
|
|
+ // RechargeSProxy.ReqRecharge(itemData.id).Coroutine();
|
|
|
+ // LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
}
|
|
|
item.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_txtName.text = string.Format("{0}{1}", itemData.itemNum, itemData.itemName);
|
|
|
+ item.m_txtDesc.text = string.Format("首充赠送+{0}{1}", itemData.itemNum, itemData.itemName);
|
|
|
bool isDouble = ShopDataManager.Instance.GetRechargeBuyNumById(itemData.id) < itemData.doubleTimes;
|
|
|
item.m_imgDouble.visible = isDouble;
|
|
|
item.m_txtDesc.visible = isDouble;
|
|
|
- item.m_icon.url = "ui://Store/sc_zizhuan_" + itemData.id;
|
|
|
+ item.m_icon.url = "ui://Store/sc_zizhuan_" + (index + 1);
|
|
|
|
|
|
- UI_StoreListItem.ProxyEnd();
|
|
|
+ UI_ListChargeItem.ProxyEnd();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void OnClickBtnBuy(EventContext context)
|
|
|
+ {
|
|
|
+ GObject obj = context.sender as GObject;
|
|
|
+ int index = (int)obj.data;
|
|
|
+ ShopCfg itemData = _shopCfgs[index];
|
|
|
+ if (!AntiAddictionController.CheckAntiAddictionRecharge(itemData.price))
|
|
|
+ {
|
|
|
+ RechargeSProxy.ReqRecharge(itemData.id).Coroutine();
|
|
|
+ LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|