local UIInfoReminderMsgView = UIViewClass() function UIInfoReminderMsgView:OnOpened(context) UIUtils.SetLabelText(self.UICommonPopUpTab.txt_Title, Const_IDS.IDS_InfoReminder) local list = MDL.InfoReminder.GetPlayerEventType() for i, v in ipairs(list) do if MDL.Unlock.IsUnlock(v.FunctionID) then --势力类型 需要判断解锁和是否有势力 if v.ID ~= 5 or MDL.Guild.IsHasGuild() then self.loop_TabList:AddData(v, 0) end end end self.loop_TabList:SelectIndex(0) end function UIInfoReminderMsgView:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUpTab.btn_Close) end function UIInfoReminderMsgView:OnButtonClicked(comp) if comp == self.UICommonPopUpTab.btn_Close then self:CloseView() end end function UIInfoReminderMsgView:OnCellSelect(scrollRect, index, cellTable, data) if scrollRect == self.loop_TabList then MDL.InfoReminder.SetIterateId(data.ID) self.Loop_Tasks:ClearCells() CSExt.CSFunc_ReloadAll(self.Loop_Tasks, MDL.InfoReminder.GetListByTypeId) if self.Loop_Tasks.Count > 0 then if MDL.InfoReminder.IsUnRead(data.ID) then MDL.InfoReminder.ReadInfoRemind(data.ID) self:OnCellInit(scrollRect, index, cellTable, data) end UIUtils.SetActive(self.group_Empty, false) else UIUtils.SetActive(self.group_Empty, true) end end end function UIInfoReminderMsgView:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.loop_TabList then UIUtils.SetLabelText(cellTable.txt_Name_Nomal, Const_IDS[data.EventType]); UIUtils.SetLabelText(cellTable.txt_Name_Selected, Const_IDS[data.EventType]); if MDL.InfoReminder.IsUnRead(data.ID) then UIUtils.SetActive(cellTable.img_RedDot, data.HongDian == 1) UIUtils.SetActive(cellTable.img_RedDotNew, data.HongDian ~= 1) else UIUtils.SetActive(cellTable.img_RedDot, false) UIUtils.SetActive(cellTable.img_RedDotNew, false) end UIUtils.SetImageByAssetBundle(cellTable.img_Icon, data.Icon1) UIUtils.SetImageByAssetBundle(cellTable.img_Icon1, data.Icon2) elseif scrollRect == self.Loop_Tasks then local excelData = DataSheetManager.PlayerEvent:GetDataByEventType_EventID(data.mainTempId, data.subTempId) local str = UTL.String.GetMessageFormatStr(excelData.EventText, data.params) local special = MDL.InfoReminder.GetSpecialParam(data) if special then UIUtils.SetActive(cellTable.img_Bg01, special.isWarning) str = str .. UIUtils.GetLocalizedTxt(Const_IDS.IDS_InfoReminder_AreaRankDown3) else UIUtils.SetActive(cellTable.img_Bg01, false) end cellTable.txt_Records.text = str cellTable.txt_Time.text = os.date(UTL.Time.FormatDateEnum.MDHMS, data.time) UIUtils.SetActive(cellTable.btn_Check, excelData.JumpUI > 0) end end function UIInfoReminderMsgView:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.Loop_Tasks then if target == cellTable.btn_Check then local excelData = DataSheetManager.PlayerEvent:GetDataByEventType_EventID(data.mainTempId, data.subTempId) CTL.ItemSources.ExecuteSourceFunctionById(excelData.JumpUI) end end end return UIInfoReminderMsgView