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

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管理器
local TabBox = require("Modules/Common/TabBox")
local GlobalActConfig = ConfigManager.GetConfig(ConfigName.GlobalActivity)
this._CurPageIndex =1
local _CurPageIndex =1
local orginLayer
local tabs = {
[1] = { --破阵诛仙
@ -124,15 +124,16 @@ end
--界面打开时调用(用于子类重写)
function DynamicActivityPanel:OnOpen(chooseIndex)
-- 初始化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
--界面销毁时调用(用于子类重写)