From a8523745fb47297b83ba7dfa0297d647868a8e8c Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Mon, 19 Jul 2021 11:58:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=8D=A1=E7=95=8C=E9=9D=A2=20?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E4=BD=8D=E7=BD=AE=E4=BF=AE=E6=94=B9=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Recruit/RecruitMainPanel.lua | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitMainPanel.lua index 70f88945d1..adb684cdd3 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitMainPanel.lua @@ -183,7 +183,7 @@ function RecruitMainPanel:BindEvent() self.lastPage = self.curPage - 1 > 0 and self.curPage - 1 or #self.dicData self.nextPage = self.curPage + 1 > #self.dicData and 1 or self.curPage + 1 this:SetIndex() - this:PageOnChange() + this:PageOnChange(true) end) Util.AddClick(this.jiantouzuo , function() this.mask:SetActive(true) @@ -200,7 +200,7 @@ function RecruitMainPanel:BindEvent() self.lastPage = self.curPage - 1 > 0 and self.curPage - 1 or #self.dicData self.nextPage = self.curPage + 1 > #self.dicData and 1 or self.curPage + 1 this:SetIndex() - this:PageOnChange() + this:PageOnChange(true) end) end @@ -279,7 +279,7 @@ function RecruitMainPanel:OnShow() self.nextPage = self.curPage + 1 > #self.dicData and 1 or self.curPage + 1 lastIndex = self.curPage this:SetIndex(self.curPage) - this:PageOnChange() + this:PageOnChange(false) end function this:RefreshTabData() @@ -361,11 +361,8 @@ function this:SetIndex() coroutine.wait(0.01) end this.mask:SetActive(false) - this.select.transform:SetParent(this.itemList[2].go.transform) - this.select.transform:GetComponent("RectTransform").anchoredPosition = Vector3.zero - this.select.gameObject:SetActive(true) - this.selectIma.sprite = this.spLoader:LoadSprite(self.dicData[self.curPage].Icon[2]) this:RefreshJianTou() + this:PageOnChange(true) end) end break @@ -373,7 +370,13 @@ function this:SetIndex() end end -function this:PageOnChange() +function this:PageOnChange(isShow) + if isShow then + this.select.transform:SetParent(this.itemList[2].go.transform) + this.select.transform:GetComponent("RectTransform").anchoredPosition = Vector3.zero + this.select.gameObject:SetActive(true) + this.selectIma.sprite = this.spLoader:LoadSprite(self.dicData[self.curPage].Icon[2]) + end RecruitManager.CurRecruitId = self.CurRecruitId if subViewList[lastIndex] and subViewList[lastIndex].config and subViewList[lastIndex].sub then subViewList[lastIndex].sub:OnClose() @@ -402,13 +405,8 @@ function this:LeftAction() self.lastPage = self.curPage self.curPage = self.nextPage self.nextPage = self.curPage + 1 > #self.dicData and 1 or self.curPage + 1 - this.select.transform:SetParent(this.itemList[2].go.transform) - this.select.transform:GetComponent("RectTransform").anchoredPosition = Vector3.zero - this.select.gameObject:SetActive(true) - this.selectIma.sprite = this.spLoader:LoadSprite(self.dicData[self.curPage].Icon[2]) this:RefreshJianTou() - this:PageOnChange() - --this:RefreshTabData() + this:PageOnChange(true) end function this:RightAction() lastIndex = self.curPage @@ -416,13 +414,8 @@ function this:RightAction() self.nextPage = self.curPage self.curPage = self.lastPage self.lastPage = self.curPage - 1 > 0 and self.curPage - 1 or #self.dicData - this.select.transform:SetParent(this.itemList[2].go.transform) - this.select.transform:GetComponent("RectTransform").anchoredPosition = Vector3.zero - this.select.gameObject:SetActive(true) - this.selectIma.sprite = this.spLoader:LoadSprite(self.dicData[self.curPage].Icon[2]) this:RefreshJianTou() - this:PageOnChange() - --this:RefreshTabData() + this:PageOnChange(true) end function this:OnSortingOrderChange()