KLGoldChallengeRewardItem.lua 855 B

123456789101112131415161718192021222324252627282930313233343536
  1. ---@class KLGoldChallengeRewardItem:UIKmlLuaPanelBase
  2. ---@field view KLGoldChallengeRewardItemView
  3. local KLGoldChallengeRewardItem = class(UIKmlLuaPanelBase)
  4. local this =KLGoldChallengeRewardItem
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---创建或者刷新界面数据时调用
  9. function this:RefreshItem(args)
  10. self.args = args
  11. GUI:Item_setItemId(self.view.RewardItem,tostring(self.args[1]))
  12. GUI:Item_setItemCount(self.view.RewardItem,tostring(SL:GetSimpleNumber(self.args[2],0)))
  13. end
  14. ---注册UI事件和服务器消息
  15. function this:RegistEvents()
  16. GUI:AddOnClickEvent(self.view.btnTips,self,self.BtnClick)
  17. end
  18. function this:BtnClick()
  19. if self.args then
  20. SL:OpenTips("", self.args[1])
  21. end
  22. end
  23. ---创建或者刷新界面数据时调用
  24. function this:Refresh()
  25. end
  26. function this:Close()
  27. end
  28. return this