parent
40473196a9
commit
8c5e89a27b
|
|
@ -44,6 +44,7 @@ function EveryDayGiftNew:InitComponent()
|
|||
self.btnGet = Util.GetGameObject(self.grow, "btnGet")
|
||||
self.price = Util.GetGameObject(self.btnGet, "cost/Text"):GetComponent("Text")
|
||||
self.cost = Util.GetGameObject(self.btnGet, "cost")
|
||||
self.discountbg = Util.GetGameObject(self.btnGet, "discountbg")
|
||||
self.btnText = Util.GetGameObject(self.btnGet, "Text")
|
||||
self.btnRed = Util.GetGameObject(self.btnGet, "red")
|
||||
self.leftRed = Util.GetGameObject(self.btnLeft, "Red")
|
||||
|
|
@ -283,6 +284,19 @@ function EveryDayGiftNew:RefreshReward(Data)
|
|||
if Data.data.limitNum - Data.data.boughtNum > 0 then
|
||||
self.btnText:SetActive(false)
|
||||
self.cost:SetActive(true)
|
||||
|
||||
--LogError("sssssssssssssssssssssssssssss" .. tostring(Data.data.shopItemData.DiscountDegree))
|
||||
if self.discountbg then
|
||||
self.discountbg:SetActive(false)
|
||||
if Data.data.price ~= 0 then
|
||||
local isDiscount = Data.data.shopItemData.IsDiscount == 1
|
||||
self.discountbg:SetActive(isDiscount)
|
||||
if isDiscount then
|
||||
self.discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_0" ..
|
||||
Data.data.shopItemData.DiscountDegree .. "_zh")
|
||||
end
|
||||
end
|
||||
end
|
||||
self.btnGet:GetComponent("Button").interactable = true
|
||||
Util.SetGray(self.btnGet, false)
|
||||
if rechargeNum >= needNum then
|
||||
|
|
@ -296,6 +310,9 @@ function EveryDayGiftNew:RefreshReward(Data)
|
|||
else
|
||||
self.btnText:SetActive(true)
|
||||
self.cost:SetActive(false)
|
||||
if self.discountbg then
|
||||
self.discountbg:SetActive(false)
|
||||
end
|
||||
self.btnGet:GetComponent("Button").interactable = false
|
||||
Util.SetGray(self.btnGet, true)
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue