--[[ 入围队伍信息 ]] local UITeamFairChampionshipPromotList = UIViewClass() local function SortByTeamTvtScore(teamInfo1, teamInfo2) return teamInfo1.enterRank0 then UIUtils.SetActive(self.btn_GroupNow, true) UIUtils.SetLabel(self.txt_Now, string.FormatByIdsId(Const_IDS.IDS_FairTournament_PlayerGroup, myFilterGroupId)) self.loop_FTJoinTab:SelectIndex(myFilterGroupId - 1, true) else UIUtils.SetActive(self.group_Mine.gameObject, false) UIUtils.SetActive(self.btn_GroupNow, false) self.loop_FTJoinTab:SelectIndex(0, true) end end function UITeamFairChampionshipPromotList:RefreshOneStage(stageId) if CTL.TeamFairChampionship.IsFilterMatchStageByStageId(stageId) then self:SetMatchTeamList() end end function UITeamFairChampionshipPromotList:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.loop_FTJoinTab then local title = string.FormatByIdsId(Const_IDS.IDS_FairTournament_Group, data) UIUtils.SetLabel(cellTable.txt_Name_Nomal, title) UIUtils.SetLabel(cellTable.txt_Name_Selected, title) else if index % 2 == 0 then UIUtils.SetActive(cellTable.img_Odd, true) UIUtils.SetActive(cellTable.img_Even, false) else UIUtils.SetActive(cellTable.img_Odd, false) UIUtils.SetActive(cellTable.img_Even, true) end self:SetMatchTeamInfo(cellTable, data) end end function UITeamFairChampionshipPromotList:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.loop_FTJoinTab then self.selectGroup = data self:SetMatchTeamList() end end function UITeamFairChampionshipPromotList:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UITeamFairChampionshipPromotList:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() elseif comp == self.btn_GroupNow then local groupId = MDL.TeamFairChampionship.GetMyFilterGroupId() if groupId > 0 then self.loop_FTJoinTab:SelectIndex(groupId-1, true) end elseif comp == self.group_ScoreInfo then UIUtils.SetActive(self.group_ScoreInfo, false) elseif comp == self.btn_Info then UIUtils.SetActive(self.group_ScoreInfo, true) end end function UITeamFairChampionshipPromotList:SetMatchTeamList() table.clearArray(self.infoList) local curStageID = MDL.TeamFairChampionship.GetCurStageID() if not CTL.TeamFairChampionship.IsFilterMatchStage() then curStageID = MDL.TeamFairChampionship.Stage.Filtration_2 end local stageInfo = MDL.TeamFairChampionship.GetMatchStageInfo(curStageID) if not stageInfo then MDL.TeamFairChampionship.TeamFairGetStageInfoReq(curStageID) return end local myTeamId = MDL.TeamFairChampionship.GetMyTeamId() local myTeamData = nil for __, groupInfo in ipairs(stageInfo.groupInfo) do if groupInfo.matchGroupId == self.selectGroup then for __, teamInfo in ipairs(groupInfo.teamInfos) do if not string.isNilOrEmpty(teamInfo.teamId) then table.insert(self.infoList, teamInfo) if teamInfo.teamId == myTeamId then myTeamData = teamInfo end end end end end table.sort(self.infoList, SortByTeamTvtScore) self.loop_FPPlayerJoinList:ReloadAll(self.infoList) UIUtils.SetActive(self.group_Mine.gameObject, myTeamData~=nil) if myTeamData then self:SetMatchTeamInfo(self.group_Mine, myTeamData) end end function UITeamFairChampionshipPromotList:SetMatchTeamInfo(comp, teamInfo) UIUtils.SetLabel(comp.txt_Name, teamInfo.teamName) UIUtils.SetLabel(comp.txt_Point, teamInfo.teamTvtScore) end return UITeamFairChampionshipPromotList