Merge branch 'dev' of http://git.juzugame.com/b6-client/b6-lua into dev
# Conflicts: # lua/app/common/bi_report.lua
This commit is contained in:
commit
e69b7a14e5
@ -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
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -71,6 +71,8 @@ function GoldPigUI:onLoadRootComplete()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
BIReport:postPayUIShow(BIReport.GIFT_TYPE.GOLD_PIG)
|
||||
end
|
||||
|
||||
function GoldPigUI:initSpine()
|
||||
|
||||
@ -58,6 +58,8 @@ function BountyMainUI:onLoadRootComplete()
|
||||
self:updateTime()
|
||||
end, 1)
|
||||
self:updateTime()
|
||||
|
||||
BIReport:postPayUIShow(BIReport.GIFT_TYPE.BOUNTY)
|
||||
end
|
||||
|
||||
function BountyMainUI:initTitle()
|
||||
|
||||
@ -65,6 +65,7 @@ function GrowthFundUI:onLoadRootComplete()
|
||||
self:initPayBtns()
|
||||
self:initRewards()
|
||||
self:bindData()
|
||||
BIReport:postPayUIShow(BIReport.GIFT_TYPE.GROWTH_FUND)
|
||||
end
|
||||
|
||||
function GrowthFundUI:initTitle()
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -155,6 +155,10 @@ function GiftPopUI:refresh(needCheck)
|
||||
end
|
||||
end
|
||||
|
||||
-- 上报
|
||||
local giftType = PayManager:getGiftType(self.actType, self.actId)
|
||||
BIReport:postPayUIShow(giftType, self.actId)
|
||||
|
||||
self:updateTime()
|
||||
end
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user