KLSurePanel.lua 855 B

123456789101112131415161718192021222324252627282930313233343536
  1. ---@class KLSurePanel:UIKmlLuaPanelBase
  2. ---@field view KLSurePanelView
  3. local KLSurePanel = class(UIKmlLuaPanelBase)
  4. local this =KLSurePanel
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---创建或者刷新界面数据时调用
  9. function this:Refresh()
  10. GUI:Text_setString(self.view.ContentTxt,self.args.content or "")
  11. end
  12. ---注册UI事件和服务器消息
  13. function this:RegistEvents()
  14. GUI:AddOnClickEvent(self.view.okBtn,self,self.OnClickOkBtn)
  15. GUI:AddOnClickEvent(self.view.cancelBtn,self,self.OnClickCloseBtn)
  16. GUI:AddOnClickEvent(self.view.closeBtn,self,self.OnClickCloseBtn)
  17. end
  18. function this:OnClickOkBtn()
  19. if self.args.okFunc then
  20. self.args.okFunc()
  21. end
  22. end
  23. function this:OnClickCloseBtn()
  24. GUI:UIPanel_Close("dev/outui/Activity/Panel/KLSure/KLSurePanel")
  25. end
  26. function this:Close()
  27. end
  28. return this