local UISuperGoldLotteryUnlock = UIViewClass() local EventSystem = require('Event/EventSystem') function UISuperGoldLotteryUnlock:OnOpened(context) self.activityId = context.activityId self:RegistSystemEvent(EventID.UI_OperationActivity_CloseView, self.OnCloseActivitySelf) self.nextIndex = context.index --下一级奖池的索引 local allData = MDL.SuperGoldLottery.GetTurnTableInfo(self.activityId) local data = allData[context.index] UIUtils.SetLabel(self.lab_Unlock,string.FormatByIdsId(Const_IDS.IDS_SuperGoldHeroActivity_Turntable_UnlockHint_1,UIUtils.GetLocalizedTxt(Const_IDS[data.StoreName]))) UTL.Item.SetAtlasSprite(self.img_icon, "UI_SuperGoldenHero", data.StorePic) end function UISuperGoldLotteryUnlock:OnCloseActivitySelf(viewClassPath, activityId) if viewClassPath == self.__viewClassPath then if self.activityId and activityId == self.activityId then self:CloseView() end end end function UISuperGoldLotteryUnlock:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UISuperGoldLotteryUnlock:OnButtonClicked(comp) if comp == self.btn2 then --稍后 self:CloseView() elseif comp == self.btn1 then --立即前往 EventSystem.Dispatch(EventID.UI_SuperGoldLottery_RefreshUI) self:CloseView() end end return UISuperGoldLotteryUnlock