From 08631456a2e5c338c05a0ea3d1bc2b4d3787b87e Mon Sep 17 00:00:00 2001 From: CloudJ Date: Wed, 24 May 2023 17:28:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A9=E5=8A=9B=E7=A4=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/shop/cell/level_cell.lua | 12 +++++++----- lua/app/ui/shop/cell/level_sell_cell.lua | 8 +------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lua/app/ui/shop/cell/level_cell.lua b/lua/app/ui/shop/cell/level_cell.lua index 01b289a3..b515aa53 100644 --- a/lua/app/ui/shop/cell/level_cell.lua +++ b/lua/app/ui/shop/cell/level_cell.lua @@ -69,15 +69,17 @@ function LevelCell:refresh(idx, cfgInfo, clickCallback) -- 限时(隐藏) self.timeImg:setVisible(false) - if clickCallback then - self:addClickListener(function() - clickCallback(cfgInfo.id) - end) - end + self:addClickListener(function() + self:onClickGift(cfgInfo.id) + end) end function LevelCell:setVisible(visible) self.baseObject:setVisible(visible) end +function LevelCell:onClickGift(id) + PayManager:purchasePackage(id, PayManager.PURCHARSE_TYPE.ACT_GIFT) +end + return LevelCell \ No newline at end of file diff --git a/lua/app/ui/shop/cell/level_sell_cell.lua b/lua/app/ui/shop/cell/level_sell_cell.lua index 20835a41..ba06833b 100644 --- a/lua/app/ui/shop/cell/level_sell_cell.lua +++ b/lua/app/ui/shop/cell/level_sell_cell.lua @@ -12,9 +12,7 @@ function LevelSellCell:init() end) self.scrollRect:addRefreshCallback(function(idx, cell) if self.actGiftCfg and self.actGiftCfg[idx] then - cell:refresh(idx, self.actGiftCfg[idx], function() - self:onClickGift(self.actGiftCfg[idx].id) - end) + cell:refresh(idx, self.actGiftCfg[idx]) end end) self.scrollRect:clearCells() @@ -50,8 +48,4 @@ function LevelSellCell:setVisible(visible) self.baseObject:setVisible(visible) end -function LevelSellCell:onClickGift(id) - Logger.logHighlight("Click id:%s", id) -- TODOJ -end - return LevelSellCell \ No newline at end of file