【十五日登陆】修改提交

(cherry picked from commit 8e0177d3ed)
dev_chengFeng
ZhangBiao 2021-04-12 15:02:49 +08:00
parent 034ed82f0f
commit 276e0129fe
4 changed files with 1690 additions and 38 deletions

View File

@ -62,13 +62,4 @@ function this.CheckRedPoint()
return false return false
end end
function this.CheckActOpen()
this.InitRewardData()
if Data and Data.ActState == 0 then
return true
else
return false
end
end
return FifteenDayGiftManager return FifteenDayGiftManager

View File

@ -45,7 +45,23 @@ function FifteenDayGift:BindEvent()
PopupTipPanel.ShowTip(Language[12285]) PopupTipPanel.ShowTip(Language[12285])
return return
end end
NetManager.GetActivityRewardRequest(-1,Data.activityId,function (drop) FifteenDayGift:Request()
end)
BindRedPointObject(RedPointType.FifteenDayGift_1,self.redPoint)
end
function FifteenDayGift:Request(missionId,obj)
local id = missionId and missionId or -1
NetManager.GetActivityRewardRequest(id,Data.activityId,function (drop)
if obj then -- 单个领取
local thread=coroutine.start(function()
obj[1].transform:DORotate(Vector3.New(0, 90, 0), 0.3)
coroutine.wait(0.3)
obj[1]:SetActive(false)
obj[2].transform:DORotate(Vector3.New(0, 0, 0), 0.3)
coroutine.wait(1)
end)
else--全部领取
for i = 1, #frontList do for i = 1, #frontList do
local thread=coroutine.start(function() local thread=coroutine.start(function()
frontList[i].transform:DORotate(Vector3.New(0, 90, 0), 0.3) frontList[i].transform:DORotate(Vector3.New(0, 90, 0), 0.3)
@ -55,33 +71,31 @@ function FifteenDayGift:BindEvent()
coroutine.wait(1) coroutine.wait(1)
end) end)
end end
--奖励界面 end
local func = function (drop)
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1,function() --奖励界面
FifteenDayGift:Refresh() local func = function (drop)
CheckRedPointStatus(RedPointType.FifteenDayGift_1) UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1,function()
end) FifteenDayGift:Refresh()
end CheckRedPointStatus(RedPointType.FifteenDayGift_1)
Timer.New(function () end)
--检测奖励是否为灵兽 end
if drop.pokemon and #drop.pokemon >= 1 then Timer.New(function ()
local thread=coroutine.start(function() --检测奖励是否为灵兽
self.effect2:SetActive(true) if drop.pokemon and #drop.pokemon >= 1 then
coroutine.wait(3) local thread=coroutine.start(function()
UIManager.OpenPanel(UIName.PokemonSingleResultPanel,nil,drop,nil,nil,function () self.effect2:SetActive(true)
self.effect2:SetActive(false) coroutine.wait(3)
func(drop) UIManager.OpenPanel(UIName.PokemonSingleResultPanel,nil,drop,nil,nil,function ()
end) self.effect2:SetActive(false)
func(drop)
end) end)
else end)
func(drop) else
end func(drop)
end,0.5):Start() end
end,0.5):Start()
end)
end) end)
BindRedPointObject(RedPointType.FifteenDayGift_1,self.redPoint)
end end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)
@ -137,7 +151,9 @@ function FifteenDayGift:SetSingleReward(sData,go,index)
local num = Util.GetGameObject(front,"num"):GetComponent("Text") local num = Util.GetGameObject(front,"num"):GetComponent("Text")
local back = Util.GetGameObject(go,"back") local back = Util.GetGameObject(go,"back")
local red = Util.GetGameObject(front,"red") local red = Util.GetGameObject(front,"red")
local mask = Util.GetGameObject(front,"mask")--单个奖励领取按钮
red:SetActive(false) red:SetActive(false)
mask:SetActive(false)
local curTime = GetTimeStamp() local curTime = GetTimeStamp()
--弄一个ItemView提供点击方法 --弄一个ItemView提供点击方法
@ -152,12 +168,13 @@ function FifteenDayGift:SetSingleReward(sData,go,index)
front:GetComponent("RectTransform").rotation = sData.State == 0 and angle[1] or angle[2] front:GetComponent("RectTransform").rotation = sData.State == 0 and angle[1] or angle[2]
back:GetComponent("RectTransform").rotation = sData.State == 1 and angle[1] or angle[2] back:GetComponent("RectTransform").rotation = sData.State == 1 and angle[1] or angle[2]
--判断哪些可领取,插入表 --判断哪些可领取,插入表
-- LogPurple("sData.Progress:"..tostring(sData.Progress).." sData.State:"..tostring(sData.State)) -- LogPurple("sData.missionId:"..tostring(sData.missionId).." sData.Progress:"..tostring(sData.Progress).." sData.State:"..tostring(sData.State))
if sData.Progress <= curTime and sData.State == 0 then if sData.Progress <= curTime and sData.State == 0 then
-- LogPink("index:"..tostring(index)) -- LogPink("index:"..tostring(index))
table.insert(frontList,front) table.insert(frontList,front)
table.insert(backList,back) table.insert(backList,back)
red:SetActive(true) red:SetActive(true)
mask:SetActive(true)
end end
--如果已领取、可领取、不可领取显示第几天;下一领取显示时间 --如果已领取、可领取、不可领取显示第几天;下一领取显示时间
if sData.Progress > curTime and sData.Progress - 86400 <= curTime then if sData.Progress > curTime and sData.Progress - 86400 <= curTime then
@ -187,6 +204,9 @@ function FifteenDayGift:SetSingleReward(sData,go,index)
Util.AddOnceClick(icon.gameObject,function () Util.AddOnceClick(icon.gameObject,function ()
ItemViewList[index]:OnBtnCkickEvent(sData.Reward[1]) ItemViewList[index]:OnBtnCkickEvent(sData.Reward[1])
end) end)
Util.AddOnceClick(mask,function ()
FifteenDayGift:Request(sData.missionId,{front,back})
end)
end end
--界面关闭时调用(用于子类重写) --界面关闭时调用(用于子类重写)

View File

@ -1335,8 +1335,14 @@ function this.RefreshEightGiftPreview()
this.sgBtn:SetActive(false) this.sgBtn:SetActive(false)
end end
--十五日 --十五日
this.fgBtn:SetActive(FifteenDayGiftManager.CheckActOpen()) if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FifteenDayGift) then
this.rpFifteenDayEffect:SetActive(FifteenDayGiftManager.CheckActOpen()) this.fgBtn:SetActive(true)
this.rpFifteenDayEffect:SetActive(true)
FifteenDayGiftManager.InitRewardData()
else
this.fgBtn:SetActive(false)
this.rpFifteenDayEffect:SetActive(false)
end
end end
-- 七日登陆奖励预览 -- 七日登陆奖励预览