From d25b80dd1be397d1f884822b44c2ffcef3d7603f Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Mon, 5 Jul 2021 18:01:31 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=BC=A5=E7=BC=88=E4=B9=8B=E6=97=85?= =?UTF-8?q?=E3=80=91bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JourneyWithWind/JourneyWithWindPanel.lua | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/JourneyWithWind/JourneyWithWindPanel.lua b/Assets/ManagedResources/~Lua/Modules/JourneyWithWind/JourneyWithWindPanel.lua index fbd3b3e648..89e2aaadbd 100644 --- a/Assets/ManagedResources/~Lua/Modules/JourneyWithWind/JourneyWithWindPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/JourneyWithWind/JourneyWithWindPanel.lua @@ -61,13 +61,12 @@ end function JourneyWithWindPanel:RemoveListener() Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, this.AutoClose) end - +local curServerDay --界面打开时调用(用于子类重写) function JourneyWithWindPanel:OnOpen(_curDayIndex) allBtnsConFigData = ActivityGiftManager.GetJourneyWithWindAllDayConFigData() - local curServerDay = math.ceil((CalculateSecondsNowTo_N_OClock(0) + GetTimeStamp() - PlayerManager.userCreateTime)/86400) - + curServerDay = math.ceil((CalculateSecondsNowTo_N_OClock(0) + GetTimeStamp() - PlayerManager.userCreateTime)/86400) for i = 1, #allBtnsConFigData do if curServerDay >= allBtnsConFigData[i].Values[1][2] then curDay = allBtnsConFigData[i].Values[1][2] @@ -112,22 +111,11 @@ function this.SingleDayBtnDataShow(_go,data,index) Util.GetGameObject(go, "icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(iconItemId.ResourceID)) local redPoint = Util.GetGameObject(go, "redPoint") local redState = false - if curDay >= data.Values[1][2] then + if curServerDay >= data.Values[1][2] then Util.SetGray(Util.GetGameObject(go, "dayBg"),false) else Util.SetGray(Util.GetGameObject(go, "dayBg"),true) end - if activityData then - for j = 1, #activityData.mission do - if activityData.mission[j].missionId == data.Id then - redState = ActivityGiftManager.SingleJourneyWithWindRewardNoGet(activityData.mission[j]) - end - end - end - if not redState and curDay >= data.Values[1][2] then - redState = tonumber(ActivityGiftManager.GetJourneyWithWindPlayerPrefs(data.Values[1][2])) == 0 - end - redPoint:SetActive(redState) --上方按钮一个高一个低 if index%2 == 0 then go.transform.anchoredPosition = Vector3.New(3.05,23,0) @@ -137,8 +125,19 @@ function this.SingleDayBtnDataShow(_go,data,index) if data.Values[1][2] == curDayIndex then--初始化按钮选中状态 this.selected.transform:SetParent(Util.GetGameObject(go, "selectedParent").transform) this.selected.transform.anchoredPosition = Vector3.New(4.3,9.4,0) - redPoint:SetActive(false) + ActivityGiftManager.SetJourneyWithWindPlayerPrefs(curDayIndex,1) end + if activityData then + for j = 1, #activityData.mission do + if activityData.mission[j].missionId == data.Id then + redState = ActivityGiftManager.SingleJourneyWithWindRewardNoGet(activityData.mission[j]) + end + end + end + if not redState and curServerDay >= data.Values[1][2] then + redState = tonumber(ActivityGiftManager.GetJourneyWithWindPlayerPrefs(data.Values[1][2])) == 0 + end + redPoint:SetActive(redState) Util.AddOnceClick(go, function() this.ShowDayData(data.Values[1][2])--点击按钮刷新界面 this.selected.transform:SetParent(Util.GetGameObject(go, "selectedParent").transform) @@ -212,7 +211,7 @@ function this.ShowDayData(_curDayIndex) end local progress = curMissionData.progress--任务进度 local state = curMissionData.state--任务状态 0:未完成 1:完成未领取 2:已达成(已领取) - isOpenLock = curDay >= curDayIndex + isOpenLock = curServerDay >= curDayIndex Util.SetGray(btnJump,false) if isOpenLock then--到天数 btnJump.transform.anchoredPosition = Vector3.New(262.41,44.5,0) @@ -315,7 +314,7 @@ function this.ShowDayDataActivityReward() local btnText = Util.GetGameObject(getBtn, "get"):GetComponent("Text") local redPoint = Util.GetGameObject(getBtn, "redPoint") isGetState = ActivityGiftManager.SingleJourneyWithWindRewardNoGet(curRewardTaskData) - isOpenLock = curDay >= curDayIndex + isOpenLock = curServerDay >= curDayIndex local imageStr = isGetState and "s_slbz_1anniuongse" or "s_slbz_1anniuhuise" getBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite(imageStr) redPoint:SetActive(isGetState)