整理代码
This commit is contained in:
parent
4c27243520
commit
b36fde93c3
@ -41,6 +41,7 @@ end
|
||||
|
||||
function FullMoonManager:rspActData(result)
|
||||
self.isReqActData = false
|
||||
DataManager.FullMoonData:setInReset(false)
|
||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||
DataManager.FullMoonData:onGetActData(result.full_moon)
|
||||
end
|
||||
|
||||
@ -63,11 +63,6 @@ function TaskManager:onResetDailyTask(result)
|
||||
DataManager.DailyTaskData:setInReset(false)
|
||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||
DataManager.DailyTaskData:init(result.info)
|
||||
|
||||
-- 检查圆月活动任务更新
|
||||
if self:getIsInReset() then
|
||||
ModuleManager.FullMoonManager:reqActData()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -16,6 +16,12 @@ function FullMoonUI:onPressBackspace()
|
||||
self:closeUI()
|
||||
end
|
||||
|
||||
function FullMoonUI:onClose()
|
||||
if self.actCountdownSid then
|
||||
self.txCountdown:unscheduleGlobal(self.actCountdownSid)
|
||||
end
|
||||
end
|
||||
|
||||
function FullMoonUI:ctor(param)
|
||||
if param then
|
||||
self.panelType = param
|
||||
@ -92,6 +98,11 @@ function FullMoonUI:onLoadRootComplete()
|
||||
self:closeUI()
|
||||
end)
|
||||
self:bind(DataManager.FullMoonData, "isDirty", function()
|
||||
-- 检查更新数据
|
||||
if DataManager.FullMoonData:getIsInReset() and self.panelType == GConst.FullMoonConst.PANEL_TYPE.TASK then
|
||||
ModuleManager.FullMoonManager:reqActData()
|
||||
end
|
||||
|
||||
self:onRefresh()
|
||||
end)
|
||||
self:bind(DataManager.ShopData, "isDirty", function()
|
||||
@ -107,11 +118,6 @@ function FullMoonUI:onRefresh()
|
||||
self.txCountdown:setText(GFunc.getTimeStrWithHMS2(DataManager.FullMoonData:getEndRemainTime()))
|
||||
self.actCountdownSid = self.txCountdown:scheduleGlobal(function()
|
||||
self.txCountdown:setText(GFunc.getTimeStrWithHMS2(DataManager.FullMoonData:getEndRemainTime()))
|
||||
|
||||
-- 检查更新数据
|
||||
if self:getIsInReset() and self.panelType == GConst.FullMoonConst.PANEL_TYPE.TASK then
|
||||
ModuleManager.FullMoonManager:reqActData()
|
||||
end
|
||||
end, 1)
|
||||
|
||||
if self.panelType == GConst.FullMoonConst.PANEL_TYPE.TASK then
|
||||
|
||||
@ -2,6 +2,12 @@ local FullMoonData = class("FullMoonData", BaseData)
|
||||
|
||||
function FullMoonData:ctor()
|
||||
self.data.isDirty = false
|
||||
|
||||
self.taskFinished = 0
|
||||
self.curHeroGiftChoose = nil
|
||||
self.taskStatus = GConst.EMPTY_TABLE
|
||||
self.taskProgReward = GConst.EMPTY_TABLE
|
||||
self.chapterSkinClaimed = GConst.EMPTY_TABLE
|
||||
end
|
||||
|
||||
function FullMoonData:clear()
|
||||
@ -28,9 +34,7 @@ function FullMoonData:onGetActData(data)
|
||||
self.taskFinished = data.finished or 0-- 任务奖励总计
|
||||
self.taskStatus = data.tasks or GConst.EMPTY_TABLE
|
||||
self.taskProgReward = data.claimed or GConst.EMPTY_TABLE
|
||||
-- self.curHeroGiftId = data.custom_gift_id
|
||||
self.curHeroGiftChoose = data.custom_gift_choose
|
||||
-- self.curNewHeroGiftId = data.hero_gift_id
|
||||
self.chapterSkinClaimed = data.chapter_skin_claimed or GConst.EMPTY_TABLE
|
||||
|
||||
if self:isOpenTime() then
|
||||
@ -56,6 +60,7 @@ function FullMoonData:onGetActData(data)
|
||||
end
|
||||
|
||||
self:setInReset(true)
|
||||
self:setDirty()
|
||||
end)
|
||||
|
||||
self.isInitedData = true
|
||||
@ -320,6 +325,7 @@ function FullMoonData:getTaskProgress(id)
|
||||
-- 玩家等级实时处理
|
||||
return DataManager.PlayerData:getLv()
|
||||
end
|
||||
|
||||
return self.taskStatus[id] and self.taskStatus[id].progress or 0
|
||||
end
|
||||
|
||||
@ -347,6 +353,11 @@ function FullMoonData:addTaskProgress(taskType, count)
|
||||
return
|
||||
end
|
||||
|
||||
-- 检查圆月活动任务更新
|
||||
if self:getIsInReset() then
|
||||
ModuleManager.FullMoonManager:reqActData()
|
||||
end
|
||||
|
||||
for id, data in pairs(self.taskStatus) do
|
||||
local tt = self:getTaskType(id)
|
||||
if tt == taskType then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user