diff --git a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua index 1d1e4bd876..096a51d489 100644 --- a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua @@ -134,7 +134,7 @@ function this.InitActivityServerData(msg, isUpdate) this.CheckMoneyProgress(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 --LogGreen(" 刷新活动数据missionId:" .. m.missionId .. " state:" .. m.state .. " progress:" .. m.progress) if (v.activityId == ActivityTypeDef.OnlineGift) then @@ -231,7 +231,6 @@ function this.GetActivityTypeInfo(type) local missionData = nil table.walk(globalActConfigs, function(actConfigInfo) if this.mission[actConfigInfo.Id] then - --LogError("actConfigInfo.Id "..actConfigInfo.Id) missionData = this.mission[actConfigInfo.Id] end end) @@ -285,8 +284,9 @@ function this.SetActivityInfo(type, Id, state) end function this.GetActivityOpenStatus(type) - if this.mission[type] then - return this.mission[type].reallyOpen == 1 + local id = this.GetActivityIdByType(type) + if this.mission[id] then + return this.mission[id].reallyOpen == 1 else Log(string.format(Language[10002], type)) return false diff --git a/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua index a63bf9b06a..8b96792ef9 100644 --- a/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua @@ -1329,10 +1329,10 @@ function this.TimeFormat() local dynamicAct = not not ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy) if dynamicAct then local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy) - info = info.endTime - PlayerManager.serverTime - info = math.floor(info/86400) + local tempTime = info.endTime - PlayerManager.serverTime + tempTime = math.floor(tempTime/86400) if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy) then - this.DynamicActivityTime.text = info.."天" + this.DynamicActivityTime.text = tempTime.."天" end end --青龙秘宝 diff --git a/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel.lua b/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel.lua index 94a37e62be..f29427df6a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel.lua @@ -118,8 +118,7 @@ end --切换视图 function this.SwitchView(_index) if _index == 2 or _index == 3 then - local id =ActivityGiftManager.GetActivityIdByType(8) - if not ActivityGiftManager.GetActivityOpenStatus(id) then + if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then PopupTipPanel.ShowTip("未在活动时间范围内") return end diff --git a/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel_QingLongSecretTreasure.lua b/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel_QingLongSecretTreasure.lua index fc37323f86..c3719b7c9f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel_QingLongSecretTreasure.lua +++ b/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel_QingLongSecretTreasure.lua @@ -69,10 +69,10 @@ function this:RemoveListener() end this.Closefunction = function() Timer.New(function() - local id = ActivityGiftManager.GetActivityIdByType(8) - LogBlue("收到了关闭活动的消息,id:"..id) - if not ActivityGiftManager.GetActivityOpenStatus(id) then - parent.SwitchView(1) + if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then + PopupTipPanel.ShowTip("活动已结束") + parent:ClosePanel() + return else this.refresh() @@ -97,13 +97,14 @@ function this:OnSortingOrderChange(sortingOrder) end function this:OnClose() - if self.localTimer then - self.localTimer:Stop() - self.localTimer = nil - end + end function this:OnDestroy() itemsList={} + if self.timer then + self.timer :Stop() + self.timer = nil + end end this.refresh = function() diff --git a/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel_SecretTreasureTrail.lua b/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel_SecretTreasureTrail.lua index 0dca906b52..71cc0a0ec5 100644 --- a/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel_SecretTreasureTrail.lua +++ b/Assets/ManagedResources/~Lua/Modules/Mission/MissionDailyPanel_SecretTreasureTrail.lua @@ -77,10 +77,10 @@ end this.Closefunction = function() Timer.New(function() - local id = ActivityGiftManager.GetActivityIdByType(8) - LogBlue("收到了关闭活动的消息,id:"..id) - if not ActivityGiftManager.GetActivityOpenStatus(id) then - parent.SwitchView(1) + if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then + PopupTipPanel.ShowTip("活动已结束") + parent:ClosePanel() + return else this.refresh(curType) @@ -133,13 +133,13 @@ function this:OnSortingOrderChange(sortingOrder) end function this:OnClose() - if self.localTimer then - self.localTimer:Stop() - self.localTimer = nil - end + end function this:OnDestroy() - + if self.timer then + self.timer:Stop() + self.timer = nil + end end function this.refresh(type) this:SetTopBar() diff --git a/Assets/ManagedResources/~Lua/Modules/Mission/QinglongSerectTreasureManager.lua b/Assets/ManagedResources/~Lua/Modules/Mission/QinglongSerectTreasureManager.lua index 866e487028..c5b8b3a76a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Mission/QinglongSerectTreasureManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Mission/QinglongSerectTreasureManager.lua @@ -155,7 +155,7 @@ function this.GetQinglongTaskData(_curtype) end function this.GetQinglongSerectTreasureRedPot() - if this.activityId==0 or not ActivityGiftManager.GetActivityOpenStatus(this.activityId) then + if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then return false end local state = this.GetTreasureState() @@ -170,7 +170,7 @@ function this.GetQinglongSerectTreasureRedPot() end function this.GetSerectTreasureTrailRedPot() - if this.activityId == 0 or not ActivityGiftManager.GetActivityOpenStatus(this.activityId) then + if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then return false end for i = 1,2 do diff --git a/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftPage.lua b/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftPage.lua index b4c6bcca61..3cc2009a8c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftPage.lua +++ b/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftPage.lua @@ -100,7 +100,7 @@ function GrowthGiftPage:RefreshShowData(item, data) local GrowthRewardId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.GrowthReward)--当前礼包奖励的活动类型(6\7\8\9\16)(成长礼包的不同档位奖励ActivityId不同,虽然同为成长基金) 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 openStatus = ActivityGiftManager.GetActivityOpenStatus(GrowthRewardId) + local openStatus = ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.GrowthReward) --item local shadow = Util.GetGameObject(item, "shadow") local grid = Util.GetGameObject(item, "scrollView/grid") diff --git a/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftTaskItem.lua b/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftTaskItem.lua index 538b8c29ad..c44535054c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftTaskItem.lua +++ b/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftTaskItem.lua @@ -79,9 +79,8 @@ function GrowthGiftTaskItem:SetValue() --OperatingManager.GetGrowthRedPointState(GrowthRewardId) end -function GrowthGiftTaskItem:OnBtnDealClicked() - - local openStatus = ActivityGiftManager.GetActivityOpenStatus(GrowthRewardId) +function GrowthGiftTaskItem:OnBtnDealClicked() + local openStatus = ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.GrowthReward) local goods = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.GrowthReward, GlobalActivity[GrowthRewardId].CanBuyRechargeId) if not openStatus or (goods and goods.buyTimes < 1) then PopupTipPanel.ShowTip(Language[11474])