--[[ * @ClassName ContinuityRechargePage * @Description 连续充值 * @Date 2019/8/2 16:45 * @Author MagicianJoker, fengliudianshao@outlook.com * @Copyright Copyright (c) 2019, MagicianJoker --]] local ContinuityRechargeItem = require("Modules/Operating/ContinuityRechargeItem") --积天豪礼 ---@class ContinuityRechargePage local ContinuityRechargePage = quick_class("ContinuityRechargePage") local sortingOrder = 0 function ContinuityRechargePage:ctor(mainPanel, gameObject) self.mainPanel = mainPanel self.gameObject = gameObject sortingOrder = 0 self.conditionDesc = Util.GetGameObject(self.gameObject, "condition"):GetComponent("Text") self.continuityTaskContent = Util.GetGameObject(self.gameObject, "taskList/viewPort/content") self.continuityTaskItem = Util.GetGameObject(self.continuityTaskContent, "itemPro") self.effect = Util.GetGameObject(self.gameObject, "UI_effect_OperatingPanel_normal") self.continuityTaskItem:SetActive(false) self.continuityTaskList = {} end function ContinuityRechargePage:OnShow(_sortingOrder) Util.AddParticleSortLayer( self.effect, _sortingOrder - sortingOrder) sortingOrder = _sortingOrder Game.GlobalEvent:AddEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh, self.RefreshPanel, self) Game.GlobalEvent:AddEvent(GameEvent.Activity.ContinueRechargeRefresh, self.RefreshPanel, self) self.gameObject:SetActive(true) self:RefreshPanel() end --层级重设 防特效穿透 function ContinuityRechargePage:OnSortingOrderChange(cursortingOrder) Util.AddParticleSortLayer( self.effect, cursortingOrder - sortingOrder) sortingOrder = cursortingOrder for i, v in pairs(self.continuityTaskList) do v:OnSortingOrderChange(cursortingOrder) end end function ContinuityRechargePage:OnHide() Game.GlobalEvent:RemoveEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh, self.RefreshPanel, self) Game.GlobalEvent:RemoveEvent(GameEvent.Activity.ContinueRechargeRefresh, self.RefreshPanel, self) self.gameObject:SetActive(false) end function ContinuityRechargePage:RefreshPanel() local actRewardConfigs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig, "ActivityId", ActivityTypeDef.ContinuityRecharge) self.conditionDesc.text = actRewardConfigs[1].Values[1][1] --Log("连续充值刷新"..ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.ContinuityRecharge).value) if table.nums(self.continuityTaskList) > 0 then table.walk(self.continuityTaskList, function(taskItem) taskItem:SetValue() end) return end for i, actRewardInfo in ipairs(actRewardConfigs) do self.continuityTaskList[i] = ContinuityRechargeItem.create(self.continuityTaskItem, self.continuityTaskContent) self.continuityTaskList[i]:Init(actRewardInfo,sortingOrder) self.continuityTaskList[i]:SetValue() end table.walk(self.continuityTaskList, function(continuityTaskItem) continuityTaskItem:TrySetLastSibling() end) end return ContinuityRechargePage