|
@@ -11,7 +11,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
public class NewLimitChargeView : BaseWindow
|
|
public class NewLimitChargeView : BaseWindow
|
|
{
|
|
{
|
|
- private UI_StoreChargeAddUpUI _ui;
|
|
|
|
|
|
+ private UI_NewLimitChargeUI _ui;
|
|
private List<ShopCfg> _shopCfgs;
|
|
private List<ShopCfg> _shopCfgs;
|
|
private DressUpObjUI _dressUpObjUI;
|
|
private DressUpObjUI _dressUpObjUI;
|
|
private List<DressUpObjUI> _dressUpObjUIs = new List<DressUpObjUI>();
|
|
private List<DressUpObjUI> _dressUpObjUIs = new List<DressUpObjUI>();
|
|
@@ -49,7 +49,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
base.OnInit();
|
|
base.OnInit();
|
|
packageName = UI_StoreChargeAddUpUI.PACKAGE_NAME;
|
|
packageName = UI_StoreChargeAddUpUI.PACKAGE_NAME;
|
|
- _ui = UI_StoreChargeAddUpUI.Create();
|
|
|
|
|
|
+ _ui = UI_NewLimitChargeUI.Create();
|
|
this.viewCom = _ui.target;
|
|
this.viewCom = _ui.target;
|
|
isfullScreen = true;
|
|
isfullScreen = true;
|
|
this.clickBlankToClose = false;
|
|
this.clickBlankToClose = false;
|
|
@@ -64,50 +64,60 @@ namespace GFGGame
|
|
|
|
|
|
_ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
_ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
_ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
_ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
|
|
+ _ui.m_btnBack.onClick.Add(OnBtnBackClick);
|
|
|
|
+ _ui.m_btnCharge.onClick.Add(OnBtnChargeClick);
|
|
}
|
|
}
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
{
|
|
{
|
|
base.AddEventListener();
|
|
base.AddEventListener();
|
|
EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, RefreshList);
|
|
EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, RefreshList);
|
|
- EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
|
|
|
|
|
|
+ //EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
|
|
}
|
|
}
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
|
|
|
|
- RefreshList();
|
|
|
|
- _curSelectIndex = Math.Max(0, RoleDataManager.vipLv - 1);
|
|
|
|
- _ui.m_list.selectedIndex = _curSelectIndex;
|
|
|
|
- _ui.m_list.ScrollToView(_curSelectIndex);
|
|
|
|
- _ui.m_btnLeft.visible = _curSelectIndex == 0 ? false : true;
|
|
|
|
- _ui.m_btnRight.visible = _curSelectIndex < _ui.m_list.numItems - 1 ? true : false;
|
|
|
|
|
|
+ //_curSelectIndex = Math.Max(0, RoleDataManager.vipLv - 1);
|
|
|
|
+ //_ui.m_list.selectedIndex = _curSelectIndex;
|
|
|
|
+ //_ui.m_list.ScrollToView(_curSelectIndex);
|
|
|
|
|
|
|
|
+ //_activityId = 501;
|
|
_activityId = (int)(this.viewData as object[])[0];
|
|
_activityId = (int)(this.viewData as object[])[0];
|
|
_rechargeCfgs = ActivityRechargeCfgArray.Instance.GetCfgsByactivityId(_activityId);
|
|
_rechargeCfgs = ActivityRechargeCfgArray.Instance.GetCfgsByactivityId(_activityId);
|
|
|
|
+ _activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(_activityId);
|
|
|
|
+ //UpdateRedDot();
|
|
|
|
+
|
|
|
|
+ RefreshList();
|
|
|
|
+ _ui.m_btnLeft.visible = _curSelectIndex == 0 ? false : true;
|
|
|
|
+ _ui.m_btnRight.visible = _curSelectIndex < _ui.m_list.numItems - 1 ? true : false;
|
|
|
|
|
|
- UpdateRedDot();
|
|
|
|
|
|
+ Timers.inst.Add(1, 0, UpdateTime);
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
|
|
+ if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
|
|
|
|
+ Timers.inst.Remove(UpdateTime);
|
|
}
|
|
}
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
{
|
|
{
|
|
base.RemoveEventListener();
|
|
base.RemoveEventListener();
|
|
EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, RefreshList);
|
|
EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, RefreshList);
|
|
- EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
|
|
|
|
|
|
+ //EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
|
|
}
|
|
}
|
|
|
|
|
|
private void RefreshList()
|
|
private void RefreshList()
|
|
{
|
|
{
|
|
- _ui.m_list.numItems = VipCfgArray.Instance.dataArray.Length - 1;
|
|
|
|
|
|
+ _ui.m_list.numItems = _rechargeCfgs.Count;
|
|
}
|
|
}
|
|
private void ListItemRenderer(int index, GObject obj)
|
|
private void ListItemRenderer(int index, GObject obj)
|
|
{
|
|
{
|
|
|
|
|
|
- VipCfg lastVipCfg = VipCfgArray.Instance.dataArray[index];
|
|
|
|
- VipCfg vipCfg = VipCfgArray.Instance.dataArray[index + 1];
|
|
|
|
|
|
+ ActivityRechargeCfg lastVipCfg = _rechargeCfgs[index];
|
|
|
|
+ ActivityRechargeCfg vipCfg = _rechargeCfgs[index];
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
UI_ListShowItem item = UI_ListShowItem.Proxy(obj);
|
|
UI_ListShowItem item = UI_ListShowItem.Proxy(obj);
|
|
string name = SuitCfgArray.Instance.GetCfg(vipCfg.suitId).name;
|
|
string name = SuitCfgArray.Instance.GetCfg(vipCfg.suitId).name;
|
|
@@ -116,15 +126,14 @@ namespace GFGGame
|
|
item.m_txtName2.text = name.Length > 2 ? name.Substring(2, 1) : "";
|
|
item.m_txtName2.text = name.Length > 2 ? name.Substring(2, 1) : "";
|
|
item.m_txtName3.text = name.Length > 3 ? name.Substring(3, 1) : "";
|
|
item.m_txtName3.text = name.Length > 3 ? name.Substring(3, 1) : "";
|
|
item.m_txtName4.text = name.Length > 4 ? name.Substring(4) : "";
|
|
item.m_txtName4.text = name.Length > 4 ? name.Substring(4) : "";
|
|
-
|
|
|
|
- item.m_txtGiftBag.SetVar("value", vipCfg.id.ToString()).FlushVars();
|
|
|
|
|
|
+ _ui.m_packageName.text = name;
|
|
if (item.m_listGiftBag.data == null)
|
|
if (item.m_listGiftBag.data == null)
|
|
{
|
|
{
|
|
item.m_listGiftBag.itemRenderer = ListRewardItemRender;
|
|
item.m_listGiftBag.itemRenderer = ListRewardItemRender;
|
|
item.m_listGiftBag.onClickItem.Add(OnListItemClick);
|
|
item.m_listGiftBag.onClickItem.Add(OnListItemClick);
|
|
}
|
|
}
|
|
- item.m_listGiftBag.data = lastVipCfg.bonusOnceArr;
|
|
|
|
- item.m_listGiftBag.numItems = lastVipCfg.bonusOnceArr.Length;
|
|
|
|
|
|
+ item.m_listGiftBag.data = lastVipCfg.bonusArr;
|
|
|
|
+ item.m_listGiftBag.numItems = lastVipCfg.bonusArr.Length;
|
|
|
|
|
|
if (item.m_holder.data == null)
|
|
if (item.m_holder.data == null)
|
|
{
|
|
{
|
|
@@ -148,9 +157,14 @@ namespace GFGGame
|
|
}
|
|
}
|
|
item.m_btnGetGiftBag.data = vipCfg.id;
|
|
item.m_btnGetGiftBag.data = vipCfg.id;
|
|
bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfg.id);
|
|
bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfg.id);
|
|
- item.m_btnGetGiftBag.grayed = isGet || vipCfg.id > RoleDataManager.vipLv;
|
|
|
|
- RedDotController.Instance.SetComRedDot(item.m_btnGetGiftBag, !isGet && RoleDataManager.vipLv >= vipCfg.id);
|
|
|
|
- bool canGet = GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv == vipCfg.id;
|
|
|
|
|
|
+ long limitChargeExp = _activityInfo.CountValue;
|
|
|
|
+ item.m_btnGetGiftBag.grayed = limitChargeExp < _rechargeCfgs[index].value;
|
|
|
|
+ //RedDotController.Instance.SetComRedDot(item.m_btnGetGiftBag, !isGet && RoleDataManager.vipLv >= vipCfg.id);
|
|
|
|
+ //bool canGet = GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv == vipCfg.id;
|
|
|
|
+
|
|
|
|
+ //long limitChargeExp = _activityInfo.CountValue;// GameGlobal.myNumericComponent.GetAsInt(NumericType.TotalRechargeScore);
|
|
|
|
+ item.m_txtGiftBag.text = string.Format("活动期间累计获得{0}会员积分({1}/{2})", _rechargeCfgs[index].value, limitChargeExp, _rechargeCfgs[index].value);
|
|
|
|
+
|
|
UI_ListVipItem.ProxyEnd();
|
|
UI_ListVipItem.ProxyEnd();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -184,29 +198,11 @@ namespace GFGGame
|
|
ViewManager.Show<SuitShowView>(new object[] { _suitTypeId, suitId, new List<int>() { suitId }, false });
|
|
ViewManager.Show<SuitShowView>(new object[] { _suitTypeId, suitId, new List<int>() { suitId }, false });
|
|
}
|
|
}
|
|
|
|
|
|
- private void OnBtnWeekClick(EventContext context)
|
|
|
|
- {
|
|
|
|
- GObject obj = context.sender as GObject;
|
|
|
|
- int vipLv = (int)obj.data;
|
|
|
|
- ViewManager.Show<WeekGiftView>(vipLv);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private void OnBtnGetGiftBagClick(EventContext context)
|
|
private void OnBtnGetGiftBagClick(EventContext context)
|
|
{
|
|
{
|
|
GObject obj = context.sender as GObject;
|
|
GObject obj = context.sender as GObject;
|
|
- int vipLv = (int)obj.data;
|
|
|
|
- bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipLv);
|
|
|
|
- if (isGet)
|
|
|
|
- {
|
|
|
|
- PromptController.Instance.ShowFloatTextPrompt("会员等级礼包已领取");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (RoleDataManager.vipLv < vipLv)
|
|
|
|
- {
|
|
|
|
- PromptController.Instance.ShowFloatTextPrompt("会员等级不足");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- ShopSProxy.ReqGetVipGiftBag(vipLv).Coroutine();
|
|
|
|
|
|
+ int id = (int)obj.data;
|
|
|
|
+ ActivityGlobalSProxy.ReqGetActivityBonus(_activityId, id).Coroutine();
|
|
}
|
|
}
|
|
|
|
|
|
private void OnBtnLeftClick()
|
|
private void OnBtnLeftClick()
|
|
@@ -215,16 +211,20 @@ namespace GFGGame
|
|
if (_curSelectIndex == 0) return;
|
|
if (_curSelectIndex == 0) return;
|
|
_curSelectIndex = _curSelectIndex - 1;
|
|
_curSelectIndex = _curSelectIndex - 1;
|
|
_ui.m_list.ScrollToView(_curSelectIndex, true);
|
|
_ui.m_list.ScrollToView(_curSelectIndex, true);
|
|
- UpdateRedDot();
|
|
|
|
|
|
+ //UpdateRedDot();
|
|
}
|
|
}
|
|
private void OnBtnRightClick()
|
|
private void OnBtnRightClick()
|
|
{
|
|
{
|
|
if (_curSelectIndex == _ui.m_list.numItems - 1) return;
|
|
if (_curSelectIndex == _ui.m_list.numItems - 1) return;
|
|
_curSelectIndex = _curSelectIndex + 1;
|
|
_curSelectIndex = _curSelectIndex + 1;
|
|
_ui.m_list.ScrollToView(_curSelectIndex, true);
|
|
_ui.m_list.ScrollToView(_curSelectIndex, true);
|
|
- UpdateRedDot();
|
|
|
|
|
|
+ //UpdateRedDot();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ private void OnBtnChargeClick()
|
|
|
|
+ {
|
|
|
|
+ ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_CHARGE, ConstStoreSubId.STORE_CHARGE });
|
|
|
|
+ }
|
|
private void UpdateSuitView()
|
|
private void UpdateSuitView()
|
|
{
|
|
{
|
|
_curSelectIndex = _ui.m_list.GetFirstChildInView();
|
|
_curSelectIndex = _ui.m_list.GetFirstChildInView();
|
|
@@ -233,35 +233,42 @@ namespace GFGGame
|
|
_ui.m_btnRight.visible = _curSelectIndex < _ui.m_list.numItems - 1 ? true : false;
|
|
_ui.m_btnRight.visible = _curSelectIndex < _ui.m_list.numItems - 1 ? true : false;
|
|
}
|
|
}
|
|
|
|
|
|
- private void UpdateRedDot()
|
|
|
|
|
|
+ private void UpdateTime(object param)
|
|
{
|
|
{
|
|
|
|
+ long curTime = TimeHelper.ServerNow();
|
|
|
|
+ long endTime = _activityInfo.EndTime;
|
|
|
|
+ _ui.m_txtTime.text = TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
|
|
+ }
|
|
|
|
|
|
- bool leftRed = false;
|
|
|
|
- bool rightRed = false;
|
|
|
|
- VipCfg[] vipCfgs = VipCfgArray.Instance.dataArray;
|
|
|
|
- for (int i = 1; i < vipCfgs.Length; i++)
|
|
|
|
- {
|
|
|
|
- bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfgs[i].id);
|
|
|
|
- bool red = !isGet && RoleDataManager.vipLv >= vipCfgs[i].id;
|
|
|
|
|
|
+ //private void UpdateRedDot()
|
|
|
|
+ //{
|
|
|
|
|
|
- if (red && _curSelectIndex > i - 1)
|
|
|
|
- {
|
|
|
|
- leftRed = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- if (red && _curSelectIndex + 1 < i)
|
|
|
|
- {
|
|
|
|
- rightRed = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // bool leftRed = false;
|
|
|
|
+ // bool rightRed = false;
|
|
|
|
+ // VipCfg[] vipCfgs = VipCfgArray.Instance.dataArray;
|
|
|
|
+ // for (int i = 1; i < vipCfgs.Length; i++)
|
|
|
|
+ // {
|
|
|
|
+ // bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfgs[i].id);
|
|
|
|
+ // bool red = !isGet && RoleDataManager.vipLv >= vipCfgs[i].id;
|
|
|
|
|
|
- if (GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv > 0 && _curSelectIndex > RoleDataManager.vipLv - 1) { leftRed = true; }
|
|
|
|
- if (GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv > 0 && _curSelectIndex + 1 < RoleDataManager.vipLv) { rightRed = true; }
|
|
|
|
- RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, leftRed);
|
|
|
|
- RedDotController.Instance.SetComRedDot(_ui.m_btnRight, rightRed);
|
|
|
|
|
|
+ // if (red && _curSelectIndex > i - 1)
|
|
|
|
+ // {
|
|
|
|
+ // leftRed = true;
|
|
|
|
+ // break;
|
|
|
|
+ // }
|
|
|
|
+ // if (red && _curSelectIndex + 1 < i)
|
|
|
|
+ // {
|
|
|
|
+ // rightRed = true;
|
|
|
|
+ // break;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ // if (GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv > 0 && _curSelectIndex > RoleDataManager.vipLv - 1) { leftRed = true; }
|
|
|
|
+ // if (GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv > 0 && _curSelectIndex + 1 < RoleDataManager.vipLv) { rightRed = true; }
|
|
|
|
+ // RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, leftRed);
|
|
|
|
+ // RedDotController.Instance.SetComRedDot(_ui.m_btnRight, rightRed);
|
|
|
|
+
|
|
|
|
+ //}
|
|
|
|
|
|
private void OnListItemClick(EventContext context)
|
|
private void OnListItemClick(EventContext context)
|
|
{
|
|
{
|
|
@@ -269,5 +276,10 @@ namespace GFGGame
|
|
ItemCfg itemCfg = comItem.data as ItemCfg;
|
|
ItemCfg itemCfg = comItem.data as ItemCfg;
|
|
GoodsItemTipsController.ShowItemTips(itemCfg.id);
|
|
GoodsItemTipsController.ShowItemTips(itemCfg.id);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void OnBtnBackClick()
|
|
|
|
+ {
|
|
|
|
+ ViewManager.GoBackFrom(typeof(NewLimitChargeView).FullName);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|