From afc0b58e39c25f3a1d8c468089f1b22d8d1c798c Mon Sep 17 00:00:00 2001 From: chenxi Date: Tue, 30 May 2023 19:14:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=83=E5=A4=A9=E4=B9=90=E5=A4=A9=E6=95=B0?= =?UTF-8?q?=E6=B2=A1=E8=A7=A3=E9=94=81=E7=9A=84=E8=A1=A8=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/activity/seven_day/seven_day_ui.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lua/app/ui/activity/seven_day/seven_day_ui.lua b/lua/app/ui/activity/seven_day/seven_day_ui.lua index 242b54fa..b488c7b5 100644 --- a/lua/app/ui/activity/seven_day/seven_day_ui.lua +++ b/lua/app/ui/activity/seven_day/seven_day_ui.lua @@ -53,8 +53,10 @@ end function SevenDayUI:initTop() self.dayTextList = {} + self.dayLockList = {} self.stepObjs = {} for i = 1, 7 do + self.dayLockList[i] = self.uiMap["seven_day_ui.day_bg.lock_" .. i] self.dayTextList[i] = self.uiMap["seven_day_ui.day_bg.day_" .. i] self.dayTextList[i]:setText(I18N:getGlobalText(I18N.GlobalConst.DAY_X, i)) self.dayTextList[i]:addClickListener(function() @@ -122,10 +124,16 @@ function SevenDayUI:refreshDay() if i == self.day then self.daySelectImg:setAnchoredPositionX(self.dayTextList[i]:fastGetAnchoredPositionX()) end - if DataManager.SevenDayData:showRedPoint(i) and i <= actDay then - self.dayTextList[i]:addRedPoint(40, 26, 0.5) - else + if i > actDay then + self.dayLockList[i]:setVisible(true) self.dayTextList[i]:removeRedPoint() + else + self.dayLockList[i]:setVisible(false) + if DataManager.SevenDayData:showRedPoint(i) then + self.dayTextList[i]:addRedPoint(40, 26, 0.5) + else + self.dayTextList[i]:removeRedPoint() + end end end end