UIVoyageLogCtr.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. local UIVoyageLogCtr = class("UIVoyageLogCtr", require("UICtrBase"))
  2. local GUILD_COLOR_ID1 = string.formatbykey('ColorID3')
  3. local GUILD_COLOR_ID2 = string.formatbykey('ColorID6')
  4. local GUILD_COLOR_DEFAULT = string.formatbykey('ColorID3')
  5. function UIVoyageLogCtr:Init(view)
  6. self.view = view
  7. end
  8. function UIVoyageLogCtr:SetData(data)
  9. self.asyncIdx = 0
  10. if data == nil then return end
  11. self.data = data
  12. end
  13. function UIVoyageLogCtr:GetAsyncIdx()
  14. self.asyncIdx = self.asyncIdx + 1
  15. return self.asyncIdx
  16. end
  17. function UIVoyageLogCtr:GetData()
  18. return self.data
  19. end
  20. function UIVoyageLogCtr:OnDispose()
  21. self.logData = nil
  22. self.data = nil
  23. self.view = nil
  24. end
  25. function UIVoyageLogCtr:InitData()
  26. self.battleIdx = self.data
  27. self:RefreshLogData()
  28. end
  29. function UIVoyageLogCtr:RefreshLogData()
  30. self.logData = ManagerContainer.DataMgr.VoyageDataMgr:GetLogsData()
  31. end
  32. function UIVoyageLogCtr:GetLogData()
  33. return self.logData
  34. end
  35. function UIVoyageLogCtr:GetLogMaxNum()
  36. return 50
  37. end
  38. function UIVoyageLogCtr:GetReloadLogStartTime()
  39. return self.logData and self.logData:GetReloadLogStartTime() or 0
  40. end
  41. function UIVoyageLogCtr:GetNextLoadLogStartTime()
  42. return self.logData and self.logData:GetNextLoadLogStartTime() or 0
  43. end
  44. function UIVoyageLogCtr:GetLogById(idx)
  45. return self.logData and self.logData:GetLogById(idx + 1) or nil
  46. end
  47. function UIVoyageLogCtr:GetLogs()
  48. return self.logData and self.logData:GetLogs() or nil
  49. end
  50. function UIVoyageLogCtr:GetLogNum()
  51. return self.logData and self.logData:GetLogNum() or 0
  52. end
  53. function UIVoyageLogCtr:GetLogWhole()
  54. return self.logData and self.logData:GetLogWhole() or false
  55. end
  56. function UIVoyageLogCtr:SendGetLogInfoReq(isBegin)
  57. local errorCode = 0
  58. if isBegin then
  59. if not ManagerContainer.DataMgr.VoyageDataMgr:SendLogReq(self:GetReloadLogStartTime()) then
  60. return 100007
  61. end
  62. else
  63. if self:GetLogWhole() then
  64. return 1
  65. end
  66. if not ManagerContainer.DataMgr.VoyageDataMgr:SendLogReq(self:GetNextLoadLogStartTime()) then
  67. return 100007
  68. end
  69. end
  70. return errorCode
  71. end
  72. function UIVoyageLogCtr:SendCheckInfoReq(uid, endTime)
  73. if not ManagerContainer.DataMgr.VoyageDataMgr:SendCheckInfoReq(uid, endTime) then
  74. return 100007
  75. end
  76. return 0
  77. end
  78. return UIVoyageLogCtr