huoqu huodongzhuangtai tijiao

dev_chengFeng
jiaoyangna 2020-08-22 16:43:39 +08:00
parent 3a16bedd0d
commit fa6bdeeb6a
8 changed files with 16 additions and 20 deletions

View File

@ -132,7 +132,7 @@ function this.InitActivityServerData(msg, isUpdate)
end end
for i, v in ipairs(msg.activityInfo) do for i, v in ipairs(msg.activityInfo) do
this.mission[v.activityId] = v this.mission[v.activityId] = v
--LogGreen("刷新活动数据activityId" .. v.activityId .. " value" .. v.value) LogGreen("刷新活动数据activityId" .. v.activityId .. " value" .. v.value)
for n, m in ipairs(v.mission) do for n, m in ipairs(v.mission) do
--LogGreen(" 刷新活动数据missionId" .. m.missionId .. " state" .. m.state .. " progress" .. m.progress) --LogGreen(" 刷新活动数据missionId" .. m.missionId .. " state" .. m.state .. " progress" .. m.progress)
if (v.activityId == ActivityTypeDef.OnlineGift) then if (v.activityId == ActivityTypeDef.OnlineGift) then
@ -228,7 +228,6 @@ function this.GetActivityTypeInfo(type)
local missionData = nil local missionData = nil
table.walk(globalActConfigs, function(actConfigInfo) table.walk(globalActConfigs, function(actConfigInfo)
if this.mission[actConfigInfo.Id] then if this.mission[actConfigInfo.Id] then
--LogError("actConfigInfo.Id "..actConfigInfo.Id)
missionData = this.mission[actConfigInfo.Id] missionData = this.mission[actConfigInfo.Id]
end end
end) end)
@ -276,8 +275,9 @@ function this.SetActivityInfo(type, Id, state)
end end
function this.GetActivityOpenStatus(type) function this.GetActivityOpenStatus(type)
if this.mission[type] then local id = this.GetActivityIdByType(type)
return this.mission[type].reallyOpen == 1 if this.mission[id] then
return this.mission[id].reallyOpen == 1
else else
Log(string.format(Language[10002], type)) Log(string.format(Language[10002], type))
return false return false

View File

@ -1327,10 +1327,10 @@ function this.TimeFormat()
local dynamicAct = ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.FindFairy) local dynamicAct = ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.FindFairy)
if dynamicAct then if dynamicAct then
local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy) local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy)
info = info.endTime - PlayerManager.serverTime local tempTime = info.endTime - PlayerManager.serverTime
info = math.floor(info/86400) tempTime = math.floor(tempTime/86400)
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy) then if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy) then
this.DynamicActivityTime.text = info.."" this.DynamicActivityTime.text = tempTime..""
end end
end end

View File

@ -122,8 +122,7 @@ end
--切换视图 --切换视图
function this.SwitchView(_index) function this.SwitchView(_index)
if _index == 2 or _index == 3 then if _index == 2 or _index == 3 then
local id =ActivityGiftManager.GetActivityIdByType(8) if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
if not ActivityGiftManager.GetActivityOpenStatus(id) then
PopupTipPanel.ShowTip("未在活动时间范围内") PopupTipPanel.ShowTip("未在活动时间范围内")
return return
end end

View File

@ -69,9 +69,8 @@ function this:RemoveListener()
end end
this.Closefunction = function() this.Closefunction = function()
Timer.New(function() Timer.New(function()
local id = ActivityGiftManager.GetActivityIdByType(8) if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
LogBlue("收到了关闭活动的消息id:"..id) PopupTipPanel.ShowTip("活动已结束")
if not ActivityGiftManager.GetActivityOpenStatus(id) then
parent:ClosePanel() parent:ClosePanel()
return return
else else

View File

@ -77,9 +77,8 @@ end
this.Closefunction = function() this.Closefunction = function()
Timer.New(function() Timer.New(function()
local id = ActivityGiftManager.GetActivityIdByType(8) if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
LogBlue("收到了关闭活动的消息id:"..id) PopupTipPanel.ShowTip("活动已结束")
if not ActivityGiftManager.GetActivityOpenStatus(id) then
parent:ClosePanel() parent:ClosePanel()
return return
else else

View File

@ -170,7 +170,7 @@ function this.GetQinglongSerectTreasureRedPot()
end end
function this.GetSerectTreasureTrailRedPot() function this.GetSerectTreasureTrailRedPot()
if this.activityId == 0 or not ActivityGiftManager.GetActivityOpenStatus(this.activityId) then if this.activityId == 0 or not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
return false return false
end end
for i = 1,2 do for i = 1,2 do

View File

@ -100,7 +100,7 @@ function GrowthGiftPage:RefreshShowData(item, data)
local GrowthRewardId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.GrowthReward)--当前礼包奖励的活动类型(6\7\8\9\16)成长礼包的不同档位奖励ActivityId不同虽然同为成长基金 local GrowthRewardId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.GrowthReward)--当前礼包奖励的活动类型(6\7\8\9\16)成长礼包的不同档位奖励ActivityId不同虽然同为成长基金
local singleRewardData = ActivityGiftManager.GetActivityInfo(GrowthRewardId, data.Id)--获取活动数据 self.context.Id local singleRewardData = ActivityGiftManager.GetActivityInfo(GrowthRewardId, data.Id)--获取活动数据 self.context.Id
local havaBought = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.GrowthReward, GlobalActivity[GrowthRewardId].CanBuyRechargeId)--当前礼包ID(101\102\103\104\105) local havaBought = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.GrowthReward, GlobalActivity[GrowthRewardId].CanBuyRechargeId)--当前礼包ID(101\102\103\104\105)
local openStatus = ActivityGiftManager.GetActivityOpenStatus(GrowthRewardId) local openStatus = ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.GrowthReward)
--item --item
local shadow = Util.GetGameObject(item, "shadow") local shadow = Util.GetGameObject(item, "shadow")
local grid = Util.GetGameObject(item, "scrollView/grid") local grid = Util.GetGameObject(item, "scrollView/grid")

View File

@ -79,9 +79,8 @@ function GrowthGiftTaskItem:SetValue()
--OperatingManager.GetGrowthRedPointState(GrowthRewardId) --OperatingManager.GetGrowthRedPointState(GrowthRewardId)
end end
function GrowthGiftTaskItem:OnBtnDealClicked() function GrowthGiftTaskItem:OnBtnDealClicked()
local openStatus = ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.GrowthReward)
local openStatus = ActivityGiftManager.GetActivityOpenStatus(GrowthRewardId)
local goods = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.GrowthReward, GlobalActivity[GrowthRewardId].CanBuyRechargeId) local goods = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.GrowthReward, GlobalActivity[GrowthRewardId].CanBuyRechargeId)
if not openStatus or (goods and goods.buyTimes < 1) then if not openStatus or (goods and goods.buyTimes < 1) then
PopupTipPanel.ShowTip(Language[11474]) PopupTipPanel.ShowTip(Language[11474])