|
@@ -1,6 +1,7 @@
|
|
|
using System.Text.RegularExpressions;
|
|
|
using ET;
|
|
|
using FairyGUI;
|
|
|
+using Hutool;
|
|
|
using UI.League;
|
|
|
using UnityEngine;
|
|
|
|
|
@@ -18,6 +19,7 @@ namespace GFGGame
|
|
|
_ui.Dispose();
|
|
|
_ui = null;
|
|
|
}
|
|
|
+
|
|
|
base.Dispose();
|
|
|
}
|
|
|
|
|
@@ -36,10 +38,12 @@ namespace GFGGame
|
|
|
_ui.m_btnRank.onClick.Add(OnBtnRankClick);
|
|
|
_ui.m_btnAnswer.onClick.Add(OnBtnAnswerClick);
|
|
|
}
|
|
|
+
|
|
|
protected override void AddEventListener()
|
|
|
{
|
|
|
base.AddEventListener();
|
|
|
}
|
|
|
+
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
@@ -56,12 +60,13 @@ namespace GFGGame
|
|
|
protected override void RemoveEventListener()
|
|
|
{
|
|
|
base.RemoveEventListener();
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
private void OnBtnRankClick()
|
|
|
{
|
|
|
ViewManager.Show<LeagueAnswerRankView>();
|
|
|
}
|
|
|
+
|
|
|
private void OnBtnAnswerClick()
|
|
|
{
|
|
|
Hide();
|
|
@@ -70,18 +75,21 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateView()
|
|
|
{
|
|
|
-
|
|
|
- OtherRoleInfoData lastNO1 = LeagueDataManager.Instance.GetMemberRoleInfo(LeagueDataManager.Instance.LeagueData.LastWeekAnswerNO1Id);
|
|
|
+ OtherRoleInfoData lastNO1 =
|
|
|
+ LeagueDataManager.Instance.GetMemberRoleInfo(LeagueDataManager.Instance.LeagueData.LastWeekAnswerNO1Id);
|
|
|
_ui.m_comHead.target.visible = false;
|
|
|
if (lastNO1 != null)
|
|
|
{
|
|
|
- ItemCfg headCfg = ItemCfgArray.Instance.GetCfg(lastNO1.headId == 0 ? ConstItemID.HEADID : lastNO1.headId);
|
|
|
+ ItemCfg headCfg =
|
|
|
+ ItemCfgArray.Instance.GetCfg(lastNO1.headId == 0 ? ConstItemID.HEADID : lastNO1.headId);
|
|
|
_ui.m_comHead.m_loaIcon.url = ResPathUtil.GetHeadPath(headCfg.res);
|
|
|
_ui.m_comHead.target.visible = true;
|
|
|
}
|
|
|
+
|
|
|
_ui.m_txtName.text = lastNO1 == null ? "虚位以待" : lastNO1.roleName;
|
|
|
_ui.m_txtRule.text = TextDescCfgArray.Instance.GetCfg(300008).text;
|
|
|
- if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.End)
|
|
|
+ if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) ==
|
|
|
+ LeagueQuestionStatus.End)
|
|
|
{
|
|
|
_ui.m_btnAnswer.visible = false;
|
|
|
_ui.m_txtTime.visible = true;
|
|
@@ -93,18 +101,24 @@ namespace GFGGame
|
|
|
_ui.m_txtTime.visible = false;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void UpdateTime(object param)
|
|
|
{
|
|
|
+ int curIndex = DateUtil.GetNearestStartTimeIndex(GlobalCfgArray.globalCfg.leagueQuestionCloseTimeArr);
|
|
|
long curTime = TimeHelper.ServerNow();
|
|
|
- long endTime = TimeUtil.GetNextTime(GlobalCfgArray.globalCfg.leagueQuestionStartTimeArr[0]);//暂时
|
|
|
- if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) > LeagueQuestionStatus.End
|
|
|
- || endTime - curTime < 0)
|
|
|
+ var questionStartTimeStr = GlobalCfgArray.globalCfg.leagueQuestionStartTimeArr[curIndex];
|
|
|
+ long endTime =TimeHelper.ServerNow() > TimeUtil.GetCurDayTime(questionStartTimeStr)
|
|
|
+ ? TimeUtil.GetNextTime(questionStartTimeStr)
|
|
|
+ : TimeUtil.GetCurDayTime(questionStartTimeStr);
|
|
|
+ if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) >
|
|
|
+ LeagueQuestionStatus.End
|
|
|
+ || endTime - curTime < 0)
|
|
|
{
|
|
|
Timers.inst.Remove(UpdateTime);
|
|
|
return;
|
|
|
}
|
|
|
- _ui.m_txtTime.text = string.Format("{0}后开启", TimeUtil.FormattingTimeTo_HHmmss((endTime - curTime)));
|
|
|
|
|
|
+ _ui.m_txtTime.text = string.Format("{0}后开启", TimeUtil.FormattingTimeTo_HHmmss((endTime - curTime)));
|
|
|
}
|
|
|
}
|
|
|
}
|