KLStallChatSelectItem.lua 970 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---@class KLStallChatSelectItem:UIKmlLuaPanelBase
  2. ---@field view KLStallChatSelectItemView
  3. local KLStallChatSelectItem = class(UIKmlLuaPanelBase)
  4. local this = KLStallChatSelectItem
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---创建或者刷新界面数据时调用
  9. function this:RefreshItem(data,select,StallPanel)
  10. self.data = data
  11. self.StallPanel = StallPanel
  12. self.select_id = select
  13. GUI:Text_setString(self.view.name,self.data.message.name)
  14. self:CheckShow()
  15. end
  16. function this:CheckShow()
  17. if self.select_id == self.data.message.id then
  18. GUI:setVisible(self.view.select, true)
  19. else
  20. GUI:setVisible(self.view.select, false)
  21. end
  22. end
  23. ---注册UI事件和服务器消息
  24. function this:RegistEvents()
  25. GUI:AddOnClickEvent(self.view.name,self,self.SelectClick)
  26. end
  27. function this:Close()
  28. end
  29. function this:SelectClick()
  30. self.StallPanel:Select(self.data.type,self.data.message.id)
  31. end
  32. return this