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()