From b59a8d20d678a4bf41c10e43bad6b5b5e182bed6 Mon Sep 17 00:00:00 2001 From: CloudJ Date: Tue, 27 Jun 2023 17:24:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E9=97=A8=E7=A4=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/bi_report.lua | 2 + lua/app/common/data_manager.lua | 1 + lua/app/common/module_manager.lua | 1 + lua/app/common/pay_manager.lua | 3 + lua/app/module/chapter/chapter_manager.lua | 5 + lua/app/module/maincity/maincity_const.lua | 3 +- lua/app/module/shop/shop_const.lua | 2 + lua/app/module/shop/shop_manager.lua | 2 + .../cell/side_bar_introduct_gift_cell.lua | 46 ++++++++ .../side_bar_introduct_gift_cell.lua.meta | 10 ++ lua/app/ui/main_city/main_city_ui.lua | 19 +++- lua/app/ui/shop/introduct_pop_ui.lua | 92 ++++++++++++++++ lua/app/ui/shop/introduct_pop_ui.lua.meta | 10 ++ lua/app/userdata/shop/shop_data.lua | 101 +++++++++++++----- 14 files changed, 267 insertions(+), 30 deletions(-) create mode 100644 lua/app/ui/main_city/cell/side_bar_introduct_gift_cell.lua create mode 100644 lua/app/ui/main_city/cell/side_bar_introduct_gift_cell.lua.meta create mode 100644 lua/app/ui/shop/introduct_pop_ui.lua create mode 100644 lua/app/ui/shop/introduct_pop_ui.lua.meta diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 3c71f1a9..f68eb62b 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -108,6 +108,7 @@ BIReport.ITEM_GET_TYPE = { CHANGE_NAME = "ChangeName", -- 重命名 CHANGE_AVATAR = "ChangeAvatar", -- 修改头像 CHANGE_FRAME = "ChangeFrame", -- 修改头像框 + INTRODUCTORY_GIFT = "IntroductoryGift", -- 入门礼包 } BIReport.ADS_CLICK_TYPE = { @@ -160,6 +161,7 @@ BIReport.GIFT_TYPE = { ACT_CHAPTER_STORE = "ActChapterStore", GROWTH_FUND = "GrowthFund", GROW_UP_GIFT = "GrowUpGift", + INTRODUCTORY_GIFT = "IntroductoryGift", } BIReport.COIN_TYPE = { diff --git a/lua/app/common/data_manager.lua b/lua/app/common/data_manager.lua index 51f82c91..7bda59b5 100644 --- a/lua/app/common/data_manager.lua +++ b/lua/app/common/data_manager.lua @@ -140,6 +140,7 @@ function DataManager:initWithServerData(data) self.ShopData:initCommonDailyGoldGift(data.mall_idle and data.mall_idle.ad_count) -- 常驻金币礼包 self.ShopData:initGrowUpGift(data.act_grow_up_gift, data.now_ts) -- 成长礼包 self.ShopData:initLevelUpGift(data.act_level_up_gift) -- 助力/金币礼包 + self.ShopData:initIntroductGift(data.act_introductory_gift) -- 入门礼包 -- 商店礼包都初始化完了后检查一下每日红点 self.ShopData:checkShopDiscountRedPoint() self.SummonData:init(data.summon, true) diff --git a/lua/app/common/module_manager.lua b/lua/app/common/module_manager.lua index 0e299a5e..8beeeb4b 100644 --- a/lua/app/common/module_manager.lua +++ b/lua/app/common/module_manager.lua @@ -74,6 +74,7 @@ ModuleManager.MODULE_KEY = { MAIL = "mail_open", -- 邮件 DUNGEON_SHARDS = "dungeon_shards_open", -- 碎片副本 DUNGEON_GOLD = "dungeon_gold_open", -- 金币副本 + INTRODUCT_GIFT = "introduct_gift", -- 入门礼包 } local _moduleMgrs = {} diff --git a/lua/app/common/pay_manager.lua b/lua/app/common/pay_manager.lua index dbbd0800..aa2a0dfd 100644 --- a/lua/app/common/pay_manager.lua +++ b/lua/app/common/pay_manager.lua @@ -11,6 +11,7 @@ PayManager.PURCHARSE_TYPE = { PayManager.PURCHARSE_ACT_TYPE = { FIRST_RECHARGE = 1, COIN_GIFT = 2, + INTRODUCTORY_GIFT = 3, BEGINNER_GIFT = 4, LEVEL_UP_GIFT = 5, GROWTH_FUND = 6, @@ -29,6 +30,7 @@ PayManager.BI_ITEM_GET_TYPE = { [PayManager.PURCHARSE_TYPE.ACT_GIFT] = { [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.ITEM_GET_TYPE.FIRST_RECHARGE, [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = BIReport.ITEM_GET_TYPE.COIN_GIFT, + [PayManager.PURCHARSE_ACT_TYPE.INTRODUCTORY_GIFT] = BIReport.ITEM_GET_TYPE.INTRODUCTORY_GIFT, [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = BIReport.ITEM_GET_TYPE.BEGINNER_GIFT, [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = BIReport.ITEM_GET_TYPE.LEVEL_UP_GIFT, [PayManager.PURCHARSE_ACT_TYPE.GROWTH_FUND] = BIReport.ITEM_GET_TYPE.GROWTH_FUND, @@ -44,6 +46,7 @@ PayManager.BI_GIFT_TYPE = { [PayManager.PURCHARSE_TYPE.ACT_GIFT] = { [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.GIFT_TYPE.FIRST_RECHARGE, [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = BIReport.GIFT_TYPE.COIN_GIFT, + [PayManager.PURCHARSE_ACT_TYPE.INTRODUCTORY_GIFT] = BIReport.GIFT_TYPE.INTRODUCTORY_GIFT, [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = BIReport.GIFT_TYPE.BEGINNER_GIFT, [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = BIReport.GIFT_TYPE.LEVEL_UP_GIFT, [PayManager.PURCHARSE_ACT_TYPE.GROWTH_FUND] = BIReport.GIFT_TYPE.GROWTH_FUND, diff --git a/lua/app/module/chapter/chapter_manager.lua b/lua/app/module/chapter/chapter_manager.lua index 0010b04d..98dc2d3c 100644 --- a/lua/app/module/chapter/chapter_manager.lua +++ b/lua/app/module/chapter/chapter_manager.lua @@ -46,6 +46,11 @@ end function ChapterManager:startFightFinish(result) if result.err_code == GConst.ERROR_STR.SUCCESS then ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.STAGE) + + -- 开始第二章时,触发成长礼包 + if result.reqData.chapter_id == GConst.ShopConst.INTRODUCTORY_GIFT_TRIGGER_CHAPTER_ID then + DataManager.ShopData:onTriggerIntroductGift() + end end end diff --git a/lua/app/module/maincity/maincity_const.lua b/lua/app/module/maincity/maincity_const.lua index 1bffbd83..06e7f659 100644 --- a/lua/app/module/maincity/maincity_const.lua +++ b/lua/app/module/maincity/maincity_const.lua @@ -31,7 +31,8 @@ MainCityConst.LEFT_SIDE_BARS = { MainCityConst.RIGHT_SIDE_BARS = { "app/ui/main_city/cell/side_bar_gold_pig_cell", - "app/ui/main_city/cell/side_bar_first_recharge_cell", + -- "app/ui/main_city/cell/side_bar_first_recharge_cell", 已作废 + "app/ui/main_city/cell/side_bar_introduct_gift_cell", "app/ui/main_city/cell/side_bar_beginner_gift_cell", "app/ui/main_city/cell/side_bar_grow_up_gift_1_cell", "app/ui/main_city/cell/side_bar_grow_up_gift_2_cell", diff --git a/lua/app/module/shop/shop_const.lua b/lua/app/module/shop/shop_const.lua index 2defa184..09fb5e6a 100644 --- a/lua/app/module/shop/shop_const.lua +++ b/lua/app/module/shop/shop_const.lua @@ -2,6 +2,8 @@ local ShopConst = {} ShopConst.FIRST_RECHARGE_ID = 10102 -- 首充礼包ID ShopConst.BEGINNER_GIFT_ID = 40102 -- 新手礼包ID +ShopConst.INTRODUCTORY_GIFT_ID = 30102 -- 入门礼包ID +ShopConst.INTRODUCTORY_GIFT_TRIGGER_CHAPTER_ID = 2 -- 入门礼包触发的章节ID ShopConst.MAIN_UI_POP_TYPE = { -- 当触发弹窗时,相关联的类型礼包也要触发 [PayManager.PURCHARSE_TYPE.ACT_GIFT] = { [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = true, diff --git a/lua/app/module/shop/shop_manager.lua b/lua/app/module/shop/shop_manager.lua index 6a8bf62e..8cb6b33a 100644 --- a/lua/app/module/shop/shop_manager.lua +++ b/lua/app/module/shop/shop_manager.lua @@ -36,6 +36,8 @@ function ShopManager:showGiftPopUI(actType, actId, onlySelf) end if actType == PayManager.PURCHARSE_TYPE.ACT_GIFT and actId == GConst.ShopConst.FIRST_RECHARGE_ID then UIManager:showUI("app/ui/shop/first_recharge_pop_ui") + elseif actType == PayManager.PURCHARSE_TYPE.ACT_GIFT and actId == GConst.ShopConst.INTRODUCT_GIFT_ID then + UIManager:showUI("app/ui/shop/introduct_pop_ui") else UIManager:showUI("app/ui/shop/gift_pop_ui", {type = actType, id = actId, onlySelf = onlySelf}) end diff --git a/lua/app/ui/main_city/cell/side_bar_introduct_gift_cell.lua b/lua/app/ui/main_city/cell/side_bar_introduct_gift_cell.lua new file mode 100644 index 00000000..47a63b55 --- /dev/null +++ b/lua/app/ui/main_city/cell/side_bar_introduct_gift_cell.lua @@ -0,0 +1,46 @@ +local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell" +local SideBarIntroductGiftCell = class("SideBarIntroductGiftCell", SideBarBaseCellComp) + +function SideBarIntroductGiftCell:getModuleKey() + return ModuleManager.MODULE_KEY.INTRODUCT_GIFT +end + +function SideBarIntroductGiftCell:getIsOpen() + return DataManager.ShopData:getIntroductGiftShowSideBar() +end + +function SideBarIntroductGiftCell:getSpineName() + return "main_btn_gift_new" +end + +function SideBarIntroductGiftCell:onClick() + ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.INTRODUCT_GIFT_ID, true) +end + +function SideBarIntroductGiftCell:getIsShowRedPoint() + return false +end + +function SideBarIntroductGiftCell:onRefresh() + self.timeBg:setVisible(true) + self:_refreshTime() +end + +function SideBarIntroductGiftCell:updateTime() + if self:getIsOpen() then + self:_refreshTime() + else + self:closeBtn() + end +end + +function SideBarIntroductGiftCell:_refreshTime() + local remainTime = DataManager.ShopData:getIntroductGiftRemainTime() + if remainTime >= 0 then + self.timeTx:setText(GFunc.getTimeStr(remainTime)) + else + self.timeTx:setText("00:00:00") + end +end + +return SideBarIntroductGiftCell \ No newline at end of file diff --git a/lua/app/ui/main_city/cell/side_bar_introduct_gift_cell.lua.meta b/lua/app/ui/main_city/cell/side_bar_introduct_gift_cell.lua.meta new file mode 100644 index 00000000..3914613c --- /dev/null +++ b/lua/app/ui/main_city/cell/side_bar_introduct_gift_cell.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c8bc1461168b10444b874ff8cdd0c025 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index 79c51e0b..a5827050 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -1003,7 +1003,7 @@ function MainCityUI:checkTutorial() end end --- 检查礼包(首充/章节/新手/助力/成长/金币顺序) +-- 检查礼包(首充(作废)/入门/章节/新手/助力/成长/金币顺序) function MainCityUI:checkGift() -- 审核模式不弹礼包 if GFunc.isShenhe() then @@ -1023,6 +1023,7 @@ function MainCityUI:checkGift() local beginnerGiftIds local levelUpGiftIds local firstRechargeIds + local introductGiftIds local actPopUpGifts = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.ACT_GIFT) if actPopUpGifts and #actPopUpGifts > 0 then -- 先遍历找出符合弹出的类型 @@ -1050,6 +1051,13 @@ function MainCityUI:checkGift() end table.insert(firstRechargeIds, actId) end + -- 入门礼包 + if cfgInfo.type == PayManager.PURCHARSE_ACT_TYPE.INTRODUCTORY_GIFT then + if not introductGiftIds then + introductGiftIds = {} + end + table.insert(introductGiftIds, actId) + end end end end @@ -1057,8 +1065,13 @@ function MainCityUI:checkGift() local growUpPopUpGifts = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT) -- 按顺序弹出(首充/章节/新手/助力/成长/金币顺序) -- 首充礼包 - if firstRechargeIds and #firstRechargeIds > 0 then - ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, firstRechargeIds[1]) + -- if firstRechargeIds and #firstRechargeIds > 0 then + -- ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, firstRechargeIds[1]) + -- return true + -- end + -- 入门礼包 + if introductGiftIds and #introductGiftIds > 0 then + ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, introductGiftIds[1]) return true end -- 章节礼包 diff --git a/lua/app/ui/shop/introduct_pop_ui.lua b/lua/app/ui/shop/introduct_pop_ui.lua new file mode 100644 index 00000000..b02fd40e --- /dev/null +++ b/lua/app/ui/shop/introduct_pop_ui.lua @@ -0,0 +1,92 @@ +local IntroductPopUI = class("IntroductPopUI", BaseUI) +local MAX_ITEM_NUM = 3 + +function IntroductPopUI:ctor() +end + +function IntroductPopUI:isFullScreen() + return false +end + +function IntroductPopUI:getPrefabPath() + return "assets/prefabs/ui/shop/introduct_pop_ui.prefab" +end + +function IntroductPopUI:onPressBackspace() + self:closeUI() +end + +function IntroductPopUI:onLoadRootComplete() + self.uiMap = self.root:genAllChildren() + self.uiMap["introduct_pop_ui.close_btn"]:addClickListener(function() + self:closeUI() + end) + + self.titleTx = self.uiMap["introduct_pop_ui.bg.title_bg.title"] + self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_37)) -- 入门礼包 + + self.rewardCellList = {} + for i = 1, MAX_ITEM_NUM do + table.insert(self.rewardCellList, CellManager:addCellComp(self.uiMap["introduct_pop_ui.bg.pop_reward_cell_" .. i], GConst.TYPEOF_LUA_CLASS.POP_REWARD_CELL)) + end + + self.descText = self.uiMap["introduct_pop_ui.bg.desc_text"] + self.descText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_38)) -- 超值S级英雄,仅此一次! + + self.buyBtn = self.uiMap["introduct_pop_ui.bg.buy_btn"] + self.buyText = self.uiMap["introduct_pop_ui.bg.buy_btn.text"] + + self.buyBtn:addClickListener(function() + self:onClickFuncBtn() + end) + local cfgInfo = PayManager:getGiftConfigInfo(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.INTRODUCTORY_GIFT_ID) + local rechargeId = cfgInfo.recharge_id + self.buyText:setText(GFunc.getFormatPrice(rechargeId)) + + self.timeText = self.uiMap["introduct_pop_ui.bg.time_node.text"] + + self:_bind() + self:refresh() + + -- 上报 + BIReport:postPayUIShow(BIReport.GIFT_TYPE.INTRODUCTORY_GIFT, GConst.ShopConst.INTRODUCTORY_GIFT_ID) +end + +function IntroductPopUI:_bind() + self:bind(DataManager.ShopData, "isDirty", function() + self:refresh() + end) +end + +function IntroductPopUI:refresh() + if not (DataManager.ShopData:getIntroductGiftRemainBuyCount() > 0 and DataManager.ShopData:getIntroductGiftRemainTime() > 0) then + self:closeUI() + end + + local cfgInfo = PayManager:getGiftConfigInfo(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.INTRODUCTORY_GIFT_ID) + local rewards = cfgInfo.reward or {} + for i = 1, MAX_ITEM_NUM do + if i <= #rewards then + self.rewardCellList[i]:setVisible(true, 0.8) + self.rewardCellList[i]:refresh(rewards[i].id, rewards[i].num, false) + else + self.rewardCellList[i]:setVisible(false) + end + end + self:updateTime() +end + +function IntroductPopUI:updateTime() + local remainTime = DataManager.ShopData:getIntroductGiftRemainTime() + if remainTime > 0 then + self.timeText:setText(Time:formatNumTime(remainTime)) + else + self:closeUI() + end +end + +function IntroductPopUI:onClickFuncBtn() + PayManager:purchasePackage(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.INTRODUCTORY_GIFT_ID) +end + +return IntroductPopUI \ No newline at end of file diff --git a/lua/app/ui/shop/introduct_pop_ui.lua.meta b/lua/app/ui/shop/introduct_pop_ui.lua.meta new file mode 100644 index 00000000..88aa5bb4 --- /dev/null +++ b/lua/app/ui/shop/introduct_pop_ui.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 250463b2c13ef8146bff1f4439207b9a +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/userdata/shop/shop_data.lua b/lua/app/userdata/shop/shop_data.lua index 70291379..b71d215c 100644 --- a/lua/app/userdata/shop/shop_data.lua +++ b/lua/app/userdata/shop/shop_data.lua @@ -765,60 +765,109 @@ end -- 成长礼包结束 ---------------------------------------------------------------------------------------------- --- 首充 ********************************************************************************************** +-- 首充(作废) ********************************************************************************************** function ShopData:getIsFirstRechargeOpen() - return ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.FIRST_RECHARGE, true) + return false -- ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.FIRST_RECHARGE, true) end -- 用于标记是否弹窗 要求等级不低于2 未领取该奖励 function ShopData:initFirstRecharge() - local lv = DataManager.PlayerData:getLv() - if lv > 1 and not self:getHasGotFirstRechargeReward() then - self:markPopUpGift(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.FIRST_RECHARGE_ID) - end + -- local lv = DataManager.PlayerData:getLv() + -- if lv > 1 and not self:getHasGotFirstRechargeReward() then + -- self:markPopUpGift(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.FIRST_RECHARGE_ID) + -- end end -- 是否有首充奖励 有支付且未领取 function ShopData:getHasFirstRechargeReward() - local pay = DataManager.PlayerData:getTotalPayAmount() - if pay > 0 and not self:getHasGotFirstRechargeReward() then - return true - else - return false - end + -- local pay = DataManager.PlayerData:getTotalPayAmount() + -- if pay > 0 and not self:getHasGotFirstRechargeReward() then + -- return true + -- else + -- return false + -- end + return false end -- 是否已领取首充奖励 function ShopData:getHasGotFirstRechargeReward() -- 通用act礼包中是否有已购 - local boughtNum = self:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.FIRST_RECHARGE_ID) - return boughtNum > 0 + -- local boughtNum = self:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.FIRST_RECHARGE_ID) + -- return boughtNum > 0 + return true end -- 侧边栏是否展示 要求功能开启 未领取该奖励 function ShopData:getShowFirstRechargeSideBar() - if not self:getIsFirstRechargeOpen() then - return false - end - if not self:getHasGotFirstRechargeReward() then - return true - else - return false - end + -- if not self:getIsFirstRechargeOpen() then + -- return false + -- end + -- if not self:getHasGotFirstRechargeReward() then + -- return true + -- else + -- return false + -- end + return false end -- 侧边栏红点 function ShopData:showFirstRechargeRp() - if not self:getIsFirstRechargeOpen() then - return false - end + -- if not self:getIsFirstRechargeOpen() then + -- return false + -- end - return self:getHasFirstRechargeReward() + -- return self:getHasFirstRechargeReward() + return false end -- 首充结束 ---------------------------------------------------------------------------------------------- +-- 入门礼包 ---------------------------------------------------------------------------------------------- + +function ShopData:initIntroductGift(introductGift) + introductGift = introductGift or {} + self.introductGift = introductGift or {} + self.introductGiftTriggerTime = self.introductGift.trigger_at or 0 +end + +function ShopData:getIntroductGiftTriggerTime() + return self.introductGiftTriggerTime // 1000 +end + +function ShopData:setIntroductGiftTriggerTime(time) + self.introductGiftTriggerTime = time +end + +-- 入门礼包剩余时间 +function ShopData:getIntroductGiftRemainTime() + local cfgInfo = self:getActGiftConfig()[GConst.ShopConst.INTRODUCT_GIFT_ID] + local triggerTime = self:getIntroductGiftTriggerTime() + local remainTime = triggerTime + (cfgInfo.limit_time or 0) * 3600 - Time:getServerTime() + return remainTime +end + +-- 入门礼包剩余可购次数 +function ShopData:getIntroductGiftRemainBuyCount() + local cfgInfo = self:getActGiftConfig()[GConst.ShopConst.INTRODUCT_GIFT_ID] + local buyCount = self:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.INTRODUCT_GIFT_ID) + return cfgInfo.limit or 1 - buyCount +end + +-- 触发入门礼包 +function ShopData:onTriggerIntroductGift() + self:initIntroductGift({trigger_at = Time:getServerTime() * 1000}) + -- 标记弹窗 + self:markPopUpGift(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.INTRODUCT_GIFT_ID) +end + +-- 侧边栏是否展示(时间次数均满足) +function ShopData:getIntroductGiftShowSideBar() + return self:getIntroductGiftRemainBuyCount() > 0 and self:getIntroductGiftRemainTime() > 0 +end + +-- 入门礼包结束 -------------------------------------------------------------------------------------------- + -- 底部栏是否有红点 function ShopData:getRp() if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, true) then