商店报错

This commit is contained in:
kai 2025-06-29 10:34:41 +08:00
parent 32534e7880
commit 3d2008baad
2 changed files with 5 additions and 4 deletions

View File

@ -89,7 +89,7 @@ function BoxSellCell:refreshCost()
local costItem2, cost2 = DataManager.SummonData:getSummonCost(GConst.SummonConst.SUMMON_TYPE.LV_2)
local costItem3, cost3 = DataManager.SummonData:getSummonCost(GConst.SummonConst.SUMMON_TYPE.LV_3)
if GFunc.checkCost(costItem1.id, costItem1.num, false) then
if not cost1 or GFunc.checkCost(costItem1.id, costItem1.num, false) then
self.boxBuyBtnCoin1:setSprite(GFunc.getIconRes(costItem1.id))
local totalCount = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_BOX_KEY_LV_1)
local totalCountStr = totalCount <= 99 and tostring(totalCount) or "99"
@ -100,7 +100,7 @@ function BoxSellCell:refreshCost()
end
GFunc.centerImgAndTx(self.boxBuyBtnCoin1, self.boxBuyBtnTx1, 5)
if GFunc.checkCost(costItem2.id, costItem2.num, false) then
if not cost2 or GFunc.checkCost(costItem2.id, costItem2.num, false) then
self.boxBuyBtnCoin2:setSprite(GFunc.getIconRes(costItem2.id))
local totalCount = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_BOX_KEY_LV_2)
local totalCountStr = totalCount <= 99 and tostring(totalCount) or "99"
@ -111,7 +111,7 @@ function BoxSellCell:refreshCost()
end
GFunc.centerImgAndTx(self.boxBuyBtnCoin2, self.boxBuyBtnTx2, 5)
if GFunc.checkCost(costItem3.id, costItem3.num, false) then
if not cost3 or GFunc.checkCost(costItem3.id, costItem3.num, false) then
self.boxBuyBtnCoin3:setSprite(GFunc.getIconRes(costItem3.id))
local totalCount = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_BOX_KEY_LV_3)
local totalCountStr = totalCount <= 99 and tostring(totalCount) or "99"

View File

@ -33,7 +33,8 @@ function HotCell:refresh(data)
local reward = cfgInfo.good and cfgInfo.good[index]
local cost = cfgInfo.cost and cfgInfo.cost[index]
local isHeroReward = id ~= 1 -- 约定
-- local isHeroReward = id ~= 1 -- 约定
local isHeroReward = false
local isFree = id == 1 -- 约定
if isHeroReward then