|
@@ -13,6 +13,7 @@ namespace GFGGame
|
|
|
private EffectUI _effectUI2;
|
|
|
private AdCfg[] activitydata;
|
|
|
private List<AdCfg> showActivity = new List<AdCfg>();
|
|
|
+
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
EffectUIPool.Recycle(_effectUI1);
|
|
@@ -37,6 +38,7 @@ namespace GFGGame
|
|
|
this.viewCom.Center();
|
|
|
this.modal = true;
|
|
|
viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
|
|
|
+ isReturnView = true;
|
|
|
}
|
|
|
|
|
|
protected override void OnInit()
|
|
@@ -60,11 +62,18 @@ namespace GFGGame
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
- _ui.m_c1.selectedIndex = 1;
|
|
|
- _ui.m_listActivity.visible = true;
|
|
|
- _ui.m_listNotice.visible = true;
|
|
|
- _ui.m_buttonCom.visible = true;
|
|
|
+
|
|
|
+ if (backRefresh)
|
|
|
+ {
|
|
|
+ _ui.m_c1.selectedIndex = 1;
|
|
|
+ _ui.m_listActivity.visible = true;
|
|
|
+ _ui.m_listNotice.visible = true;
|
|
|
+ _ui.m_buttonCom.visible = true;
|
|
|
+ }
|
|
|
+
|
|
|
OnCtrlChange();
|
|
|
+ UpdateInfo();
|
|
|
+ UpdateTitleRedDot();
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -102,20 +111,16 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 活动公告 0
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="index"></param>
|
|
|
+ /// <param name="obj"></param>
|
|
|
private void ListActivityItemRender(int index, GObject obj)
|
|
|
{
|
|
|
UI_ListActivityItem item = UI_ListActivityItem.Proxy(obj);
|
|
|
- item.m_loaShow.url = ResPathUtil.GetActivityPath(showActivity[index].NoticeTips,"png");
|
|
|
+ item.m_loaShow.url = ResPathUtil.GetActivityPath(showActivity[index].NoticeTips, "png");
|
|
|
item.m_txtName.text = "";
|
|
|
- switch (showActivity[index].jumpId)
|
|
|
- {
|
|
|
- //后续添加其他活动
|
|
|
- case "LuckyBoxView":
|
|
|
- item.m_imgTips.visible = RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy) || RedDotDataManager.Instance.GetLuckyBoxFreeTimes();
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
long endTime = 0;
|
|
|
long curTime = TimeHelper.ServerNow();
|
|
|
if (showActivity.Count > 0)
|
|
@@ -133,9 +138,11 @@ namespace GFGGame
|
|
|
item.m_txtTime.text = string.Format("剩余时间:{0}", TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime));
|
|
|
item.target.onClick.Add(OnListActivityClick);
|
|
|
item.target.data = showActivity[index];
|
|
|
+ item.m_imgTips.visible = NoticeDataManager.Instance.GetRedDotState(showActivity[index].jumpId, showActivity[index].activityId);
|
|
|
UI_ListActivityItem.ProxyEnd();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private void OnListActivityClick(EventContext context)
|
|
|
{
|
|
|
AdCfg adCfg = (AdCfg)(context.sender as GObject).data;
|
|
@@ -156,16 +163,21 @@ namespace GFGGame
|
|
|
|
|
|
if (jumpIndex != 0)
|
|
|
{
|
|
|
- this.Hide();
|
|
|
- ViewManager.Show($"GFGGame.{adCfg.jumpId}", jumpIndex);
|
|
|
+ //Hide();
|
|
|
+ ViewManager.Show($"GFGGame.{adCfg.jumpId}", jumpIndex, false, false);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- this.Hide();
|
|
|
- ViewManager.Show($"GFGGame.{adCfg.jumpId}", param);
|
|
|
+ //Hide();
|
|
|
+ ViewManager.Show($"GFGGame.{adCfg.jumpId}", param, false, false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 系统公告 1
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="index"></param>
|
|
|
+ /// <param name="obj"></param>
|
|
|
private void ListNoticeItemRender(int index, GObject obj)
|
|
|
{
|
|
|
NoticeInfo noticeInfo = NoticeDataManager.Instance.NoticeInfos[index];
|
|
@@ -179,8 +191,10 @@ namespace GFGGame
|
|
|
item.m_btnGo.onClick.Add(OnListNoticeBtnGoClick);
|
|
|
}
|
|
|
item.m_btnGo.data = noticeInfo;
|
|
|
+
|
|
|
UI_ListNoticeItem.ProxyEnd();
|
|
|
}
|
|
|
+
|
|
|
private async void OnListNoticeBtnGoClick(EventContext context)
|
|
|
{
|
|
|
_ui.m_listActivity.visible = false;
|
|
@@ -203,48 +217,33 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateInfo()
|
|
|
{
|
|
|
- if(activitydata == null)
|
|
|
- {
|
|
|
- activitydata = AdCfgArray.Instance.dataArray;
|
|
|
- }
|
|
|
- showActivity.Clear();
|
|
|
- for (int i = 0; i < activitydata.Length; i++)
|
|
|
+ showActivity = NoticeDataManager.Instance.UpdateShowActivity();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private void UpdateTitleRedDot()
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnActivity, false);
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnNotice, false);
|
|
|
+
|
|
|
+ // 活动公告
|
|
|
+ for (int i = 0; i < showActivity.Count; i++)
|
|
|
{
|
|
|
- AdCfg adCfg = activitydata[i];
|
|
|
- if (adCfg.activityId > 0)
|
|
|
+ if (NoticeDataManager.Instance.GetRedDotState(showActivity[i].jumpId, showActivity[i].activityId))
|
|
|
{
|
|
|
- if (ActivityGlobalDataManager.Instance.GetActivityInfo(adCfg.activityId) == null) continue;
|
|
|
- ActivityInfo activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(adCfg.activityId);
|
|
|
- if (TimeHelper.ServerNow() < activityInfo.StartTime || TimeHelper.ServerNow() > activityInfo.EndTime) continue;
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnActivity, true, "", -25);
|
|
|
+ break;
|
|
|
}
|
|
|
- if (adCfg.NoticeTips != null && adCfg.NoticeTips != "")
|
|
|
+ }
|
|
|
+
|
|
|
+ // 系统公告
|
|
|
+ for (int i = 0; i < NoticeDataManager.Instance.NoticeInfos.Count; i++)
|
|
|
+ {
|
|
|
+ if (!NoticeDataManager.Instance.NoticeInfos[i].readStatus)
|
|
|
{
|
|
|
- if (adCfg.activityId != 0)
|
|
|
- {
|
|
|
- ActivityInfo activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(adCfg.activityId);
|
|
|
- if (TimeHelper.ServerNow() < activityInfo.StartTime || TimeHelper.ServerNow() > activityInfo.EndTime)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- showActivity.Add(adCfg);
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- if (adCfg.startTime != "" && adCfg.startTime != null)
|
|
|
- {
|
|
|
- long startTime = TimeUtil.DateTimeToTimestamp(adCfg.startTime);
|
|
|
- long endTime = TimeUtil.DateTimeToTimestamp(adCfg.endTime);
|
|
|
- if (TimeHelper.ServerNow() < startTime || TimeHelper.ServerNow() > endTime)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- showActivity.Add(adCfg);
|
|
|
- }
|
|
|
- }
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnNotice, true, "", -25);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|