local UICommonGuessingBase = require("View/TeamFairChampionship/UICommonGuessingBase") local UITeamFairChampionshipGuessing = UIViewClass(UICommonGuessingBase) function UITeamFairChampionshipGuessing:Init() self:RegistSystemEvent(EventID.UI_TeamFairChampionship_CloseView, self.OnBackButtonPressed) -- 赛程结束关闭界面 self:RegistSystemEvent(EventID.UI_TeamFairChampionship_RefreshGuessing, self.RefreshGuessing) -- 刷新界面信息 MDL.TeamFairChampionship.TeamFairGetAllQuizInfoReq() UIUtils.SetActive(self.img_TeamFairChampionship, true) end function UITeamFairChampionshipGuessing:UpdateAllQuizInfoRepeatFunc(deltaTime, timeSinceUpdate) MDL.TeamFairChampionship.TeamFairGetAllQuizInfoReq() end function UITeamFairChampionshipGuessing:ClickBuy() MDL.TeamFairChampionship.TeamFairQuizBetReq(self.guessServerInfo[self.selectGuessIndex].guessCfg.ID, self.selectOptionIndex, tonumber(self.cacheNumStr)) self:IsShowKeyPad(false) end function UITeamFairChampionshipGuessing:OnCellInit(scrollRect, index, cellTable, data) UTL.Item.MoneyIcon(cellTable.img_Item, data.guessCfg.GuessMoneyID) UIUtils.SetLabelText(cellTable.txt_Topic, Const_IDS[data.guessCfg.QuestionDes]) local StageCfg = DataSheetManager.TeamFairMatchStage:GetDataByID(data.guessCfg.TalkGuessEnd) if data.serverInfo.isOverdue then cellTable.state:SetState(1) else if data.serverInfo.betOption > 0 then cellTable.state:SetState(2) else cellTable.state:SetState(0) end end UIUtils.SetLabel(cellTable.txt_Deadline, string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_PickTime, string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_StopGambling, UIUtils.GetLocalizedTxt(Const_IDS[StageCfg.InterfaceDes])))) -- 话题到期时间 end function UITeamFairChampionshipGuessing:RefreshGuessing() self.guessServerInfo = MDL.TeamFairChampionship.GetGuessingInfo() self.loop_Topic:ReloadAll(self.guessServerInfo) if self.selectGuessIndex == nil then self.loop_Topic:SelectIndex(0) else self.loop_Topic:SelectIndex(self.selectGuessIndex - 1) end if not self.initCurrency then local moneyID = self.guessServerInfo[1].guessCfg.GuessMoneyID CTL.Currency.OpenCurrencyPanel(self.__viewClassPath, self.currency_Info, { moneyID }) self.initCurrency = true end end --endregion ******************** 小键盘 ************************** return UITeamFairChampionshipGuessing