TCX_LongZhu
DESKTOP-MMO982B\User 2026-06-11 22:23:37 +08:00
parent f2096cce91
commit e63473dc9a
1 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,8 @@ function DailyShoppingPanel:InitComponent()
self.Reward = Util.GetGameObject(self.gameObject, "BG/ShopList")
self.itemPre = Util.GetGameObject(self.gameObject, "shopItem")
this.btnBack = Util.GetGameObject(self.gameObject, "btnBack")
this.btnClose = Util.GetGameObject(self.gameObject, "BG/CloseBtn")
end
-- 绑定事件(用于子类重写)
@ -18,6 +20,10 @@ function DailyShoppingPanel:BindEvent()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
this:ClosePanel()
end)
Util.AddClick(this.btnClose, function ()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
this:ClosePanel()
end)
end
function DailyShoppingPanel:RefreshData()
for i = 1, #self.actConfig.ShopData do
@ -100,7 +106,6 @@ function DailyShoppingPanel:RefreshShowData(item, _data, growIndex)
local btnBuy = Util.GetGameObject(item, "GameObject/bg")
local buyInfo = Util.GetGameObject(item, "GameObject/bg/buyLimitbg/tip"):GetComponent("Text")
local isCanBuy = (_data.data.limitNum - _data.data.boughtNum > 0) and 0 or 2
LogError("sssssssssssssssss" .. isCanBuy .. " " .. _data.data.limitNum .. "/" .. _data.data.boughtNum)
btnBuy:GetComponent("Button").interactable = (isCanBuy == 0 or isCanBuy == 1)
Util.SetGray(btnBuy, isCanBuy ~= 0)