local UIPushInterfaceHeroMatch3v3 = UIViewClass() function UIPushInterfaceHeroMatch3v3:OnOpened(context) self:RegistSystemEvent(EventID.UI_HeroMatch3v3_CloseView, self.OnBackButtonPressed) -- 赛程结束关闭界面 self:RegistSystemEvent(EventID.UI_SpecialTeam_TeamMemberFull, self.OnTeamRed) self:RegistSystemEvent(EventID.UI_SpecialTeam_ApplyInfoHandle, self.OnTeamRed) self:OnTeamRed() local MatchServerInfo = MDL.HeroMatch3v3.GetHeroMatch3v3AllInfo() -- X年第Y赛季 UIUtils.SetLabel(self.lab_PackageName1, string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_Time1, UTL.Time.OsDateOriginal("%Y", UTL.Time.GetServerTimestamp()), MDL.HeroMatch3v3.GetCurSeasonID())) -- X日-Y日 每日几时到几时 local startDay, endDay, timetable local day = 0 for k, v in DataSheetManager.TeamMatchTime:GetEnumerator() do day = day + v.Day if v.ID + 1 == MDL.HeroMatch3v3.Enum_BigStage.Screening then startDay = os.date(UTL.Time.FormatDateEnum.MD, MatchServerInfo.startTm + day * UTL.Time.TotalSecondsOneDay) elseif v.ID == MDL.HeroMatch3v3.Enum_BigStage.Screening then timetable = { StartTime = v.StartTime, EndTime = v.EndTime } elseif v.ID + 1 == MDL.HeroMatch3v3.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_HeroMatch3v3_VN_Time2, refreshTime, startDay, endDay)) else UIUtils.SetLabel(self.lab_PackageName2, string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_Time2, startDay, endDay, refreshTime)) end MDL.CrossServer.GetZoneGroupInfoReq(MDL.CrossServer.CrossServerZoneGroupType[LuaConst.ActivityType.HeroMatch3v3]) end function UIPushInterfaceHeroMatch3v3:OnTeamRed() if MDL.SpecialTeam.IsHasMemberApply() or CTL.SpecialTeam.IsHasSpecialTeamFullRedKey() then self.btn_Team:SetRedPoint(true) else self.btn_Team:SetRedPoint(false) end end function UIPushInterfaceHeroMatch3v3:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIPushInterfaceHeroMatch3v3: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.UIHeroMatch3v3Guessing, nil, "HeroMatch1v1/UIHeroMatch1v1Guessing") elseif comp == self.btn_Team then -- 战团 CTL.SpecialTeam.OpenMain() elseif comp == self.btn_WarZone then -- 赛制介绍 UIManager.OpenView(Const_UI_Lua.UIEnum.UIWarzoneList, { crossServerZoneGroupType = MDL.CrossServer.CrossServerZoneGroupType[LuaConst.ActivityType.HeroMatch3v3] }) elseif comp == self.btn_InfoLoc or comp == self.btn_Info then --打开战区 UIManager.OpenView(Const_UI_Lua.UIEnum.UICommonNoteView, { id = LuaConst.NoteID.HeroMatch3v3 }) elseif comp == self.btn_Reward then -- 奖励预览 UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroMatch3v3Reward, nil, Const_UI_Lua.UIEnum.UIHeroMatch1v1Reward) end end return UIPushInterfaceHeroMatch3v3