---@class KLRechargeActivityToggleItem:UIKmlLuaPanelBase ---@field view KLRechargeActivityToggleItemView local KLRechargeActivityToggleItem = class(UIKmlLuaPanelBase) local this =KLRechargeActivityToggleItem --限时礼包右侧toggle ---创建时调用一次 function this:Init() end ---注册UI事件和服务器消息 function this:RegistEvents() GUI:SetToggleOnValueChange(self.view.activeToggle, self, self.ActivityOnToggle) end function this:ActivityOnToggle(control, eventData) if GUI:Toggle_getIsOn(control) then self.baseUI:SelectGiftGroup(self) end end ---创建或者刷新界面数据时调用 function this:Refresh() if self.args then GUI:Text_setString(self.view.Label, self.args.allCfg.name) local actualTimer = (self.args.msgInfo.endTime - Time.GetServerTime()) / 1000 if actualTimer > 0 then GUI:SetControl_time(self.view.time, actualTimer) end end end function this:RefreshItem(args) self.args = args self:Refresh() end function this:ToggleOn() GUI:setVisible(self.view.time,false) GUI:SetIsOnWithoutNotify(self.view.activeToggle, true) end function this:ToggleOff() GUI:setVisible(self.view.time,true) GUI:SetIsOnWithoutNotify(self.view.activeToggle, false) end function this:Close() end return this