KLStallTimeSelectItem.lua 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---@class KLStallTimeSelectItem:UIKmlLuaPanelBase
  2. ---@field view KLStallTimeSelectItemView
  3. local KLStallTimeSelectItem = class(UIKmlLuaPanelBase)
  4. local this = KLStallTimeSelectItem
  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. --SL:LogTable(self.data.message,true)
  14. GUI:Text_setString(self.view.name,self.data.message.time.."小时")
  15. self:CheckShow()
  16. end
  17. function this:CheckShow()
  18. if self.select_id == self.data.message.id then
  19. GUI:setVisible(self.view.select, true)
  20. else
  21. GUI:setVisible(self.view.select, false)
  22. end
  23. end
  24. ---注册UI事件和服务器消息
  25. function this:RegistEvents()
  26. GUI:AddOnClickEvent(self.view.name,self,self.SelectClick)
  27. end
  28. function this:Close()
  29. end
  30. function this:SelectClick()
  31. self.StallPanel:SelectTime(self.data.message.id)
  32. end
  33. return this