leon vor 1 Jahr
Ursprung
Commit
108f5fb40e

+ 1 - 1
src/_health/base/new_button.tsx

@@ -200,7 +200,7 @@ export default function NewButton(props: {
                 justifyContent: 'center',
                 justifyContent: 'center',
                 flexDirection: 'row',
                 flexDirection: 'row',
                 flex: 1,
                 flex: 1,
-                color: '#5C7099',
+                color: props.color?props.color:'#5C7099',
                 fontSize: props.fontSize ? props.fontSize : rpxToPx(26),
                 fontSize: props.fontSize ? props.fontSize : rpxToPx(26),
                 opacity: isTouched ? 0.4 : 1,
                 opacity: isTouched ? 0.4 : 1,
             }
             }

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

@@ -86,9 +86,10 @@ export default function StatusIndicator(props: {
     }
     }
 
 
     function marginLeft() {
     function marginLeft() {
-        if (props.type == StatusType.console || props.type == StatusType.big) return rpxToPx(24)
+        if (props.type == StatusType.console) return rpxToPx(24)
         if (props.defaultSpace) return rpxToPx(12)
         if (props.defaultSpace) return rpxToPx(12)
         if (props.space) return props.space
         if (props.space) return props.space
+        if (props.type == StatusType.big) return rpxToPx(24)
         return rpxToPx(6)
         return rpxToPx(6)
     }
     }
 
 

+ 4 - 1
src/_health/components/cover_list.tsx

@@ -6,7 +6,10 @@ export default function CoverList(props: { imgs: any, count: number }) {
     return <View className="media" style={{ marginRight: props.count == 4 ? 80 : 0 }}>
     return <View className="media" style={{ marginRight: props.count == 4 ? 80 : 0 }}>
         {
         {
             props.imgs.map((obj, j) => {
             props.imgs.map((obj, j) => {
-                return <Image className="media_item" mode="aspectFill" onClick={() => {
+                return <Image className="media_item" mode="aspectFill" onClick={(e) => {
+                    if (process.env.TARO_ENV=='weapp'){
+                        e.stopPropagation()
+                    }
                     Taro.previewImage({
                     Taro.previewImage({
                         current: obj,
                         current: obj,
                         urls: props.imgs
                         urls: props.imgs

+ 11 - 17
src/_health/components/fast_sleep_card.tsx

@@ -281,7 +281,7 @@ export default function FastSleepCard(props: { step: number, data: any }) {
 
 
         return <View style={{
         return <View style={{
             display: 'flex', alignItems: 'center', justifyContent: 'center', width: 114, height: 114,
             display: 'flex', alignItems: 'center', justifyContent: 'center', width: 114, height: 114,
-            marginLeft: rpxToPx(50),
+            marginLeft: rpxToPx(42),
             marginTop: rpxToPx(86),
             marginTop: rpxToPx(86),
             position: 'relative',
             position: 'relative',
         }}>
         }}>
@@ -324,7 +324,7 @@ export default function FastSleepCard(props: { step: number, data: any }) {
         else if (fast.target.start_timestamp <= new Date().getTime() && new Date().getTime() < fast.target.end_timestamp) {
         else if (fast.target.start_timestamp <= new Date().getTime() && new Date().getTime() < fast.target.end_timestamp) {
             outRange = false
             outRange = false
         }
         }
-        return <View style={{ display: 'flex', marginTop: rpxToPx(100), marginLeft: rpxToPx(70), alignItems: 'center', justifyContent: 'center', width: 96, height: 96, position: 'relative' }}> <Rings common={common3}
+        return <View style={{ display: 'flex', marginTop: rpxToPx(100), marginLeft: rpxToPx(42), alignItems: 'center', justifyContent: 'center', width: 96, height: 96, position: 'relative' }}> <Rings common={common3}
             bgRing={bgRing}
             bgRing={bgRing}
             targetRing={target1BigRing()}
             targetRing={target1BigRing()}
             realRing={real1BigRing()}
             realRing={real1BigRing()}
@@ -342,7 +342,7 @@ export default function FastSleepCard(props: { step: number, data: any }) {
         else if (sleep.target.start_timestamp <= new Date().getTime() && new Date().getTime() < sleep.target.end_timestamp) {
         else if (sleep.target.start_timestamp <= new Date().getTime() && new Date().getTime() < sleep.target.end_timestamp) {
             outRange = false
             outRange = false
         }
         }
-        return <View style={{ display: 'flex', marginTop: rpxToPx(100), marginLeft: rpxToPx(70), alignItems: 'center', justifyContent: 'center', width: 96, height: 96, position: 'relative' }}> <Rings common={common3}
+        return <View style={{ display: 'flex', marginTop: rpxToPx(100), marginLeft: rpxToPx(42), alignItems: 'center', justifyContent: 'center', width: 96, height: 96, position: 'relative' }}> <Rings common={common3}
             bgRing={bgRing}
             bgRing={bgRing}
             targetRing={target2BigRing()}
             targetRing={target2BigRing()}
             realRing={real2BigRing()}
             realRing={real2BigRing()}
@@ -382,7 +382,7 @@ export default function FastSleepCard(props: { step: number, data: any }) {
             }
             }
         }
         }
 
 
-        return <View style={{ display: 'flex', marginTop: rpxToPx(100), marginLeft: rpxToPx(70), alignItems: 'center', justifyContent: 'center', width: 96, height: 96, position: 'relative' }}> <Rings common={common3}
+        return <View style={{ display: 'flex', marginTop: rpxToPx(100), marginLeft: rpxToPx(42), alignItems: 'center', justifyContent: 'center', width: 96, height: 96, position: 'relative' }}> <Rings common={common3}
             bgRing={bgRing}
             bgRing={bgRing}
             targetRing={target3BigRing()}
             targetRing={target3BigRing()}
             realRing={real3BigRing()}
             realRing={real3BigRing()}
@@ -461,13 +461,12 @@ export default function FastSleepCard(props: { step: number, data: any }) {
                         type = StatusType.normal
                         type = StatusType.normal
                     }
                     }
                     else if (status == 'OG2_NO1') {
                     else if (status == 'OG2_NO1') {
-                        type = StatusType.img
+                        type = StatusType.normal
                         color = MainColorType.error
                         color = MainColorType.error
-                        img = <IconMiss width={rpxToPx(26)} color='#fff' />
                     }
                     }
                     else {
                     else {
                         type = StatusType.img
                         type = StatusType.img
-                        img = <IconCheck width={rpxToPx(26)} height={rpxToPx(26)} color='#fff' />
+                        img = <IconCheck width={rpxToPx(20)} height={rpxToPx(20)} color='#fff' />
                     }
                     }
 
 
                     return <View style={{
                     return <View style={{
@@ -508,21 +507,16 @@ export default function FastSleepCard(props: { step: number, data: any }) {
                     var type = StatusType.normal
                     var type = StatusType.normal
                     var img: any = null
                     var img: any = null
                     var color: any = MainColorType.sleep
                     var color: any = MainColorType.sleep
-                    if (status == 'WFS' || status == 'OG1') {
-                        type = StatusType.normal
-                        // img = <IconCircle width={rpxToPx(26)} color={MainColorType.sleep} />
-                        // color = 'transparent'
+                    if (status == 'OG1'){
+                        color = MainColorType.g03
                     }
                     }
-                    else if (status == 'OG2') {
-                        type = StatusType.normal
-                    }
-                    else if (status == 'OG2_NO1') {
+                    if (status == 'WFS' || status == 'OG1' || status == 'OG2' || status == 'OG2_NO1') {
                         type = StatusType.normal
                         type = StatusType.normal
                         // img = <IconMiss width={rpxToPx(26)} color='#fff' />
                         // img = <IconMiss width={rpxToPx(26)} color='#fff' />
                     }
                     }
                     else {
                     else {
                         type = StatusType.img
                         type = StatusType.img
-                        img = <IconCheck width={rpxToPx(26)} height={rpxToPx(26)} color='#fff' />
+                        img = <IconCheck width={rpxToPx(20)} height={rpxToPx(20)} color='#fff' />
                     }
                     }
 
 
                     // debugger
                     // debugger
@@ -576,7 +570,7 @@ export default function FastSleepCard(props: { step: number, data: any }) {
                     }}>
                     }}>
                         <StatusIndicator type={type}
                         <StatusIndicator type={type}
                             // color={status == 'OG3' ? MainColorType.fast : 'transparent'}
                             // color={status == 'OG3' ? MainColorType.fast : 'transparent'}
-                            color={MainColorType.fast}
+                            color={status != 'WFS' && status != 'OG3' ? MainColorType.g03 : MainColorType.fast}
                             text={title}
                             text={title}
                             fontColor={MainColorType.g01}
                             fontColor={MainColorType.g01}
                             fontSize={rpxToPx(20)}
                             fontSize={rpxToPx(20)}

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

@@ -1,12 +1,4 @@
-.timeline_item {
-    display: flex;
-    flex-direction: row;
-    align-items: center;
-    padding-right: 40px;
-    position: relative;
-    padding-left: 52px;
-    background-color: #fff;
-}
+
 
 
 .cell_hover {
 .cell_hover {
   background-color: #E5E5E5;
   background-color: #E5E5E5;

+ 10 - 3
src/_health/components/fast_sleep_popup.scss

@@ -59,13 +59,20 @@
     margin-bottom: 36px;
     margin-bottom: 36px;
 }
 }
 
 
-.pop_step_content{
+.pop_step_content {
     margin-top: 12px;
     margin-top: 12px;
     display: flex;
     display: flex;
     flex-direction: row;
     flex-direction: row;
 }
 }
 
 
-.pop_step_right{
+.pop_step_right {
     margin-left: 10px;
     margin-left: 10px;
-    margin-top: 14px;
+    margin-top: 4px;
+    height: 44px;
+    line-height: 44px;
+}
+
+.line_height_48 {
+    line-height: 48px;
+    height: 48px;
 }
 }

+ 4 - 46
src/_health/components/fast_sleep_popup.tsx

@@ -34,7 +34,7 @@ export default function FastSleepPopup(props: { close: any, data: any }) {
         const { sleep, status } = props.data
         const { sleep, status } = props.data
         if (status == 'WFS') return ''
         if (status == 'WFS') return ''
         var str = ' / ' + diffentTime(sleep.period.start_time, sleep.period.end_time)
         var str = ' / ' + diffentTime(sleep.period.start_time, sleep.period.end_time)
-        if (status == 'OG2' || status == 'OG2_NO1'||status == 'OG3') {
+        if (status == 'OG2' || status == 'OG2_NO1' || status == 'OG3') {
             return <View className="h24 bold pop_step_right" style={{ color: MainColorType.sleep }}>{str}</View>
             return <View className="h24 bold pop_step_right" style={{ color: MainColorType.sleep }}>{str}</View>
         }
         }
         return <View className="h24 bold pop_step_right" style={{ color: MainColorType.g02 }}>{str}</View>
         return <View className="h24 bold pop_step_right" style={{ color: MainColorType.g02 }}>{str}</View>
@@ -65,7 +65,7 @@ export default function FastSleepPopup(props: { close: any, data: any }) {
         else if (status == 'OG2_NO1') {
         else if (status == 'OG2_NO1') {
             return ('')
             return ('')
         }
         }
-        return <View className="h30 bold" style={{ color: MainColorType.fast }}>{TimeFormatter.calculateTimeDifference(fast.real.start_timestamp, sleep.real.start_timestamp)}</View>
+        return <View className="line_height_48 h30 bold" style={{ color: MainColorType.fast }}>{TimeFormatter.calculateTimeDifference(fast.real.start_timestamp, sleep.real.start_timestamp)}</View>
     }
     }
 
 
     function step2() {
     function step2() {
@@ -114,10 +114,7 @@ export default function FastSleepPopup(props: { close: any, data: any }) {
     function beforeStatus() {
     function beforeStatus() {
         const { status } = props.data
         const { status } = props.data
         var type = StatusType.normal
         var type = StatusType.normal
-        if (status == 'WFS') {
-            type = StatusType.normal
-        }
-        else if (status == 'OG1') {
+        if (status == 'WFS' || status == 'OG1' || status == 'OG2_NO1') {
             type = StatusType.normal
             type = StatusType.normal
         }
         }
         else {
         else {
@@ -126,24 +123,11 @@ export default function FastSleepPopup(props: { close: any, data: any }) {
         return type
         return type
     }
     }
 
 
-    function beforeSleep() {
-        const type = beforeStatus()
-        return <StatusIndicator type={type}
-            color={MainColorType.fast}
-            fontColor={MainColorType.g01}
-            text={t('health.fast_before_bed')}
-        >
-            {
-                type == StatusType.img && <Image style={{ width: rpxToPx(20), height: rpxToPx(20) }} src={require('@assets/_health/checked.png')} />
-            }
-        </StatusIndicator>
-
-    }
 
 
     function ingStatus() {
     function ingStatus() {
         const { status } = props.data
         const { status } = props.data
         var type = StatusType.normal
         var type = StatusType.normal
-        if (status == 'WFS' || status == 'OG1') {
+        if (status == 'WFS' || status == 'OG1' || status == 'OG2_NO1') {
             type = StatusType.normal
             type = StatusType.normal
         }
         }
         else if (status == 'OG2') {
         else if (status == 'OG2') {
@@ -155,19 +139,6 @@ export default function FastSleepPopup(props: { close: any, data: any }) {
         return type;
         return type;
     }
     }
 
 
-    function sleeping() {
-        const type = ingStatus()
-        return <StatusIndicator type={type}
-            color={MainColorType.sleep}
-            fontColor={MainColorType.g01}
-            text={t('health.fast_while_sleep')}
-        >
-            {
-                type == StatusType.img && <Image style={{ width: rpxToPx(20), height: rpxToPx(20) }} src={require('@assets/_health/checked.png')} />
-            }
-        </StatusIndicator>
-    }
-
     function afterStatus() {
     function afterStatus() {
         const { status } = props.data
         const { status } = props.data
         var type = StatusType.normal
         var type = StatusType.normal
@@ -183,19 +154,6 @@ export default function FastSleepPopup(props: { close: any, data: any }) {
         return type;
         return type;
     }
     }
 
 
-    function afterSleep() {
-        const type = afterStatus()
-        return <StatusIndicator type={type}
-            color={MainColorType.fast}
-            fontColor={MainColorType.g01}
-            text={t('health.fast_after_sleep')}
-        >
-            {
-                type == StatusType.img && <Image style={{ width: rpxToPx(20), height: rpxToPx(20) }} src={require('@assets/_health/checked.png')} />
-            }
-        </StatusIndicator>
-    }
-
     return <FastSleepPopupContent
     return <FastSleepPopupContent
         close={props.close}
         close={props.close}
         status={props.data.status}
         status={props.data.status}

+ 20 - 4
src/_health/components/fast_sleep_popup_content.tsx

@@ -51,8 +51,15 @@ export default function FastSleepPopupContent(props: {
 
 
     function sleeping() {
     function sleeping() {
         const type = props.sleepStatus
         const type = props.sleepStatus
+        var color = MainColorType.sleep
+        if (props.status){
+            if (props.status == 'OG1'){
+                color = MainColorType.g03
+            }
+        }
+
         return <StatusIndicator type={type}
         return <StatusIndicator type={type}
-            color={MainColorType.sleep}
+            color={color}
             fontColor={MainColorType.black}
             fontColor={MainColorType.black}
             fontSize={rpxToPx(24)}
             fontSize={rpxToPx(24)}
             text={t('health.fast_while_sleep')}
             text={t('health.fast_while_sleep')}
@@ -65,8 +72,15 @@ export default function FastSleepPopupContent(props: {
 
 
     function afterSleep() {
     function afterSleep() {
         const type = props.afterStatus
         const type = props.afterStatus
+        var color = MainColorType.fast
+        if (props.status){
+            if (props.status != 'WFS' && props.status != 'OG3'){
+                color = MainColorType.g03
+            }
+        }
+
         return <StatusIndicator type={type}
         return <StatusIndicator type={type}
-            color={MainColorType.fast}
+            color={color}
             fontColor={MainColorType.black}
             fontColor={MainColorType.black}
             fontSize={rpxToPx(24)}
             fontSize={rpxToPx(24)}
             text={t('health.fast_after_sleep')}
             text={t('health.fast_after_sleep')}
@@ -92,6 +106,8 @@ export default function FastSleepPopupContent(props: {
                         marginLeft: rpxToPx(10),
                         marginLeft: rpxToPx(10),
                         marginRight: rpxToPx(24),
                         marginRight: rpxToPx(24),
                         width: 1, height: rpxToPx(103),
                         width: 1, height: rpxToPx(103),
+                        display:'flex',
+                        flexDirection:'column',
                         backgroundColor: (props.sleepStatus == StatusType.ing || props.afterStatus == StatusType.ing) ? MainColorType.g01 : MainColorType.g03
                         backgroundColor: (props.sleepStatus == StatusType.ing || props.afterStatus == StatusType.ing) ? MainColorType.g01 : MainColorType.g03
                     }} />
                     }} />
                     <View className="pop_step_content">
                     <View className="pop_step_content">
@@ -143,8 +159,8 @@ export default function FastSleepPopupContent(props: {
                 </View>
                 </View>
             </View>
             </View>
             <NewButton
             <NewButton
-                type={NewButtonType.fill}
-                color={MainColorType.fast}
+                type={NewButtonType.text}
+                // color={MainColorType.fast}
                 width={rpxToPx(440)}
                 width={rpxToPx(440)}
                 height={rpxToPx(96)}
                 height={rpxToPx(96)}
                 title={t('health.ok')}
                 title={t('health.ok')}

+ 86 - 4
src/_health/components/target_progress.tsx

@@ -1,4 +1,4 @@
-import { View } from '@tarojs/components'
+import { View, Text } from '@tarojs/components'
 import Rings, { RingCommon, BgRing, TargetRing, CurrentDot } from "@/features/trackTimeDuration/components/Rings";
 import Rings, { RingCommon, BgRing, TargetRing, CurrentDot } from "@/features/trackTimeDuration/components/Rings";
 import './target_progress.scss'
 import './target_progress.scss'
 import { MainColorType } from '@/context/themes/color';
 import { MainColorType } from '@/context/themes/color';
@@ -13,7 +13,12 @@ export default function TargetProgress(props: {
     canvasId?: string,
     canvasId?: string,
     showRing: boolean,
     showRing: boolean,
     icon?: any,
     icon?: any,
-    desc?: string
+    desc?: string,
+
+    //双环
+    doubleRing?: boolean,
+    first?: any,
+    second?: any
 }) {
 }) {
 
 
     function ring() {
     function ring() {
@@ -38,12 +43,83 @@ export default function TargetProgress(props: {
         return <Rings common={common} bgRing={bgRing} realRing={realRing} canvasId={props.canvasId ?? 'helloworld'} />
         return <Rings common={common} bgRing={bgRing} realRing={realRing} canvasId={props.canvasId ?? 'helloworld'} />
     }
     }
 
 
+    function ring1() {
+        const common: RingCommon = {
+            useCase: 'ChooseScenario',
+            radius: 12.5,
+            lineWidth: 5,
+            isFast: true,
+            status: 'WAIT_FOR_START'
+        }
+
+        const bgRing: BgRing = {
+            color: MainColorType.ringBg
+        }
 
 
-    return <View className='history_duration_bg' style={{ position: 'relative', marginTop: 0,marginBottom:props.showLine?rpxToPx(7):0 }}>
+        const realRing = {
+            hideBg: true,
+            color: MainColorType.fast,
+            startArc: startArc(props.first.window_range.start_timestamp ?? 0),
+            durationArc: durationArc(props.first.window_range.start_timestamp ?? 0, props.first.window_range.end_timestamp ?? 0)
+        }
+        return <Rings common={common} bgRing={bgRing} realRing={realRing} canvasId={props.canvasId+'big' ?? 'helloworld'} />
+    }
+
+    function ring2() {
+        const common: RingCommon = {
+            useCase: 'ChooseScenario',
+            radius: 6.5,
+            lineWidth: 5,
+            isFast: true,
+            status: 'WAIT_FOR_START'
+        }
+
+        const bgRing: BgRing = {
+            color: MainColorType.ringBg
+        }
+
+        const realRing = {
+            hideBg: true,
+            color: MainColorType.sleep,
+            startArc: startArc(props.second.window_range.start_timestamp ?? 0),
+            durationArc: durationArc(props.second.window_range.start_timestamp ?? 0, props.second.window_range.end_timestamp ?? 0)
+        }
+        return <Rings common={common} bgRing={bgRing} realRing={realRing} canvasId={props.canvasId+'small' ?? 'helloworld'} />
+    }
+
+    function twoRing() {
+        return <View style={{
+            display: 'flex',
+            alignItems: 'center',
+            justifyContent: 'center',
+            position: 'relative'
+        }}>
+            {
+                ring1()
+            }
+            <View style={{
+                position: 'absolute',
+                left: 0,
+                right: 0,
+                top: 0,
+                bottom: 0,
+                display: 'flex',
+                alignItems: 'center',
+                justifyContent: 'center'
+            }}>
+                {
+                    ring2()
+                }
+            </View>
+        </View>
+    }
+
+
+    return <View className='history_duration_bg' style={{ position: 'relative', marginTop: 0, marginBottom: props.showLine ? rpxToPx(7) : 0 }}>
         {
         {
             props.showRing ? <View className='recent_ring_bg'>
             props.showRing ? <View className='recent_ring_bg'>
                 {
                 {
-                    ring()
+                    props.doubleRing ? twoRing() : ring()
                 }
                 }
             </View> :
             </View> :
                 <View className='recent_ring_bg'>
                 <View className='recent_ring_bg'>
@@ -55,6 +131,12 @@ export default function TargetProgress(props: {
         {
         {
             props.desc && <View className='history_item_duration h32'>{props.desc}</View>
             props.desc && <View className='history_item_duration h32'>{props.desc}</View>
         }
         }
+        {
+            props.doubleRing && <View className='history_item_duration h32' style={{
+                display: 'flex',
+                flexDirection: 'column'
+            }}><Text className='h32'>{props.first.description}</Text><Text className='h32'>{props.second.description}</Text></View>
+        }
         {/* {
         {/* {
             props.showLine && <View style={{height:rpxToPx(7),flexShrink:0}} />
             props.showLine && <View style={{height:rpxToPx(7),flexShrink:0}} />
         } */}
         } */}

+ 26 - 21
src/_health/pages/archive.tsx

@@ -240,7 +240,7 @@ export default function Archive() {
             flexDirection: 'column',
             flexDirection: 'column',
             boxSizing: 'border-box'
             boxSizing: 'border-box'
         }}>
         }}>
-            <View className="h26">档案存储了某一天中含有不完整条目的记录。如果您已完成当天所有[餐食/活动]记录,请将该记录“标记为完成”。</View>
+            <View className="h26" style={{lineHeight:rpxToPx(40)+'px'}}>档案存储了某一天中含有不完整条目的记录。如果您已完成当天所有[餐食/活动]记录,请将该记录“标记为完成”。</View>
             <View style={{
             <View style={{
                 display: 'flex',
                 display: 'flex',
                 flexDirection: 'row',
                 flexDirection: 'row',
@@ -252,37 +252,42 @@ export default function Archive() {
                     setChecked(!checked)
                     setChecked(!checked)
                 }}>
                 }}>
                     <StatusIndicator
                     <StatusIndicator
-                        type={StatusType.img}
+                        type={StatusType.big}
                         color={checked ? MainColorType.g02 : 'transparent'}
                         color={checked ? MainColorType.g02 : 'transparent'}
                         text="不再显示"
                         text="不再显示"
+                        space={rpxToPx(8)}
                         fontColor={MainColorType.g02}
                         fontColor={MainColorType.g02}
                         fontSize={rpxToPx(24)}
                         fontSize={rpxToPx(24)}
                     >
                     >
                         {
                         {
-                            checked ? <IconCheck width={rpxToPx(26)} height={rpxToPx(26)} color={MainColorType.white} /> :
-                                <IconCircle width={rpxToPx(26)} color={MainColorType.g02} />
+                            checked ? <IconCheck width={rpxToPx(24)} height={rpxToPx(24)} color={MainColorType.white} /> :
+                                <IconCircle width={rpxToPx(32)} color={MainColorType.g02} />
                         }
                         }
                     </StatusIndicator>
                     </StatusIndicator>
                 </View>
                 </View>
-                <View className="h26"
-                    onClick={() => {
-                        setShowNote(false)
-                        if (checked) {
-                            Taro.setStorage({
-                                key: 'hideArchiveNote',
-                                data: true
-                            })
-                        }
-
-                    }}
-                    style={{
-                        width: rpxToPx(125),
-                        height: rpxToPx(72),
-                        color: getThemeColor(health.mode),
-                        display: 'flex',
+                <View style={{
+                    width: rpxToPx(125),
+                    height: rpxToPx(72),
+                    display: 'flex',
                         alignItems: 'center',
                         alignItems: 'center',
                         justifyContent: 'center'
                         justifyContent: 'center'
-                    }}>知道了</View>
+                }}>
+                    <NewButton 
+                        type={NewButtonType.link}
+                        color={getThemeColor(health.mode)}
+                        onClick={() => {
+                            setShowNote(false)
+                            if (checked) {
+                                Taro.setStorage({
+                                    key: 'hideArchiveNote',
+                                    data: true
+                                })
+                            }
+    
+                        }}
+                        title="知道了"
+                    />
+                </View>
             </View>
             </View>
         </View>
         </View>
     }
     }

+ 22 - 12
src/_health/pages/timeline_detail.tsx

@@ -68,7 +68,7 @@ export default function TimelineDetail() {
         router = useRouter()
         router = useRouter()
     }
     }
 
 
-    const { schedule_id, event_id, window_id } = router.params
+    const { schedule_id, event_id, window_id, isfastsleep } = router.params
 
 
     useEffect(() => {
     useEffect(() => {
         Taro.setNavigationBarColor({
         Taro.setNavigationBarColor({
@@ -311,15 +311,15 @@ export default function TimelineDetail() {
         })
         })
     }
     }
 
 
-    function tapMarkdone(){
-        makeDone(window_id).then(res=>{
+    function tapMarkdone() {
+        makeDone(window_id).then(res => {
             Taro.showToast({
             Taro.showToast({
-                title:'操作成功',
-                icon:'none'
+                title: '操作成功',
+                icon: 'none'
             })
             })
             getDatas()
             getDatas()
             global.refreshHistory()
             global.refreshHistory()
-            if (global.refreshArchiveHistory){
+            if (global.refreshArchiveHistory) {
                 global.refreshArchiveHistory()
                 global.refreshArchiveHistory()
             }
             }
         })
         })
@@ -328,8 +328,8 @@ export default function TimelineDetail() {
     function tapMore() {
     function tapMore() {
         var list: any = []
         var list: any = []
         if (window_id) {
         if (window_id) {
-            if (detail.archived){
-                list = ['删除','Mark Done']
+            if (detail.archived) {
+                list = ['删除', 'Mark Done']
             }
             }
             else {
             else {
                 list = ['删除']
                 list = ['删除']
@@ -342,14 +342,14 @@ export default function TimelineDetail() {
                     if (res == 0) {
                     if (res == 0) {
                         delHistory()
                         delHistory()
                     }
                     }
-                    else if (res == 1){
+                    else if (res == 1) {
                         tapMarkdone()
                         tapMarkdone()
                     }
                     }
                 }
                 }
             })
             })
             return
             return
         }
         }
-        
+
         if (health.mode != 'ACTIVE' && health.mode != 'EAT') {
         if (health.mode != 'ACTIVE' && health.mode != 'EAT') {
             list = ['删除']
             list = ['删除']
         }
         }
@@ -380,6 +380,7 @@ export default function TimelineDetail() {
 
 
     if (!loaded) return <View />
     if (!loaded) return <View />
 
 
+
     return <View style={{ display: 'flex', flex: 1, flexDirection: 'column' }}>
     return <View style={{ display: 'flex', flex: 1, flexDirection: 'column' }}>
         <View className="detail_header">
         <View className="detail_header">
             <Image className="detail_header_header"
             <Image className="detail_header_header"
@@ -492,7 +493,7 @@ export default function TimelineDetail() {
                 }
                 }
 
 
                 {
                 {
-                    history && detail.windows && detail.windows.map((item, index) => {
+                    isfastsleep=='0' && history && detail.windows && detail.windows.map((item, index) => {
                         return <TargetProgress key={index} showLine={index < detail.windows.length - 1}
                         return <TargetProgress key={index} showLine={index < detail.windows.length - 1}
                             color={getThemeColor(item.window)}
                             color={getThemeColor(item.window)}
                             showRing={true}
                             showRing={true}
@@ -507,7 +508,16 @@ export default function TimelineDetail() {
                     })
                     })
                 }
                 }
                 {
                 {
-                    publish && <View style={{ display: 'flex', flexDirection: 'row', height: rpxToPx(60),marginTop:rpxToPx(17), alignItems: 'center', justifyContent: 'space-between' }}>
+                    isfastsleep=='1' && history && detail.windows && <TargetProgress
+                        showRing={true}
+                        doubleRing={true}
+                        first={detail.windows[0]}
+                        second={detail.windows[1]}
+                        canvasId={`double_${detail.windows[0].window_range.start_timestamp}`}
+                    />
+                }
+                {
+                    publish && <View style={{ display: 'flex', flexDirection: 'row', height: rpxToPx(60), marginTop: rpxToPx(17), alignItems: 'center', justifyContent: 'space-between' }}>
                         <Text className="h24 g02">{publish.edited ? '编辑于' : '发布于'}{dayjs(publish.timestamp).format('MM-DD HH:mm')}</Text>
                         <Text className="h24 g02">{publish.edited ? '编辑于' : '发布于'}{dayjs(publish.timestamp).format('MM-DD HH:mm')}</Text>
                         <NewButton
                         <NewButton
                             type={NewButtonType.more}
                             type={NewButtonType.more}

+ 6 - 1
src/app.scss

@@ -485,6 +485,11 @@ page {
     line-height: 42px;
     line-height: 42px;
 }
 }
 
 
+.h32{
+    font-size: 32px;
+    line-height: 38px;
+}
+
 .h30 {
 .h30 {
     font-size: 30px;
     font-size: 30px;
     line-height: 36px;
     line-height: 36px;
@@ -654,7 +659,7 @@ page {
     display: flex;
     display: flex;
     color: #fff;
     color: #fff;
     border-radius: 10px;
     border-radius: 10px;
-    min-width: 137px;
+    min-width: 144px;
     padding-left: 9px;
     padding-left: 9px;
     padding-right: 9px;
     padding-right: 9px;
     box-sizing: border-box;
     box-sizing: border-box;

+ 2 - 0
src/context/locales/en.js

@@ -981,5 +981,7 @@ export default {
 
 
         log_extra_meal:'Log Extra Meal',
         log_extra_meal:'Log Extra Meal',
         log_extra_activity:'Log Extra Activity',
         log_extra_activity:'Log Extra Activity',
+
+        photo_wall:'Photo Wall',
     }
     }
 }
 }

+ 2 - 0
src/context/locales/zh.js

@@ -982,5 +982,7 @@ export default {
 
 
         log_extra_meal: '记录额外一餐',
         log_extra_meal: '记录额外一餐',
         log_extra_activity: '记录额外活动',
         log_extra_activity: '记录额外活动',
+
+        photo_wall:'照片墙',
     }
     }
 }
 }

+ 44 - 29
src/features/health/HeaderCircadian.tsx

@@ -20,7 +20,6 @@ export default function HeaderCircadian() {
     const [icon, setIcon] = useState('DAY')
     const [icon, setIcon] = useState('DAY')
     const [title, setTitle] = useState('')
     const [title, setTitle] = useState('')
     const [desc, setDesc] = useState('')
     const [desc, setDesc] = useState('')
-    const [lowLight, setLowLight] = useState(false)
     const [isOG, setIsOG] = useState(false)
     const [isOG, setIsOG] = useState(false)
     const { t } = useTranslation()
     const { t } = useTranslation()
 
 
@@ -43,21 +42,33 @@ export default function HeaderCircadian() {
             // lauchShow = true
             // lauchShow = true
             const scenario = getScenario(health.windows, health.mode)
             const scenario = getScenario(health.windows, health.mode)
             if (scenario.real || scenario.status == 'OG') {
             if (scenario.real || scenario.status == 'OG') {
-                setIcon(scenario.window)
+                if (getScenario(health.windows, 'FAST').window_id == scenario.window_id){
+                    console.log('oooo',scenario)
+                    setIcon('FAST')
+                }
+                else if (getScenario(health.windows, 'SLEEP').window_id == scenario.window_id){
+                    setIcon('SLEEP')
+                }
+                else if (getScenario(health.windows, 'ACTIVE').window_id == scenario.window_id){
+                    setIcon('ACTIVE')
+                }
+                else if (getScenario(health.windows, 'EAT').window_id == scenario.window_id){
+                    setIcon('EAT')
+                }
                 setIsOG(true)
                 setIsOG(true)
+                // dispatch(setShowActionTip({
+                //     isShow: false,
+                //     isCompleted: false
+                // }))
+
+                // setTimeout(() => {
                 dispatch(setShowActionTip({
                 dispatch(setShowActionTip({
-                    isShow: false,
+                    isShow: true,
                     isCompleted: false
                     isCompleted: false
                 }))
                 }))
+                // }, 50)
 
 
-                setTimeout(() => {
-                    dispatch(setShowActionTip({
-                        isShow: true,
-                        isCompleted: false
-                    }))
-                }, 50)
-
-                switch(health.mode){
+                switch (health.mode) {
                     case 'FAST':
                     case 'FAST':
                         setTitle(t('health.fasting_log'))
                         setTitle(t('health.fasting_log'))
                         break
                         break
@@ -71,20 +82,20 @@ export default function HeaderCircadian() {
                         setTitle(t('health.active_log'))
                         setTitle(t('health.active_log'))
                         break
                         break
                 }
                 }
+                setDesc(t('health.in_progress'))
 
 
                 return;
                 return;
             }
             }
             else {
             else {
 
 
                 if (new Date().getTime() >= scenario.target.start_timestamp && new Date().getTime() < scenario.target.end_timestamp) {
                 if (new Date().getTime() >= scenario.target.start_timestamp && new Date().getTime() < scenario.target.end_timestamp) {
-                    setDesc( t('health.live_now'))
-                    setLowLight(false)
+                    setDesc(t('health.live_now'))
                 }
                 }
                 else {
                 else {
                     setDesc(t('health.next_up'))
                     setDesc(t('health.next_up'))
-                    setLowLight(true)
                 }
                 }
             }
             }
+            console.log(health.mode)
             switch (health.mode) {
             switch (health.mode) {
                 case 'FAST':
                 case 'FAST':
                     {
                     {
@@ -129,7 +140,7 @@ export default function HeaderCircadian() {
                     }
                     }
                     break;
                     break;
             }
             }
-            
+
             setIsOG(false)
             setIsOG(false)
             setShowTip(true)
             setShowTip(true)
             if (timer) {
             if (timer) {
@@ -144,40 +155,43 @@ export default function HeaderCircadian() {
 
 
     useEffect(() => {
     useEffect(() => {
         if (health.showActionCircadian) {
         if (health.showActionCircadian) {
-            setLowLight(false)
-            const scenario = getScenario(health.windows,health.mode)
+            const scenario = getScenario(health.windows, health.mode)
+            setIsOG(scenario.status == 'OG')
+            var isLiveNow = new Date().getTime() >= scenario.target.start_timestamp && new Date().getTime() < scenario.target.end_timestamp
+            setDesc(scenario.status == 'OG' ? t('health.in_progress') : isLiveNow ? t('health.live_now') : t('health.next_up'))
             switch (health.mode) {
             switch (health.mode) {
                 case 'FAST':
                 case 'FAST':
                     {
                     {
                         setIcon('FAST')
                         setIcon('FAST')
-                        setTitle(t('health.fasting_schedule'))
-                        setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
+                        setTitle(scenario.status == 'OG' ? t('health.fasting_log') : t('health.fasting_schedule'))
+
+
                     }
                     }
                     break;
                     break;
                 case 'EAT':
                 case 'EAT':
                     {
                     {
                         setIcon('EAT')
                         setIcon('EAT')
-                        setTitle(t('health.eating_schedule'))
-                        setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
+                        setTitle(scenario.status == 'OG' ? t('health.meal_log') : t('health.eating_schedule'))
+                        // setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
                     }
                     }
                     break;
                     break;
                 case 'SLEEP':
                 case 'SLEEP':
                     {
                     {
                         setIcon('SLEEP')
                         setIcon('SLEEP')
-                        setTitle(t('health.sleep_schedule'))
-                        setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
+                        setTitle(scenario.status == 'OG' ? t('health.sleep_log') : t('health.sleep_schedule'))
+                        // setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
                     }
                     }
                     break;
                     break;
                 case 'ACTIVE':
                 case 'ACTIVE':
                     {
                     {
                         setIcon('ACTIVE')
                         setIcon('ACTIVE')
-                        setTitle(t('health.active_schedule'))
-                        setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
+                        setTitle(scenario.status == 'OG' ? t('health.active_log') : t('health.active_schedule'))
+                        // setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
                     }
                     }
                     break;
                     break;
             }
             }
-            
-            setIsOG(scenario.status == 'OG')
+
+            // setIsOG(scenario.status == 'OG')
             setShowTip(true)
             setShowTip(true)
             if (timer) {
             if (timer) {
                 clearTimeout(timer)
                 clearTimeout(timer)
@@ -236,7 +250,6 @@ export default function HeaderCircadian() {
                 }
                 }
                 if (isShow) {
                 if (isShow) {
                     setDesc(t('health.live_now'))
                     setDesc(t('health.live_now'))
-                    setLowLight(false)
                     setShowTip(true)
                     setShowTip(true)
                     if (timer) {
                     if (timer) {
                         clearTimeout(timer)
                         clearTimeout(timer)
@@ -271,6 +284,8 @@ export default function HeaderCircadian() {
                 break
                 break
         }
         }
 
 
+        console.log(isOG,icon,bgColor)
+
         return <View className='circadian_icon' style={{ backgroundColor: bgColor }}>
         return <View className='circadian_icon' style={{ backgroundColor: bgColor }}>
             {
             {
                 icon == 'DAY' && <IconDay width={rpxToPx(36)} color={MainColorType.day} />
                 icon == 'DAY' && <IconDay width={rpxToPx(36)} color={MainColorType.day} />
@@ -310,7 +325,7 @@ export default function HeaderCircadian() {
         }
         }
         return MainColorType.g02
         return MainColorType.g02
     }
     }
-    
+
 
 
     return <View className='circadian_bg' style={{ opacity: showTip ? 1 : 0 }}>
     return <View className='circadian_bg' style={{ opacity: showTip ? 1 : 0 }}>
         {
         {

+ 17 - 8
src/features/health/HistoryItem.tsx

@@ -264,7 +264,6 @@ export default function HistoryItem(props: {
         }
         }
 
 
     }
     }
-
     return <View className="history_item2" onClick={goDetail}>
     return <View className="history_item2" onClick={goDetail}>
         <View className="cell_date" >
         <View className="cell_date" >
             <View className="h42 bold" style={{ lineHeight: rpxToPx(60) + 'px' }}>{historyDate()}</View>
             <View className="h42 bold" style={{ lineHeight: rpxToPx(60) + 'px' }}>{historyDate()}</View>
@@ -296,19 +295,19 @@ export default function HistoryItem(props: {
                             })}</View>
                             })}</View>
                         }
                         }
                         {
                         {
-                            content.type == 'PIC' && <CoverList imgs={content.data} count={content.data.length}/>
+                            content.type == 'PIC' && <CoverList imgs={content.data} count={content.data.length} />
                         }
                         }
                         {
                         {
                             content.type == 'PIC_TEXT' && <Image
                             content.type == 'PIC_TEXT' && <Image
                                 style={{ width: rpxToPx(178), height: rpxToPx(178), marginRight: rpxToPx(7), flexShrink: 0 }}
                                 style={{ width: rpxToPx(178), height: rpxToPx(178), marginRight: rpxToPx(7), flexShrink: 0 }}
                                 src={content.data[0].url}
                                 src={content.data[0].url}
-                                onClick={(e)=>{
-                                    if (process.env.TARO_ENV=='weapp'){
+                                onClick={(e) => {
+                                    if (process.env.TARO_ENV == 'weapp') {
                                         e.stopPropagation()
                                         e.stopPropagation()
                                     }
                                     }
                                     Taro.previewImage({
                                     Taro.previewImage({
-                                        current:content.data[0].url,
-                                        urls:[content.data[0].url]
+                                        current: content.data[0].url,
+                                        urls: [content.data[0].url]
                                     })
                                     })
                                 }}
                                 }}
                                 mode="aspectFill" />
                                 mode="aspectFill" />
@@ -323,7 +322,7 @@ export default function HistoryItem(props: {
                                 paddingLeft: rpxToPx(17),
                                 paddingLeft: rpxToPx(17),
                                 paddingRight: 0,
                                 paddingRight: 0,
                                 paddingTop: 0,
                                 paddingTop: 0,
-                                paddingBottom:  0
+                                paddingBottom: 0
                             }}>
                             }}>
                                 <TimeTitleDesc
                                 <TimeTitleDesc
                                     className={'line3'}
                                     className={'line3'}
@@ -372,7 +371,7 @@ export default function HistoryItem(props: {
             } */}
             } */}
 
 
             {
             {
-                props.data.windows.map((item, index) => {
+                props.type != 'FAST,SLEEP' && props.data.windows.map((item, index) => {
                     return <TargetProgress key={index} showLine={index < props.data.windows.length - 1}
                     return <TargetProgress key={index} showLine={index < props.data.windows.length - 1}
                         color={getThemeColor(item.window)}
                         color={getThemeColor(item.window)}
                         showRing={props.fast_type != 'LF'}
                         showRing={props.fast_type != 'LF'}
@@ -386,6 +385,16 @@ export default function HistoryItem(props: {
                     />
                     />
                 })
                 })
             }
             }
+
+            {
+                props.type == 'FAST,SLEEP' && <TargetProgress
+                    showRing={true}
+                    doubleRing={true}
+                    first={props.data.windows[0]}
+                    second={props.data.windows[1]}
+                    canvasId={`double_${props.data.windows[0].window_range.start_timestamp}`}
+                />
+            }
             {/* <TargetProgress showLine={props.mode == 'FAST,SLEEP' && props.data.events.length > 2}
             {/* <TargetProgress showLine={props.mode == 'FAST,SLEEP' && props.data.events.length > 2}
                 color={props.mode == 'FAST,SLEEP' ? getThemeColor('FAST') : getThemeColor(health.mode)}
                 color={props.mode == 'FAST,SLEEP' ? getThemeColor('FAST') : getThemeColor(health.mode)}
                 showRing={props.fast_type != 'LF'}
                 showRing={props.fast_type != 'LF'}

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

@@ -1,15 +1,4 @@
-.timeline_item {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  padding-right: 40px;
-  position: relative;
-  padding-left: 52px;
-  background-color: #fff;
-  width: 750px;
-  box-sizing: border-box;
-  height: 172px;
-}
+
 
 
 .cell_hover {
 .cell_hover {
   background-color: #E5E5E5;
   background-color: #E5E5E5;

+ 1 - 0
src/features/health/MainHistory.tsx

@@ -406,6 +406,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                 index={index}
                                 index={index}
                                 mode={props.type ?? health.mode}
                                 mode={props.type ?? health.mode}
                                 fast_type={props.fast_type}
                                 fast_type={props.fast_type}
+                                type={props.type}
                                 hideLine={hideLine(index)}
                                 hideLine={hideLine(index)}
                                 onClick={() => {
                                 onClick={() => {
                                     jumpPage('/_health/pages/moment_detail')
                                     jumpPage('/_health/pages/moment_detail')

+ 7 - 0
src/pages/account/PhotoWall.tsx

@@ -8,6 +8,7 @@ import ListFooter from "@/_health/components/list_footer";
 import Layout from "@/components/layout/layout";
 import Layout from "@/components/layout/layout";
 import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
 import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
 import NoRecord from "@/_health/components/no_record";
 import NoRecord from "@/_health/components/no_record";
+import { useTranslation } from "react-i18next";
 
 
 let useRoute;
 let useRoute;
 let useNavigation;
 let useNavigation;
@@ -32,6 +33,8 @@ export default function PhotoWall() {
     const [loading, setLoading] = useState(false)
     const [loading, setLoading] = useState(false)
     const [loaded, setLoaded] = useState(false)
     const [loaded, setLoaded] = useState(false)
 
 
+    const {t} = useTranslation()
+
     let router
     let router
     let navigation;
     let navigation;
     if (useNavigation) {
     if (useNavigation) {
@@ -47,6 +50,9 @@ export default function PhotoWall() {
 
 
     useEffect(() => {
     useEffect(() => {
         refresh()
         refresh()
+        Taro.setNavigationBarTitle({
+            title:t('health.photo_wall')
+        })
         // getAlbumsData(router.params.window)
         // getAlbumsData(router.params.window)
     }, [])
     }, [])
 
 
@@ -87,6 +93,7 @@ export default function PhotoWall() {
             // setList(array)
             // setList(array)
             setLoaded(true)
             setLoaded(true)
             setLoading(false)
             setLoading(false)
+            setTriggered(false)
             if (page == 1) {
             if (page == 1) {
                 setTotal((res as any).total)
                 setTotal((res as any).total)
                 setList(array)
                 setList(array)