leon 1 년 전
부모
커밋
3e0a8a8af8

+ 3 - 1
src/_health/base/status_indicator.tsx

@@ -18,6 +18,7 @@ export default function StatusIndicator(props: {
     children?: any,
     fontColor?: string,
     fontSize?: number
+    bold?:boolean,
     defaultSpace?: boolean,
     space?: number
 }) {
@@ -57,7 +58,7 @@ export default function StatusIndicator(props: {
                     height: rpxToPx(32),
                     borderRadius: rpxToPx(16),
                     backgroundColor: props.color,
-                    marginTop: rpxToPx(2),
+                    marginTop: rpxToPx(4),
                     display: 'flex',
                     alignItems: 'center',
                     justifyContent: 'center'
@@ -114,6 +115,7 @@ export default function StatusIndicator(props: {
             props.text && <View className='h20' style={{
                 color: props.fontColor ? props.fontColor : MainColorType.g01,
                 fontSize: props.fontSize ? props.fontSize : rpxToPx(20),
+                fontWeight:props.bold?'bold':'normal',
                 marginLeft: marginLeft()
             }}>{props.text}</View>
         }

+ 1 - 1
src/_health/components/console_cell.scss

@@ -23,7 +23,7 @@
     line-height: 34px;
     // width: 500px;
     flex: 1;
-    color: #B2B2B2;
+    // color: #B2B2B2;
     // white-space: nowrap;
     // display: -webkit-box;
     // -webkit-box-orient: vertical;

+ 1 - 1
src/_health/components/console_cell.tsx

@@ -30,7 +30,7 @@ export default function ConsoleCell(props: {
                 }
 
                 {
-                    props.description && <Text className='h24 g02 timeline_desc' style={{marginLeft:rpxToPx(56)}}>{props.description}{props.subDesc}</Text>
+                    props.description && <Text className='h24 timeline_desc g02' style={{marginLeft:rpxToPx(56)}}>{props.description}{props.subDesc}</Text>
                 }
                 <View style={{
                     height: props.description ? rpxToPx(28) : rpxToPx(54), flexShrink: 0,

+ 1 - 1
src/_health/components/fast_sleep_console.scss

@@ -43,7 +43,7 @@
     font-size: 24px;
     line-height: 34px;
     width: 500px;
-    color: #B2B2B2;
+    // color: #B2B2B2;
     white-space: nowrap;
     display: -webkit-box;
     -webkit-box-orient: vertical;

+ 11 - 9
src/_health/components/fast_sleep_console.tsx

@@ -7,7 +7,7 @@ import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import dayjs from "dayjs";
 import { MainColorType } from "@/context/themes/color";
 import showAlert from "@/components/basic/Alert";
-import { IconArrow, IconCellArrow, IconNotification, IconNotificationOff } from "@/components/basic/Icons";
+import { IconArrow, IconCellArrow, IconCircle, IconNotification, IconNotificationOff } from "@/components/basic/Icons";
 import { useSelector } from "react-redux";
 import { delRecord } from "@/services/health";
 import { TimeFormatter } from "@/utils/time_format";
@@ -132,27 +132,27 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
         // }
         switch (index) {
             case 0:
-                if (new Date().getTime() <= fast.target.start_timestamp) {
+                if (!fast.timeline[0].real) {
                     return MainColorType.g02
                 }
                 break
             case 1:
-                if (new Date().getTime() <= sleep.target.start_timestamp) {
+                if (!sleep.timeline[0].real) {
                     return MainColorType.g02
                 }
                 break
             case 2:
-                if (new Date().getTime() <= sleep.target.end_timestamp) {
+                if (!sleep.timeline[1].real) {
                     return MainColorType.g02
                 }
                 break
             case 3:
-                if (new Date().getTime() <= fast.target.end_timestamp) {
+                if (!fast.timeline[1].real) {
                     return MainColorType.g02
                 }
                 break
         }
-        var color = MainColorType.g03
+        var color = MainColorType.g02
         if (index == 1 || index == 2) {
             color = MainColorType.sleep
         }
@@ -169,7 +169,8 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
         if (finish) {
             return <Image style={{ width: rpxToPx(24), height: rpxToPx(24) }} src={require('@assets/_health/checked.png')} />
         }
-        return <View style={{ width: rpxToPx(26), height: rpxToPx(26), borderRadius: rpxToPx(13), backgroundColor: '#fff' }} />
+        return <IconCircle width={rpxToPx(32)} color={MainColorType.g02}/>
+        // return <View style={{ width: rpxToPx(26), height: rpxToPx(26), borderRadius: rpxToPx(13), backgroundColor: '#fff' }} />
         // if (item.timeline.reminder) {
         //     return <IconNotification color="#fff" width={rpxToPx(24)} />
         // }
@@ -365,8 +366,9 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
         return <ConsoleCell
             status={
                 <StatusIndicator type={StatusType.console}
-                    color={isError ? MainColorType.error : getIconColor(index, finish)}
-                    fontColor={isError ? MainColorType.error : MainColorType.g01}
+                    color={isError ? MainColorType.error : getIconColor(index, finish)==MainColorType.g02?'transparent':getIconColor(index, finish)}
+                    fontColor={isError ? MainColorType.error : getIconColor(index, finish)==MainColorType.g02?MainColorType.g01:getIconColor(index, finish)}
+                    bold={getIconColor(index, finish)!=MainColorType.g02}
                     fontSize={rpxToPx(24)}
                     text={time}
                 >{

+ 1 - 1
src/app.scss

@@ -570,7 +570,7 @@ text{
 }
 
 .g02 {
-    color: #b2b2b2
+    color: #999999
 }
 
 .g03 {

+ 3 - 0
src/features/health/MainCard.scss

@@ -135,10 +135,13 @@
     display: flex;
     align-items: flex-end;
     justify-content: center;
+    line-height: 28px;
+    width: 100%;
 }
 
 .window_name_sel {
     font-size: 34px;
+    line-height: 34px;
     color: #000;
     height: 42px;
 }

+ 0 - 1
src/features/health/MainConsole.scss

@@ -48,7 +48,6 @@
   line-height: 34px;
   // width: 500px;
   flex:1;
-  color: #B2B2B2;
   // white-space: nowrap;
   // display: -webkit-box;
   // -webkit-box-orient: vertical;

+ 30 - 4
src/features/health/MainConsole.tsx

@@ -14,7 +14,7 @@ import showActionSheet from "@/components/basic/ActionSheet";
 import { rpxToPx } from "@/utils/tools";
 import { setMode, setShowActionTip } from "@/store/health";
 import { getCountownTime, getDuration, getScenario, getThemeColor, getWindowStatus } from "./hooks/health_hooks";
-import { IconArrow, IconClose, IconMiss, IconMore, IconNotification, IconNotificationOff, IconSwitch, IconWalk } from "@/components/basic/Icons";
+import { IconArrow, IconCircle, IconClose, IconMiss, IconMore, IconNotification, IconNotificationOff, IconSwitch, IconWalk } from "@/components/basic/Icons";
 import DurationPicker from "@/_health/components/duration_picker";
 import Taro from "@tarojs/taro";
 import { systemLocation } from "@/services/common";
@@ -297,12 +297,14 @@ export default function MainConsole(props: { type: WindowType }) {
     function timelineItem(item: any, index: number, count: number) {
         function statusView() {
             return <StatusIndicator type={StatusType.console}
-                color={item.real?getThemeColor(health.mode):MainColorType.g02 }
+                color={item.real?getThemeColor(health.mode):'transparent' }
+                fontColor={item.real?getThemeColor(health.mode):MainColorType.g01 }
+                bold={item.real?true:false}
                 // color={new Date().getTime()<item.target.timestamp?MainColorType.g02:getThemeColor(health.mode)}
                 text={itemTitle(item)}
                 fontSize={rpxToPx(24)}
             >{
-                    processIcon(index)
+                    item.real?processIcon(index):<IconCircle width={rpxToPx(32)} color={MainColorType.g02}/>
                 }</StatusIndicator>
         }
         return <ConsoleCell
@@ -476,11 +478,35 @@ export default function MainConsole(props: { type: WindowType }) {
             return
         }
 
+        var strTitle = ''
+        if (health.mode == 'DAY' || health.mode == 'NIGHT'){
+            strTitle = getLocation()
+        }
+        else if (health.mode == 'EAT' || health.mode == 'ACTIVE'){
+            const scenario = getScenario(health.windows,health.mode)
+            if (scenario.archive_timestamp){
+                /*"Today's logs will be archived at 23:59."
+"Today's logs will be archived at 03:10 tomorrow."
+
+"今日记录将于 23:59 归档"
+"今日记录将于明天 23:59 归档"*/
+                var today = new Date().getDate()
+                var date = new Date(scenario.archive_timestamp).getDate()
+                strTitle = `今日记录将于${today==date?'':'明天'} ${dayjs(scenario.archive_timestamp).format('HH:mm')} 归档`
+            }
+            else {
+                strTitle = t('health.more_actions')
+            }
+        }
+        else {
+            strTitle = t('health.more_actions')
+        }
+
 
 
         showActionSheet({
             showActionSheetWithOptions: showActionSheetWithOptions,
-            title: (health.mode == 'DAY' || health.mode == 'NIGHT') ? getLocation() : t('health.more_actions'),
+            title: strTitle,
             itemList: actionList(),
             success: (res) => {
                 tapActionSheet(res)

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

@@ -198,7 +198,7 @@ export default function MainSwiper(props: { count: number, pageChanged: Function
         <Swiper
             onTransition={onTransition}
             onAnimationFinish={onTransitionend}
-            style={{ height: 110, width: rpxToPx(634) }} circular
+            style={{ height: rpxToPx(218), width: rpxToPx(634) }} circular
             previousMargin={rpxToPx(634/3)}
             nextMargin={rpxToPx(634/3)}
             onChange={pageChanged}