| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 | 
							- using System.Text.RegularExpressions;
 
- using ET;
 
- using FairyGUI;
 
- using Hutool;
 
- using UI.League;
 
- using UnityEngine;
 
- namespace GFGGame
 
- {
 
-     //联盟答题
 
-     public class LeagueAnswerView : BaseWindow
 
-     {
 
-         private UI_LeagueAnswerUI _ui;
 
-         public override void Dispose()
 
-         {
 
-             if (_ui != null)
 
-             {
 
-                 _ui.Dispose();
 
-                 _ui = null;
 
-             }
 
-             base.Dispose();
 
-         }
 
-         protected override void OnInit()
 
-         {
 
-             base.OnInit();
 
-             packageName = UI_LeagueAnswerUI.PACKAGE_NAME;
 
-             _ui = UI_LeagueAnswerUI.Create();
 
-             this.viewCom = _ui.target;
 
-             this.viewCom.Center();
 
-             this.modal = true;
 
-             viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
-             _ui.m_btnClose.onClick.Add(Hide);
 
-             _ui.m_btnRank.onClick.Add(OnBtnRankClick);
 
-             _ui.m_btnAnswer.onClick.Add(OnBtnAnswerClick);
 
-             _ui.m_btnTeaParty.onClick.Add(OnBtnTeaPartyClick);
 
-         }
 
-         protected override void AddEventListener()
 
-         {
 
-             base.AddEventListener();
 
-         }
 
-         protected override void OnShown()
 
-         {
 
-             base.OnShown();
 
-             if (this.viewData != null)
 
-             {
 
-                 var index = (int)this.viewData;
 
-                 _ui.m_c1.selectedIndex = index;
 
-                 var openCfg = TeapartyOpenCfgArray.Instance.GetCfg(LeagueDataManager.Instance.TeaPartyId);
 
-                 _ui.m_txtPlayRule.text =  TextDescCfgArray.Instance.GetCfg(300023).text + openCfg.preview;
 
-                 _ui.m_btnTeaParty.visible = LeagueDataManager.Instance.TeaPartyStatus != 0;
 
-             }
 
-             else {
 
-                 _ui.m_c1.selectedIndex = 0;
 
-                 UpdateView();
 
-             }
 
-         }
 
-         protected override void OnHide()
 
-         {
 
-             base.OnHide();
 
-             Timers.inst.Remove(UpdateTime);
 
-         }
 
-         protected override void RemoveEventListener()
 
-         {
 
-             base.RemoveEventListener();
 
-         }
 
-         private void OnBtnRankClick()
 
-         {
 
-             ViewManager.Show<LeagueAnswerRankView>();
 
-         }
 
-         private void OnBtnAnswerClick()
 
-         {
 
-             Hide();
 
-             ViewManager.Show<LeagueAnsweringView>();
 
-         }
 
-         private void OnBtnTeaPartyClick()
 
-         {
 
-             Hide();
 
-             var roleTeapartyInfo = LeagueDataManager.Instance.RoleTeapartyInfo;
 
-             if (roleTeapartyInfo.IsQuitTeaParty && roleTeapartyInfo.LastOpenCfgId != 0 && roleTeapartyInfo.LastOpenCfgId == LeagueDataManager.Instance.TeaPartyId) {
 
-                 PromptController.Instance.ShowFloatTextPrompt("该玩法不可以重复参加哦");
 
-                 return;
 
-             }
 
-             if (LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesGo && !LeagueDataManager.Instance.RoleTeapartyInfo.IsComplete && LeagueDataManager.Instance.RoleTeapartyInfo.Status)
 
-                 ViewManager.Show<LeagueTeaPartyShowView>(null, new object[] { typeof(LeagueView).FullName, null });
 
-             else 
 
-                 ViewManager.Show<LeagueTeaPartyView>(null, new object[] { typeof(LeagueView).FullName, null });
 
-         }
 
-         
 
-         private void UpdateView()
 
-         {
 
-             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);
 
-                 _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)
 
-             {
 
-                 _ui.m_btnAnswer.visible = false;
 
-                 _ui.m_txtTime.visible = true;
 
-                 Timers.inst.Add(1, 0, UpdateTime);
 
-             }
 
-             else
 
-             {
 
-                 _ui.m_btnAnswer.visible = true;
 
-                 _ui.m_txtTime.visible = false;
 
-             }
 
-         }
 
-         private void UpdateTime(object param)
 
-         {
 
-             int curIndex = DateUtil.GetNearestStartTimeIndex(GlobalCfgArray.globalCfg.leagueQuestionCloseTimeArr);
 
-             long curTime = TimeHelper.ServerNow();
 
-             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)));
 
-         }
 
-     }
 
- }
 
 
  |