local UIGuildEscortSuccess = UIViewClass() -- [[ -- 势力押镖-押镖奖励界面 -- ]] local Countdown = 30 -- 倒计时关闭 -------------------- -- context 中包含的字段 -- GuildIntegral 势力积分 -- PersonalRewards 个人奖励 function UIGuildEscortSuccess:OnOpened(context) self:InitPanel(context) CTL.Sound.PlayGameSound("UI_obtain") end function UIGuildEscortSuccess:OnClosed() self.labLocal_Timer:EndTimer() end function UIGuildEscortSuccess:OnBackButtonPressed() self:OnButtonClicked(self.event_Bottom) end function UIGuildEscortSuccess:OnButtonClicked(comp) if comp == self.event_Bottom then self:CloseView() end end function UIGuildEscortSuccess:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.scroll_Reward then UTL.Item.SetItemCell(cellTable.item, data.ItemId, data.ItemCount) end end function UIGuildEscortSuccess:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.scroll_Reward then if target == cellTable.item.event_Click then UTL.ItemTips.ShowCommonTipsById(data.ItemId) end end end -------------------- function UIGuildEscortSuccess:InitPanel(context) -- 设置势力活动积分增加 UIUtils.SetLabel(self.lab_Tips2, string.FormatByIdsId(Const_IDS.IDS_Escort_GuildReward2, context.GuildIntegral)) -- 设置个人奖励 self.scroll_Reward:ReloadAll(context.PersonalRewards) -- 设置倒计时 self:StartRepeatFunc(self.CountdownEnd, Countdown) self.labLocal_Timer:ResetAndBeginCustomTimer(false, Countdown, 0, UIUtils.GetLocalizedTxt(Const_IDS.IDS_GuildBoss_AutoCloseTime), 1) end -- 倒计时结束关闭 function UIGuildEscortSuccess:CountdownEnd(deltaTime, timeSinceUpdate) self:OnButtonClicked(self.event_Bottom) end return UIGuildEscortSuccess