diff --git a/lua/app/common/data_manager.lua b/lua/app/common/data_manager.lua index 1f906855..243f3be7 100644 --- a/lua/app/common/data_manager.lua +++ b/lua/app/common/data_manager.lua @@ -154,6 +154,7 @@ function DataManager:initWithServerData(data) self.ShopData:initIntroductGift(data.act_introductory_gift) -- 入门礼包 -- 商店礼包都初始化完了后检查一下每日红点 self.ShopData:checkShopDiscountRedPoint() + self.ShopData:checkLoginPopInfo() -- 需要写在shopdata所有初始化之后 self.SummonData:init(data.summon, true) self.AIHelperData:init(nil, true) -- 成长基金要在ShopData和PlayerDataBagData还有之后初始化,依赖这些数据 diff --git a/lua/app/module/chapter/chapter_manager.lua b/lua/app/module/chapter/chapter_manager.lua index ad7af255..b78ace71 100644 --- a/lua/app/module/chapter/chapter_manager.lua +++ b/lua/app/module/chapter/chapter_manager.lua @@ -160,6 +160,10 @@ function ChapterManager:endFightFinish(result) DataManager.ShopData:onTriggerIntroductGift() end + if not reqData.win then + DataManager.ShopData:markPopLastChapterActGift() + end + ModuleManager.TaskManager:addFightTaskProgress(reqData.task_stat) end end diff --git a/lua/app/userdata/shop/shop_data.lua b/lua/app/userdata/shop/shop_data.lua index f2694323..3417c063 100644 --- a/lua/app/userdata/shop/shop_data.lua +++ b/lua/app/userdata/shop/shop_data.lua @@ -895,4 +895,22 @@ function ShopData:markShopDiscountRedPoint() LocalData:setShopDiscountRedPointTime(today) end +function ShopData:checkLoginPopInfo() + -- 初始化礼包弹出逻辑 + local actPopUpGifts = self:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.ACT_GIFT) + if not actPopUpGifts or #actPopUpGifts <= 0 then + self:markPopLastChapterActGift() + end +end + +function ShopData:markPopLastChapterActGift() + local chapterPopUpGifts = self:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT) + if not chapterPopUpGifts or #chapterPopUpGifts <= 0 then + local list = self:getActChapterStoreCanBuyActIds() + if list and list[1] then + self:markPopUpGift(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT, list[#list]) + end + end +end + return ShopData \ No newline at end of file