代码调整
This commit is contained in:
parent
89eeac3f2d
commit
6eea9de2e5
@ -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
|
||||
@ -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()
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user