diff --git a/lua/app/common/local_data.lua b/lua/app/common/local_data.lua index 7b30e682..d90214a3 100644 --- a/lua/app/common/local_data.lua +++ b/lua/app/common/local_data.lua @@ -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 \ No newline at end of file diff --git a/lua/app/ui/activity/fourteen_day/fourteen_day_exchange_ui.lua b/lua/app/ui/activity/fourteen_day/fourteen_day_exchange_ui.lua index c70bf78f..c7b3cd6e 100644 --- a/lua/app/ui/activity/fourteen_day/fourteen_day_exchange_ui.lua +++ b/lua/app/ui/activity/fourteen_day/fourteen_day_exchange_ui.lua @@ -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() diff --git a/lua/app/userdata/activity/fourteen_day/fourteen_day_data.lua b/lua/app/userdata/activity/fourteen_day/fourteen_day_data.lua index abdda6d5..1a95375b 100644 --- a/lua/app/userdata/activity/fourteen_day/fourteen_day_data.lua +++ b/lua/app/userdata/activity/fourteen_day/fourteen_day_data.lua @@ -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