From 81fe73352d494179ea866b8e56862c6484dda2ad Mon Sep 17 00:00:00 2001 From: CloudJ Date: Mon, 29 May 2023 15:38:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=9F=8E=E5=BC=80=E5=90=AF=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/main_city/main_city_ui.lua | 21 ++++++++++++++------- lua/app/ui/shop/cell/gem_sell_cell.lua | 4 ++-- lua/app/userdata/shop/shop_data.lua | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index 721c0e64..93d022a8 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -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 diff --git a/lua/app/ui/shop/cell/gem_sell_cell.lua b/lua/app/ui/shop/cell/gem_sell_cell.lua index 56c9af48..ce9930fc 100644 --- a/lua/app/ui/shop/cell/gem_sell_cell.lua +++ b/lua/app/ui/shop/cell/gem_sell_cell.lua @@ -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]) diff --git a/lua/app/userdata/shop/shop_data.lua b/lua/app/userdata/shop/shop_data.lua index 61cdbcfc..cd7f598c 100644 --- a/lua/app/userdata/shop/shop_data.lua +++ b/lua/app/userdata/shop/shop_data.lua @@ -351,7 +351,7 @@ end -- 常驻钻石礼包 ********************************************************************************************** function ShopData:getMallTreasureConfig() - return ConfigManager:getConfig("mall_treasure") + return ConfigManager:getConfig("mall_treasure") -- 审核模式会去读另一张表 TODOJ end -- 常驻钻石礼包结束 ----------------------------------------------------------------------------------------------