KLUIMonthCardCommonPanel.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ---@class KLUIMonthCardCommonPanel:UIKmlLuaPanelBase
  2. ---@field view KLUIMonthCardCommonPanelView
  3. local KLUIMonthCardCommonPanel = class(UIKmlLuaPanelBase)
  4. local this =KLUIMonthCardCommonPanel
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---注册UI事件和服务器消息
  9. function this:RegistEvents()
  10. GUI:AddOnClickEvent(self.view.closeBtn, self, self.CloseBtnOnClick)
  11. GUI:AddOnClickEvent(self.view.GoBtn, self, self.GoBtnOnClick)
  12. end
  13. function this:CloseBtnOnClick()
  14. GUI:UIPanel_Close("dev/outui/MonthCard/Panel/KLUIMonthCardCommon/KLUIMonthCardCommonPanel")
  15. end
  16. function this:GoBtnOnClick()
  17. if self.args and self.args.GoBtnBack then
  18. self.args.GoBtnBack(self)
  19. end
  20. end
  21. ---创建或者刷新界面数据时调用
  22. function this:Refresh()
  23. if self.args then
  24. if self.args.TitleText then
  25. GUI:Text_setString(self.view.TitleText,self.args.TitleText)
  26. end
  27. if self.args.Content then
  28. GUI:Text_setString(self.view.contentText,self.args.Content)
  29. end
  30. end
  31. end
  32. function this:Close()
  33. end
  34. return this