leon 1 год назад
Родитель
Сommit
51bb29fed5

+ 1 - 1
src/features/health/MainDayNightCard.tsx

@@ -25,7 +25,7 @@ export default function MainDayNightCard(props: { count: number, typeChanged: Fu
 
 
     useEffect(() => {
     useEffect(() => {
         const { day } = health.windows.night_day
         const { day } = health.windows.night_day
-        if (isCurrentTimeInRange(day.schedule.start_time, day.schedule.end_time)) {
+        if (isCurrentTimeInRange(day.period.start_time, day.period.end_time)) {
             setIsDay(true)
             setIsDay(true)
             setIsDayMode(true)
             setIsDayMode(true)
         }
         }

+ 11 - 11
src/features/health/MainFastEatCard.tsx

@@ -72,7 +72,7 @@ export default function MainFastEatCard(props: { count: any, typeChanged: Functi
     useEffect(() => {
     useEffect(() => {
         const { fast, eat } = health.windows.fast_eat
         const { fast, eat } = health.windows.fast_eat
         var now = new Date().getTime()
         var now = new Date().getTime()
-        if ((fast.status == 'WAIT_FOR_END' || fast.target.start_time <= now && fast.target.end_time >= now) || isCurrentTimeInRange(fast.schedule.start_time, fast.schedule.end_time)) {
+        if ((fast.status == 'WAIT_FOR_END' || fast.target.start_time <= now && fast.target.end_time >= now) || isCurrentTimeInRange(fast.period.start_time, fast.period.end_time)) {
             setIsFastMode(true)
             setIsFastMode(true)
         }
         }
         else {
         else {
@@ -81,8 +81,8 @@ export default function MainFastEatCard(props: { count: any, typeChanged: Functi
 
 
         setEatData(eat)
         setEatData(eat)
         setFastData(fast)
         setFastData(fast)
-        setStartScheduleTime(fast.schedule.start_time)
-        setEndScheduleTime(fast.schedule.end_time)
+        setStartScheduleTime(fast.period.start_time)
+        setEndScheduleTime(fast.period.end_time)
 
 
         update(fast)
         update(fast)
     }, [user.isLogin])
     }, [user.isLogin])
@@ -112,8 +112,8 @@ export default function MainFastEatCard(props: { count: any, typeChanged: Functi
             const fast = fast_win.fast
             const fast = fast_win.fast
             setEatData(eat_win)
             setEatData(eat_win)
             setFastData(fast_win)
             setFastData(fast_win)
-            setStartScheduleTime(fast_win.fast.schedule.start_time)
-            setEndScheduleTime(fast_win.fast.schedule.end_time)
+            setStartScheduleTime(fast_win.fast.period.start_time)
+            setEndScheduleTime(fast_win.fast.period.end_time)
         })
         })
     }
     }
 
 
@@ -123,8 +123,8 @@ export default function MainFastEatCard(props: { count: any, typeChanged: Functi
         if (fast.status == 'WAIT_FOR_END') {
         if (fast.status == 'WAIT_FOR_END') {
             setStatus('process')
             setStatus('process')
         }
         }
-        else if ((fast.target.start_timestamp <= now && fast.target.end_timestamp >= now) || isCurrentTimeInRange(fast.schedule.start_time, fast.schedule.end_time)) {
-            setStartTime(fast.schedule.start_time)
+        else if ((fast.target.start_timestamp <= now && fast.target.end_timestamp >= now) || isCurrentTimeInRange(fast.period.start_time, fast.period.end_time)) {
+            setStartTime(fast.period.start_time)
             setStatus('new')
             setStatus('new')
         }
         }
         else {
         else {
@@ -354,9 +354,9 @@ export default function MainFastEatCard(props: { count: any, typeChanged: Functi
                 milliSeconds = new Date().getTime() - fastData.real_start_time
                 milliSeconds = new Date().getTime() - fastData.real_start_time
                 break;
                 break;
             case 'new':
             case 'new':
-                return getTimeToDestination(fastData.schedule.start_time, true)
+                return getTimeToDestination(fastData.period.start_time, true)
             case 'upcoming':
             case 'upcoming':
-                return getTimeToDestination(fastData.schedule.start_time, false)
+                return getTimeToDestination(fastData.period.start_time, false)
 
 
         }
         }
         var seconds = Math.floor(milliSeconds / 1000)
         var seconds = Math.floor(milliSeconds / 1000)
@@ -368,7 +368,7 @@ export default function MainFastEatCard(props: { count: any, typeChanged: Functi
 
 
     function getEatTime() {
     function getEatTime() {
 
 
-        return getTimeToDestination(eatData.schedule.start_time, isCurrentTimeInRange(eatData.schedule.start_time, eatData.schedule.end_time))
+        return getTimeToDestination(eatData.period.start_time, isCurrentTimeInRange(eatData.period.start_time, eatData.period.end_time))
     }
     }
 
 
     function tapFastStart() {
     function tapFastStart() {
@@ -708,7 +708,7 @@ export default function MainFastEatCard(props: { count: any, typeChanged: Functi
                             <View className="schedule">
                             <View className="schedule">
                                 <Text className="schedule_name">{item.name}</Text>
                                 <Text className="schedule_name">{item.name}</Text>
                                 <Text className="schedule">
                                 <Text className="schedule">
-                                    {item.real_start_time ? dayjs(item.real_start_time).format('HH:mm') + ' - ' + dayjs(item.real_end_time).format('HH:mm') : item.schedule.start_time}
+                                    {item.real_start_time ? dayjs(item.real_start_time).format('HH:mm') + ' - ' + dayjs(item.real_end_time).format('HH:mm') : item.period.start_time}
                                 </Text>
                                 </Text>
                             </View>
                             </View>
                             <View style={{ flex: 1 }} />
                             <View style={{ flex: 1 }} />

+ 7 - 7
src/features/health/MainSleepActiveCard.tsx

@@ -25,7 +25,7 @@ export default function MainSleepActiveCard(props: { count: any, typeChanged: Fu
 
 
     useEffect(() => {
     useEffect(() => {
         const { sleep } = health.windows.sleep_active
         const { sleep } = health.windows.sleep_active
-        if (isCurrentTimeInRange(sleep.schedule.start_time, sleep.schedule.end_time)) {
+        if (isCurrentTimeInRange(sleep.period.start_time, sleep.period.end_time)) {
             setIsSleepMode(true)
             setIsSleepMode(true)
         }
         }
         else {
         else {
@@ -106,12 +106,12 @@ export default function MainSleepActiveCard(props: { count: any, typeChanged: Fu
         const color = isSleepMode ? MainColorType.sleep : MainColorType.active
         const color = isSleepMode ? MainColorType.sleep : MainColorType.active
         const { sleep, active } = health.windows.sleep_active
         const { sleep, active } = health.windows.sleep_active
         if (isSleepMode) {
         if (isSleepMode) {
-            if (!isCurrentTimeInRange(sleep.schedule.start_time, sleep.schedule.end_time)) {
+            if (!isCurrentTimeInRange(sleep.period.start_time, sleep.period.end_time)) {
                 return null
                 return null
             }
             }
         }
         }
         else {
         else {
-            if (!isCurrentTimeInRange(active.schedule.start_time, active.schedule.end_time)) {
+            if (!isCurrentTimeInRange(active.period.start_time, active.period.end_time)) {
                 return null
                 return null
             }
             }
         }
         }
@@ -184,12 +184,12 @@ export default function MainSleepActiveCard(props: { count: any, typeChanged: Fu
     function switchIcon() {
     function switchIcon() {
         const { sleep } = health.windows.sleep_active
         const { sleep } = health.windows.sleep_active
         if (isSleepMode) {
         if (isSleepMode) {
-            if (isCurrentTimeInRange(sleep.schedule.start_time, sleep.schedule.end_time)) {
+            if (isCurrentTimeInRange(sleep.period.start_time, sleep.period.end_time)) {
                 return <IconSwitch1 color="#000" width={15} />
                 return <IconSwitch1 color="#000" width={15} />
             }
             }
             return <IconSwitch2 color="#fff" width={15} />
             return <IconSwitch2 color="#fff" width={15} />
         }
         }
-        if (isCurrentTimeInRange(sleep.schedule.start_time, sleep.schedule.end_time)) {
+        if (isCurrentTimeInRange(sleep.period.start_time, sleep.period.end_time)) {
             return <IconSwitch2 color="#fff" width={15} />
             return <IconSwitch2 color="#fff" width={15} />
         }
         }
         return <IconSwitch1 color="#000" width={15} />
         return <IconSwitch1 color="#000" width={15} />
@@ -199,7 +199,7 @@ export default function MainSleepActiveCard(props: { count: any, typeChanged: Fu
         var bgColor = ''
         var bgColor = ''
         const { sleep } = health.windows.sleep_active
         const { sleep } = health.windows.sleep_active
         if (isSleepMode) {
         if (isSleepMode) {
-            if (isCurrentTimeInRange(sleep.schedule.start_time, sleep.schedule.end_time)) {
+            if (isCurrentTimeInRange(sleep.period.start_time, sleep.period.end_time)) {
                 bgColor = '#fff'
                 bgColor = '#fff'
             }
             }
             else {
             else {
@@ -208,7 +208,7 @@ export default function MainSleepActiveCard(props: { count: any, typeChanged: Fu
 
 
         }
         }
         else {
         else {
-            if (isCurrentTimeInRange(sleep.schedule.start_time, sleep.schedule.end_time)) {
+            if (isCurrentTimeInRange(sleep.period.start_time, sleep.period.end_time)) {
                 bgColor = MainColorType.sleep
                 bgColor = MainColorType.sleep
             }
             }
             else {
             else {

+ 3 - 0
src/pages/clock/Clock.config.ts

@@ -0,0 +1,3 @@
+export default definePageConfig({
+    "navigationStyle":"custom"
+})

+ 1 - 0
src/pages/clock/Clock.tsx

@@ -89,6 +89,7 @@ export default function Clock() {
         return <View />
         return <View />
     
     
     return <View style={{flex:1}}>
     return <View style={{flex:1}}>
+        <View style={{height:100,backgroundColor:'pink',zIndex:1000}}/>
         <ClockNew />
         <ClockNew />
     </View>
     </View>
 }
 }