首充弹窗
This commit is contained in:
parent
b69fd2227d
commit
e1565b9631
@ -33,6 +33,7 @@ local MODULE_PATHS = {
|
|||||||
GameSettingManager = "app/module/game_setting/game_setting_manager",
|
GameSettingManager = "app/module/game_setting/game_setting_manager",
|
||||||
-- 活动
|
-- 活动
|
||||||
ActivityManager = "app/module/activity/activity_manager",
|
ActivityManager = "app/module/activity/activity_manager",
|
||||||
|
ActivityPopManager = "app/module/activity/activity_pop_manager",
|
||||||
-- 礼包
|
-- 礼包
|
||||||
CommerceManager = "app/module/commerce/commerce_manager",
|
CommerceManager = "app/module/commerce/commerce_manager",
|
||||||
-- 战令
|
-- 战令
|
||||||
|
|||||||
@ -189,6 +189,7 @@ GConst.TYPEOF_LUA_CLASS = {
|
|||||||
-- 资源条
|
-- 资源条
|
||||||
CURRENCY_BAR = "app/ui/currency_bar/currency_bar",
|
CURRENCY_BAR = "app/ui/currency_bar/currency_bar",
|
||||||
CURRENCY_BAR_CELL = "app/ui/currency_bar/cell/currency_cell",
|
CURRENCY_BAR_CELL = "app/ui/currency_bar/cell/currency_cell",
|
||||||
|
POP_SKIP_BAR = "app/ui/pop_skip_bar/pop_skip_bar",
|
||||||
|
|
||||||
-- cell
|
-- cell
|
||||||
ITEM_CELL = "app/ui/common/cell/item_cell",
|
ITEM_CELL = "app/ui/common/cell/item_cell",
|
||||||
|
|||||||
102
lua/app/module/activity/activity_pop_manager.lua
Normal file
102
lua/app/module/activity/activity_pop_manager.lua
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
local ActivityPopManager = class("ActivityPopManager", BaseModule)
|
||||||
|
|
||||||
|
function ActivityPopManager:setFirstLogin(isFirstEnter)
|
||||||
|
self.firstRechargePop = isFirstEnter
|
||||||
|
self.giftPop = isFirstEnter
|
||||||
|
self.giftPopChain = isFirstEnter
|
||||||
|
self.activityPop = {
|
||||||
|
isActSummon = isFirstEnter,
|
||||||
|
isActSprint = isFirstEnter,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 增加今日不再提示组件(注意只可以在 onLoadRootComplete 里调用且只可以调用一次)
|
||||||
|
function ActivityPopManager:addPopBar(parent, node)
|
||||||
|
if not parent then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local childList = parent:getChildList()
|
||||||
|
for _, uiObj in pairs(childList) do
|
||||||
|
if uiObj:getTag() == GConst.GAME_OBJECT_TAG.POP_SKIP_BAR then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local targetNode = node or parent
|
||||||
|
UIPrefabManager:loadUIWidgetAsync("assets/prefabs/ui/common/pop_skip_bar.prefab", targetNode, function(prefabObject)
|
||||||
|
local popBar = prefabObject:addLuaComponent(GConst.TYPEOF_LUA_CLASS.POP_SKIP_BAR)
|
||||||
|
prefabObject:setTag(GConst.GAME_OBJECT_TAG.POP_SKIP_BAR)
|
||||||
|
popBar:show()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function ActivityPopManager:checkFirstRechargePop()
|
||||||
|
if DataManager.TutorialData:getIsInTutorial() then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
if DataManager.ShopData:getNeedShowFirstRechargePop() then
|
||||||
|
ModuleManager.ShopManager:showFirstRechargeUI()
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- function ActivityPopManager:setGiftPopState(state)
|
||||||
|
-- self.giftPop = state
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- function ActivityPopManager:checkGiftPop()
|
||||||
|
-- if not self.giftPop then
|
||||||
|
-- return false
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- if self:checkPopGift() then
|
||||||
|
-- return true
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- return false
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- function ActivityPopManager:setGiftPopChainState(state)
|
||||||
|
-- self.giftPopChain = state
|
||||||
|
-- end
|
||||||
|
|
||||||
|
function ActivityPopManager:checkActivityPop()
|
||||||
|
if self:checkActivityActivityPop() then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- function ActivityPopManager:checkPopGift()
|
||||||
|
-- local giftType, _ = DataManager.GiftPopData:getPopGiftType(self.giftPop)
|
||||||
|
-- self.giftPop = false
|
||||||
|
-- if not giftType then
|
||||||
|
-- return false
|
||||||
|
-- end
|
||||||
|
-- ModuleManager.GiftPopManager:showPopGiftUI({
|
||||||
|
-- popType = giftType
|
||||||
|
-- })
|
||||||
|
-- return true
|
||||||
|
-- end
|
||||||
|
|
||||||
|
function ActivityPopManager:checkActivityActivityPop()
|
||||||
|
return self:checkActSprint()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 冲刺活动
|
||||||
|
function ActivityPopManager:checkActSprint()
|
||||||
|
if not DataManager.ActSprintData:getIsOpen() or not DataManager.ActSprintData:showSideBar() then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local params = {}
|
||||||
|
params.autoPop = true
|
||||||
|
params.showToday = GConst.MESSAGE_BOX_SHOW_TODAY.ACT_SPRINT
|
||||||
|
ModuleManager.ActSprintManager:showActSprintListUI(params)
|
||||||
|
self.activityPop.isActSprint = false
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return ActivityPopManager
|
||||||
10
lua/app/module/activity/activity_pop_manager.lua.meta
Normal file
10
lua/app/module/activity/activity_pop_manager.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 087c7df512aa24c2dbbabee10af49464
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
@ -14,6 +14,7 @@ end
|
|||||||
|
|
||||||
-- 从登录界面第一次进入主城
|
-- 从登录界面第一次进入主城
|
||||||
function MaincityManager:firstEnterMainCity()
|
function MaincityManager:firstEnterMainCity()
|
||||||
|
ModuleManager.ActivityPopManager:setFirstLogin(true)
|
||||||
if (EDITOR_MODE or not Platform:getIsPublishChannel()) and LocalData:getTutorialSkip() > 0 then
|
if (EDITOR_MODE or not Platform:getIsPublishChannel()) and LocalData:getTutorialSkip() > 0 then
|
||||||
-- 如果是新号就直接进入战斗
|
-- 如果是新号就直接进入战斗
|
||||||
self:showMainCityUI(true)
|
self:showMainCityUI(true)
|
||||||
|
|||||||
@ -680,16 +680,23 @@ function MainCityUI:checkMainPop()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 首充
|
||||||
|
if ModuleManager.ActivityPopManager:checkFirstRechargePop() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- 礼包
|
-- 礼包
|
||||||
-- if self:checkGift() then
|
-- if self:checkGift() then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
-- 圆月活动
|
-- local actPopShowFlag = (not self.popSkipFlag) or DataManager.ActivityData:getTheDayFirstLogin()
|
||||||
-- local showType = DataManager.FullMoonData:getNeedShowActPanel()
|
-- if self.selectedInedx == GConst.MainCityConst.BOTTOM_PAGE.MAIN and not GFunc.isShenhe() then
|
||||||
-- if showType then
|
-- if not DataManager.TutorialData:getIsInTutorial() and actPopShowFlag then
|
||||||
-- ModuleManager.FullMoonManager:showActMainUI(showType)
|
-- if ModuleManager.ActivityPopManager:checkActivityPop() then
|
||||||
-- return
|
-- return
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
8
lua/app/ui/pop_skip_bar.meta
Normal file
8
lua/app/ui/pop_skip_bar.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 04ee08c712f07446d9d4921703631967
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
52
lua/app/ui/pop_skip_bar/pop_skip_bar.lua
Normal file
52
lua/app/ui/pop_skip_bar/pop_skip_bar.lua
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
local Component = require (GConst.TYPEOF_LUA_CLASS.LUA_COMPONENT)
|
||||||
|
local PopSkipBar = class("PopSkipBar", Component)
|
||||||
|
|
||||||
|
function PopSkipBar:init()
|
||||||
|
self.currVisible = true
|
||||||
|
local uiMap = self.baseObject:genAllChildren()
|
||||||
|
|
||||||
|
self.onIcon = uiMap["pop_skip_bar.bg.toggle_bg.ok"]
|
||||||
|
self.text = uiMap["pop_skip_bar.bg.toggle_bg.Label"]
|
||||||
|
self.toggle_Btn = uiMap["pop_skip_bar.bg.toggle_bg"]
|
||||||
|
|
||||||
|
self.Bg = uiMap["pop_skip_bar.bg"]
|
||||||
|
|
||||||
|
self.Bg:setAnchoredPositionY(-110)
|
||||||
|
self:setVisible(false)
|
||||||
|
self.text:setText(I18N:getGlobalText(I18N.GlobalConst.CONFIRM_IGNORE))
|
||||||
|
self:_addClickListener(self.toggle_Btn,function ()
|
||||||
|
local flag = DataManager.ActivityData:getLoginPopSkipFlag()
|
||||||
|
DataManager.ActivityData:setLoginPopSkipFlag(not flag)
|
||||||
|
self:refreshIcon()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function PopSkipBar:show()
|
||||||
|
self:setVisible(true)
|
||||||
|
self:refreshIcon()
|
||||||
|
end
|
||||||
|
|
||||||
|
function PopSkipBar:setVisible(visible)
|
||||||
|
if self.currVisible == visible then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.currVisible = visible
|
||||||
|
if visible then
|
||||||
|
self.baseObject:setVisible(true)
|
||||||
|
else
|
||||||
|
self.baseObject:setVisible(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function PopSkipBar:_addClickListener(Btn, callback)
|
||||||
|
if callback then
|
||||||
|
Btn:addClickListener(callback)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function PopSkipBar:refreshIcon()
|
||||||
|
local flag = DataManager.ActivityData:getLoginPopSkipFlag()
|
||||||
|
self.onIcon:setActive(flag)
|
||||||
|
end
|
||||||
|
|
||||||
|
return PopSkipBar
|
||||||
10
lua/app/ui/pop_skip_bar/pop_skip_bar.lua.meta
Normal file
10
lua/app/ui/pop_skip_bar/pop_skip_bar.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 62e233795e5c0614e91e02a08b160baa
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
Loading…
x
Reference in New Issue
Block a user