diff --git a/Assets/ManagedResources/~Lua/View/ShopView.lua b/Assets/ManagedResources/~Lua/View/ShopView.lua index 23a77c2b3d..1bb3c34cd9 100644 --- a/Assets/ManagedResources/~Lua/View/ShopView.lua +++ b/Assets/ManagedResources/~Lua/View/ShopView.lua @@ -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") @@ -516,7 +518,7 @@ function this:ShopItemAdapter(shopItem, itemData) local new = Util.GetGameObject(shopItem, "GameObject/new") -- 计算数据 local itemInfo = ShopManager.GetShopItemInfo(itemData.id) - + local curBuyCount = itemData.buyNum local maxLimitCount = ShopManager.GetShopItemLimitBuyCount(itemData.id) local costId, price = ShopManager.calculateBuyCost(self.ShopType, itemData.id, 1) @@ -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 -- 消耗物品的信息