--[[ 队伍公平竞技,64T32+32T16+16T8 ]] local PlayerHeadCell3V3Helper = require "Modules.TeamFairChampionship.PlayerHeadCell3V3Helper" local UITeamFairChampionshipBaseStage02 = UIViewClass() function UITeamFairChampionshipBaseStage02:OnCreated() self.displayMatchStageId = -1 self.matchStageInfo = nil self.curSelectToggleIndex = 0 self.infoList = {} UTL.Toggle.InitToggleGroupByIDS(self.group_Toggles01, "txt", { Const_IDS.IDS_HeroMatch3v3_Team1, Const_IDS.IDS_HeroMatch3v3_Team2, Const_IDS.IDS_HeroMatch3v3_Team3, Const_IDS.IDS_HeroMatch3v3_Team4 }) end function UITeamFairChampionshipBaseStage02:OnOpened(context) self:RegistSystemEvent(EventID.UI_TeamFairChampionship_RefreshInfo, self.RefreshScrollList) self:RegistSystemEvent(EventID.UI_TeamFairChampionship_RefreshOneStage, self.RefreshStage) self:RegistSystemEvent(EventID.UI_TeamFairChampionship_BattleBet, self.RefreshScrollList) self:RegistSystemEvent(EventID.UI_TeamFairChampionship_AllPlayerInfo, self.RefreshScrollList) self.displayMatchStageId = context.displayMatchStageId self.matchStageInfo = MDL.TeamFairChampionship.GetMatchStageInfo(self.displayMatchStageId) if not self.matchStageInfo then MDL.TeamFairChampionship.TeamFairGetStageInfoReq(self.displayMatchStageId) else self:RefreshStage(self.displayMatchStageId, 0) end end function UITeamFairChampionshipBaseStage02:RefreshStage(stageId, myMatchGroupId) if stageId == self.displayMatchStageId then self.matchStageInfo = MDL.TeamFairChampionship.GetMatchStageInfo(self.displayMatchStageId) local watchParam = MDL.TeamFairChampionship.GetWatchParam() if watchParam and watchParam.watchStageId == self.displayMatchStageId then self.group_Toggles01:SelectIndex(watchParam.watchMatchGroupId-1) elseif self.curSelectToggleIndex == 0 then myMatchGroupId = MDL.TeamFairChampionship.GetMyStageMatchGroupIndex(self.displayMatchStageId) if myMatchGroupId>0 then self.group_Toggles01:SelectIndex(myMatchGroupId-1) else self.group_Toggles01:SelectIndex(myMatchGroupId) end else self:RefreshScrollList() end end end function UITeamFairChampionshipBaseStage02:RefreshScrollList() self.LoopScroll_TeamCompetition:RefreshCells() end function UITeamFairChampionshipBaseStage02:OnValueChanged(comp, value) if comp == self.group_Toggles01 then self.curSelectToggleIndex = value+1 self:ShowTeamCompetitionGroupData() end end local SortByGroup = function(groupInfo1, groupInfo2) if groupInfo1.matchGroupId ~= groupInfo2.matchGroupId then return groupInfo1.matchGroupId