leon 1 рік тому
батько
коміт
401bf2dc4c

+ 4 - 3
src/_health/components/add_label.tsx

@@ -52,9 +52,10 @@ export default function AddLabel(props: { labels: any }) {
             }]
         }).then(res => {
             global.refreshWindow()
-            if (process.env.TARO_ENV == 'weapp') {
-                Taro.navigateBack()
-            }
+            global.refreshSchedules()
+            // if (process.env.TARO_ENV == 'weapp') {
+            //     Taro.navigateBack()
+            // }
         })
     }
 

+ 10 - 0
src/_health/pages/move.scss

@@ -206,4 +206,14 @@
     width: 34px;
     height: 34px;
     padding: 10px;
+}
+
+.no_current{
+    display: flex;
+    height: 300px;
+    color: #B2B2B2;
+    align-items: center;
+    justify-content: center;
+    position: relative;
+    width: 750px;
 }

+ 18 - 12
src/_health/pages/move.tsx

@@ -26,7 +26,7 @@ export default function Move() {
     const [hideCurrentRecent, setHideCurrentRecent] = useState(false)
     const [moreActive, setMoreActive] = useState(false)
     const [hours, setHours] = useState<any>([])
-    const [startDate,setStarteDate] = useState('')
+    const [startDate, setStarteDate] = useState('')
     const { t } = useTranslation()
     const dispatch = useDispatch()
 
@@ -282,7 +282,7 @@ export default function Move() {
             pre = next
             next = pre + 3600 * 1000
         }
-        return dayjs(pre).format('H:00') + '-' + dayjs(next).format('H:00')
+        return dayjs(pre).format('HH:00') + '-' + dayjs(next).format('HH:00')
     }
 
     function getCurrentTarget() {
@@ -292,8 +292,8 @@ export default function Move() {
             pre -= 3600 * 1000
         }
 
-        if (currentHourChecked()){
-            pre += 3600*1000
+        if (currentHourChecked()) {
+            pre += 3600 * 1000
         }
         const hour = new Date(pre).getHours()
         for (var i = 0; i < data.hours.length; i++) {
@@ -320,11 +320,11 @@ export default function Move() {
         return hour
     }
 
-    function isExtra(){
+    function isExtra() {
         const hour = currentHourPeriod()
         var isFind = false
-        data.hours.map((item)=>{
-            if (item.hour==hour){
+        data.hours.map((item) => {
+            if (item.hour == hour) {
                 isFind = true
             }
         })
@@ -343,12 +343,12 @@ export default function Move() {
         return <View className="move-header">
             <View className="header-current">
                 <View className="current_intro">
-                    <View style={{ color: (new Date().getMinutes() < 10 && getStatus()=='open') ? getThemeColor(health.mode) : '#b2b2b2' }}>{getDuration()}</View>
+                    <View style={{ color: (new Date().getMinutes() < 10 && getStatus() == 'open') ? getThemeColor(health.mode) : '#b2b2b2' }}>{getDuration()}</View>
                     {
-                        isExtra()?<Text style={{color:getThemeColor('SLEEP')}}>is extra</Text>:<Text>{getCurrentTarget()} steps</Text>
+                        isExtra() ? <Text style={{ color: getThemeColor('SLEEP') }}>is extra</Text> : <Text>{getCurrentTarget()} steps</Text>
                     }
-                    
-                    
+
+
                 </View>
                 <View className="log_btn" style={{
                     backgroundColor: getStatus() == 'open' ? getThemeColor(health.mode) : '#6666661A',
@@ -376,7 +376,7 @@ export default function Move() {
             <View style={{ display: 'flex', flexDirection: 'column' }}>
                 <Text className="current_item_period">{isYesterday ? '昨天' : ''}{start}:00-{end}:00</Text>
                 {
-                    item.is_extra && <Text style={{color:getThemeColor('SLEEP')}}>is Extra</Text>
+                    item.is_extra && <Text style={{ color: getThemeColor('SLEEP') }}>is Extra</Text>
                 }
                 <Text>{item.real_steps}/{item.target_steps}</Text>
             </View>
@@ -433,6 +433,12 @@ export default function Move() {
                     }
                 </View>
             }
+            {
+                hours.length == 0 && <View className="no_current">
+                    <Text>No Active Hours Yet.</Text>
+                    <View className="border_footer_line"/>
+                </View>
+            }
 
             <View className="summary_footer">
                 <View className="summary_footer_item">

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

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

+ 113 - 0
src/_health/pages/schedules_edit.scss

@@ -0,0 +1,113 @@
+@import "~taro-ui/dist/style/components/swipe-action.scss";
+
+.container {
+    display: flex;
+    flex-direction: column;
+    flex: 1;
+}
+
+.schedule_item {
+    padding-left: 40px;
+    padding-right: 52px;
+    height: 128px;
+    align-items: center;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    position: relative;
+    background-color: #fff;
+}
+
+.item_hover{
+    background-color: #E5E5E5;
+}
+
+.item_line{
+    height: 2px;
+    background-color: #B2B2B2;
+    transform: scaleY(0.5);
+    position: absolute;
+    left: 100px;
+    right: 0;
+    bottom: 0;
+}
+
+.item_left{
+    display: flex;
+    flex-direction: row;
+    flex: 1;
+    align-items: center;
+}
+
+.item_index{
+    color: #B2B2B2;
+    font-size: 26px;
+    width: 36px;
+    height: 42px;
+    margin-right: 24px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
+}
+
+.item_name{
+    color: #000;
+    font-size: 34px;
+}
+
+.edit_item_time{
+    color: #000;
+    font-size: 34px;
+    width: 115px;
+    height: 88px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background-color: #B2B2B21A;
+    border-radius: 20px;
+}
+
+.toolbar{
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    margin-top: 20px;
+    margin-bottom: 20px;
+    padding-left: 46px;
+    padding-right: 46px;
+}
+
+.item_add{
+    height: 128px;
+    display: flex;
+    flex-direction: row;
+    background-color: #fff;
+    align-items: center;
+    padding-left: 40px;
+}
+
+.toolbar_btn{
+    color: #FF751A;
+    font-size: 34px;
+    margin-left: 26px;
+}
+
+.notification_icon{
+    width: 34px;
+    height: 34px;
+    margin-right: 12px;
+}
+
+.schedule_header_title{
+    margin-left: 40px;
+    font-weight: bold;
+    font-size: 50px;
+    color: #000;
+    margin-bottom: 40px;
+    margin-top: 22px;
+}
+
+.cell_hover{
+    background-color: #E5E5E5;
+}

+ 170 - 0
src/_health/pages/schedules_edit.tsx

@@ -0,0 +1,170 @@
+import { View, Text, Image, Switch } from "@tarojs/components";
+import './schedules_edit.scss'
+import { useEffect, useState } from "react";
+import { useSelector } from "react-redux";
+import { createSchedule, getLabels, getSchedules } from "@/services/health";
+import { rpxToPx } from "@/utils/tools";
+import { getThemeColor } from "@/features/health/hooks/health_hooks";
+import Modal from "@/components/layout/Modal.weapp";
+import TimePicker from "@/features/common/TimePicker";
+import { AtSwipeAction } from "taro-ui"
+import Taro from "@tarojs/taro";
+
+export default function SchedulesEdit() {
+    const [list, setList] = useState<any>([])
+    const [labels, setLabels] = useState<any>([])
+    const [showDel, setShowDel] = useState(false)
+    const health = useSelector((state: any) => state.health);
+    const [showTimePicker, setShowTimePicker] = useState(false)
+    const [selItem, setSelItem] = useState<any>(null)
+
+    useEffect(() => {
+        schedules()
+    }, [])
+
+    function schedules() {
+        let windows = ''
+        switch (health.mode) {
+            case 'FAST':
+                windows = 'FAST,EAT';
+                break
+            case 'EAT':
+                windows = 'EAT,FAST';
+                break
+            case 'SLEEP':
+                windows = 'SLEEP,ACTIVE';
+                break
+            case 'ACTIVE':
+                windows = 'ACTIVE,SLEEP';
+                break
+        }
+        getSchedules({ window: windows }).then(res => {
+            if ((res as any).data && (res as any).data.length > 0) {
+                // setList((res as any).data)
+
+                let grouped: any = {};
+                (res as any).data.forEach(item => {
+                    const window = item.window;
+
+                    if (!grouped[window]) {
+                        grouped[window] = { window: window, list: [] };
+                    }
+                    grouped[window].list.push(item);
+                });
+                // console.log(Object.values(grouped))
+                setList(Object.values(grouped))
+            }
+        }).catch(e => {
+
+        })
+
+        getLabels({ window: health.mode }).then(res => {
+            setLabels((res as any).labels)
+        })
+    }
+
+    function changeTime(item) {
+        setSelItem(item)
+        setShowTimePicker(true)
+    }
+
+    function modalContent() {
+        const strTime = selItem.time
+
+        var title = selItem.title
+        var color = getThemeColor(selItem.window)
+
+        return <TimePicker time={strTime}
+            color={color}
+            title={title}
+            confirm={(e) => {
+                selItem.time = e
+                setSelItem(selItem)
+                setShowTimePicker(false)
+                // confirmPickerTime(e)
+            }}
+            cancel={() => {
+                setShowTimePicker(false)
+            }} />
+    }
+
+    function tapDone() {
+        var array: any = []
+        list.map((obj) => {
+            obj.list.map(item => {
+                array.push({
+                    id: item.id,
+                    time: item.time,
+                    event: item.event,
+                    title: item.title,
+                    reminder:item.reminder
+                })
+            })
+
+        })
+
+        createSchedule({
+            schedules: array
+        }).then(res => {
+            global.refreshWindow()
+            global.refreshSchedules()
+            if (process.env.TARO_ENV == 'weapp') {
+                Taro.navigateBack()
+            }
+        })
+    }
+    console.log(health.mode)
+    return <View>
+        {
+            list.map((item, index) => {
+                return <View key={index} style={{ display: 'flex', flexDirection: 'column', marginBottom: rpxToPx(36) }}>
+                    {
+                        item.list.map((obj, i) => {
+                            return <View className='schedule_item' key={i * 100}>
+
+                                <View className='item_left'>
+                                    <Text className='item_index'>{i + 1}</Text>
+
+
+                                    <Text className='item_name'>{obj.title}</Text>
+                                </View>
+                                <View style={{ flex: 1 }} />
+
+                                <View className='edit_item_time' onClick={() => changeTime(obj)} style={{ marginRight: rpxToPx(24) }}>{obj.time}</View>
+
+                                <Switch checked={obj.reminder}
+                                    color={getThemeColor(obj.window)}
+                                    onChange={e => {
+                                        if (process.env.TARO_ENV == 'weapp') {
+                                            e.stopPropagation()
+                                        }
+
+                                        obj.reminder = e.detail.value;
+                                        setList([...list])
+                                    }} />
+                                {
+                                    i < item.list.length - 1 && <View className='item_line' />
+                                }
+
+                            </View>
+                        })
+                    }
+                </View>
+            })
+        }
+
+        <View className="edit_footer_btn" style={{ color: getThemeColor(health.mode), backgroundColor: getThemeColor(health.mode) + '33' }} onClick={tapDone}>完成</View>
+        {
+            showTimePicker && <Modal
+                testInfo={null}
+                dismiss={() => {
+                    setShowTimePicker(false)
+                }}
+                confirm={() => { }}>
+                {
+                    modalContent()
+                }
+            </Modal>
+        }
+    </View>
+}

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

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

+ 45 - 10
src/_health/pages/schedules_list.scss

@@ -6,10 +6,10 @@
     flex: 1;
 }
 
-.item {
-    padding-left: 46px;
-    padding-right: 46px;
-    height: 114px;
+.schedule_item {
+    padding-left: 40px;
+    padding-right: 52px;
+    height: 128px;
     align-items: center;
     display: flex;
     flex-direction: row;
@@ -18,34 +18,46 @@
     background-color: #fff;
 }
 
+.item_hover{
+    background-color: #E5E5E5;
+}
+
 .item_line{
     height: 2px;
     background-color: #B2B2B2;
     transform: scaleY(0.5);
     position: absolute;
-    left: 0;
+    left: 100px;
     right: 0;
     bottom: 0;
 }
 
 .item_left{
     display: flex;
-    flex-direction: column;
+    flex-direction: row;
     flex: 1;
+    align-items: center;
 }
 
 .item_index{
     color: #B2B2B2;
-    font-size: 18px;
+    font-size: 26px;
+    width: 36px;
+    height: 42px;
+    margin-right: 24px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
 }
 
 .item_name{
-    color: #4D4D4D;
+    color: #000;
     font-size: 34px;
 }
 
 .item_time{
-    color: #B2B2B2;
+    color: #000;
     font-size: 34px;
 }
 
@@ -59,13 +71,36 @@
     padding-right: 46px;
 }
 
+.item_add{
+    height: 128px;
+    display: flex;
+    flex-direction: row;
+    background-color: #fff;
+    align-items: center;
+    padding-left: 40px;
+}
+
 .toolbar_btn{
     color: #FF751A;
-    font-size: 30px;
+    font-size: 34px;
+    margin-left: 26px;
 }
 
 .notification_icon{
     width: 34px;
     height: 34px;
     margin-right: 12px;
+}
+
+.schedule_header_title{
+    margin-left: 40px;
+    font-weight: bold;
+    font-size: 50px;
+    color: #000;
+    margin-bottom: 40px;
+    margin-top: 22px;
+}
+
+.cell_hover{
+    background-color: #E5E5E5;
 }

+ 91 - 38
src/_health/pages/schedules_list.tsx

@@ -10,6 +10,8 @@ import { useSelector } from 'react-redux'
 import { getThemeColor } from '@/features/health/hooks/health_hooks'
 import showActionSheet from '@/components/basic/ActionSheet'
 import { jumpPage } from '@/features/trackTimeDuration/hooks/Common'
+import { IconAdd } from '@/components/basic/Icons'
+import { rpxToPx } from '@/utils/tools'
 
 
 export default function SchedulesList() {
@@ -29,10 +31,43 @@ export default function SchedulesList() {
     }
 
     function schedules() {
-        getSchedules({ window: health.mode }).then(res => {
-            console.log('sss', res)
+        let windows = ''
+        switch (health.mode) {
+            case 'FAST':
+                windows = 'FAST,EAT';
+                break
+            case 'EAT':
+                windows = 'EAT,FAST';
+                break
+            case 'SLEEP':
+                windows = 'SLEEP,ACTIVE';
+                break
+            case 'ACTIVE':
+                windows = 'ACTIVE,SLEEP';
+                break
+        }
+        getSchedules({ window: windows }).then(res => {
             if ((res as any).data && (res as any).data.length > 0) {
-                setList((res as any).data)
+                // setList((res as any).data)
+
+                let grouped: any = {};
+                (res as any).data.forEach(item => {
+                    const window = item.window;
+
+                    if (!grouped[window]) {
+                        grouped[window] = { window: window, list: [] };
+                    }
+                    grouped[window].list.push(item);
+                });
+                var array = Object.values(grouped)
+                array.map((dt: any) => {
+                    if (dt.window == 'EAT' || dt.window == 'ACTIVE') {
+                        dt.list.push({
+                            add: true
+                        })
+                    }
+                })
+                setList(array)
             }
         }).catch(e => {
 
@@ -56,6 +91,8 @@ export default function SchedulesList() {
     }
 
     function tapEdit() {
+        jumpPage('./schedules_edit')
+        return;
         let array: any = []
         switch (health.mode) {
             case 'DAY':
@@ -108,50 +145,66 @@ export default function SchedulesList() {
         }
     }
 
+    function getTitle() {
+        switch (health.mode) {
+            case 'FAST':
+                return '断食和进食';
+            case 'EAT':
+                return '进食和断食';
+            case 'SLEEP':
+                return '睡眠和活动';
+            case 'ACTIVE':
+                return '活动和睡眠';
+        }
+        return ''
+    }
+
     return <View>
+        <View className='schedule_header_title'>{getTitle()}</View>
         {
             list.map((item, index) => {
-                // return <AtSwipeAction key={index} isOpened options={[
-                //     {
-                //         text: '删除',
-                //         style: {
-                //             backgroundColor: '#FF4949'
-                //         }
-                //     }
-                // ]}>
-                return <View className='item' key={index}>
+                return <View key={index} style={{ display: 'flex', flexDirection: 'column', marginBottom: rpxToPx(36) }}>
                     {
-                        showDel && <Text style={{ color: 'red', marginRight: 5 }} onClick={() => delItem(index)}>删除</Text>
+                        item.list.map((obj, i) => {
+                            if (obj.add) {
+                                return <View key={i * 100} className='item_add'
+                                    hoverClass='cell_hover'
+                                    hoverStayTime={50}
+                                    onClick={add}>
+                                    <IconAdd color={getThemeColor(item.window)} width={rpxToPx(34)} />
+                                    <View className='toolbar_btn' style={{ color: getThemeColor(item.window) }} >添加</View>
+                                    <View style={{ flex: 1 }} />
+                                    {/* <View className='toolbar_btn' style={{ color: getThemeColor(health.mode) }} onClick={() => setShowDel(!showDel)}>移除</View> */}
+                                </View>
+                            }
+
+                            return <View className='schedule_item' key={i * 100} hoverClass='cell_hover' hoverStayTime={50} onClick={() => {
+
+                            }}>
+
+                                <View className='item_left'>
+                                    <Text className='item_index'>{i + 1}</Text>
+
+
+                                    <Text className='item_name'>{obj.title}</Text>
+                                </View>
+                                <View style={{ flex: 1 }} />
+                                {
+                                    !obj.reminder && <Image src={require('@assets/images/notification_off.png')} className='notification_icon' />
+                                }
+
+                                <Text className='item_time'>{obj.time}</Text>
+                                {
+                                    i < item.list.length - 1 && <View className='item_line' />
+                                }
+
+                            </View>
+                        })
                     }
-
-                    <View className='item_left'>
-                        {
-                            health.mode == 'EAT' && <Text className='item_index'>第{index + 1}餐</Text>
-                        }
-
-                        <Text className='item_name'>{item.title}</Text>
-                    </View>
-                    <View style={{ flex: 1 }} />
-                    {
-                        !item.reminder && <Image src={require('@assets/images/notification_off.png')} className='notification_icon' />
-                    }
-
-                    <Text className='item_time'>{item.time}</Text>
-                    <View className='item_line' />
                 </View>
-                // </AtSwipeAction>
             })
         }
 
-
-        {
-            (health.mode == 'EAT' || health.mode == 'ACTIVE') && <View className='toolbar'>
-                <View className='toolbar_btn' style={{ color: getThemeColor(health.mode) }} onClick={add}>添加</View>
-                <View style={{ flex: 1 }} />
-                {/* <View className='toolbar_btn' style={{ color: getThemeColor(health.mode) }} onClick={() => setShowDel(!showDel)}>移除</View> */}
-            </View>
-        }
-
         <View className="edit_footer_btn" style={{ color: getThemeColor(health.mode), backgroundColor: getThemeColor(health.mode) + '33' }} onClick={tapEdit}>批量编辑</View>
 
         {

+ 1 - 0
src/app.config.ts

@@ -56,6 +56,7 @@ const appConfig = defineAppConfig({
         'pages/schedules_order',
         'pages/schedules_reminder',
         'pages/schedules_time',
+        'pages/schedules_edit',
         'pages/setting_reminder',
         'pages/moment_detail',
         'pages/archive',

+ 4 - 1
src/app.scss

@@ -392,5 +392,8 @@ page {
 }
 
 .canvas{
-    // transform: translate(-50%,-50%);
+}
+
+.cell_hover{
+    background-color: #E5E5E5;
 }

+ 5 - 0
src/components/basic/Icons.tsx

@@ -203,4 +203,9 @@ export const Icon = (width,height,icon)=>{
     return <View style={{ width: width, height: width }}>
         {process.env.TARO_ENV == 'weapp' ? <mysvg src={icon} colors={[]} /> : <SvgXml xml={icon} width={width} height={width} />}
     </View>
+}
+
+export const IconAdd = (props:{width:number,color:string})=>{
+    const icon = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="34" height="34" viewBox="0 0 34 34"><defs><clipPath id="master_svg0_7_02849"><rect x="0" y="0" width="34" height="34" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_7_02849)"><rect x="0" y="0" width="34" height="34" rx="0" fill="#FFFFFF00" fill-opacity="1"/><g transform="matrix(0,1,-1,0,22.6668701171875,-8.4998779296875)"><line x1="15.5833740234375" y1="5.666829466819763" x2="35.41670608520508" y2="5.666829466819763" fill-opacity="0" stroke-opacity="1" stroke="${props.color}" fill="none" stroke-width="2.8333332538604736" stroke-linecap="ROUND" stroke-linejoin="round"/></g><g><line x1="7.0833740234375" y1="16.999837279319763" x2="26.916706085205078" y2="16.999837279319763" fill-opacity="0" stroke-opacity="1" stroke="${props.color}" fill="none" stroke-width="2.8333332538604736" stroke-linecap="ROUND" stroke-linejoin="round"/></g></g></svg>`
+    return Icon(props.width,props.width,icon);
 }

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

@@ -4,9 +4,8 @@
     align-items: center;
     padding-right: 40px;
     position: relative;
-    margin-left: 64px;
-    padding-top: 32px;
-    padding-bottom: 32px;
+    padding-left: 64px;
+    height: 172px;
 }
 
 .timeline_left{
@@ -16,7 +15,8 @@
 }
 
 .timeline_title{
-    font-size: 24px;
+    font-size: 34px;
+    line-height: 42px;
     color: #808080;
     overflow: hidden;
     width: 500px;
@@ -28,6 +28,24 @@
     text-overflow: ellipsis; // 超出部分显示省略号
 }
 
+.timeline_desc{
+    font-size: 24px;
+    line-height: 28px;
+    width: 500px;
+    color: #B2B2B2;
+    white-space: nowrap;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    -webkit-line-clamp: 1; // 限制为一行
+    text-overflow: ellipsis; // 超出部分显示省略号
+}
+
+.timeline_thirdspace{
+    height: 12px;
+    margin-top: 5px;
+}
+
 .timeline_time{
     font-size: 34px;
     color: #4D4D4D;
@@ -35,11 +53,10 @@
 
 .timeline_operate{
     height: 72px;
-    border-radius: 20px;
-    font-size: 28px;
+    border-radius: 18px;
+    font-size: 30px;
     font-weight: bold;
-    padding-left: 40px;
-    padding-right: 40px;
+    width: 128px;
     display: flex;
     align-items: center;
     justify-content: center;
@@ -71,7 +88,24 @@
 .main_summary_time{
     font-size: 36px;
     color: #000;
-    line-height: 44px;
+    height: 44px;
+    min-width: 150px;
+    align-items: center;
+    justify-content: center;
+    display: flex;
+    position: relative;
+}
+
+.time_point{
+    width: 12px;
+    height: 12px;
+    position: absolute;
+    border-radius: 6px;
+    background-color: blue;
+    position: absolute;
+    left: -12px;
+    top: 16px;
+    
 }
 
 .main_summary_duration{
@@ -118,9 +152,9 @@
 }
 
 .console_item_img{
-    width: 72px;
-    height: 72px;
-    border-radius: 36px;
+    width: 76px;
+    height: 76px;
+    border-radius: 12px;
 }
 
 .notification_icon{

+ 13 - 12
src/features/health/MainConsole.tsx

@@ -139,7 +139,7 @@ export default function MainConsole(props: { type: WindowType }) {
     function timelineItem(item: any, index: number, count: number) {
         return <View key={index} className="timeline_item" >
             <View className="timeline_left">
-                <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
+                <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center',height:rpxToPx(28) }}>
                     {
                         !item.reminder && <Image src={require('@assets/images/notification_off.png')} className='notification_icon' />
                     }
@@ -147,11 +147,11 @@ export default function MainConsole(props: { type: WindowType }) {
                 </View>
 
 
-                <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
+                <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center',marginTop:rpxToPx(5) }}>
                     <Text className="timeline_time" onClick={() => edit(item)}>{item.title}</Text>
                 </View>
                 {
-                    item.moment && item.moment.description && <Text className="timeline_title">{item.moment.description}</Text>
+                    (item.moment && item.moment.description) ? <Text className="timeline_desc">{item.moment.description}</Text>:<View  className="timeline_thirdspace"/>
                 }
 
             </View>
@@ -169,7 +169,7 @@ export default function MainConsole(props: { type: WindowType }) {
             {/* {
                 item.action && item.action != 'NA' && 
             } */}
-            <View className="border_footer_line" style={{ left: count - 1 == index ? -rpxToPx(64) : 0 }} />
+            <View className="border_footer_line" style={{ left: count - 1 == index ? -rpxToPx(64) : rpxToPx(64) }} />
         </View>
     }
 
@@ -359,16 +359,15 @@ export default function MainConsole(props: { type: WindowType }) {
                             list.push('删除本次记录')
                         }
                     }
-                    else {
-                        list = ['编辑日程']
-                    }
+                    list.push('编辑日程列表')
+                    
                 }
                 break;
             case 'EAT':
                 {
                     list = [
                         'Add Snack',
-                        '自定义餐次列表',
+                        '编辑日程列表',
                     ]
 
                     if (getScenario(health.windows, health.mode).window_id) {
@@ -380,7 +379,7 @@ export default function MainConsole(props: { type: WindowType }) {
                 {
                     list = [
                         '记录一次活动',
-                        '编辑日程',
+                        '编辑日程列表',
                     ]
 
                     if (getScenario(health.windows, health.mode).window_id) {
@@ -445,7 +444,7 @@ export default function MainConsole(props: { type: WindowType }) {
                             const obj = getScenario(health.windows, health.mode)
                             if (obj.window_id) {
                                 //del record
-
+                                jumpPage('/_health/pages/schedules_list')
                                 console.log('zzzzzzzzz')
                             }
                             else {
@@ -618,8 +617,10 @@ export default function MainConsole(props: { type: WindowType }) {
     return <View className="main-console-bg">
         <Image className="main_arrow" src={require('@assets/images/center_arrow.png')} />
         <View className="main_summary">
-            <View className="main_summary_status" style={{ color: getThemeColor(health.mode) }}>{windowStatus()}</View>
-            <Text className="main_summary_time" style={{ color: getWindowStatus(health.windows, health.mode) == WindowStatusType.upcoming ? '#B2B2B2' : '#000' }}>{getCountownTime(health.windows, health.mode)}</Text>
+            {/* <View className="main_summary_status" style={{ color: getThemeColor(health.mode) }}>{windowStatus()}</View> */}
+            <View className="main_summary_time" style={{ color: getWindowStatus(health.windows, health.mode) == WindowStatusType.upcoming ? '#B2B2B2' : '#000' }}>{getCountownTime(health.windows, health.mode)}
+                <View className="time_point" style={{backgroundColor:getWindowStatus(health.windows,health.mode)==WindowStatusType.upcoming?'#B2B2B2':getThemeColor(health.mode)}}/>
+            </View>
             <Text className="main_summary_duration">Total {getDuration(health.windows, health.mode)}</Text>
             <View className="border_footer_line" />
         </View>

+ 8 - 4
src/features/health/hooks/health_hooks.tsx

@@ -71,16 +71,20 @@ export function getCountownTime(windows: any, mode: any) {
     const status = getWindowStatus(windows, mode)
     const scenario = getScenario(windows, mode)
     const now = new Date().getTime()
+    var stringTime = ''
     switch (status) {
         case WindowStatusType.process:
-            return TimeFormatter.countdown(scenario.real.start_timestamp, now)
+            stringTime = TimeFormatter.countdown(scenario.real.start_timestamp, now)
         case WindowStatusType.open:
 
-            return TimeFormatter.countdown(scenario.target.start_timestamp, now)
+        stringTime = TimeFormatter.countdown(scenario.target.start_timestamp, now)
         case WindowStatusType.upcoming:
-            return TimeFormatter.countdown(now, scenario.target.start_timestamp)
+            stringTime = TimeFormatter.countdown(now, scenario.target.start_timestamp)
     }
-    return ''
+    if (stringTime.indexOf('0')==0){
+        stringTime = stringTime.substring(1,stringTime.length)
+    }
+    return stringTime
 }
 
 export const getStartArc = (time: number) => {