diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index ecabc15a..48dcd0b0 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -187,6 +187,8 @@ local EVENT_NAME_VIT_GET = "client_vit_get" local EVENT_NAME_DAILY_TASK = "client_daily_task" local EVENT_NAME_MAIL_OPT = "client_mail_opt" local EVENT_NAME_HERO_OPT = "client_hero_opt" +local EVENT_NAME_PLAYER_LV_UP = "client_player_lv_up" -- 玩家升级 +local EVENT_NAME_PAY_UI_SHOW = "client_pay_ui_show" -- 内购相关界面展示 function BIReport:setIsNewPlayer(isNewPlayer) self.isNewPlayer = isNewPlayer @@ -861,4 +863,22 @@ function BIReport:postHeroOpt(heroId, optType) self:report(EVENT_NAME_HERO_OPT, args) end +function BIReport:postPlayerLvUp(fromLevel, toLevel) + local args = { + player_level_from = fromLevel, + player_level = toLevel, + } + self:report(EVENT_NAME_PLAYER_LV_UP, args) +end + +-- 内购相关界面展示,包括弹出/主动打开(如果是打开商城页签,钻石礼包只上报id2,章节礼包只上报首个可购买章节id) +-- giftType为BIReport.GIFT_TYPE +function BIReport:postPayUIShow(giftType, giftId) + local args = { + gift_type = giftType, + gift_id = giftId, + } + self:report(EVENT_NAME_PAY_UI_SHOW, args) +end + return BIReport \ No newline at end of file diff --git a/lua/app/module/daily_challenge/daily_challenge_manager.lua b/lua/app/module/daily_challenge/daily_challenge_manager.lua index 8507c751..8c6ee2e1 100644 --- a/lua/app/module/daily_challenge/daily_challenge_manager.lua +++ b/lua/app/module/daily_challenge/daily_challenge_manager.lua @@ -71,10 +71,7 @@ function DailyChallengeManager:rspStartChallenge(result) if result.err_code == GConst.ERROR_STR.SUCCESS then DataManager.DailyChallengeData:onFightCountReduce() DataManager.DailyChallengeData:setFixedChapterId(result.today_fixed_chapter_id) - ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, {}, function() - UIManager:closeAllUI() - ModuleManager.MaincityManager:showMainCityUI(false, GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE) - end) + ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE) end end diff --git a/lua/app/module/maincity/maincity_manager.lua b/lua/app/module/maincity/maincity_manager.lua index 1873819a..2e06fb85 100644 --- a/lua/app/module/maincity/maincity_manager.lua +++ b/lua/app/module/maincity/maincity_manager.lua @@ -98,4 +98,16 @@ function MaincityManager:isActivSideBarModule(moduleKey) return mainUI:isActivSideBarModule(moduleKey) end +function MaincityManager:setCurModule(moduleKey) + self.curModule = moduleKey +end + +function MaincityManager:getCurModule() + if not self.curModule then + -- 默认进主线章节 + return GConst.MainCityConst.MAIN_MODULE.CHAPTER + end + return self.curModule +end + return MaincityManager \ No newline at end of file diff --git a/lua/app/module/player/player_manager.lua b/lua/app/module/player/player_manager.lua index e1303cfd..b477c407 100644 --- a/lua/app/module/player/player_manager.lua +++ b/lua/app/module/player/player_manager.lua @@ -21,6 +21,7 @@ function PlayerManager:onLevelUpFinish(result) self:showPlayerUpUI(currLv, result.rewards) ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_PLAYER_LV_REACH, diffLv) DataManager:tryOpenModules() + BIReport:postPlayerLvUp(currLv, result.level) end end end diff --git a/lua/app/ui/activity/gold_pig/gold_pig_ui.lua b/lua/app/ui/activity/gold_pig/gold_pig_ui.lua index 3ad0cbf9..1beda6db 100644 --- a/lua/app/ui/activity/gold_pig/gold_pig_ui.lua +++ b/lua/app/ui/activity/gold_pig/gold_pig_ui.lua @@ -71,6 +71,8 @@ function GoldPigUI:onLoadRootComplete() end end end) + + BIReport:postPayUIShow(BIReport.GIFT_TYPE.GOLD_PIG) end function GoldPigUI:initSpine() diff --git a/lua/app/ui/bounty/bounty_main_ui.lua b/lua/app/ui/bounty/bounty_main_ui.lua index 6f8a098d..f67a0f02 100644 --- a/lua/app/ui/bounty/bounty_main_ui.lua +++ b/lua/app/ui/bounty/bounty_main_ui.lua @@ -58,6 +58,8 @@ function BountyMainUI:onLoadRootComplete() self:updateTime() end, 1) self:updateTime() + + BIReport:postPayUIShow(BIReport.GIFT_TYPE.BOUNTY) end function BountyMainUI:initTitle() diff --git a/lua/app/ui/fund/growth_fund_ui.lua b/lua/app/ui/fund/growth_fund_ui.lua index 16738514..fddf0f87 100644 --- a/lua/app/ui/fund/growth_fund_ui.lua +++ b/lua/app/ui/fund/growth_fund_ui.lua @@ -65,6 +65,7 @@ function GrowthFundUI:onLoadRootComplete() self:initPayBtns() self:initRewards() self:bindData() + BIReport:postPayUIShow(BIReport.GIFT_TYPE.GROWTH_FUND) end function GrowthFundUI:initTitle() diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 9b4c8cab..843351c0 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -7,7 +7,7 @@ local BOTTOM_HEIGHT = 120 function MainComp:init() self.uiMap = self:getBaseObject():genAllChildren() - self:refreshModule(GConst.MainCityConst.MAIN_MODULE.CHAPTER) + self:refreshModule(ModuleManager.MaincityManager:getCurModule()) self:initStageFormation() end @@ -29,6 +29,7 @@ function MainComp:refreshModule(selectModule) if self.curModuleType ~= selectModule then self.curModuleType = selectModule + ModuleManager.MaincityManager:setCurModule(self.curModuleType) if self.curModuleType == GConst.MainCityConst.MAIN_MODULE.CHAPTER then -- 切换到主线章节 EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_CHAPTER) diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index 08bdc01e..170d402e 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -694,7 +694,11 @@ function MainCityUI:switchComp(index) for i, comp in pairs(self.subComps) do comp:getBaseObject():setActive(i == index) if i == index then + if index == GConst.MainCityConst.BOTTOM_PAGE.SHOP then + comp:clearPostFlag() + end comp:refresh() + self:updateTime() end end diff --git a/lua/app/ui/shop/first_recharge_pop_ui.lua b/lua/app/ui/shop/first_recharge_pop_ui.lua index d4b21310..94de9067 100644 --- a/lua/app/ui/shop/first_recharge_pop_ui.lua +++ b/lua/app/ui/shop/first_recharge_pop_ui.lua @@ -43,6 +43,9 @@ function FirstRechargePopUI:onLoadRootComplete() self:_bind() self:refresh() + + -- 上报 + BIReport:postPayUIShow(BIReport.GIFT_TYPE.FIRST_RECHARGE, GConst.ShopConst.FIRST_RECHARGE_ID) end function FirstRechargePopUI:_bind() diff --git a/lua/app/ui/shop/gift_pop_ui.lua b/lua/app/ui/shop/gift_pop_ui.lua index f6ef6b59..059d813f 100644 --- a/lua/app/ui/shop/gift_pop_ui.lua +++ b/lua/app/ui/shop/gift_pop_ui.lua @@ -154,6 +154,10 @@ function GiftPopUI:refresh(needCheck) end end end + + -- 上报 + local giftType = PayManager:getGiftType(self.actType, self.actId) + BIReport:postPayUIShow(giftType, self.actId) self:updateTime() end diff --git a/lua/app/ui/shop/shop_comp.lua b/lua/app/ui/shop/shop_comp.lua index 989a77c6..51301b1c 100644 --- a/lua/app/ui/shop/shop_comp.lua +++ b/lua/app/ui/shop/shop_comp.lua @@ -21,6 +21,7 @@ function ShopComp:init() self.uiMap = self.baseObject:genAllChildren() self.page = PAGE_MAIN -- 默认展示主要商品 + self.post = false self:initTitlePage() self:initMainPage() @@ -81,6 +82,7 @@ end function ShopComp:switchPage(page) if self.page ~= page then self.page = page + self.post = false self:refresh() end end @@ -168,6 +170,55 @@ function ShopComp:refresh() end self:refreshTime() + + -- 上报 + self:postEnterPage() +end + +function ShopComp:postEnterPage() + if self.post then + return + end + self.post = true + + if self.page == PAGE_DISCOUNT then + -- 找到所有的项目 + -- 章节 + local actIdList = DataManager.ShopData:getActChapterStoreCanBuyActIds() + if actIdList and #actIdList > 0 then + BIReport:postPayUIShow(BIReport.GIFT_TYPE.ACT_CHAPTER_STORE, actIdList[1]) -- 约定上报第一个付费项 + end + -- 新手 + if not DataManager.ShopData:getBeginnerGiftHasBuy() then + BIReport:postPayUIShow(BIReport.GIFT_TYPE.BEGINNER_GIFT, GConst.ShopConst.BEGINNER_GIFT_ID) + end + -- 助力 + local actIdList = DataManager.ShopData:getLevelUpGiftActIds() + if actIdList and #actIdList > 0 then + for _, id in ipairs(actIdList) do + BIReport:postPayUIShow(BIReport.GIFT_TYPE.LEVEL_UP_GIFT, id) + end + end + -- 成长 + local actIdList = DataManager.ShopData:getValidGrowUpGifts() + if actIdList and #actIdList > 0 then + for _, id in ipairs(actIdList) do + BIReport:postPayUIShow(BIReport.GIFT_TYPE.GROW_UP_GIFT, id) + end + end + -- 金币 + local actId = DataManager.ShopData:getValidCoinGiftId() + if actId and actId > 0 then + BIReport:postPayUIShow(BIReport.GIFT_TYPE.COIN_GIFT, actId) + end + else + -- 找到所有的钻石项目 + BIReport:postPayUIShow(BIReport.GIFT_TYPE.MALL_TREASURE, 2) -- 约定上报第一个付费项 + end +end + +function ShopComp:clearPostFlag() + self.post = false end function ShopComp:refreshTime() @@ -181,7 +232,7 @@ function ShopComp:refreshTime() end if self.coinCellCount ~= coinCellCount then self.coinCellCount = coinCellCount - DataManager.ShopData:setDirty() + DataManager.ShopData:setDirty() end local growCellCount = 0 if self.growSellCell and self.growSellCell:getIsOpen() then diff --git a/lua/app/userdata/player/player_data.lua b/lua/app/userdata/player/player_data.lua index 2dcaffeb..bd6c5db4 100644 --- a/lua/app/userdata/player/player_data.lua +++ b/lua/app/userdata/player/player_data.lua @@ -25,6 +25,12 @@ function PlayerData:init(data) self:markDirty() end) self.createTime = basicInfo.create_at or 0 -- 创角时间 + + local time = data.now_ts or 0 + if math.abs(self.createTime - time) <= 3000 then -- 认为是新号初次登录 + local vit = self:getMaxVit() + BIReport:postVitGet(vit, BIReport.ITEM_GET_TYPE.NEW_PLAYER_INITIAL, vit) + end self:initModuleUnlockInfo() end diff --git a/lua/app/userdata/shop/shop_data.lua b/lua/app/userdata/shop/shop_data.lua index 1fab764a..910545b7 100644 --- a/lua/app/userdata/shop/shop_data.lua +++ b/lua/app/userdata/shop/shop_data.lua @@ -6,7 +6,6 @@ end function ShopData:initBase() self:initActChapterStoreData() - self:initFirstRecharge() self:initCrossDay() end @@ -52,7 +51,7 @@ function ShopData:initActGift(act) end self.giftMap[giftType][giftId] = gift end - + self:initFirstRecharge() self:setDirty() end