diff --git a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityPanel.lua b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityPanel.lua index f2683ea5be..c257c9a402 100644 --- a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityPanel.lua @@ -4,7 +4,7 @@ local this = DynamicActivityPanel -- Tab管理器 local TabBox = require("Modules/Common/TabBox") local GlobalActConfig = ConfigManager.GetConfig(ConfigName.GlobalActivity) -this._CurPageIndex =1 +local _CurPageIndex =1 local orginLayer local tabs = { [1] = { --破阵诛仙 @@ -123,16 +123,17 @@ end --界面打开时调用(用于子类重写) function DynamicActivityPanel:OnOpen(chooseIndex) - -- 初始化tab数据 + -- 初始化tab数据 + LogBlue("当前选中页签1:"..chooseIndex) + _CurPageIndex = chooseIndex or 1 this.PageTabCtrl:Init(this.tabbox, tabs) - this._CurPageIndex = chooseIndex or 1 - end -- 打开,重新打开时回调 function DynamicActivityPanel:OnShow() - if this._CurPageIndex then - this.PageTabCtrl:ChangeTab(this._CurPageIndex) + if _CurPageIndex then + LogBlue("当前选中页签:".._CurPageIndex) + this.PageTabCtrl:ChangeTab(_CurPageIndex) end end @@ -180,7 +181,7 @@ end -- tab改变事件 function this.OnPageTabChange(index) - this._CurPageIndex = index + _CurPageIndex = index for i = 1, #this.PageList do if this.PageList[i] then this.PageList[i]:OnHide() @@ -218,9 +219,9 @@ end --界面关闭时调用(用于子类重写) function DynamicActivityPanel:OnClose() - if this._CurPageIndex then - this.PageList[_PageInfo[this._CurPageIndex]]:OnHide() - this.PageList[_PageInfo[this._CurPageIndex]].gameObject:SetActive(false) + if _CurPageIndex then + this.PageList[_PageInfo[_CurPageIndex]]:OnHide() + this.PageList[_PageInfo[_CurPageIndex]].gameObject:SetActive(false) end end --界面销毁时调用(用于子类重写)