master
parent
a62bfa6368
commit
3ba8c8086f
|
@ -9,7 +9,7 @@ local tabs = {
|
|||
select = "X1_zhutihuodong_yingxiongjiadao_01",
|
||||
rpType = RedPointType.CardActivity_Draw,
|
||||
panelType = PanelType.CardActivity,
|
||||
UpViewConfigId = 4,
|
||||
UpViewConfigId = 4,
|
||||
ActType = ActivityTypeDef.CardActivity_Draw
|
||||
},
|
||||
[2] = {
|
||||
|
@ -17,7 +17,7 @@ local tabs = {
|
|||
select = "X1_zhutihuodong_shenmizhiling_01",
|
||||
rpType = RedPointType.CardActivity_Task,
|
||||
panelType = PanelType.CardActivity,
|
||||
UpViewConfigId = 5,
|
||||
UpViewConfigId = 5,
|
||||
ActType = ActivityTypeDef.CardActivity_Task
|
||||
},
|
||||
[3] = {
|
||||
|
@ -25,7 +25,7 @@ local tabs = {
|
|||
select = "X1_zhutihuodong_yingxionglibao_01",
|
||||
rpType = -1,
|
||||
panelType = PanelType.CardActivity,
|
||||
UpViewConfigId = 6,
|
||||
UpViewConfigId = 6,
|
||||
ActType = ActivityTypeDef.CardActivity_Gift
|
||||
},
|
||||
[4] = {
|
||||
|
@ -33,31 +33,29 @@ local tabs = {
|
|||
select = "X1_zhutihuodong_yingxionghaoli_01",
|
||||
rpType = RedPointType.CardActivity_Haoli,
|
||||
panelType = PanelType.CardActivity,
|
||||
UpViewConfigId = 7,
|
||||
UpViewConfigId = 7,
|
||||
ActType = ActivityTypeDef.CardActivity_Haoli
|
||||
},
|
||||
--[[
|
||||
[5] = {
|
||||
[5] = {
|
||||
default = "X1_zhutihuodong_yingxiongshouji_02",
|
||||
select = "X1_zhutihuodong_yingxiongshouji_01",
|
||||
rpType = RedPointType.CardActivity_Collect,
|
||||
panelType = PanelType.CardActivity,
|
||||
UpViewConfigId = 8,
|
||||
UpViewConfigId = 8,
|
||||
ActType = ActivityTypeDef.CardActivity_Collect
|
||||
},
|
||||
]]
|
||||
}
|
||||
|
||||
this.contents = {
|
||||
[1] = {view = require("Modules/CardActivity/DrawCardPanel"), panelName = "page_1"},
|
||||
[2] = {view = require("Modules/CardActivity/TaskPanel"), panelName = "page_2"},
|
||||
[3] = {view = require("Modules/CardActivity/GiftPanel"), panelName = "page_3"},
|
||||
[4] = {view = require("Modules/CardActivity/WishPanel"), panelName = "page_4"},
|
||||
[5] = {view = require("Modules/CardActivity/CollectPanel"), panelName = "page_5"},
|
||||
[1] = { view = require("Modules/CardActivity/DrawCardPanel"), panelName = "page_1" },
|
||||
[2] = { view = require("Modules/CardActivity/TaskPanel"), panelName = "page_2" },
|
||||
[3] = { view = require("Modules/CardActivity/GiftPanel"), panelName = "page_3" },
|
||||
[4] = { view = require("Modules/CardActivity/WishPanel"), panelName = "page_4" },
|
||||
[5] = { view = require("Modules/CardActivity/CollectPanel"), panelName = "page_5" },
|
||||
}
|
||||
--初始化组件(用于子类重写)
|
||||
function CardActivityPanel:InitComponent()
|
||||
this.close = Util.GetGameObject(self.gameObject,"btnBack")
|
||||
this.close = Util.GetGameObject(self.gameObject, "btnBack")
|
||||
this.tabbox = Util.GetGameObject(self.gameObject, "tabbox")
|
||||
|
||||
this.PageTabCtrl = TabBox.New()
|
||||
|
@ -68,7 +66,7 @@ function CardActivityPanel:InitComponent()
|
|||
this.prefabs = {}
|
||||
|
||||
for i = 1, #this.contents do
|
||||
this.prefabs[i] = Util.GetGameObject(self.gameObject,this.contents[i].panelName)
|
||||
this.prefabs[i] = Util.GetGameObject(self.gameObject, this.contents[i].panelName)
|
||||
this.contents[i].view:InitComponent(Util.GetGameObject(self.gameObject, this.contents[i].panelName))
|
||||
end
|
||||
|
||||
|
@ -82,7 +80,8 @@ function this.PageTabAdapter(tab, index, status)
|
|||
local selected = Util.GetGameObject(tab, "selected")
|
||||
|
||||
img.sprite = Util.LoadSprite(GetPictureFont(tabs[index].default))
|
||||
Util.GetGameObject(selected, "icon"):GetComponent("Image").sprite = Util.LoadSprite(GetPictureFont(tabs[index].select))
|
||||
Util.GetGameObject(selected, "icon"):GetComponent("Image").sprite = Util.LoadSprite(GetPictureFont(tabs[index]
|
||||
.select))
|
||||
selected:SetActive(status == "select")
|
||||
end
|
||||
|
||||
|
@ -96,15 +95,15 @@ function this.OnPageTabChange(index)
|
|||
_CurPageIndex = index
|
||||
|
||||
for i = 1, #this.prefabs do
|
||||
this.prefabs[i].gameObject:SetActive(i == index)--切换子模块预设显隐
|
||||
this.prefabs[i].gameObject:SetActive(i == index) --切换子模块预设显隐
|
||||
end
|
||||
this.contents[index].view:OnShow(this.sortingOrder,this)
|
||||
this.contents[index].view:OnShow(this.sortingOrder, this)
|
||||
this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, UpViewConfigId = tabs[index].UpViewConfigId })
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function CardActivityPanel:BindEvent()
|
||||
Util.AddClick(this.close,function ()
|
||||
Util.AddClick(this.close, function()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
for i = 1, #this.contents do
|
||||
|
@ -130,7 +129,7 @@ end
|
|||
function CardActivityPanel:OnOpen(index)
|
||||
_CurPageIndex = index and index or 1
|
||||
|
||||
this.PageTabCtrl:Init(this.tabbox, tabs,_CurPageIndex)
|
||||
this.PageTabCtrl:Init(this.tabbox, tabs, _CurPageIndex)
|
||||
|
||||
for i = 1, #tabs do
|
||||
local go = Util.GetGameObject(this.tabbox, "box").transform:GetChild(i - 1).gameObject
|
||||
|
@ -166,4 +165,4 @@ function CardActivityPanel:OnDestroy()
|
|||
end
|
||||
end
|
||||
|
||||
return CardActivityPanel
|
||||
return CardActivityPanel
|
||||
|
|
Loading…
Reference in New Issue