商城开启条件

This commit is contained in:
CloudJ 2023-05-29 15:38:13 +08:00
parent 832701111b
commit 81fe73352d
3 changed files with 17 additions and 10 deletions

View File

@ -131,14 +131,16 @@ function MainCityUI:_addListeners()
self:checkGift()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.GO_SHOP, function(params)
if self.selectedIndex == MainCityUI.CLICK_BTN_TYPE[3] then
return
if ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, false) then
if self.selectedIndex == MainCityUI.CLICK_BTN_TYPE[3] then
return
end
BIReport:postHomeBtnCilck(BIReport.CLICK_BTN_TYPE[MainCityUI.CLICK_BTN_TYPE[3]])
self.bottomBtnSpines[3]:playAnimComplete("born", false, false, function()
self.bottomBtnSpines[3]:playAnim("idle", false, false)
end)
self:refreshBottom(3, true)
end
BIReport:postHomeBtnCilck(BIReport.CLICK_BTN_TYPE[MainCityUI.CLICK_BTN_TYPE[3]])
self.bottomBtnSpines[3]:playAnimComplete("born", false, false, function()
self.bottomBtnSpines[3]:playAnim("idle", false, false)
end)
self:refreshBottom(3, true)
end)
DataManager.MailData:checkNewMail()
end
@ -216,6 +218,11 @@ function MainCityUI:initBottomUI()
for i = 1, 3 do
local cellCom = CellManager:addCellComp(uiMap["main_ui.bottom_node.bottom_btn_cell_" .. i], BOTTOM_BTN_CELL)
cellCom:addClickListener(function()
if i == 3 then -- 商城有开启条件
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, false) then
return
end
end
if self.selectedIndex == i then
return
end

View File

@ -8,7 +8,7 @@ function GemSellCell:init()
self.cells = {}
self.cellHeight = 0
local cellHeight = nil
local cfg = ConfigManager:getConfig("mall_treasure") -- 审核模式读取另一张表
local cfg = DataManager.ShopData:getMallTreasureConfig() -- 审核模式读取另一张表
for i = 1, 19 do -- 正常9个 提审19个
local cell = uiMap["gem_sell_cell.cell_" .. i]
if cellHeight == nil then
@ -30,7 +30,7 @@ function GemSellCell:init()
end
function GemSellCell:refresh()
local cfg = ConfigManager:getConfig("mall_treasure")
local cfg = DataManager.ShopData:getMallTreasureConfig()
for k, v in ipairs(self.cells) do
local id = k -- 目前配置表结构如此
v:refresh(id, cfg[id])

View File

@ -351,7 +351,7 @@ end
-- 常驻钻石礼包 **********************************************************************************************
function ShopData:getMallTreasureConfig()
return ConfigManager:getConfig("mall_treasure")
return ConfigManager:getConfig("mall_treasure") -- 审核模式会去读另一张表 TODOJ
end
-- 常驻钻石礼包结束 ----------------------------------------------------------------------------------------------