From 5a861ade956a8cca0d9f13dde21ad32f270886e2 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Tue, 3 Nov 2020 18:00:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=95=86=E5=BA=97=E3=80=91=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E4=BB=8E=E8=A1=A8=E9=87=8C=E5=88=A4=E6=96=AD=E5=95=86?= =?UTF-8?q?=E5=93=81=E7=9A=84=E6=98=BE=E7=A4=BA=E7=8A=B6=E6=80=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Shop/ShopManager.lua | 17 ++++++++++++++++- Assets/ManagedResources/~Lua/View/ShopView.lua | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua b/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua index 724ef688c5..c14e7b8248 100644 --- a/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua @@ -370,7 +370,7 @@ end -- 刷新商店物品列表排序 function this.SortItemList(shopType) -- 试炼副本商店不按sort字段排序 - -- if shopType == SHOP_TYPE.TRIAL_SHOP then return end--森罗商店上来就被🈲了,但是现在对森罗商店有了处理 + -- if shopType == SHOP_TYPE.TRIAL_SHOP then return end--森罗商店上来就被禁了,但是现在对森罗商店有了处理 -- 排序 local shopData = nil for _, v in ipairs(this.allShopData) do @@ -1152,4 +1152,19 @@ function this.CheckNoviceGiftData() end +-- 检测商店物品 +function this.CheckShopItemList(list) + local itemList = {} + for _, item in ipairs(list) do + local info = this.GetShopItemInfo(item.id) + if info.OpenLv and + info.OpenLv[1] and info.OpenLv[1] <= PlayerManager.level then + -- info.OpenLv[2] and info.OpenLv[2] >= PlayerManager.level then + table.insert(itemList, item) + end + end + return itemList +end + + return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/View/ShopView.lua b/Assets/ManagedResources/~Lua/View/ShopView.lua index 72ac288f12..0e25464bb2 100644 --- a/Assets/ManagedResources/~Lua/View/ShopView.lua +++ b/Assets/ManagedResources/~Lua/View/ShopView.lua @@ -402,7 +402,7 @@ function this:RefreshItemList(isTop) -- 重置列表 self.RechargeScrollView.gameObject:SetActive(false) self.ScrollView.gameObject:SetActive(true) - local itemlist = self.ShopData.storeItem + local itemlist = ShopManager.CheckShopItemList(self.ShopData.storeItem) self.ScrollView:SetData(itemlist, function(index, shopItem) local itemData = itemlist[index] self:ShopItemAdapter(shopItem, itemData)