【主题活动】打开主题活动界面,没有自动选择有红点的页签,显示第一个页签的界面,页签不显示选中状态

dev_chengFeng
jiaoyangna 2020-10-12 16:56:05 +08:00
parent 49e94e9204
commit e84efa0961
1 changed files with 11 additions and 10 deletions

View File

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