From 96fb520ace6dd97ef0202a5714f5dbfba8a05aa8 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Tue, 23 Mar 2021 11:17:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=99=BE=E5=AE=9D=E6=96=8B=E3=80=91?= =?UTF-8?q?=E7=AB=9E=E6=8A=80=E5=9C=BA=E8=B5=9B=E5=AD=A3=E8=BF=87=E6=B8=A1?= =?UTF-8?q?=E4=BB=A5=E5=90=8E=EF=BC=8C=E5=8E=BB=E7=99=BE=E5=AE=9D=E6=96=8B?= =?UTF-8?q?=E9=87=8C=E7=82=B9=E5=87=BB=E4=B8=8B=E6=96=B9=E5=A4=A7=E9=A1=B5?= =?UTF-8?q?=E7=AD=BE=E5=8F=AF=E4=BB=A5=E6=AD=A3=E5=B8=B8=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E9=80=90=E8=83=9C=E5=95=86=E5=BA=97=E5=B9=B6=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E6=98=AF=E5=88=87=E6=8D=A2=20=20=E9=80=90?= =?UTF-8?q?=E8=83=9C/=E5=85=AC=E4=BC=9A=EF=BC=8C=E8=BF=99=E7=A7=8D?= =?UTF-8?q?=E5=B0=8F=E9=A1=B5=E7=AD=BE=20=E5=B0=B1=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E8=B5=9B=E5=AD=A3=E5=B7=B2=E7=BB=93=E6=9D=9F=E4=B8=8D=E8=AE=A9?= =?UTF-8?q?=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Shop/MainShopPanel.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Shop/MainShopPanel.lua b/Assets/ManagedResources/~Lua/Modules/Shop/MainShopPanel.lua index 5113e63d7f..168dba2135 100644 --- a/Assets/ManagedResources/~Lua/Modules/Shop/MainShopPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Shop/MainShopPanel.lua @@ -219,7 +219,11 @@ function this.OnPageTabChange(index, lastIndex) -- 默认打开第一个商店 if this.ShopTabCtrl then this._CurShopIndex = nil - this.ShopTabCtrl:ChangeTab(this._ChooseShopIndex or 1) + if this._ChooseShopIndex then + this.ShopTabCtrl:ChangeTab(this._ChooseShopIndex or 1) + else + this.ShopTabCtrl:ChangeTab(this.GetAvailableChildShopIndex() or 1) + end end -- 二级页签只有一个的时候不显示 @@ -230,6 +234,16 @@ function this.OnPageTabChange(index, lastIndex) this.tabbox2Content.transform.localPosition = Vector3.New(contentWidth/2, curPos.y, curPos.z) end +-- 获取当前大页签下可用的小页签的序号 +function this.GetAvailableChildShopIndex() + for index, shopType in ipairs(this._MainShopTypeList) do + local isActive, errorTip = ShopManager.IsActive(shopType) + if isActive then + return index + end + end +end + ----==========================二级页签相关=========================================== -- tab按钮自定义显示设置 function this.ShopTabAdapter(tab, index, status)