local UIPushInterfaceHeroMatch1v1 = UIViewClass() function UIPushInterfaceHeroMatch1v1:OnOpened(context) self:RegistSystemEvent(EventID.UI_HeroMatch1v1_CloseView, self.OnBackButtonPressed) -- 赛程结束关闭界面 local MatchServerInfo = MDL.HeroMatch1v1.GetHeroMatch1v1AllInfo() -- X年第Y赛季 UIUtils.SetLabel(self.lab_PackageName1, string.FormatByIdsId(Const_IDS.IDS_HeroMatch1v1_Time1, UTL.Time.OsDateOriginal("%Y", UTL.Time.GetServerTimestamp()), MDL.HeroMatch1v1.GetCurSeasonID())) -- X日-Y日 每日几时到几时 local startDay, endDay, timetable local day = 0 for k,v in DataSheetManager.MatchTime:GetEnumerator() do day = day + v.Day if v.ID + 1 == MDL.HeroMatch1v1.Enum_BigStage.Screening then startDay = os.date(UTL.Time.FormatDateEnum.MD, MatchServerInfo.startTm + day * UTL.Time.TotalSecondsOneDay) elseif v.ID == MDL.HeroMatch1v1.Enum_BigStage.Screening then timetable = {StartTime= v.StartTime, EndTime = v.EndTime} elseif v.ID + 1 == MDL.HeroMatch1v1.Enum_BigStage.Display then endDay = os.date(UTL.Time.FormatDateEnum.MD, MatchServerInfo.startTm + (day - 1) * UTL.Time.TotalSecondsOneDay) break end end local _, refreshTime = UTL.Time.GetDateDescAndTime({timetable}) if GameAppInfo.IsVietnamPackage() then UIUtils.SetLabel(self.lab_PackageName2, string.FormatByIdsId(Const_IDS.IDS_HeroMatch1v1_VN_Time2, refreshTime, startDay, endDay)) else UIUtils.SetLabel(self.lab_PackageName2, string.FormatByIdsId(Const_IDS.IDS_HeroMatch1v1_Time2, startDay, endDay, refreshTime)) end end function UIPushInterfaceHeroMatch1v1:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIPushInterfaceHeroMatch1v1:OnButtonClicked(comp) if comp == self.btn_Close then CTL.PushInterface.HidePushInterface(self.__viewClassPath) self:CloseView() elseif comp == self.btn_TopicQuiz then -- 话题竞猜 UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroMatch1v1Guessing) elseif comp == self.btn_Introduction then -- 赛制介绍 UIManager.OpenView(Const_UI_Lua.UIEnum.UICommonNoteView,{id = LuaConst.NoteID.HeroMatch1v1}) elseif comp == self.btn_Reward then -- 奖励预览 UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroMatch1v1Reward) elseif comp == self.btn_WarZone then -- 战区分组 UIManager.OpenView(Const_UI_Lua.UIEnum.UIWarzoneList, {crossServerZoneGroupType = MDL.CrossServer.CrossServerZoneGroupType[LuaConst.ActivityType.HeroMatch1v1]}) end end return UIPushInterfaceHeroMatch1v1