diff --git a/Assets/ManagedResources/Prefabs/UI/TreasureOfHeaven/RecruitTreasurePanel.prefab b/Assets/ManagedResources/Prefabs/UI/TreasureOfHeaven/RecruitTreasurePanel.prefab index ddbf56594e..5b57e2dd37 100644 --- a/Assets/ManagedResources/Prefabs/UI/TreasureOfHeaven/RecruitTreasurePanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/TreasureOfHeaven/RecruitTreasurePanel.prefab @@ -296,8 +296,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -227.7} - m_SizeDelta: {x: -115, y: -945.6} + m_AnchoredPosition: {x: 0, y: -194.27} + m_SizeDelta: {x: -115, y: -1012.56} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &263232123 CanvasRenderer: @@ -788,8 +788,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -11.200012, y: -212} - m_SizeDelta: {x: -56, y: -850} + m_AnchoredPosition: {x: -11.200012, y: -181.5} + m_SizeDelta: {x: -56, y: -911} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &700413945 CanvasRenderer: @@ -1734,8 +1734,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 184, y: 175} + m_AnchoredPosition: {x: 0.12504, y: -0.04} + m_SizeDelta: {x: 160, y: 74} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6962248010961131481 CanvasRenderer: @@ -1765,8 +1765,8 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 461e6af409ec67d45ba908596f22e977, type: 3} - m_Type: 1 + m_Sprite: {fileID: 21300000, guid: d8e19ffb0a1c14b4dba326a273e52e7a, type: 3} + m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1889,7 +1889,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 184, y: 175} + m_SizeDelta: {x: 160, y: 74} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8921616627170501590 CanvasRenderer: @@ -1919,7 +1919,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: d780da214597bd144b017ef450a9142d, type: 3} + m_Sprite: {fileID: 21300000, guid: adc4c40d7df40e94db1c69896e51878c, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -1986,7 +1986,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_Color: {r: 0.70980394, g: 0.6431373, b: 0.5058824, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -1994,11 +1994,11 @@ MonoBehaviour: m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: - m_Font: {fileID: 12800000, guid: 6fa15837529b0e640af6620b07d3207d, type: 3} - m_FontSize: 39 + m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3} + m_FontSize: 36 m_FontStyle: 0 m_BestFit: 0 - m_MinSize: 10 + m_MinSize: 3 m_MaxSize: 40 m_Alignment: 4 m_AlignByGeometry: 0 @@ -2876,7 +2876,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 74.9, y: 23} + m_AnchoredPosition: {x: 78.99998, y: 16.095001} m_SizeDelta: {x: 26, y: 26} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6875376091408120744 @@ -2950,7 +2950,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: 0.000030517578, y: 38} + m_AnchoredPosition: {x: 0, y: 38} m_SizeDelta: {x: 0, y: 76} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &4125706634736168924 @@ -2971,7 +2971,7 @@ MonoBehaviour: m_Top: 0 m_Bottom: 0 m_ChildAlignment: 4 - m_Spacing: 27.71 + m_Spacing: 1.7 m_ChildForceExpandWidth: 0 m_ChildForceExpandHeight: 0 m_ChildControlWidth: 0 @@ -3106,7 +3106,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: 9.15, y: 175.2} + m_AnchoredPosition: {x: 9.1501, y: 214.5} m_SizeDelta: {x: -96.7, y: 75.6} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &5457082822150884615 diff --git a/Assets/ManagedResources/~Lua/Modules/TreasureOfHeaven/RecruitTreasureManager.lua b/Assets/ManagedResources/~Lua/Modules/TreasureOfHeaven/RecruitTreasureManager.lua index a1b14ac0d3..5a07b18c1c 100644 --- a/Assets/ManagedResources/~Lua/Modules/TreasureOfHeaven/RecruitTreasureManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/TreasureOfHeaven/RecruitTreasureManager.lua @@ -38,8 +38,7 @@ end function this.CheckIsBuyTreasureByGoodsId(goodsId) local goodsInfo = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.RecruiteTreasure,goodsId) - LogGreen("goodsInfo.isBought:"..tostring(goodsInfo.isBought)) - return goodsInfo.isBought > 0 + return goodsInfo and goodsInfo.isBought > 0 end function this.GetConfigDataByActId(actId) diff --git a/Assets/ManagedResources/~Lua/Modules/TreasureOfHeaven/RecruitTreasurePanel.lua b/Assets/ManagedResources/~Lua/Modules/TreasureOfHeaven/RecruitTreasurePanel.lua index 170ca04782..f99cffbfd8 100644 --- a/Assets/ManagedResources/~Lua/Modules/TreasureOfHeaven/RecruitTreasurePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/TreasureOfHeaven/RecruitTreasurePanel.lua @@ -25,14 +25,15 @@ function RecruitTreasurePanel:InitComponent() this.buyBtn = Util.GetGameObject(self.transform, "bg/topBar/buyBtn") this.Text1 = Util.GetGameObject(this.buyBtn, "buy"):GetComponent("Text") this.tips = Util.GetGameObject(self.transform, "bg/topBar/tips"):GetComponent("Text") + this.topBarImage = Util.GetGameObject(self.transform, "bg/topBar"):GetComponent("Image") --Content this.scoreText = Util.GetGameObject(self.transform, "bg/pageContent/bg/score/number"):GetComponent("Text") this.treasureList = Util.GetGameObject(self.transform, "bg/pageContent/treasureList") this.itemPre = Util.GetGameObject(self.transform, "bg/pageContent/itemPro") - + local v = this.treasureList:GetComponent("RectTransform").rect --设置滚动条 - this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,this.treasureList.transform,this.itemPre,nil,Vector2.New(950, 1000),1,1,Vector2.New(100, 25)) + this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,this.treasureList.transform,this.itemPre,nil,Vector2.New(v.width, v.height),1,1,Vector2.New(100, 25)) this.ScrollView.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, 0) this.ScrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5) this.ScrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5) @@ -92,6 +93,9 @@ end function this.OnPageTabChange(index) curPage = index + this.actId = configs[curPage].ActId + this.tips.text = configs[curPage].TitleText + this.topBarImage.sprite = this.spLoader:LoadSprite(configs[curPage].Icon[2]) this:refresh() end @@ -122,7 +126,6 @@ function RecruitTreasurePanel:OnShow(_sortingOrder) sortingOrder = _sortingOrder this.actType = this.actConfig.ActiveType > 0 and this.actConfig.ActiveType or this.actConfig.FunType this.titleImage.sprite = this.spLoader:LoadSprite(this.actConfig.Icon[3]) - local activeNum = 0 curPage = 0 for i = 1,#configs do @@ -148,15 +151,13 @@ function RecruitTreasurePanel:OnShow(_sortingOrder) if curPage < 1 then curPage = activeNum end - this.actData = ActivityGiftManager.GetActivityInfoByType(configs[curPage].ActId) this.PageTabCtrl:Init(this.tabbox.gameObject, configs,curPage) end function RecruitTreasurePanel:refresh() - this.actId = configs[curPage].ActId - this.tips.text = configs[curPage].TitleText - this.isBuy = RecruitTreasureManager.CheckIsBuyTreasureByGoodsId(configs[curPage].ShopData[1][1]) - LogGreen("this.isBuy:"..tostring(this.isBuy)) + this.treasureData = RecruitTreasureManager.GetRecruitTreasureData(configs[curPage].ActId,configs[curPage].ShopData[1][1]) + this.actData = ActivityGiftManager.GetActivityInfoByType(configs[curPage].ActId) + this.isBuy = RecruitTreasureManager.CheckIsBuyTreasureByGoodsId(configs[curPage].ShopData[1][1]) self:topBar() self:showTaskList() end @@ -318,6 +319,11 @@ end --界面销毁时调用(用于子类重写) function RecruitTreasurePanel:OnDestroy() this.spLoader:Destroy() + for k,v in pairs(this.itemsList) do + for n,m in pairs(v) do + SubUIManager.Close(m) + end + end this.itemsList = {} if this.ScrollView then SubUIManager.Close(this.ScrollView)