代码调整

This commit is contained in:
Fang 2023-09-01 15:58:52 +08:00
parent 89eeac3f2d
commit 6eea9de2e5
3 changed files with 10 additions and 5 deletions

View File

@ -471,11 +471,7 @@ function LocalData:getTodayFourteenDayExchangeWatched()
end
function LocalData:recordTodayFourteenDayExchangeWatched()
if self:getTodayFourteenDayExchangeWatched() then
return
end
self:setInt(LOCAL_DATA_KEY.FOURTEEN_DAY_TODAY_EXCHANGE .. Time:getBeginningOfServerToday(), 1)
DataManager.FourteenDayData:setDirty()
end
return LocalData

View File

@ -58,7 +58,7 @@ function FourteenDayExchangeUI:onLoadRootComplete()
end
function FourteenDayExchangeUI:onRefresh()
LocalData:recordTodayFourteenDayExchangeWatched()
DataManager.FourteenDayData:onShowExchangeView()
self.txNum:setText(DataManager.FourteenDayData:getExchangeItemNum())
self.scrollrectComp:updateAllCell()

View File

@ -504,6 +504,15 @@ function FourteenDayData:getExchangeReward(id)
return self:getExchangeCfg()[id].reward
end
-- 查看兑换界面
function FourteenDayData:onShowExchangeView()
if LocalData:getTodayFourteenDayExchangeWatched() then
return
end
LocalData:recordTodayFourteenDayExchangeWatched()
self:setDirty()
end
-- 兑换奖励领取成功
function FourteenDayData:onReceivedExchangeReward(id)
if self.exchangeStatus[id] == nil then