leon 1 年之前
父節點
當前提交
86810195fe

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

@@ -454,7 +454,7 @@ export default function FastSleepCard(props: { step: number, data: any }) {
                     var img: any = null
                     if (status == 'WFS') {
                         type = StatusType.normal
-                        color = 'transparent'
+                        // color = 'trsansparent'
                         img = <IconCircle width={rpxToPx(26)} color={MainColorType.fast} />
                     }
                     else if (status == 'OG1') {

+ 2 - 2
src/_health/components/schedule_move_list.tsx

@@ -51,6 +51,7 @@ export default function ScheduleMoveList(props: { array: any, itemHeight: number
         setMovaleViewY(e.target.offsetTop)
         setCanScroll(false)
         setHiddenContent(true)
+        console.log(e.target.offsetTop)
     }
 
     function touchMove(e) {
@@ -63,7 +64,6 @@ export default function ScheduleMoveList(props: { array: any, itemHeight: number
 
             let targetIndex = computeFutureIndex(targetMoveDistance, dragIndex)
             if (targetIndex !== false && targetIndex != changedIndex) {
-                debugger
                 var temps = swapListItems(list, targetIndex, changedIndex)
                 setList(temps)
                 setChangedIndex(targetIndex)
@@ -153,7 +153,7 @@ export default function ScheduleMoveList(props: { array: any, itemHeight: number
         }
     }
 
-    return <View id="myScrollView" ref={ref} style={{ height: '100%', overflow: canScroll ? 'scroll' : 'hidden' }} catchMove>
+    return <View id="myScrollView" ref={ref} style={{ height: '100%', overflow: canScroll ? 'scroll' : 'hidden',position:'relative' }} catchMove>
         <MovableArea style={{ height: list.length * props.itemHeight, width: rpxToPx(700) }}>
             <View>
                 {

+ 72 - 31
src/_health/pages/active_plan.tsx

@@ -9,6 +9,12 @@ import { getLabelsEvent, getSchedules } from "@/services/health";
 import { useSelector } from "react-redux";
 import Taro from "@tarojs/taro";
 import NewHeader, { NewHeaderType } from "../components/new_header";
+import StatusIndicator, { StatusType } from "../base/status_indicator";
+import { MainColorType } from "@/context/themes/color";
+import { rpxToPx } from "@/utils/tools";
+import Card from "../components/card";
+import NewButton, { NewButtonType } from "../base/new_button";
+import { IconAdd } from "@/components/basic/Icons";
 
 let useRoute;
 let useNavigation;
@@ -64,35 +70,81 @@ export default function ActivePlan() {
     return <View style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>
         <NewHeader
             type={NewHeaderType.left_subtitle}
-            title="Plan my daily life"
-            subtitle="Header: List top 3 activities that matter most to me/I want to practice to every day"
+            title={list.length == 0 ? "Plan my daily life" : 'Create my list'}
+            subtitle={list.length == 0 ? "Header: List top 3 activities that matter most to me/I want to practice to every day" : 'Top 3'}
         />
         {
-            list.length == 0 && <View className="plan_item" onClick={tapEdit}>
-                <Text>1</Text>
-                <Text style={{ flex: 1 }}>{schedule.title}</Text>
-                <Text style={{ color: getThemeColor('ACTIVE') }}>Tap to customize</Text>
-                <View className="border_footer_line" />
-            </View>
+            list.length == 0 && <Card>
+                <View className="plan_item" onClick={tapEdit}>
+                    <StatusIndicator
+                        type={StatusType.normal}
+                        color={MainColorType.active}
+                        fontSize={rpxToPx(34)}
+                        text={schedule.title} />
+                    <View style={{ flex: 1 }} />
+                    <Text style={{ color: getThemeColor('ACTIVE') }}>Tap to customize</Text>
+                    <View className="border_footer_line" />
+                </View>
+            </Card>
         }
         {
-            list.map((item, index) => {
-                return <View className="plan_item" key={index}>
-                    <Text>{1 + index}</Text>
-                    <Text style={{ flex: 1 }}>{item.title}</Text>
-                    <Text>{item.time ? item.time : item.time_label}</Text>
-                    <View className="border_footer_line" />
+            list.length > 0 && <Card>
+                <View style={{ display: 'flex', flexDirection: 'column' }}>
+                    {
+                        list.map((item, index) => {
+                            return <View className="plan_item" key={index}>
+                                <StatusIndicator
+                                    type={StatusType.normal}
+                                    color={MainColorType.active}
+                                    fontSize={rpxToPx(34)}
+                                    text={item.title} />
+                                <View style={{ flex: 1 }} />
+                                <Text>{item.time ? item.time : item.time_label}</Text>
+                                <View className="border_footer_line" style={{ left: rpxToPx(64) }} />
+                            </View>
+                        })
+                    }
+                    {
+                        list.length > 0 && list.length < 3 && <View className="plan_item" onClick={tapEdit}>
+                            {/* <Text style={{ color: getThemeColor('ACTIVE') }}>+</Text> */}
+                            <StatusIndicator
+                                type={StatusType.img}
+                                color={MainColorType.active}
+                                fontSize={rpxToPx(34)}
+                                fontColor={MainColorType.active}
+                                text='Daily Activity'>
+                                <IconAdd width={rpxToPx(26)} color="#fff" />
+                            </StatusIndicator>
+                            {/* <Text style={{ flex: 1, color: getThemeColor('ACTIVE') }}>Daily Activity</Text> */}
+                            {/* <View className="border_footer_line" /> */}
+                        </View>
+                    }
                 </View>
-            })
+            </Card>
         }
         {
-            list.length > 0 && list.length < 3 && <View className="plan_item" onClick={tapEdit}>
-                <Text style={{ color: getThemeColor('ACTIVE') }}>+</Text>
-                <Text style={{ flex: 1, color: getThemeColor('ACTIVE') }}>Daily Activity</Text>
-                <View className="border_footer_line" />
+            list.length > 0 && <View className="h24" style={{
+                marginLeft: rpxToPx(52), marginTop: rpxToPx(10),
+                color: list.length == 3 ? MainColorType.active : MainColorType.g02
+            }}>Support up to 3 daily recurring activities</View>
+        }
+
+        {
+            list.length > 0 && <View className="main_footer">
+                <NewButton
+                    type={NewButtonType.fill}
+                    title="完成"
+                    color={MainColorType.active}
+                    width={rpxToPx(646)}
+                    height={rpxToPx(96)}
+                    onClick={() => {
+                        Taro.navigateBack()
+                    }}
+                />
             </View>
         }
 
+
         {
             showModal && <AddLabel
                 labels={labels}
@@ -105,17 +157,6 @@ export default function ActivePlan() {
         }
 
 
-        {/* {
-            showModal && <Modal testInfo={null}
-                dismiss={() => {
-                    setShowModal(false)
-                }}
-                confirm={() => { }}>
-                <AddLabel labels={labels} defaultValue={list.length==0?schedule.title:''} disMiss={() => {
-                    setShowModal(false)
-                    getDatas()
-                }} />
-            </Modal>
-        } */}
+
     </View>
 }

+ 8 - 0
src/_health/pages/archive.config.ts

@@ -0,0 +1,8 @@
+export default definePageConfig({
+    usingComponents: {
+        // 'ec-canvas': '../../lib/ec-canvas/ec-canvas',
+        // 'demo':'../../components/demo'
+    },
+    "navigationBarTitleText": "",
+    "navigationBarBackgroundColor": "#ffffff"
+})

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

@@ -1,10 +1,17 @@
 import HistoryItem from "@/features/health/HistoryItem";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import { records } from "@/services/health";
-import { View,Text } from "@tarojs/components";
+import { View, Text } from "@tarojs/components";
 import { useEffect, useRef, useState } from "react";
 import { useSelector } from "react-redux";
 import ListFooter from "../components/list_footer";
+import Taro from "@tarojs/taro";
+import { rpxToPx } from "@/utils/tools";
+import NewButton, { NewButtonType } from "../base/new_button";
+import { getThemeColor } from "@/features/health/hooks/health_hooks";
+import StatusIndicator, { StatusType } from "../base/status_indicator";
+import { MainColorType } from "@/context/themes/color";
+import { IconCheck, IconCircle } from "@/components/basic/Icons";
 
 export default function Archive() {
     const [list, setList] = useState<any>([])
@@ -13,16 +20,29 @@ export default function Archive() {
     const [loaded, setLoaded] = useState(false)
     const refDemo = useRef()
     const health = useSelector((state: any) => state.health);
+    const [showNote, setShowNote] = useState(false)
+    const [checked, setChecked] = useState(false)
 
 
-    global.refreshHistory = () => {
+    global.refreshArchiveHistory = () => {
         refresh()
     }
 
 
     useEffect(() => {
         loadData(1)
+        Taro.setNavigationBarTitle({
+            title: 'Archive'
+        })
 
+        Taro.getStorage({
+            key: 'hideArchiveNote',
+            success(result) {
+            }, fail: function (err) {
+                debugger
+                setShowNote(true)
+            }
+        })
 
     }, [])
 
@@ -47,47 +67,177 @@ export default function Archive() {
             archived: true
         }).then(res => {
             setLoaded(true)
+
+            var array = (res as any).data
+
+            array.map(item => {
+                var temps: any = []
+                var lastType = ''
+                var lastTextArray: any = []
+                var lastImageArray: any = []
+                item.events.map(event => {
+                    event.moments && event.moments.map(moment => {
+                        switch (moment.type) {
+                            case 'TEXT':
+                                {
+                                    lastTextArray.push({
+                                        title: moment.title,
+                                        description: moment.description
+                                    })
+                                    if (lastType == 'PIC') {
+                                        temps.push({
+                                            type: 'PIC',
+                                            data: JSON.parse(JSON.stringify(lastImageArray))
+                                        })
+                                        lastImageArray = []
+                                    }
+                                    lastType = 'TEXT'
+                                }
+                                break;
+                            case 'PIC':
+                                {
+                                    lastImageArray.push(moment.media[0].url)
+                                    if (lastType == 'TEXT') {
+                                        temps.push({
+                                            type: 'TEXT',
+                                            data: JSON.parse(JSON.stringify(lastTextArray))
+                                        })
+                                        lastTextArray = []
+                                    }
+                                    lastType = 'PIC'
+                                }
+                                break;
+                            case 'PIC_TEXT':
+                                if (lastType == 'PIC') {
+                                    temps.push({
+                                        type: 'PIC',
+                                        data: JSON.parse(JSON.stringify(lastImageArray))
+                                    })
+                                    lastImageArray = []
+                                }
+                                if (lastType == 'TEXT') {
+                                    temps.push({
+                                        type: 'TEXT',
+                                        data: JSON.parse(JSON.stringify(lastTextArray))
+                                    })
+                                    lastTextArray = []
+                                }
+                                temps.push({
+                                    type: 'PIC_TEXT',
+                                    data: [
+                                        {
+                                            title: moment.title,
+                                            description: moment.description,
+                                            url: moment.media[0].url
+                                        }
+                                    ]
+                                })
+                                lastType = 'PIC_TEXT'
+                                break;
+                        }
+                    })
+                })
+
+                if (lastType == 'PIC') {
+                    temps.push({
+                        type: 'PIC',
+                        data: JSON.parse(JSON.stringify(lastImageArray))
+                    })
+                    lastImageArray = []
+                }
+                if (lastType == 'TEXT') {
+                    temps.push({
+                        type: 'TEXT',
+                        data: JSON.parse(JSON.stringify(lastTextArray))
+                    })
+                    lastTextArray = []
+                }
+
+                item.dataArray = temps;
+            })
+
             if (index == 1) {
-                setList((res as any).data)
+                setList(array)
                 setTotal((res as any).total)
             }
             else {
-                setList([...list, ...(res as any).data])
+                setList([...list, ...array])
             }
 
-            // if ((res as any).data.length > 0) {
-            //     setTimeout(() => {
-            //         const query = Taro.createSelectorQuery();
-            //         query.select(('#demo1')).boundingClientRect((rect) => {
-            //             console.log(rect)
-            //         }).exec();
-            //     }, 1000)
-            // }
 
         })
     }
 
+    function note() {
+        if (!showNote) return <View />
+        return <View style={{
+            paddingTop: rpxToPx(32),
+            paddingLeft: rpxToPx(40),
+            paddingRight: rpxToPx(40),
+            paddingBottom: rpxToPx(16),
+            display: 'flex',
+            flexDirection: 'column',
+            boxSizing: 'border-box'
+        }}>
+            <View className="h26">档案存储了某一天中含有不完整条目的记录。如果您已完成当天所有[餐食/活动]记录,请将该记录“标记为完成”。</View>
+            <View style={{
+                display: 'flex',
+                flexDirection: 'row',
+                justifyContent: 'space-between',
+                alignItems: 'center',
+                marginTop: rpxToPx(24)
+            }}>
+                <View onClick={() => {
+                    setChecked(!checked)
+                }}>
+                    <StatusIndicator
+                        type={StatusType.img}
+                        color={checked ? MainColorType.g02 : 'transparent'}
+                        text="不再显示"
+                        fontColor={MainColorType.g02}
+                        fontSize={rpxToPx(24)}
+                    >
+                        {
+                            checked ? <IconCheck width={rpxToPx(26)} height={rpxToPx(26)} color={MainColorType.white} /> :
+                                <IconCircle width={rpxToPx(26)} color={MainColorType.g02} />
+                        }
+                    </StatusIndicator>
+                </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',
+                        alignItems: 'center',
+                        justifyContent: 'center'
+                    }}>知道了</View>
+            </View>
+        </View>
+    }
+
     if (!loaded)
         return <View />
     return <View>
+        {
+            note()
+        }
         {
             list.map((item, index) => {
                 return <View ref={refDemo} id="demo1" key={index}>
-                    <HistoryItem type="archive" data={item} preData={index==0?null:list[index-1]} index={index} isArchived={true} mode={health.mode} onClick={() => {
+                    <HistoryItem type="archive" data={item} preData={index == 0 ? null : list[index - 1]} index={index} isArchived={true} mode={health.mode} onClick={() => {
                         jumpPage('/_health/pages/moment_detail')
-                    }} refresh={refresh}/>
-                    {/* {
-                        props.type == 'EAT' && <HistoryEatItem data={item} index={index} />
-                    }
-                    {
-                        props.type == 'FAST' && <HistoryFastItem data={item} index={index} />
-                    }
-                    {
-                        props.type == 'ACTIVE' && <HistoryActiveItem data={item} index={index} />
-                    }
-                    {
-                        props.type == 'SLEEP' && <HistorySleepItem data={item} index={index} />
-                    } */}
+                    }} refresh={refresh} />
                 </View>
             })
         }

+ 3 - 3
src/_health/pages/move.tsx

@@ -13,7 +13,7 @@ import dayjs from "dayjs";
 import { TimeFormatter } from "@/utils/time_format";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import { rpxToPx } from "@/utils/tools";
-import { IconMore, IconSit, IconWalk } from "@/components/basic/Icons";
+import { IconActive, IconMore, IconSit } from "@/components/basic/Icons";
 import NewHeader, { NewHeaderType } from "../components/new_header";
 import NewButton, { NewButtonType } from "../base/new_button";
 import { MainColorType } from "@/context/themes/color";
@@ -442,7 +442,7 @@ export default function Move() {
                 item.status == 'SEDENTARY' && <IconSit width={rpxToPx(44)} color={MainColorType.g02} />
             }
             {
-                item.status == 'ACTIVE' && <IconWalk width={rpxToPx(44)} color={MainColorType.active} />
+                item.status == 'ACTIVE' && <IconActive width={rpxToPx(44)} color={MainColorType.active} />
             }
             <View className="border_footer_line" />
         </View>
@@ -873,7 +873,7 @@ export default function Move() {
                                     <View className="h24 bold" style={{ marginLeft: rpxToPx(6), marginTop: rpxToPx(13), lineHeight: rpxToPx(47) + 'px' }}>{historyMonth(item,index)}</View>
                                 </View>
                                 <View className="history_item_detail_bg">
-                                    <IconWalk width={rpxToPx(32)} color={MainColorType.active} />
+                                    <IconActive width={rpxToPx(32)} color={MainColorType.active} />
                                     <Text style={{ fontSize: rpxToPx(26), marginLeft: rpxToPx(16) }}> Hours Active {item.active_hours} · Total Steps {item.stat.real_steps}</Text>
                                 </View>
                                 {/* <View className="border_footer_line" /> */}

+ 2 - 2
src/_health/pages/move_detail.tsx

@@ -10,7 +10,7 @@ import NewHeader, { NewHeaderType } from "../components/new_header";
 import NewButton, { NewButtonType } from "../base/new_button";
 import { MainColorType } from "@/context/themes/color";
 import ListFooter from "../components/list_footer";
-import { IconSit, IconWalk } from "@/components/basic/Icons";
+import { IconActive, IconSit } from "@/components/basic/Icons";
 
 let useRoute;
 let useNavigation;
@@ -141,7 +141,7 @@ export default function MoveDetail() {
                 item.status == 'SEDENTARY' && <IconSit width={rpxToPx(44)} color={MainColorType.g02}/>
             }
             {
-                item.status == 'ACTIVE' && <IconWalk width={rpxToPx(44)} color={MainColorType.active}/>
+                item.status == 'ACTIVE' && <IconActive width={rpxToPx(44)} color={MainColorType.active}/>
             }
             <View className="border_footer_line" />
         </View>

+ 2 - 2
src/_health/pages/post_result.tsx

@@ -4,7 +4,7 @@ import './post_result.scss'
 import { getThemeColor } from "@/features/health/hooks/health_hooks";
 import { rpxToPx } from "@/utils/tools";
 import NewButton, { NewButtonType } from "../base/new_button";
-import { IconCheck, IconNotification, IconNotificationOff, IconSit, IconWalk } from "@/components/basic/Icons";
+import { IconActive, IconCheck, IconNotification, IconNotificationOff, IconSit } from "@/components/basic/Icons";
 import { MainColorType } from "@/context/themes/color";
 import { useState } from "react";
 import dayjs from "dayjs";
@@ -130,7 +130,7 @@ export default function PostResult() {
         }
 
         if (data.scenario == 'MOVE') {
-            return data.extra.move_status == 'ACTIVE' ?<IconWalk width={rpxToPx(128)} color={MainColorType.active}/>:<IconSit width={rpxToPx(128)} color={MainColorType.g02}/>
+            return data.extra.move_status == 'ACTIVE' ?<IconActive width={rpxToPx(128)} color={MainColorType.active}/>:<IconSit width={rpxToPx(128)} color={MainColorType.g02}/>
         }
         return <View className="result_icon_bg" style={{ backgroundColor: getMainColor() }}>
             <IconCheck color="#fff" width={rpxToPx(88)} height={rpxToPx(88)} />

+ 27 - 3
src/_health/pages/timeline_detail.tsx

@@ -8,7 +8,7 @@ import dayjs from "dayjs";
 import { getThemeColor } from "@/features/health/hooks/health_hooks";
 import { baseUrl } from "@/services/http/api";
 import { checkAuthorized } from "@/utils/check_authorized";
-import { createMoment, delEvents, delRecord, getEvents, getRecordDetail } from "@/services/health";
+import { createMoment, delEvents, delRecord, getEvents, getRecordDetail, makeDone } from "@/services/health";
 import NewButton, { NewButtonType } from "../base/new_button";
 import { IconClose } from "@/components/basic/Icons";
 import { rpxToPx } from "@/utils/tools";
@@ -311,21 +311,45 @@ export default function TimelineDetail() {
         })
     }
 
+    function tapMarkdone(){
+        makeDone(window_id).then(res=>{
+            Taro.showToast({
+                title:'操作成功',
+                icon:'none'
+            })
+            getDatas()
+            global.refreshHistory()
+            if (global.refreshArchiveHistory){
+                global.refreshArchiveHistory()
+            }
+        })
+    }
+
     function tapMore() {
+        var list: any = []
         if (window_id) {
+            if (detail.archived){
+                list = ['删除','Mark Done']
+            }
+            else {
+                list = ['删除']
+            }
             showActionSheet({
                 showActionSheetWithOptions: showActionSheetWithOptions,
                 title: t('health.more_actions'),
-                itemList: ['删除'],
+                itemList: list,
                 success: (res) => {
                     if (res == 0) {
                         delHistory()
                     }
+                    else if (res == 1){
+                        tapMarkdone()
+                    }
                 }
             })
             return
         }
-        var list: any = []
+        
         if (health.mode != 'ACTIVE' && health.mode != 'EAT') {
             list = ['删除']
         }

File diff suppressed because it is too large
+ 0 - 1
src/components/basic/Icons.tsx


+ 13 - 3
src/context/locales/en.js

@@ -890,9 +890,19 @@ export default {
         nighttime:'Nighttime',
         switch_to:'Switch to {{scenario}}',
 
-        live_now:'LIVE NOW',
-        next_up:'NEXT UP',
-        in_progress:'IN PROGRESS',
+        live_now:'Live Now',
+        next_up:'Up Next',
+        in_progress:'In Progress',
+
+        fasting_log:'Fasting Log',
+        meal_log:'Meal Log',
+        active_log:'Activity Log',
+        sleep_log:'Sleep Log',
+
+        fasting_schedule:'Fasting Schedule',
+        eating_schedule:'Eating Schedule',
+        active_schedule:'Activity Schedule',
+        sleep_schedule:'Sleep Schedule',
 
         faststreak: 'Faststreak',
         eatstreak: 'Eatstreak',

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

@@ -889,9 +889,19 @@ export default {
         nighttime:'夜晚',
         switch_to: '切换到{{scenario}}',
 
-        live_now:'当前',
+        live_now:'正在进行',
         next_up:'接下来',
-        in_progress:'计时中',
+        in_progress:'进行中',
+
+        fasting_log:'断食记录',
+        meal_log:'饮食记录',
+        active_log:'活动记录',
+        sleep_log:'睡眠记录',
+
+        fasting_schedule:'断食日程',
+        eating_schedule:'进食日程',
+        active_schedule:'活动日程',
+        sleep_schedule:'睡眠日程',
 
         faststreak: '连续断食记录',
         eatstreak: '连续进食记录',

+ 15 - 7
src/features/health/HeaderCircadian.scss

@@ -4,32 +4,40 @@
     flex-direction: row;
     border-radius: 44px;
     background-color: #000;
-    padding-left: 26px;
-    padding-right: 60px;
-    align-items: center;
+    padding-left: 18px;
+    padding-right: 45px;
 }
 
 .circadian_icon {
-    width: 36px;
-    height: 36px;
-    margin-right: 30px;
+    width: 52px;
+    height: 52px;
+    border-radius: 26px;
+    margin-top: 18px;
+    margin-right: 3px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
 }
 
 .circadian_content {
     display: flex;
     flex-direction: column;
     align-items: center;
-    justify-content: center;
 }
 
 .circadian_name {
     color: #fff;
     font-weight: bold;
     font-size: 28px;
+    margin-top: 12px;
+    line-height: 34px;
 }
 
 .circadian_status {
     color: #999999;
     font-weight: bold;
     font-size: 20px;
+    line-height: 24px;
+    margin-top: 4px;
+
 }

+ 122 - 55
src/features/health/HeaderCircadian.tsx

@@ -6,6 +6,9 @@ import { setShowActionTip } from '@/store/health';
 import { getScenario } from './hooks/health_hooks';
 import dayjs from 'dayjs';
 import { useTranslation } from 'react-i18next';
+import { rpxToPx } from '@/utils/tools';
+import { IconActive, IconDay, IconEat, IconFast, IconNight, IconSleep } from '@/components/basic/Icons';
+import { MainColorType } from '@/context/themes/color';
 
 let lauchShow = false
 let timer;
@@ -14,11 +17,14 @@ export default function HeaderCircadian() {
     const dispatch = useDispatch()
     const [showTip, setShowTip] = useState(false)
 
-    const [icon, setIcon] = useState(require('@assets/_health/sun.png'))
+    const [icon, setIcon] = useState('DAY')
     const [title, setTitle] = useState('')
     const [desc, setDesc] = useState('')
     const [lowLight, setLowLight] = useState(false)
-    const {t} = useTranslation()
+    const [isOG, setIsOG] = useState(false)
+    const { t } = useTranslation()
+
+    const kWidth = global.language == 'en' ? rpxToPx(236) : rpxToPx(176)
 
     useEffect(() => {
         if (health && health.windows && !lauchShow) {
@@ -37,6 +43,8 @@ export default function HeaderCircadian() {
             // lauchShow = true
             const scenario = getScenario(health.windows, health.mode)
             if (scenario.real || scenario.status == 'OG') {
+                setIcon(scenario.window)
+                setIsOG(true)
                 dispatch(setShowActionTip({
                     isShow: false,
                     isCompleted: false
@@ -49,28 +57,27 @@ export default function HeaderCircadian() {
                     }))
                 }, 50)
 
-                return;
-            }
-            else if (scenario.status == 'DONE') {
-                dispatch(setShowActionTip({
-                    isShow: false,
-                    isCompleted: false
-                }))
-
-                setTimeout(() => {
-                    dispatch(setShowActionTip({
-                        isShow: true,
-                        isCompleted: true
-                    }))
-                }, 50)
+                switch(health.mode){
+                    case 'FAST':
+                        setTitle(t('health.fasting_log'))
+                        break
+                    case 'EAT':
+                        setTitle(t('health.meal_log'))
+                        break
+                    case 'SLEEP':
+                        setTitle(t('health.sleep_log'))
+                        break
+                    case 'ACTIVE':
+                        setTitle(t('health.active_log'))
+                        break
+                }
 
-                return
+                return;
             }
             else {
 
                 if (new Date().getTime() >= scenario.target.start_timestamp && new Date().getTime() < scenario.target.end_timestamp) {
-                    const scenario = getScenario(health.windows, health.mode)
-                    setDesc(scenario.status=='OG'?t('health.in_progress'):t('health.live_now'))
+                    setDesc( t('health.live_now'))
                     setLowLight(false)
                 }
                 else {
@@ -81,48 +88,49 @@ export default function HeaderCircadian() {
             switch (health.mode) {
                 case 'FAST':
                     {
-                        setIcon(require('@assets/_health/fast.png'))
-                        setTitle(t('health.fasting'))
+                        setIcon('FAST')
+                        setTitle(t('health.fasting_schedule'))
                         // setDesc(health.isCompleted ? 'COMPLETED' : 'IN PROGRESS')
                     }
                     break;
                 case 'EAT':
                     {
-                        setIcon(require('@assets/_health/eat.png'))
-                        setTitle(t('health.eating'))
+                        setIcon('EAT')
+                        setTitle(t('health.eating_schedule'))
                         // setDesc(health.isCompleted ? 'COMPLETED' : 'IN PROGRESS')
                     }
                     break;
                 case 'SLEEP':
                     {
-                        setIcon(require('@assets/_health/sleep.png'))
-                        setTitle(t('health.sleep'))
+                        setIcon('SLEEP')
+                        setTitle(t('health.sleep_schedule'))
                         // setDesc(health.isCompleted ? 'COMPLETED' : 'IN PROGRESS')
                     }
                     break;
                 case 'ACTIVE':
                     {
-                        setIcon(require('@assets/_health/active.png'))
-                        setTitle(t('health.active'))
+                        setIcon('ACTIVE')
+                        setTitle(t('health.active_schedule'))
                         // setDesc(health.isCompleted ? 'COMPLETED' : 'IN PROGRESS')
                     }
                     break;
                 case 'DAY':
                     {
-                        setIcon(require('@assets/_health/sun.png'))
+                        setIcon('DAY')
                         setTitle(t('health.daytime'))
                         // setDesc(health.isCompleted ? 'COMPLETED' : 'IN PROGRESS')
                     }
                     break;
                 case 'NIGHT':
                     {
-                        setIcon(require('@assets/_health/moon.png'))
+                        setIcon('NIGHT')
                         setTitle(t('health.nighttime'))
                         // setDesc(health.isCompleted ? 'COMPLETED' : 'IN PROGRESS')
                     }
                     break;
             }
-
+            
+            setIsOG(false)
             setShowTip(true)
             if (timer) {
                 clearTimeout(timer)
@@ -137,37 +145,39 @@ export default function HeaderCircadian() {
     useEffect(() => {
         if (health.showActionCircadian) {
             setLowLight(false)
+            const scenario = getScenario(health.windows,health.mode)
             switch (health.mode) {
                 case 'FAST':
                     {
-                        setIcon(require('@assets/_health/fast.png'))
-                        setTitle(t('health.fasting'))
+                        setIcon('FAST')
+                        setTitle(t('health.fasting_schedule'))
                         setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
                     }
                     break;
                 case 'EAT':
                     {
-                        setIcon(require('@assets/_health/eat.png'))
-                        setTitle(t('health.eating'))
+                        setIcon('EAT')
+                        setTitle(t('health.eating_schedule'))
                         setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
                     }
                     break;
                 case 'SLEEP':
                     {
-                        setIcon(require('@assets/_health/sleep.png'))
-                        setTitle(t('health.sleep'))
+                        setIcon('SLEEP')
+                        setTitle(t('health.sleep_schedule'))
                         setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
                     }
                     break;
                 case 'ACTIVE':
                     {
-                        setIcon(require('@assets/_health/active.png'))
-                        setTitle(t('health.active'))
+                        setIcon('ACTIVE')
+                        setTitle(t('health.active_schedule'))
                         setDesc(health.isCompleted ? 'COMPLETED' : t('health.in_progress'))
                     }
                     break;
             }
-
+            
+            setIsOG(scenario.status == 'OG')
             setShowTip(true)
             if (timer) {
                 clearTimeout(timer)
@@ -196,33 +206,33 @@ export default function HeaderCircadian() {
                 var isShow = false
                 if (dayjs(day.target.start_timestamp).format('YYYY-MM-DD HH:mm:ss') == now) {
                     isShow = true;
-                    setIcon(require('@assets/_health/sun.png'))
+                    setIcon('DAY')
                     setTitle(t('health.daytime'))
                 }
                 else if (dayjs(night.target.start_timestamp).format('YYYY-MM-DD HH:mm:ss') == now) {
                     isShow = true;
-                    setIcon(require('@assets/_health/moon.png'))
+                    setIcon('NIGHT')
                     setTitle(t('health.nighttime'))
                 }
                 else if (dayjs(fast.target.start_timestamp).format('YYYY-MM-DD HH:mm:ss') == now) {
                     isShow = true;
-                    setIcon(require('@assets/_health/fast.png'))
-                    setTitle(t('health.fasting'))
+                    setIcon('FAST')
+                    setTitle(t('health.fasting_schedule'))
                 }
                 else if (dayjs(eat.target.start_timestamp).format('YYYY-MM-DD HH:mm:ss') == now) {
                     isShow = true;
-                    setIcon(require('@assets/_health/eat.png'))
-                    setTitle(t('health.eating'))
+                    setIcon('EAT')
+                    setTitle(t('health.eating_schedule'))
                 }
                 else if (dayjs(sleep.target.start_timestamp).format('YYYY-MM-DD HH:mm:ss') == now) {
                     isShow = true;
-                    setIcon(require('@assets/_health/sleep.png'))
-                    setTitle(t('health.sleep'))
+                    setIcon('SLEEP')
+                    setTitle(t('health.sleep_schedule'))
                 }
                 else if (dayjs(active.target.start_timestamp).format('YYYY-MM-DD HH:mm:ss') == now) {
                     isShow = true;
-                    setIcon(require('@assets/_health/active.png'))
-                    setTitle(t('health.active'))
+                    setIcon('ACTIVE')
+                    setTitle(t('health.active_schedule'))
                 }
                 if (isShow) {
                     setDesc(t('health.live_now'))
@@ -240,19 +250,76 @@ export default function HeaderCircadian() {
                         }))
                     }, 3000)
                 }
-
             }
+        }, 1000)
+    }, [])
 
+    function leftIcon() {
+        var bgColor = 'transparent'
+        switch (icon) {
+            case 'FAST':
+                if (isOG) bgColor = MainColorType.fast
+                break
+            case 'EAT':
+                if (isOG) bgColor = MainColorType.eat
+                break
+            case 'SLEEP':
+                if (isOG) bgColor = MainColorType.sleep
+                break
+            case 'ACTIVE':
+                if (isOG) bgColor = MainColorType.active
+                break
+        }
 
+        return <View className='circadian_icon' style={{ backgroundColor: bgColor }}>
+            {
+                icon == 'DAY' && <IconDay width={rpxToPx(36)} color={MainColorType.day} />
+            }
+            {
+                icon == 'NIGHT' && <IconNight width={rpxToPx(36)} color={MainColorType.night} />
+            }
+            {
+                icon == 'FAST' && <IconFast width={rpxToPx(36)} color={isOG ? MainColorType.black : MainColorType.fast} />
+            }
+            {
+                icon == 'SLEEP' && <IconSleep width={rpxToPx(36)} color={isOG ? MainColorType.black : MainColorType.sleep} />
+            }
+            {
+                icon == 'EAT' && <IconEat width={rpxToPx(36)} color={isOG ? MainColorType.black : MainColorType.eat} />
+            }
+            {
+                icon == 'ACTIVE' && <IconActive width={rpxToPx(36)} color={isOG ? MainColorType.black : MainColorType.active} />
+            }
+        </View>
+    }
 
-        }, 1000)
-    }, [])
+    function contentColor() {
+        switch (icon) {
+            case 'FAST':
+                if (isOG) return MainColorType.fast
+                break
+            case 'EAT':
+                if (isOG) return MainColorType.eat
+                break
+            case 'SLEEP':
+                if (isOG) return MainColorType.sleep
+                break
+            case 'ACTIVE':
+                if (isOG) return MainColorType.active
+                break
+        }
+        return MainColorType.g02
+    }
+    
 
     return <View className='circadian_bg' style={{ opacity: showTip ? 1 : 0 }}>
-        <Image src={icon} className='circadian_icon' style={{ opacity: lowLight ? 0.7 : 1.0 }} />
-        <View className='circadian_content'>
+        {
+            leftIcon()
+        }
+        {/* <Image src={icon} className='circadian_icon' style={{ opacity: lowLight ? 0.7 : 1.0 }} /> */}
+        <View className='circadian_content' style={{ width: kWidth }}>
             <View className='circadian_name'>{title}</View>
-            <View className='circadian_status'>{desc}</View>
+            <View className='circadian_status' style={{ color: contentColor() }}>{desc}</View>
         </View>
     </View>
 }

+ 3 - 11
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, IconCircle, IconClose, IconMiss, IconMore, IconNotification, IconNotificationOff, IconSwitch, IconWalk } from "@/components/basic/Icons";
+import { IconActive, IconArrow, IconCircle, IconClose, IconMiss, IconMore, IconNotification, IconNotificationOff, IconSwitch } from "@/components/basic/Icons";
 import DurationPicker from "@/_health/components/duration_picker";
 import Taro from "@tarojs/taro";
 import { systemLocation } from "@/services/common";
@@ -633,6 +633,7 @@ export default function MainConsole(props: { type: WindowType }) {
         return <View>
             {
                 list.map((item, index) => {
+
                     return timelineItem(item, index, list.length)
                 })
             }
@@ -840,17 +841,14 @@ export default function MainConsole(props: { type: WindowType }) {
         <View className="main_summary">
             <View className="main_summary_time h30 bold" style={{
                 marginTop: rpxToPx(14),
-                // color: getTitleColor()
             }} >
                 {polarCheck()}
                 {getScenario(health.windows, health.mode).status == 'OG' ? ogTime() : getDuration(health.windows, health.mode)}
             </View>
             <Text className="main_summary_duration g01"
                 style={{
-                    // color: getWindowStatus(health.windows, health.mode) == WindowStatusType.upcoming ? MainColorType.g02 : MainColorType.g01,
                     marginBottom: rpxToPx(30)
                 }}>{getScenario(health.windows, health.mode).status == 'OG' ? getDuration(health.windows, health.mode) : getCountownTime(health.windows, health.mode)}
-                {/* {getScenario(health.windows, health.mode).status == 'OG' ? ' (' + t('health.logging') + ')' : ''} */}
             </Text>
             <View className="border_footer_line" />
         </View>
@@ -858,12 +856,6 @@ export default function MainConsole(props: { type: WindowType }) {
             {
                 detail()
             }
-            {/* {
-                health.mode == 'ACTIVE' && <View onClick={() => {
-                    var list = getScenario(health.windows, health.mode).timeline
-                    jumpPage('/_health/pages/active_plan?schedule=' + JSON.stringify(list.length > 0 ? list[0] : '{}'))
-                }}>测试</View>
-            } */}
 
         </View>
         <View className="main_footer2">
@@ -912,7 +904,7 @@ export default function MainConsole(props: { type: WindowType }) {
         {
             health.mode == 'ACTIVE' && <View>
                 <View className="main_column_space" /><IconTitleCell
-                    icon={<IconWalk width={rpxToPx(32)} color={MainColorType.active} />}
+                    icon={<IconActive width={rpxToPx(32)} color={MainColorType.active} />}
                     title={t('health.move_more')}
                     onClick={() => {
                         jumpPage('/_health/pages/move')

+ 17 - 5
src/features/health/MainFastEatCard.tsx

@@ -66,11 +66,17 @@ export default function MainFastEatCard(props: {
 
     const { fast, eat } = health.windows.fast_eat
     const t1 = new Date().getTime()
-    const isTempFast = (fast.status == 'WAIT_FOR_END' ||
-        fast.target.start_time <= t1 && fast.target.end_time >= t1) ||
-        isCurrentTimeInRange(fast.period.start_time, fast.period.end_time)
+    // const isTempFast = true
+    // const isTempFast = eat.status!='OG'&&(fast.status == 'WAIT_FOR_END' ||
+    //     fast.target.start_time <= t1 && fast.target.end_time >= t1) ||
+    //     isCurrentTimeInRange(fast.period.start_time, fast.period.end_time)
+
+    const isTempFast = eat.status != 'OG' && (isCurrentTimeInRange(fast.period.start_time, fast.period.end_time) ||
+        fast.target.start_time <= t1 && fast.target.end_time >= t1 ||
+        fast.status == 'WAIT_FOR_END'
+    )
     const [isFastMode, setIsFastMode] = useState(isTempFast)
-    const {t} = useTranslation()
+    const { t } = useTranslation()
 
 
     useEffect(() => {
@@ -85,7 +91,11 @@ export default function MainFastEatCard(props: {
     useEffect(() => {
         const { fast, eat } = health.windows.fast_eat
         var now = new Date().getTime()
-        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)) {
+        if (eat.status == 'OG') {
+            setIsFastMode(false)
+            dispatch(setMode('EAT'))
+        }
+        else 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)
             dispatch(setMode('FAST'))
         }
@@ -94,6 +104,8 @@ export default function MainFastEatCard(props: {
             dispatch(setMode('EAT'))
         }
 
+
+
         setEatData(eat)
         setFastData(fast)
 

+ 65 - 52
src/features/health/MainHistory.tsx

@@ -29,7 +29,8 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
     const health = useSelector((state: any) => state.health);
     const user = useSelector((state: any) => state.user);
     const [loading, setLoading] = useState(false)
-    const [showArchive, setShowArchive] = useState(true)
+    const [showEatArchive, setShowEatArchive] = useState(true)
+    const [showActiveArchive, setShowActiveArchive] = useState(true)
     const healthRef = useRef(health)
     const { t } = useTranslation()
 
@@ -233,7 +234,6 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                 item.dataArray = temps;
             })
 
-            debugger
 
             setLoading(false)
             setLoaded(true)
@@ -307,6 +307,51 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         return false
     }
 
+    function archiveContent() {
+        if (health.mode != 'EAT' && health.mode != 'ACTIVE') {
+            return
+        }
+
+        if (health.mode == 'EAT') {
+            if (!showEatArchive || !health.eatArchived || !health.eatArchived.archived) {
+                return
+            }
+        }
+
+        if (health.mode == 'ACTIVE') {
+            if (!showActiveArchive || !health.activeArchived || !health.activeArchived.archived) {
+                return
+            }
+        }
+
+        return <View style={{
+            display: 'flex',
+            flexDirection: 'column',
+            alignItems: 'center',
+            paddingTop: rpxToPx(82),
+            paddingBottom: rpxToPx(82),
+            backgroundColor: '#fff',
+            position: 'relative'
+        }}>
+            <View className="archived_bg" onClick={() => {
+                jumpPage('/_health/pages/archive')
+                setTimeout(() => {
+                    health.mode == 'EAT' ? setShowEatArchive(false) : setShowActiveArchive(false)
+                }, 1000)
+
+            }}>
+                <Text className="archived_text bold" style={{ color: getThemeColor(health.mode) }}>[{health.eatArchived.real_count}/{health.eatArchived.target_count} Meals] Archived {TimeFormatter.dateDescription(new Date(health.eatArchived.timestamp).getTime(), true, false)}</Text>
+                {
+                    health.eatArchived.images.map((item, index) => {
+                        return <Image src={item} key={index} className="archived_img" mode="aspectFill" />
+                    })
+                }
+                <IconArrow color={MainColorType.g03} width={rpxToPx(34)} />
+            </View>
+            <View className="border_footer_line" />
+        </View>
+    }
+
     if (!loaded || health.mode == 'DAY' || health.mode == 'NIGHT')
         return <View />
 
@@ -317,53 +362,32 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
             (list.length >= 0 || health.mode == 'EAT') && <View className="recent">
                 <Text className="h42 bold" >{t('health.recents')}</Text>
                 {
-                    health.mode == 'EAT' && <View onClick={() => {
+                    (health.mode == 'EAT' || health.mode == 'ACTIVE') && <View onClick={() => {
                         jumpPage('/_health/pages/archive')
                         setTimeout(() => {
-                            setShowArchive(false)
+                            health.mode == 'EAT' ? setShowEatArchive(false) : setShowActiveArchive(false)
                         }, 1000)
-                    }}>
+                    }} style={{ position: 'relative' }}>
                         <Image className="archive" src={require('@assets/_health/archive.png')} />
+                        {
+                            ((health.mode == 'EAT' && health.eatArchivedTotal > 0) ||
+                                (health.mode == 'ACTIVE' && health.activeArchivedTotal > 0)) && <View style={{
+                                    width: rpxToPx(12),
+                                    height: rpxToPx(12),
+                                    borderRadius: rpxToPx(6),
+                                    backgroundColor: 'red',
+                                    position: 'absolute',
+                                    right: -6,
+                                    top: 0
+                                }} />
+                        }
+
                     </View>
                 }
-
-                {/* <View className="border_footer_line" /> */}
             </View>
         }
         {
-            showArchive && health.mode == 'EAT' && health.eatArchived && health.eatArchived.archived && <View style={{
-                display: 'flex',
-                flexDirection: 'column',
-                alignItems: 'center',
-                paddingTop: rpxToPx(82),
-                paddingBottom: rpxToPx(82),
-                backgroundColor: '#fff',
-                position: 'relative'
-            }}>
-                <View className="archived_bg" onClick={() => {
-                    jumpPage('/_health/pages/archive')
-                    setTimeout(() => {
-                        setShowArchive(false)
-                    }, 1000)
-
-                }}>
-                    <Text className="archived_text bold" style={{ color: getThemeColor(health.mode) }}>[{health.eatArchived.real_count}/{health.eatArchived.target_count} Meals] Archived {TimeFormatter.dateDescription(new Date(health.eatArchived.timestamp).getTime(), true, false)}</Text>
-                    {
-                        health.eatArchived.images.map((item, index) => {
-                            return <Image src={item} key={index} className="archived_img" mode="aspectFill" />
-                        })
-                    }
-                    <IconArrow color={MainColorType.g03} width={rpxToPx(34)} />
-                    {/* <IconCellArrow color={MainColorType.g03} width={rpxToPx(34)} /> */}
-                    {/* <Image src={require('@assets/_health/cell_arrow.png')} style={{
-                        width: rpxToPx(24),
-                        height: rpxToPx(24),
-                        marginLeft: rpxToPx(4),
-
-                    }} /> */}
-                </View>
-                <View className="border_footer_line" />
-            </View>
+            archiveContent()
         }
         {
             list.length == 0 && <NoRecord />
@@ -386,18 +410,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                 onClick={() => {
                                     jumpPage('/_health/pages/moment_detail')
                                 }} />
-                            {/* {
-                        props.type == 'EAT' && <HistoryEatItem data={item} index={index} />
-                    }
-                    {
-                        props.type == 'FAST' && <HistoryFastItem data={item} index={index} />
-                    }
-                    {
-                        props.type == 'ACTIVE' && <HistoryActiveItem data={item} index={index} />
-                    }
-                    {
-                        props.type == 'SLEEP' && <HistorySleepItem data={item} index={index} />
-                    } */}
+
                         </View>
                     })
                 }

+ 0 - 7
src/features/health/MainSwiper.tsx

@@ -188,13 +188,6 @@ export default function MainSwiper(props: { count: number, pageChanged: Function
     return <View style={{ flexDirection: 'column', display: 'flex', alignItems: 'center' }}>
         <Text className="h50 bold" style={{marginTop:rpxToPx(24)}}>{t('health.today')}</Text>
         <Text className="main_date g01" >{global.language == 'en' ? dayjs().format('dddd, MMM D') : dayjs().format('MMMD日 dddd')}</Text>
-        {/* <View className="tabs">
-            <View className="tab_item" style={{ backgroundColor: current != 0 ? '#B2B2B2' : isDay() ? MainColorType.day : MainColorType.night }} onClick={() => tapScroll(0)}></View>
-            <View style={{ width: rpxToPx(40) }} />
-            <View className="tab_item" style={{ backgroundColor: current != 1 ? '#B2B2B2' : isFast() ? MainColorType.fast : MainColorType.eat }} onClick={() => tapScroll(1)}></View>
-            <View style={{ width: rpxToPx(40) }} />
-            <View className="tab_item" style={{ backgroundColor: current != 2 ? '#B2B2B2' : isSleep() ? MainColorType.sleep : MainColorType.active }} onClick={() => tapScroll(2)}></View>
-        </View> */}
         <Swiper
             onTransition={onTransition}
             onAnimationFinish={onTransitionend}

+ 2 - 0
src/features/trackSomething/components/MoveOrderList.weapp.tsx

@@ -50,6 +50,8 @@ export default function Component(props: { array: any, itemHeight: number, color
         setDragElement(list[index])
         setMovaleViewY(e.target.offsetTop)
         setCanScroll(false)
+
+        console.log(e.target.offsetTop)
     }
 
     function touchMove(e) {

+ 11 - 6
src/pages/clock/ClockNew.tsx

@@ -9,7 +9,7 @@ import MainHistory from "@/features/health/MainHistory";
 import { WindowType } from "@/utils/types";
 import { getArchived, windows } from "@/services/health";
 import { useDispatch, useSelector } from "react-redux";
-import health, { setEatArchived, setFastWithSleep, setFinishSetup, setLongFast, setRefreshs, setTitle, setWindows } from "@/store/health";
+import health, { setActiveArchived, setActiveArchivedTotal, setEatArchived, setEatArchivedTotal, setFastWithSleep, setFinishSetup, setLongFast, setRefreshs, setTitle, setWindows } from "@/store/health";
 import dayjs from "dayjs";
 import { MainColorType } from "@/context/themes/color";
 import NewButton, { NewButtonType } from "@/_health/base/new_button";
@@ -30,7 +30,7 @@ export default function ClockNew() {
     const health = useSelector((state: any) => state.health);
     const [type, setType] = useState(WindowType.day)
     const [needShowAddTip, setNeedShowAddTip] = useState(false)
-    const [reminderAdd,setReminderAdd] = useState(true)
+    const [reminderAdd, setReminderAdd] = useState(true)
     const [showDate, setShowDate] = useState(false)
     const [date, setDate] = useState('')
     const [isPulling, setIsPulling] = useState(false)
@@ -80,7 +80,7 @@ export default function ClockNew() {
     global.refreshWindow = () => {
         getWindows();
         archived();
-        
+
     }
 
     function getWindows() {
@@ -150,6 +150,11 @@ export default function ClockNew() {
             getArchived(health.mode).then(res => {
                 if (health.mode == 'EAT') {
                     dispatch(setEatArchived((res as any).latest))
+                    dispatch(setEatArchivedTotal((res as any).archived_total))
+                }
+                else if (health.mode == 'ACTIVE') {
+                    dispatch(setActiveArchived((res as any).latest))
+                    dispatch(setActiveArchivedTotal((res as any).archived_total))
                 }
             })
         }
@@ -219,7 +224,7 @@ export default function ClockNew() {
                 global.refreshWindow()
                 setIsPulling(true)
             }}
-            loadMore={()=>{
+            loadMore={() => {
                 if (historyRef) {
                     (historyRef.current as any).more()
                 }
@@ -251,7 +256,7 @@ export default function ClockNew() {
                         }}>
                             <IconClose color={MainColorType.g01} width={rpxToPx(32)} height={rpxToPx(32)} />
                         </NewButton>
-        
+
                     </View>
                 }
                 <MainSwiper count={count} pageChanged={pageChanged} typeChanged={typeChanged} />
@@ -261,7 +266,7 @@ export default function ClockNew() {
                     setShowDate(e.show)
                     setDate(e.date)
                 }} />
-                <View style={{ height: user.isLogin?150:300 }} />
+                <View style={{ height: user.isLogin ? 150 : 300 }} />
                 {
                     (health.mode == 'DAY' || health.mode == 'NIGHT') && <View style={{ height: 150, flexShrink: 0 }} />
                 }

+ 18 - 3
src/store/health.tsx

@@ -10,11 +10,14 @@ interface HealthState {
     refreshs: any; //刷新数据时间点
     title: string;
     eatArchived: any;
+    activeArchived: any;
+    eatArchivedTotal: number;
+    activeArchivedTotal: number;
     showActionCircadian: boolean;
     isCompleted: boolean;
     schedules: any;
     footer: any;
-    finish_setup:boolean;
+    finish_setup: boolean;
 }
 
 const initialState: HealthState = {
@@ -26,11 +29,14 @@ const initialState: HealthState = {
     refreshs: [],
     title: '',
     eatArchived: null,
+    activeArchived: null,
+    eatArchivedTotal: 0,
+    activeArchivedTotal: 0,
     showActionCircadian: false,
     isCompleted: false,
     schedules: [],
     footer: null,
-    finish_setup:false
+    finish_setup: false
 }
 
 const healthSlice = createSlice({
@@ -62,6 +68,15 @@ const healthSlice = createSlice({
         setEatArchived(state, action) {
             state.eatArchived = action.payload
         },
+        setActiveArchived(state, action) {
+            state.activeArchived = action.payload
+        },
+        setEatArchivedTotal(state, action) {
+            state.eatArchivedTotal = action.payload
+        },
+        setActiveArchivedTotal(state, action) {
+            state.activeArchivedTotal = action.payload
+        },
         setShowActionTip(state, action) {
             const { isShow, isCompleted } = action.payload
             state.showActionCircadian = isShow
@@ -83,5 +98,5 @@ const healthSlice = createSlice({
 
 
 
-export const { setWindows, setMode, setTab, setRefreshs, setTitle, setEatArchived, setShowActionTip, setFastWithSleep, setLongFast, setSchedules, setFooter,setFinishSetup } = healthSlice.actions;
+export const { setWindows, setMode, setTab, setRefreshs, setTitle, setEatArchived, setActiveArchived, setEatArchivedTotal, setActiveArchivedTotal, setShowActionTip, setFastWithSleep, setLongFast, setSchedules, setFooter, setFinishSetup } = healthSlice.actions;
 export default healthSlice.reducer;

Some files were not shown because too many files changed in this diff