diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index e09d14cd..237116c4 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -179,6 +179,7 @@ local EVENT_NAME_VIT_USE = "client_vit_use" 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_PAY_UI_SHOW = "client_pay_ui_show" -- 内购相关界面展示 function BIReport:setIsNewPlayer(isNewPlayer) self.isNewPlayer = isNewPlayer @@ -824,4 +825,13 @@ function BIReport:postAccountChangeFinish(loginType, success) self:report(EVENT_NAME_ACCOUNT_OPT, args) end +-- 内购相关界面展示,包括弹出/主动打开 +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/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..91c9cfbc 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(PayManager.PURCHARSE_TYPE.ACT_GIFT, 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..98a376cd 100644 --- a/lua/app/ui/shop/gift_pop_ui.lua +++ b/lua/app/ui/shop/gift_pop_ui.lua @@ -154,6 +154,9 @@ function GiftPopUI:refresh(needCheck) end end end + + -- 上报 + BIReport:postPayUIShow(self.actType, 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..8335c51d 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,59 @@ 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(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT, actIdList[1]) -- 约定上报第一个付费项 + end + -- 新手 + if not DataManager.ShopData:getBeginnerGiftHasBuy() then + BIReport:postPayUIShow(PayManager.PURCHARSE_TYPE.ACT_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(PayManager.PURCHARSE_TYPE.ACT_GIFT, id) + end + end + -- 成长 + local actIdList = DataManager.ShopData:getValidGrowUpGifts() + if actIdList and #actIdList > 0 then + for _, id in ipairs(actIdList) do + BIReport:postPayUIShow(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, id) + end + end + -- 金币 + local actId = DataManager.ShopData:getValidCoinGiftId() + if actId and actId > 0 then + BIReport:postPayUIShow(PayManager.PURCHARSE_TYPE.ACT_GIFT, actId) + end + else + -- 找到所有的钻石项目 + -- local gemCfg = DataManager.ShopData:getMallTreasureConfig() + -- for _, id in pairs(gemCfg) do + -- BIReport:postPayUIShow(PayManager.PURCHARSE_TYPE.MALL_TREASURE, id) + -- end + BIReport:postPayUIShow(PayManager.PURCHARSE_TYPE.MALL_TREASURE, 2) -- 约定上报第一个付费项 + end +end + +function ShopComp:clearPostFlag() + self.post = false end function ShopComp:refreshTime() @@ -181,7 +236,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/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