UIBoliShopCtr.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. local UIBoliShopCtr = class("UIBoliShopCtr", require("UICtrBase"))
  2. function UIBoliShopCtr:Init(view)
  3. self.view = view
  4. end
  5. function UIBoliShopCtr:SetData(data)
  6. self.asyncIdx = 0
  7. if data == nil then return end
  8. self.data = data
  9. end
  10. function UIBoliShopCtr:SetCurEnterType(idx)
  11. self.enterType = idx
  12. return self.enterType
  13. end
  14. function UIBoliShopCtr:GetCurEnterType()
  15. return self.enterType
  16. end
  17. function UIBoliShopCtr:RefreshGoodsData()
  18. end
  19. function UIBoliShopCtr:GetGoodsDataLength()
  20. return self.Goodstab and #self.Goodstab
  21. end
  22. function UIBoliShopCtr:GetBoliShopDataByIdx(idx)
  23. return self.Goodstab and self.Goodstab[idx]
  24. end
  25. function UIBoliShopCtr:GetAsyncIdx()
  26. self.asyncIdx = self.asyncIdx + 1
  27. return self.asyncIdx
  28. end
  29. function UIBoliShopCtr:GetBoliVipLvData()
  30. if not self.vipLvShowDatas then
  31. self:RefreshsvipLvShowDatas()
  32. end
  33. return self.vipLvShowDatas
  34. end
  35. function UIBoliShopCtr:GetBoliVipDataByIdx(idx)
  36. if not self.vipLvShowDatas then
  37. self:RefreshsvipLvShowDatas()
  38. end
  39. return self.vipLvShowDatas and self.vipLvShowDatas[idx]
  40. end
  41. function UIBoliShopCtr:SetDescData(descData)
  42. self.descData = descData
  43. end
  44. function UIBoliShopCtr:GetDescDataByIdx(idx)
  45. return self.descData and self.descData[idx]
  46. end
  47. function UIBoliShopCtr:GetBoliVipLvDataLengths()
  48. return self.vipLvShowDatas and #self.vipLvShowDatas or 0
  49. end
  50. function UIBoliShopCtr:RefreshsvipLvShowDatas()
  51. local cfgData = ManagerContainer.CfgMgr:GetBoliVipCfg()
  52. if not cfgData then
  53. return
  54. end
  55. local data = {}
  56. for k, v in pairs(cfgData) do
  57. if v.Lv ~= 0 then
  58. table.insert(data,v)
  59. end
  60. end
  61. table.sort(data,function(a,b)
  62. return a.Lv < b.Lv
  63. end)
  64. self.vipLvShowDatas = data
  65. end
  66. function UIBoliShopCtr:GetData()
  67. return self.data
  68. end
  69. function UIBoliShopCtr:OnDispose()
  70. self.data = nil
  71. self.view = nil
  72. end
  73. return UIBoliShopCtr