zhangjiannan 2025-04-19 23:44:53 +08:00
parent 91eb2b1aad
commit 4ae3dc125e
1 changed files with 42 additions and 22 deletions

View File

@ -52,17 +52,26 @@ function this:InitComponent()
for _, configInfo in ConfigPairs(infoConfig) do
local tabBtn = newObjToParent(this.btnItem, this.grid)
Util.GetGameObject(tabBtn, "Text"):GetComponent("Text").text = configInfo.RankName
local openTime = this.actData.startTime + configInfo.OpenTime
local closeTime = this.actData.startTime + configInfo.CloseTime
if GetTimeStamp() >= openTime and GetTimeStamp() <= closeTime then --活动未开启
curConfig = configInfo
currId = curConfig.Id
isFirst = true
end
--活动没开启页签不显示
if openTime > GetTimeStamp() + configInfo.Preview then
--this.actData = ActivityGiftManager.GetActivityInfo(ActivityTypeDef.KaiFuChongBang,infoConfig.GlobalActivity)
LogError("检查活动:"..this.actData.activityId)
if this.actData and this.actData.activityId == configInfo.GlobalActivity then
local openTime = this.actData.startTime + configInfo.OpenTime
local closeTime = this.actData.startTime + configInfo.CloseTime
if GetTimeStamp() >= openTime and GetTimeStamp() <= closeTime then --活动未开启
curConfig = configInfo
currId = curConfig.Id
isFirst = true
LogError("xccccccccccccccccccccccccccccccc开启活动"..configInfo.GlobalActivity)
end
--活动没开启页签不显示
if openTime > GetTimeStamp() + configInfo.Preview then
tabBtn.gameObject:SetActive(false)
end
else
tabBtn.gameObject:SetActive(false)
end
table.insert(this.btnList, tabBtn)
Util.AddClick(tabBtn, function()
btnType = _
@ -85,22 +94,32 @@ end
local state = 0
function this.TabBtnOnClick(config, btn)
local time = 0
local openTime = this.actData.startTime + config.OpenTime
local closeTime = this.actData.startTime + config.CloseTime
if openTime > GetTimeStamp() then --活动未开启
time = openTime - GetTimeStamp()
state = 1
elseif closeTime > GetTimeStamp() then --活动进行中
time = closeTime - GetTimeStamp()
state = 2
elseif closeTime < GetTimeStamp() then
time = 0
state = 3
end
if state == 1 and config.Id > currId + 1 then
LogError("ccccccccccccccccccccccccccsssssssssssssssssssssss")
--this.actData = CommonActPageManager.GetData(config.GlobalActivity)
--this.actData = ActivityGiftManager.GetActivityInfo(ActivityTypeDef.KaiFuChongBang,infoConfig.GlobalActivity)
if this.actData and this.actData.activityId == config.GlobalActivity then
LogError("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv")
local openTime = this.actData.startTime + config.OpenTime
local closeTime = this.actData.startTime + config.CloseTime
if openTime > GetTimeStamp() then --活动未开启
time = openTime - GetTimeStamp()
state = 1
elseif closeTime > GetTimeStamp() then --活动进行中
time = closeTime - GetTimeStamp()
state = 2
elseif closeTime < GetTimeStamp() then
time = 0
state = 3
end
if state == 1 and config.Id > currId + 1 then
PopupTipPanel.ShowTip(Language[11926])
return
end
else
PopupTipPanel.ShowTip(Language[11926])
return
end
this.selectObj.transform:SetParent(btn.transform)
this.selectObj.transform.localScale = Vector3.one
this.selectObj.transform.localPosition = Vector3.zero
@ -141,6 +160,7 @@ end
function this.ChangeWindow(config)
this.titleImg.sprite = this.spLoader:LoadSprite(config.Icon)
LogError("sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"..config.Icon)
curConfig = config
if state == 3 then
rankType = config.BackRankType