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