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