local UIGuildMineDailyRecord = UIViewClass() function UIGuildMineDailyRecord:OnOpened(context) MDL.GuildMine.GetGuildMineLootHistoryRequest() UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS["IDS_Mine_DailyRecord"]) self:RegistSystemEvent(EventID.UI_GuildMine_CloseView, self.OnBackButtonPressed) -- GMS self:RegistSystemEvent(EventID.UI_GuildMine_Loot_History_Refresh, self.RefreshList) -- 日志列表刷新 self:RegistSystemEvent(EventID.UI_GuildMine_Update_One_Record, self.UpdateOneRecord) -- 日志某一条刷新 self:RegistSystemEvent(EventID.New_Day_Refresh, self.NewDayRefresh) -- 跨天刷新 self:RegistSystemEvent(EventID.UI_Guild_BeKickOutRefresh, self.CloseView) -- 被踢出势力 MDL.GuildMine.GetLootHistory() end function UIGuildMineDailyRecord:RefreshList() local lootHistoryList = MDL.GuildMine.GetLootHistory() self.loop_DailyRecord:ReloadAll(lootHistoryList) UIUtils.SetActive(self.empty_node, #lootHistoryList <= 0) end function UIGuildMineDailyRecord:UpdateOneRecord(lootTime) local lootHistoryList = MDL.GuildMine.GetLootHistory() for i,v in ipairs(lootHistoryList) do if v.baseInfo.lootTime == lootTime then self.loop_DailyRecord:UpdateIndex(i-1, v) break end end end function UIGuildMineDailyRecord:NewDayRefresh() MDL.GuildMind.GetGuildMineLootHistoryRequest() end function UIGuildMineDailyRecord:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UIGuildMineDailyRecord:OnButtonClicked(comp) if comp == self.UICommonPopUp.btn_Close then self:CloseView() end end function UIGuildMineDailyRecord:OnCellInit(scrollRect, index, cellTable, data) local baseInfo = data.baseInfo local supplementInfo = data.supplementInfo UIUtils.SetLabel(cellTable.txt_Time, os.date(UTL.Time.FormatDateEnum.YMDHMS, baseInfo.lootTime)) local dataSheet = DataSheetManager.MineQuality:GetDataByID(baseInfo.mineLevel) local mineName = UTL.Color.GetColorfulText(DataSheetManager.QualityColor:GetDataByID(dataSheet.CharacterColorID).CharacterColor, dataSheet.Name) local lootItemInfo = UTL.Item.GetItemDataSpliceByType(baseInfo.lootItemId).Name..'*'..baseInfo.lootItemNum local str = string.FormatByIdsId(Const_IDS.IDS_Mine_PlunderDes, baseInfo.guildName, baseInfo.playerName,mineName, lootItemInfo) UIUtils.SetLabel(cellTable.txt_Info, str) UIUtils.SetActive(cellTable.btn_ForHelp, false) UIUtils.SetActive(cellTable.group_Helped, false) UIUtils.SetActive(cellTable.btn_StrikeBack, false) UIUtils.SetActive(cellTable.group_Captured, false) -- 已过期不可夺回 if supplementInfo.isOverdue and not supplementInfo.isFightBack then UIUtils.SetActive(cellTable.lab_BePlundered, true) UIUtils.SetLabelText(cellTable.lab_BePlundered, Const_IDS["IDS_Mine_BePlundered"]) return end UIUtils.SetActive(cellTable.lab_BePlundered, false) -- 反击状态 UIUtils.SetActive(cellTable.btn_StrikeBack, not supplementInfo.isFightBack) UIUtils.SetActive(cellTable.group_Captured, supplementInfo.isFightBack) if supplementInfo.isFightBack then return end -- 求助状态 UIUtils.SetActive(cellTable.btn_ForHelp, not supplementInfo.isSeekHelp) UIUtils.SetActive(cellTable.group_Helped, supplementInfo.isSeekHelp) end function UIGuildMineDailyRecord:OnCellClicked(scrollRect, index, cellTable, target, data) local baseInfo = data.baseInfo if target == cellTable.btn_ForHelp then MDL.GuildMine.GuildMineOptRequest(MDL.GuildMine.GuidMineOpType.SeekHelp, BattleDataGetter.GetAcID(), baseInfo.lootTime, baseInfo.lootAcid, baseInfo.mineBeginTime) elseif target == cellTable.btn_StrikeBack then if CTL.GuildMine.IsFormationFinished(MDL.GuildMine.GetMineCurKingdomId()) then MDL.GuildMine.GetGuildMineEnemyLineUpRequest(BattleDataGetter.GetAcID(), baseInfo.lootTime, baseInfo.lootAcid, baseInfo.lootGuildId) else CTL.GuildMine.OpenSelectOfficerMessageBox() end end end return UIGuildMineDailyRecord