UIGuildLogCtr.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. local UIGuildLogCtr = class("UIGuildLogCtr", require("UICtrBase"))
  2. function UIGuildLogCtr:Init(view)
  3. self.view = view
  4. end
  5. function UIGuildLogCtr:SetData(data)
  6. self.asyncIdx = 0
  7. self.data = data
  8. self.guildData = ManagerContainer.DataMgr.GuildDataMgr:GetCurGuildData()
  9. if self.guildData then
  10. self.guildData:ClearLogs()
  11. end
  12. end
  13. function UIGuildLogCtr:GetAsyncIdx()
  14. self.asyncIdx = self.asyncIdx + 1
  15. return self.asyncIdx
  16. end
  17. function UIGuildLogCtr:GetData()
  18. return self.data
  19. end
  20. function UIGuildLogCtr:OnDispose()
  21. self.data = nil
  22. self.view = nil
  23. if self.guildData then
  24. self.guildData:ClearLogs()
  25. end
  26. self.guildData = nil
  27. end
  28. function UIGuildLogCtr:GetLogMaxNum()
  29. return GlobalConfig.Instance:GetConfigIntValue(202)
  30. end
  31. function UIGuildLogCtr:GetReloadLogStartTime()
  32. return self.guildData:GetReloadLogStartTime()
  33. end
  34. function UIGuildLogCtr:GetNextLoadLogStartTime()
  35. return self.guildData:GetNextLoadLogStartTime()
  36. end
  37. function UIGuildLogCtr:GetLogById(idx)
  38. return self.guildData:GetLogById(idx + 1)
  39. end
  40. function UIGuildLogCtr:GetLogs()
  41. return self.guildData:GetLogs()
  42. end
  43. function UIGuildLogCtr:GetLogNum()
  44. return self.guildData:GetLogNum()
  45. end
  46. function UIGuildLogCtr:GetLogWhole()
  47. return self.guildData:GetLogWhole()
  48. end
  49. function UIGuildLogCtr:SendGetGuildLogInfoReq(isBegin)
  50. local errorCode = 0
  51. if isBegin then
  52. if not ManagerContainer.DataMgr.GuildDataMgr:SendGetGuildLogInfoReq(self:GetReloadLogStartTime()) then
  53. return 100007
  54. end
  55. else
  56. if self:GetLogWhole() then
  57. return 1
  58. end
  59. if not ManagerContainer.DataMgr.GuildDataMgr:SendGetGuildLogInfoReq(self:GetNextLoadLogStartTime()) then
  60. return 100007
  61. end
  62. end
  63. return errorCode
  64. end
  65. return UIGuildLogCtr