---@class UIMountPreferenceInfo @注释 UIMountPreferenceInfo = class() local this = UIMountPreferenceInfo function this:ctor() end function this:Init() self:Reset() self:InitData() self:RegistMessages() end function this:Reset() self.resData = nil self.rechargeId = 501 self.endTime = 30000 end function this:InitData() end function this:RegistMessages() SL:RegisterLuaNetMsg(LuaMessageIdToClient.RES_RECHARGE_ACTION,self.RES_RECHARGE_ACTION,self) --SL:RegisterLUAEvent(MESSAGE_ACCEPT, self.DataProcessing, self) end function this:RES_RECHARGE_ACTION(_,message) if message and message.type == tostring(ERechargeType.MountGift) then ---单充礼包 self.resData = message.data if self.resData then local rechargeId = tonumber( self.resData.rechargeId) local endTime = self.resData.endTime local buycount,totalcount = InfoManager.countInfo:GetLimitAndTotalCountByRechargeId(rechargeId) if buycount > 0 and endTime > Time.GetServerTime() then self.rechargeId = rechargeId self.endTime = endTime end local topPanel = GUI:GetUI("dev/ui/MainUI/Panel/KLUISystemTop/KLUISystemTopPanel") if topPanel then topPanel:Refresh() end end end end function this:IsShowBtn() if self.resData then local endTime = self.resData.endTime local buycount,totalcount = InfoManager.countInfo:GetLimitAndTotalCountByRechargeId(tonumber(self.resData.rechargeId)) if buycount > 0 and endTime > Time.GetServerTime() then return true end end return false end