MainRechargeInfo.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ---@class MainRechargeInfo
  2. ---@field roleTotalMoney number 角色充值总金额
  3. MainRechargeInfo = class()
  4. local this = MainRechargeInfo
  5. this.roleTotalMoney = 0
  6. function this:ctor()
  7. end
  8. function this:Reset()
  9. self.mainRechargeRedsTbl = {}
  10. end
  11. function this:Init()
  12. self:InitData()
  13. self:RegistMessages()
  14. end
  15. function this:InitData()
  16. self.mainRechargeRedsTbl = {}
  17. local togDataList = SL:GetConfigTable("sub_mainRecharge")
  18. table.sort(togDataList,function(a,b)
  19. return a.sortId < b.sortId
  20. end)
  21. for _, v in pairs(togDataList) do
  22. self.mainRechargeRedsTbl[v.togName] = false
  23. end
  24. end
  25. ---刷新福利主界面按钮红点以及子页签红点
  26. ---togName sub_mainRecharge表内字段
  27. ---isShow是否展示红点 true展示
  28. function this:RefreshMainRechargeRedPoint(togName,isShow)
  29. InfoManager.mainRechargeInfo.mainRechargeRedsTbl[togName] = isShow
  30. SL:RefreshPanelALLRedStateKmlByCondition("checkMainRechargeRed")
  31. local panel = GUI:GetUI("dev/outui/MainRecharge/Panel/KLMainRecharge/KLMainRechargePanel")
  32. if panel then
  33. panel:RefreshTogRedPointShow()
  34. end
  35. end
  36. function this:RegistMessages()
  37. SL:RegisterLuaNetMsg(LuaMessageIdToClient.RES_RECHARGE_ACTION,self.RefreshRoleMoney,self)
  38. end
  39. function this:RefreshRoleMoney(_,msg)
  40. if not table.isNullOrEmpty(msg) then
  41. if msg.type == "0" and msg.action == "record" then --通用协议内后端给的标识
  42. self.roleTotalMoney = msg.data.totalMoney or 0
  43. end
  44. end
  45. end