local UIActivitiesRemind = UIViewClass() local ImagePath = ConstAssetPathConfig.ImagePath local time = DataSheetManager.ConstData:GetDataByID("GuildBossReportWinAutoCloseTime").IntValue function UIActivitiesRemind:OnOpened(context) self:StartRepeatFunc(self.OnUpdateFun, time) local id = context[1] --需要特殊处理,将倒计时放到前往按钮,倒计时结束默认执行前往逻辑 self.isSpecial = id == LuaConst.ActivityType.HeroMatch1v1 or id == LuaConst.ActivityType.FairSoloTournament or id == LuaConst.ActivityType.HeroMatch3v3 if self.isSpecial then self.txt_01:ResetAndBeginCustomTimer(false, time, 0, UIUtils.GetLocalizedTxt(Const_IDS.IDS_HeroMatch1v1_ConfirmGetIn), 1) self.txt_02:EndTimer() self.state_CountDown:SetState(0) else self.txt_01:EndTimer() self.txt_02:ResetAndBeginCustomTimer(false, time, 0, UIUtils.GetLocalizedTxt(Const_IDS.IDS_CancelButton_Countdown), 1) self.state_CountDown:SetState(1) end self:SetPushStyle(LuaConst.PushStyleEnum.CLOSENOTRECOVER) self.activityData = DataSheetManager.ActivityData:GetDataByID(id) self.lab_Tips.text = string.FormatByIdsId(Const_IDS.IDS_GuildBoss_OpenReminder, UIUtils.GetLocalizedTxt(Const_IDS[self.activityData.Activity])) local activityIconPath = CTL.Activities.GetActivityIconPath(self.activityData.ActivityIcon) UIUtils.SetImageByAssetBundle(self.img_Icon, activityIconPath) end function UIActivitiesRemind:OnUpdateFun(deltaTime, timeSinceUpdate) CTL.Activities.limitActivityTransferID = nil if self.isSpecial then self:OnButtonClicked(self.btn_01) else self:OnButtonClicked(self.btn_02) end end function UIActivitiesRemind:OnButtonClicked(comp) if comp == self.btn_01 then if self.isSpecial then if self.activityData.ID == LuaConst.ActivityType.HeroMatch1v1 then if CTL.HeroMatch1v1.IfCanEnterBattleMatchLobby() then CTL.HeroMatch1v1.EnterBattleMatchLobby() end elseif self.activityData.ID == LuaConst.ActivityType.HeroMatch3v3 then if CTL.HeroMatch3v3.IfCanEnterBattleMatchLobby(true) then CTL.HeroMatch3v3.EnterBattleMatchLobby() end elseif self.activityData.ID == LuaConst.ActivityType.FairSoloTournament then CTL.FairSoloTournament.EnterLobby() end self:CloseView() else CTL.Activities.OpenRemindConfirmBox(self.activityData) self:CloseView() end elseif comp == self.btn_02 then self:CloseView() end end return UIActivitiesRemind