local UICountrySalaryRecord = UIViewClass() function UICountrySalaryRecord:OnOpened(context) MDL.Country.RecordRewardReq() self:RegistSystemEvent(EventID.Country_OnSalaryRecordInfo, self.OnSalaryRecordInfo) UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS.IDS_StockroomEvent) end function UICountrySalaryRecord:OnSalaryRecordInfo(msg) local list = CTL.Country.SortRecordList(msg.Record, 1) self.LoopScroll_Record:ReloadAll(list) end function UICountrySalaryRecord:OnButtonClicked(comp) if comp == self.UICommonPopUp.btn_Close then self:CloseView() end end function UICountrySalaryRecord:OnCellInit(scrollRect, index, cellTable, data) local excelData = DataSheetManager.StockroomEvent:GetDataByID(data.EventId) local params = CTL.Country.GetRecordParams(data.Params) if GameAppInfo.IsVietnamPackage() then cellTable.txt_Time.text = os.date(UTL.Time.FormatDateEnum.YMD, data.RecordTime) cellTable.txt_Date.text = os.date(UTL.Time.FormatDateEnum.HM, data.RecordTime) else cellTable.txt_Date.text = os.date(UTL.Time.FormatDateEnum.YMD, data.RecordTime) cellTable.txt_Time.text = os.date(UTL.Time.FormatDateEnum.HM, data.RecordTime) end cellTable.txt_Record.text = string.FormatByIdsId(Const_IDS[excelData.EventText], unpack(params)) end function UICountrySalaryRecord:GetStr(paramList) local params = {} for i, v in ipairs(paramList) do if v.type == 1 then local rewardData = DataSheetManager.CountryRewards:GetDataByID(v.value.uint32Param) local itemData = DataSheetManager.ItemData:GetDataByID(rewardData.ItemID) local colorText = UTL.Color.FormatQualityText(UTL.Item.GetItemDataSpliceByType(rewardData.ItemID).Name, itemData.Color) table.insert(params, colorText) elseif v.type == 3 then local list = self:GetStr(v.value.ParamInfo) for _, str in ipairs(list) do table.insert(params, str) end else if string.find(v.value.stringParam, "IDS_", 1, true) then table.insert(params, UIUtils.GetLocalizedTxt(Const_IDS[v.value.stringParam])) else table.insert(params, v.value.stringParam) end end end return params end return UICountrySalaryRecord