local UIAnniversaryLuckyDrawListPanel = UIViewClass() function UIAnniversaryLuckyDrawListPanel:OnOpened(context) self:RegistSystemEvent(EventID.UI_AnniversaryLuckyDraw_AllRewardRecord, self.RefreshList) MDL.AnniversaryLuckyDraw.NewYearLuckyDrawRecordReq(context.activityId, MDL.AnniversaryLuckyDraw.RecordType.RecordTypeAll) end function UIAnniversaryLuckyDrawListPanel:RefreshList() local drawRecord = MDL.AnniversaryLuckyDraw.GetAllLuckyDrawRecords() if #drawRecord == 0 then UIUtils.SetActive(self.group_Empty, true) else UIUtils.SetActive(self.group_Empty, false) self.Loop_Tasks:ReloadAll(drawRecord) end end function UIAnniversaryLuckyDrawListPanel:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIAnniversaryLuckyDrawListPanel:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() end end function UIAnniversaryLuckyDrawListPanel:OnCellInit(scrollRect, index, cellTable, data) local itemName = DataSheetManager.ItemData:GetDataByID(data.rewardId).Name local str = string.FormatByIdsId(Const_IDS.IDS_AnniversaryLuckyDraw_Hint_4, data.name.." "..data.serverName, UIUtils.GetLocalizedTxt(Const_IDS[itemName]), data.rewardNum) UIUtils.SetLabel(cellTable.txt_Records, str) end return UIAnniversaryLuckyDrawListPanel