KLRecycleIncomeItemItem.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---@class KLRecycleIncomeItemItem:UIKmlLuaPanelBase
  2. ---@field view KLRecycleIncomeItemItemView
  3. local KLRecycleIncomeItemItem = class(UIKmlLuaPanelBase)
  4. local this =KLRecycleIncomeItemItem
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---创建或者刷新界面数据时调用
  9. function this:Refresh()
  10. end
  11. ---注册UI事件和服务器消息
  12. function this:RegistEvents()
  13. GUI:AddOnClickEvent(self.view.KmlRecycleIncomeItemTemplate, self, self.ShowTips)
  14. end
  15. function this:Close()
  16. end
  17. ---刷新显示
  18. ---@param data {count:number,cfgId:number}
  19. function this:RefreshItem(data)
  20. self.cfgId=data.cfgId
  21. --self.view.
  22. GUI:Text_setString(self.view.IncomeCount,tostring(math.floor( data.count)))
  23. if self.item then
  24. --self.view.IncomeIcon.kmlControl:HideAllChilds()
  25. GUI:HideAllChilds(self.view.IncomeIcon)
  26. end
  27. self.item = GUI:Item_Create(self.view.IncomeIcon,{
  28. width = "30",
  29. height = "30",
  30. itemid = data.cfgId,
  31. tips = "1",
  32. bgscale = "0,0"
  33. })
  34. end
  35. function this:ShowTips()
  36. -- SL:OpenTips(bag, self.cfgId)
  37. end
  38. return this