TCX_LongZhu
PC-202302260912\Administrator 2025-12-18 15:06:04 +08:00
parent 57fd5d34c3
commit 03579e1c48
1 changed files with 8 additions and 4 deletions

View File

@ -56,12 +56,13 @@ function this:InitComponent()
self.rechargeShopItem = Util.GetGameObject(self.gameObject, "scrollbg/scrollroot/item")
self.titleBg = Util.GetGameObject(self.gameObject, "titlebg")
self.titleImg = Util.GetGameObject(self.gameObject, "titlebg/title")
self.titleText = Util.GetGameObject(self.gameObject, "titlebg/title/titleText")
self.helpBtn = Util.GetGameObject(self.gameObject, "titlebg/helpBtn") --scrollbg/titlebg/
self.helpPosition = self.helpBtn:GetComponent("RectTransform").localPosition
-- 创建循环列表
if not self.ScrollView then
self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scrollRoot.transform,
self.shopItem, nil, Vector2.New(1000, 1024), 1, 3, Vector2.New(80, 0))
self.shopItem, nil, Vector2.New(1000, 1024), 1, 2, Vector2.New(80, 0))
self.ScrollView.moveTween.MomentumAmount = 1
self.ScrollView.moveTween.Strength = 2
end
@ -509,6 +510,7 @@ function this:ShopItemAdapter(shopItem, itemData)
local itemPrice = Util.GetGameObject(bg, "pricebg/price"):GetComponent("Text")
local costIcon = Util.GetGameObject(bg, "pricebg/costIcon"):GetComponent("Image")
local discountbg = Util.GetGameObject(bg, "discountbg/zekouImage")
local discountbg1 = Util.GetGameObject(bg, "discountbg")
local empty = Util.GetGameObject(shopItem, "empty")
local yihuode = Util.GetGameObject(shopItem, "yihuode")
local lock = Util.GetGameObject(shopItem, "lock")
@ -550,12 +552,14 @@ function this:ShopItemAdapter(shopItem, itemData)
if price == 0 then
discountbg1:SetActive(true)
discountbg1:GetComponent("Image").sprite = self.spLoader:LoadSprite("X1_jingjichang_mianfei_zh")
discountbg:SetActive(false)
else
local isDiscount = itemInfo.IsDiscount == 1
discountbg:SetActive(isDiscount)
if isDiscount then
discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_0" ..
itemInfo.DiscountDegree .. "_zh")
--local str = "s_shop_zhekou_0" ..itemInfo.DiscountDegree .. "_zh"
--LogError("FFFFFFFFFFFFFFFFFFFF"..str)
discountbg:GetComponent("Text").text = ""..itemInfo.DiscountDegree
end
end
-- 消耗物品的信息