【商店】修复妖精商店资源回收导致白片

dev_chengFeng hotfix/mht_china/zf/cdn_ios/1.1.2
JLIOSM1 2021-07-16 15:37:48 +08:00
parent 7285c52be1
commit 56e7492a91
1 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@

local _ShopTypeConfig = ConfigManager.GetConfig(ConfigName.StoreTypeConfig)
-- 通用得商店逻辑
local ShopView = {}
@ -16,7 +16,7 @@ function this:New(gameObject)
end
--初始化组件(用于子类重写)
function this:InitComponent()
this.spLoader = SpriteLoader.New()
self.spLoader = SpriteLoader.New()
self.live = Util.GetGameObject(self.gameObject, "live")
self.liveRoot = Util.GetGameObject(self.gameObject, "live/root")
self.liveImg = Util.GetGameObject(self.gameObject, "live/img")
@ -359,7 +359,7 @@ function this:RefreshBase()
-- 刷新物品计算
local shopInfo = ShopManager.GetShopInfoByType(self.ShopType)
local costId, abcd = shopInfo.RefreshItem[1][1], shopInfo.RefreshItem[2]
self.costIcon:GetComponent("Image").sprite = SetIcon(this.spLoader, costId)
self.costIcon:GetComponent("Image").sprite = SetIcon(self.spLoader, costId)
-- 商店特权正确性检测
if not shopInfo.RefreshPrivilege or shopInfo.RefreshPrivilege == 0 then
Log("错误:商店类型 == " .. self.ShopType .. "商店支持手动刷新但是未配置刷新次数对应的特权id无限制次数也需要配置特权id请检查")
@ -373,7 +373,7 @@ function this:RefreshBase()
-- 商店标题
if self.ShopConfig.Title and self.ShopConfig.Title ~= "" then
self.titleImg:GetComponent("Image").sprite = this.spLoader:LoadSprite(self.ShopConfig.Title)
self.titleImg:GetComponent("Image").sprite = self.spLoader:LoadSprite(self.ShopConfig.Title)
end
-- 对话显示
@ -467,17 +467,17 @@ function this:ShopItemAdapter(shopItem, itemData)
-- 折扣
if price == 0 then
discountbg:SetActive(true)
discountbg:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_shop_zhekou_00_zh")
discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_00_zh")
else
local isDiscount = itemInfo.IsDiscount == 1
discountbg:SetActive(isDiscount)
if isDiscount then
discountbg:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_shop_zhekou_0" .. itemInfo.DiscountDegree.."_zh")
discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_0" .. itemInfo.DiscountDegree.."_zh")
end
end
-- 消耗物品的信息
itemPrice.text = PrintWanNum2(tonumber(price))--tostring(price)
costIcon.sprite = SetIcon(this.spLoader, costId)
costIcon.sprite = SetIcon(self.spLoader, costId)
-- 判断商品栏位是否解锁
local _IsUnLock = true
@ -571,7 +571,7 @@ function this:RechargeShopItemAdapter(shopItem, itemData)
-- 计算数据
local itemInfo = ShopManager.GetRechargeItemInfo(itemData.goodsId)
icon.sprite = this.spLoader:LoadSprite(GetResourcePath(itemInfo.Resources))
icon.sprite = self.spLoader:LoadSprite(GetResourcePath(itemInfo.Resources))
num.text = itemInfo.BaseReward[1][2]
price.text = MoneyUtil.GetMoneyUnitNameWithMoney(itemInfo.Price) --.. MoneyUtil.GetMoney(itemInfo.Price)