This commit is contained in:
xiekaidong 2023-09-19 11:20:48 +08:00
parent 630326bda3
commit c03e46432f

View File

@ -19,9 +19,9 @@ function CommonExchangeUI:ctor(params)
local num = DataManager.BagData.ItemData:getItemNumById(costId) local num = DataManager.BagData.ItemData:getItemNumById(costId)
local maxBuyCount = num // costNum local maxBuyCount = num // costNum
self.remainNum = math.min(self.remainNum, maxBuyCount) self.remainNum = math.min(self.remainNum, maxBuyCount)
if self.remainNum <= 0 then -- if self.remainNum <= 0 then
self.remainNum = 1 -- self.remainNum = 1
end -- end
end end
function CommonExchangeUI:getPrefabPath() function CommonExchangeUI:getPrefabPath()
@ -75,6 +75,10 @@ end
function CommonExchangeUI:_addListeners() function CommonExchangeUI:_addListeners()
local uiMap = self.root:genAllChildren() local uiMap = self.root:genAllChildren()
uiMap["exchange_ui.bg.ok_btn"]:addClickListener(function() uiMap["exchange_ui.bg.ok_btn"]:addClickListener(function()
if self.defaultNum <= 0 then
return
end
if self.callback then if self.callback then
self.callback(self.defaultNum) self.callback(self.defaultNum)
end end