UIVipLvUpCtr.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. local UIVipLvUp = class("UIVipLvUp", require("UICtrBase"))
  2. function UIVipLvUp:Init(view)
  3. self.view = view
  4. end
  5. ---@param data table {1,2} 1:为上一Vip等级,2:为目标Vip等级
  6. function UIVipLvUp:SetData(data)
  7. self.asyncIdx = 0
  8. self.data = data
  9. self:InitData()
  10. end
  11. function UIVipLvUp:GetAsyncIdx()
  12. self.asyncIdx = self.asyncIdx + 1
  13. return self.asyncIdx
  14. end
  15. function UIVipLvUp:GetData()
  16. return self.data
  17. end
  18. function UIVipLvUp:OnDispose()
  19. self.data = nil
  20. self.view = nil
  21. self.lastLv = nil
  22. self.curLv = nil
  23. end
  24. function UIVipLvUp:InitData()
  25. if self.data then
  26. self.lastLv = self.data[1] or 0
  27. self.curLv = self.data[2] or 0
  28. else
  29. self:RefreshNextChange()
  30. end
  31. end
  32. function UIVipLvUp:RefreshNextChange()
  33. local data = ManagerContainer.VipChangeMgr:GetNextChangeLv()
  34. if data then
  35. self.lastLv = data[1] or 0
  36. self.curLv = data[2] or 0
  37. return true
  38. else
  39. self.lastLv = 0
  40. self.curLv = 0
  41. return false
  42. end
  43. end
  44. function UIVipLvUp:GetInfo()
  45. return self.lastLv, self.curLv
  46. end
  47. return UIVipLvUp