--[[ 界面的接口管理 ]] local UITeamFairChampionshipBaseVM = class("UITeamFairChampionshipBaseVM") function UITeamFairChampionshipBaseVM:initialize() end function UITeamFairChampionshipBaseVM:GetTitleIds() return Const_IDS.IDS_TeamFairTournamen_Name end function UITeamFairChampionshipBaseVM:GetSubView(viewId) if viewId == MDL.TeamFairChampionship.Stage.Filtration_1 then return Const_UI_Lua.UIEnum.UITeamFairChampionshipBaseStage01 elseif viewId == MDL.TeamFairChampionship.Stage.Filtration_2 then return Const_UI_Lua.UIEnum.UITeamFairChampionshipBaseStage01 elseif viewId == MDL.TeamFairChampionship.Stage.ShowHero then return Const_UI_Lua.UIEnum.UITeamFairChampionshipBaseStage06 elseif viewId == MDL.TeamFairChampionship.Stage.match_2T1 then return Const_UI_Lua.UIEnum.UITeamFairChampionshipBaseStage05 elseif viewId == MDL.TeamFairChampionship.Stage.match_4T2 then return Const_UI_Lua.UIEnum.UITeamFairChampionshipBaseStage04 elseif viewId == MDL.TeamFairChampionship.Stage.match_8T4 then return Const_UI_Lua.UIEnum.UITeamFairChampionshipBaseStage03 elseif viewId == MDL.TeamFairChampionship.Stage.match_16T8 then return Const_UI_Lua.UIEnum.UITeamFairChampionshipBaseStage02 elseif viewId == MDL.TeamFairChampionship.Stage.match_32T16 then return Const_UI_Lua.UIEnum.UITeamFairChampionshipBaseStage02 elseif viewId == MDL.TeamFairChampionship.Stage.match_64T32 then return Const_UI_Lua.UIEnum.UITeamFairChampionshipBaseStage02 end end function UITeamFairChampionshipBaseVM:GetCurMatchStage() return MDL.TeamFairChampionship.GetCurStageID() end function UITeamFairChampionshipBaseVM:GetMatchStageEnum() return MDL.TeamFairChampionship.Stage end function UITeamFairChampionshipBaseVM:GetMatchStages() return CTL.TeamFairChampionship.GetMatchStages() end function UITeamFairChampionshipBaseVM:GetMatchStageDataCfg(stageId) return DataSheetManager.TeamFairMatchStage:GetDataByID(stageId) end function UITeamFairChampionshipBaseVM:GetMatchTimeDataCfg(matchTimeId) return DataSheetManager.TeamFairMatchTime:GetDataByID(matchTimeId) end function UITeamFairChampionshipBaseVM:GetBigMatchStageTime() return CTL.TeamFairChampionship.GetBigMatchStageTime() end function UITeamFairChampionshipBaseVM:GetFilterBetLeftTime() return CTL.TeamFairChampionship.GetFilterBetLeftTime() end function UITeamFairChampionshipBaseVM:GetBattleStageDisplayInfo() if not BattleDataGetter.CheckCurLevelType(LuaConst.LevelType.TeamFairChampionshipTown) then return 0, nil end return CTL.TeamFairChampionship.GetBattleStageDisplayInfo() end function UITeamFairChampionshipBaseVM:GetMyMatchScoreInfo() if MDL.TeamFairChampionship.GetMyFilterGroupId()<=0 then return nil, nil end if CTL.TeamFairChampionship.IsFilterMatchStage() then local curStageID = MDL.TeamFairChampionship.GetCurStageID() if MDL.TeamFairChampionship.GetMatchStageInfo(curStageID) then local left, max = CTL.TeamFairChampionship.GetFilterMatchCount() return Const_IDS.IDS_HeroMatch1v1_Condition, left .. "/" .. max end end local myRankDesc, myRank = CTL.TeamFairChampionship.GetMyRankDesc() local myMatchInfo = MDL.TeamFairChampionship.GetMyMatchInfo() if myMatchInfo.serverInfo.myStage > 0 then return Const_IDS.IDS_HeroMatch3v3_NowResult, myRankDesc else return Const_IDS.IDS_HeroMatch3v3_NowResult, myRankDesc end end function UITeamFairChampionshipBaseVM:GetMatchRule(stageId) if stageId == MDL.TeamFairChampionship.Stage.ShowHero then return nil end local matchStageCfg = DataSheetManager.TeamFairMatchStage:GetDataByID(stageId) if CTL.TeamFairChampionship.IsFilterMatchStageByStageId(stageId) then return string.FormatByIdsKey(matchStageCfg.WinAskDes, MDL.TeamFairChampionship.GetEnterEachGroup()) else return UIUtils.GetLocalizedTxt(Const_IDS[matchStageCfg.WinAskDes]) end end function UITeamFairChampionshipBaseVM:GetGueesingData() local leftGuess, maxGuess = CTL.TeamFairChampionship.GetMatchGuessingTimes() return string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_LeftPickNum, leftGuess, maxGuess) end function UITeamFairChampionshipBaseVM:IsInFilterMatchStage(stageId) return CTL.TeamFairChampionship.IsFilterMatchStageByStageId(stageId) end function UITeamFairChampionshipBaseVM:OnViewOpened() MDL.TeamFairChampionship.TeamFairOpenReq() MDL.TeamFairChampionship.TeamFairGetAllPlayerInfoReq() end --第一个是否隐藏,第二个参数是否置灰 function UITeamFairChampionshipBaseVM:GetAttendButtonState() if BattleDataGetter.CheckCurLevelType(LuaConst.LevelType.TeamFairChampionshipTown) then return false, false, false end local curStageId = MDL.TeamFairChampionship.GetCurStageID() if curStageId==MDL.TeamFairChampionship.Stage.ShowHero then return false, false, true end if not CTL.TeamFairChampionship.IsInBattleStage() then return true, true, false end local curStageInfo = MDL.TeamFairChampionship.GetMatchStageInfo(curStageId) if curStageInfo and curStageInfo.state == MDL.TeamFairChampionship.Enum_State.Ready and UTL.Time.GetServerTimestamp()