local UISuperGoldLotteryReward = UIViewClass() function UISuperGoldLotteryReward:OnOpened(context) self.activityId = context.activityId self:RegistSystemEvent(EventID.UI_OperationActivity_CloseView, self.OnCloseActivitySelf) self:InitData(context) end function UISuperGoldLotteryReward:OnCloseActivitySelf(viewClassPath, activityId) if viewClassPath == self.__viewClassPath then if self.activityId and activityId == self.activityId then self:CloseView() end end end function UISuperGoldLotteryReward:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UISuperGoldLotteryReward:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() elseif comp == self.item_Best.event_Click then --大奖点击 if self.BigRewardData then UTL.ItemTips.ShowCommonTipsById(self.BigRewardData) end end end function UISuperGoldLotteryReward:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.grid_Item then UTL.Item.SetItemCell(cellTable.item, data.Item, data.Num) end end --普通奖励点击 function UISuperGoldLotteryReward:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.grid_Item then if target == cellTable.item.event_Click then UTL.ItemTips.ShowCommonTipsById(data.Item) end end end function UISuperGoldLotteryReward:InitData(context) self.nextIndex = context.index --下一级奖池的索引 --常规UI显示 local allData = MDL.SuperGoldLottery.GetTurnTableInfo(self.activityId) local data = allData[context.index] local storeName = UIUtils.GetLocalizedTxt(Const_IDS[data.StoreName]) local lastData = allData[context.index - 1] local lastStoreName = UIUtils.GetLocalizedTxt(Const_IDS[lastData.StoreName]) UIUtils.SetLabel(self.lab_Title,string.FormatByIdsId(Const_IDS.IDS_SuperGoldHeroActivity_Turntable_PreviewHint_1,storeName)) UIUtils.SetLabel(self.lab_Tip,string.FormatByIdsId(Const_IDS.IDS_SuperGoldHeroActivity_Turntable_PreviewHint_4,lastStoreName,storeName)) --奖励道具显示 local rewardList = MDL.SuperGoldLottery.GetRewardByTurnTableID(data.TurnTableID) local normalDataList = {} for i,v in ipairs(rewardList) do if v.BigPrizeNode == 1 then --大奖 self.BigRewardData = v.Item UTL.Item.SetItemCell(self.item_Best, v.Item, v.Num) else --普通奖励 table.insert(normalDataList,v) end end self.grid_Item:ReloadAll(normalDataList) end return UISuperGoldLotteryReward