Leon 1 年間 前
コミット
b98dc4a851

+ 29 - 6
src/_health/base/status_indicator.tsx

@@ -8,7 +8,8 @@ export enum StatusType {
     normal = 'normal',
     ing = 'ing',
     img = 'img',
-    console='console'
+    console = 'console',
+    big = 'big'
 }
 export default function StatusIndicator(props: {
     type: StatusType,
@@ -17,7 +18,8 @@ export default function StatusIndicator(props: {
     children?: any,
     fontColor?: string,
     fontSize?: number
-    defaultSpace?:boolean
+    defaultSpace?: boolean,
+    space?: number
 }) {
 
     function indicator() {
@@ -55,7 +57,21 @@ export default function StatusIndicator(props: {
                     height: rpxToPx(32),
                     borderRadius: rpxToPx(16),
                     backgroundColor: props.color,
-                    marginTop:rpxToPx(2),
+                    marginTop: rpxToPx(2),
+                    display: 'flex',
+                    alignItems: 'center',
+                    justifyContent: 'center'
+                }}>
+                    {
+                        props.children
+                    }
+                </View>
+            case StatusType.big:
+                return <View style={{
+                    width: rpxToPx(32),
+                    height: rpxToPx(32),
+                    borderRadius: rpxToPx(16),
+                    backgroundColor: props.color,
                     display: 'flex',
                     alignItems: 'center',
                     justifyContent: 'center'
@@ -68,6 +84,13 @@ export default function StatusIndicator(props: {
         return <View />
     }
 
+    function marginLeft() {
+        if (props.type == StatusType.console || props.type == StatusType.big) return rpxToPx(24)
+        if (props.defaultSpace) return rpxToPx(12)
+        if (props.space) return props.space
+        return rpxToPx(6)
+    }
+
     return <View style={{
         display: 'flex',
         flexDirection: 'row',
@@ -75,8 +98,8 @@ export default function StatusIndicator(props: {
 
     }}>
         <View style={{
-            width: props.type==StatusType.console?rpxToPx(32):rpxToPx(26),
-            height: props.type==StatusType.console?rpxToPx(32):rpxToPx(26),
+            width: (props.type == StatusType.console || props.type == StatusType.big) ? rpxToPx(32) : rpxToPx(26),
+            height: (props.type == StatusType.console || props.type == StatusType.big) ? rpxToPx(32) : rpxToPx(26),
             display: 'flex',
             alignItems: 'center',
             justifyContent: 'center',
@@ -91,7 +114,7 @@ export default function StatusIndicator(props: {
             props.text && <View className='h20' style={{
                 color: props.fontColor ? props.fontColor : MainColorType.g01,
                 fontSize: props.fontSize ? props.fontSize : rpxToPx(20),
-                marginLeft: props.type==StatusType.console?rpxToPx(24):props.defaultSpace?rpxToPx(12):rpxToPx(6)
+                marginLeft: marginLeft()
             }}>{props.text}</View>
         }
     </View>

+ 3 - 2
src/_health/components/add_label.scss

@@ -8,14 +8,15 @@
 }
 
 .body1{
-    height: 600px;
+    height: 698px;
 }
 
 .input_lb{
+    background-color: #fff;
     margin-left: 40px;
     margin-right: 40px;
     height: 96px;
-    border: solid 2px #B2B2B2;
+    // border: solid 2px #B2B2B2;
     border-radius: 24px;
     padding-left: 20px;
     padding-right: 20px;

+ 92 - 55
src/_health/components/add_label.tsx

@@ -32,6 +32,7 @@ export default function AddLabel(props: {
     const [isFullday, setIsFullday] = useState(false)
     const [timeLabels, setTimeLabels] = useState<any>([])
     const [strTime, setStrTime] = useState(dayjs().format('HH:mm'))
+    const [strLabel, setStrLabel] = useState('')
 
     useEffect(() => {
         getData()
@@ -57,8 +58,8 @@ export default function AddLabel(props: {
             array = [...props.schedules, {
                 event: event,
                 title: value,
-                time: strTime,
-                is_all_day: isFullday,
+                time: isFullday ? null : strTime,
+                specific_time: !isFullday,
                 time_label: isFullday ? strTime : null
             }]
         }
@@ -66,8 +67,8 @@ export default function AddLabel(props: {
             array = [{
                 event: event,
                 title: value,
-                time: strTime,
-                is_all_day: isFullday,
+                time: isFullday ? null : strTime,
+                specific_time: !isFullday,
                 time_label: isFullday ? strTime : null
             }]
         }
@@ -131,32 +132,56 @@ export default function AddLabel(props: {
         }
     }
 
+    function isEat() {
+        if (props.window) {
+            return props.window == 'EAT'
+        }
+        else {
+            return health.mode == 'EAT'
+        }
+    }
+
     function timeContent() {
         return <Card>
-            <View style={{
-                position: 'relative',
-                display: 'flex', flexDirection: 'row',
-                height: rpxToPx(128),
-                alignItems: 'center',
-                boxSizing: 'border-box',
-                paddingLeft: rpxToPx(54),
-                paddingRight: rpxToPx(54),
-                justifyContent: 'space-between'
-            }}>
-                <Text className="h34">全天时间</Text>
-                <Switch
-                    color={props.color ? props.color : getThemeColor(health.mode)}
-                    onChange={(e) => {
-                        setIsFullday(e.detail.value)
-                        // item.reminder = e.detail.value
-                        // setList([...list])
-                    }} />
-                <View className="border_footer_line" />
-            </View>
+            {
+                isEat() ? <View style={{
+                    position: 'relative',
+                    display: 'flex', flexDirection: 'row',
+                    height: rpxToPx(128),
+                    alignItems: 'center',
+                    boxSizing: 'border-box',
+                    paddingLeft: rpxToPx(54),
+                    paddingRight: rpxToPx(54),
+                    justifyContent: 'center'
+                }}>
+                    <Text className="h34" style={{color:MainColorType.eat}}>{strTime}</Text>
+                    <View className="border_footer_line" />
+                </View> :
+                    <View style={{
+                        position: 'relative',
+                        display: 'flex', flexDirection: 'row',
+                        height: rpxToPx(128),
+                        alignItems: 'center',
+                        boxSizing: 'border-box',
+                        paddingLeft: rpxToPx(54),
+                        paddingRight: rpxToPx(54),
+                        justifyContent: 'space-between'
+                    }}>
+                        <Text className="h34">具体时间</Text>
+                        <Switch
+                            color={props.color ? props.color : getThemeColor(health.mode)}
+                            checked={!isFullday}
+                            onChange={(e) => {
+                                setIsFullday(!e.detail.value)
+                            }} />
+                        <View className="border_footer_line" />
+                    </View>
+            }
+
             {
                 isFullday ? <View>
-                    <Input className="input_lb" placeholder="选择或输入时间标签" value={strTime} onInput={(e: any) => {
-                        setStrTime(e.target.value)
+                    <Input className="input_lb" placeholder="选择或输入时间标签" value={strLabel} onInput={(e: any) => {
+                        setStrLabel(e.target.value)
                     }} />
                     <View className="label_bg">
                         {
@@ -178,35 +203,47 @@ export default function AddLabel(props: {
         </Card>
     }
 
-    return <View>
-        <View className="header1">标记为</View>
-        <View className="body1">
-            <Input className="input_lb" placeholder="选择或输入标签" value={value} onInput={(e: any) => {
-                setValue(e.target.value)
-            }} />
-            <View className="label_bg">
-                {
-                    props.labels.map((item, index) => {
-                        return <View className="label" key={index} onClick={() => setValue(item.title)}>{item.title}</View>
-                    })
-                }
+    return <NewModal title="标签" dismiss={props.disMiss}
+        themeColor={props.color ? props.color : getThemeColor(health.mode)}
+        btnTitle={props.justLabel ? '完成' : '下一步'}
+        confirm={() => {
+            tapDone()
+            // props.disMiss()
+        }}
+    >
+        <View>
+            <View className="body1">
+                <Input className="input_lb" placeholder="选择或输入标签" value={value} onInput={(e: any) => {
+                    setValue(e.target.value)
+                }} />
+                <View className="label_bg">
+                    {
+                        props.labels.map((item, index) => {
+                            return <View className="label" key={index} onClick={() => setValue(item.title)}>{item.title}</View>
+                        })
+                    }
+                </View>
             </View>
+            {/* <View className="pop_footer" style={{ backgroundColor: props.color ? props.color : getThemeColor(health.mode) }} onClick={tapDone}>{props.justLabel ? '完成' : '下一步'}</View> */}
+            {
+                showTimePicker && <NewModal
+                    title="Set Time"
+                    themeColor={props.color ? props.color : getThemeColor(health.mode)}
+                    btnTitle='完成'
+                    dismiss={() => {
+                        setShowTimePicker(false)
+                    }}
+                    confirm={done}
+                >
+                    <View style={{ height: rpxToPx(698) }}>
+                        {
+                            timeContent()
+                        }
+                    </View>
+                </NewModal>
+            }
         </View>
-        <View className="pop_footer" style={{ backgroundColor: props.color ? props.color : getThemeColor(health.mode) }} onClick={tapDone}>{props.justLabel ? '完成' : '下一步'}</View>
-        {
-            showTimePicker && <NewModal
-                title="Set Time"
-                themeColor={props.color ? props.color : getThemeColor(health.mode)}
-                btnTitle='完成'
-                dismiss={() => {
-                    setShowTimePicker(false)
-                }}
-                confirm={done}
-            >
-                {
-                    timeContent()
-                }
-            </NewModal>
-        }
-    </View>
+    </NewModal>
+
+
 }

+ 2 - 0
src/_health/components/fast_sleep_popup.scss

@@ -9,6 +9,7 @@
     align-items: center;
     justify-content: center;
     background-color: #00000080;
+    z-index: 100000;
 }
 
 /* #endif */
@@ -24,6 +25,7 @@
     display: flex;
     align-items: center;
     justify-content: center;
+    z-index: 100000;
 }
 
 /* #endif */

+ 16 - 0
src/_health/components/fast_sleep_popup.tsx

@@ -9,6 +9,7 @@ import { MainColorType } from "@/context/themes/color";
 import { TimeFormatter } from "@/utils/time_format";
 import StatusIndicator, { StatusType } from "../base/status_indicator";
 import { IconCheck } from "@/components/basic/Icons";
+import FastSleepPopupContent from "./fast_sleep_popup_content";
 
 export default function FastSleepPopup(props: { close: any, data: any }) {
     const health = useSelector((state: any) => state.health);
@@ -173,6 +174,21 @@ export default function FastSleepPopup(props: { close: any, data: any }) {
         </StatusIndicator>
     }
 
+    return <FastSleepPopupContent
+        close={props.close}
+        beforeStatus={beforeStatus()}
+        sleepStatus={ingStatus()}
+        afterStatus={afterStatus()}
+        showStep={true}
+        total={total()}
+        total1={total1()}
+        total2={total2()}
+        total3={total3()}
+        step1={step1()}
+        step2={step2()}
+        step3={step3()}
+    />
+
     return <View className="popup_container1">
         <View className="fast_sleep_content">
             <View className="h34 bold">{t('health.my_fast_journal')}</View>

+ 122 - 0
src/_health/components/fast_sleep_popup_content.tsx

@@ -0,0 +1,122 @@
+import { rpxToPx } from "@/utils/tools";
+import { View, Text, Image } from "@tarojs/components";
+import { useTranslation } from "react-i18next";
+import NewButton, { NewButtonType } from "../base/new_button";
+import { MainColorType } from "@/context/themes/color";
+import StatusIndicator, { StatusType } from "../base/status_indicator";
+import './fast_sleep_popup.scss'
+
+export default function FastSleepPopupContent(props: {
+    close: any,
+    beforeStatus: StatusType,
+    sleepStatus: StatusType,
+    afterStatus: StatusType,
+    showStep: boolean,
+    total: string,
+    total1: string,
+    total2: string,
+    total3: string,
+    step1?: string,
+    step2?: string,
+    step3?: string
+}) {
+    const { t } = useTranslation()
+
+    function beforeSleep() {
+        const type = props.beforeStatus
+        return <StatusIndicator type={type}
+            color={MainColorType.fast}
+            fontColor={MainColorType.g01}
+            text={t('health.fast_befor_bed')}
+        >
+            {
+                type == StatusType.img && <Image style={{ width: rpxToPx(20), height: rpxToPx(20) }} src={require('@assets/_health/checked.png')} />
+            }
+        </StatusIndicator>
+
+    }
+
+    function sleeping() {
+        const type = props.sleepStatus
+        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 afterSleep() {
+        const type = props.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 <View className="popup_container1">
+        <View className="fast_sleep_content">
+            <View className="h34 bold">{t('health.my_fast_journal')}</View>
+            <View className="h24 bold g01" style={{ marginTop: rpxToPx(8) }}>{t('health.my_fast_duration', { time: props.total })}</View>
+            <View className="pop_line1" />
+            <View className="pop_steps">
+                {
+                    beforeSleep()
+                }
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View style={{
+                        marginLeft: rpxToPx(12.5),
+                        marginRight: rpxToPx(24),
+                        width: 1, height: rpxToPx(103),
+                        backgroundColor: (props.sleepStatus == StatusType.ing || props.afterStatus == StatusType.ing) ? MainColorType.g01 : MainColorType.g03
+                    }} />
+                    <Text className="bold h24"
+                        style={{ marginTop: rpxToPx(12), color: props.beforeStatus == StatusType.ing ? MainColorType.fast : '#000' }}><Text className="h34">{props.step1 ?? ''}</Text>{props.showStep && ' / '}{props.total1}</Text>
+                </View>
+                {
+                    sleeping()
+                }
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View style={{
+                        marginLeft: rpxToPx(12.5),
+                        marginRight: rpxToPx(24),
+                        width: 1, height: rpxToPx(103),
+                        backgroundColor: props.afterStatus == StatusType.ing ? MainColorType.g01 : MainColorType.g03
+                    }} />
+                    <Text className="bold h24"
+                        style={{ marginTop: rpxToPx(12), color: props.sleepStatus == StatusType.ing ? MainColorType.sleep : '#000' }}><Text className="h34">{props.step2 ?? ''}</Text>{props.showStep && ' / '}{props.total2}</Text>
+                </View>
+                {
+                    afterSleep()
+                }
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View style={{
+                        marginLeft: rpxToPx(12.5),
+                        marginRight: rpxToPx(24.5),
+                        width: 1, height: rpxToPx(103),
+                        backgroundColor: 'transparent'
+                    }} />
+                    <Text className="bold h24"
+                        style={{ marginTop: rpxToPx(12), color: props.afterStatus == StatusType.ing ? MainColorType.fast : '#000' }}><Text className="h34">{props.step3 ?? ''}</Text>{props.showStep && ' / '}{props.total3}</Text>
+                </View>
+            </View>
+            <NewButton
+                type={NewButtonType.fill}
+                color={MainColorType.fast}
+                width={rpxToPx(440)}
+                height={rpxToPx(96)}
+                title={t('health.ok')}
+                onClick={props.close}
+            />
+        </View>
+    </View>
+}

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

@@ -113,11 +113,11 @@ export default function ScheduleItem(props: {
                         props.days && <View className="h30" style={{ color: MainColorType.g02 }}>+{props.days} day</View>
                     }
                     {
-                        !props.hideReminderIcon && !props.obj.is_all_day && !props.obj.reminder && <IconNotificationOff color={MainColorType.g03} width={rpxToPx(28)} />
+                        !props.hideReminderIcon && props.obj.specific_time && !props.obj.reminder && <IconNotificationOff color={MainColorType.g03} width={rpxToPx(28)} />
                     }
                     <View style={{ width: rpxToPx(12) }} />
                     {
-                        !props.disable && !props.obj.is_all_day && <View className='edit_item_time' onClick={() => {
+                        !props.disable && props.obj.specific_time && <View className='edit_item_time' onClick={() => {
                             // setSelIndex(i)
                             // setSelItem(obj)
                             setTime(props.obj.time)

+ 19 - 8
src/_health/pages/active_plan.tsx

@@ -62,7 +62,7 @@ export default function ActivePlan() {
     if (!loaded) return <View />
 
     return <View style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>
-        <NewHeader 
+        <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"
@@ -72,7 +72,7 @@ export default function ActivePlan() {
                 <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 className="border_footer_line" />
             </View>
         }
         {
@@ -81,20 +81,31 @@ export default function ActivePlan() {
                     <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"/>
+                    <View className="border_footer_line" />
                 </View>
             })
         }
         {
             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"/>
+                <Text style={{ color: getThemeColor('ACTIVE') }}>+</Text>
+                <Text style={{ flex: 1, color: getThemeColor('ACTIVE') }}>Daily Activity</Text>
+                <View className="border_footer_line" />
             </View>
         }
 
-
         {
+            showModal && <AddLabel
+                labels={labels}
+                defaultValue={list.length == 0 ? schedule.title : ''}
+                disMiss={() => {
+                    setShowModal(false)
+                    setShowModal(false)
+                    getDatas()
+                }} />
+        }
+
+
+        {/* {
             showModal && <Modal testInfo={null}
                 dismiss={() => {
                     setShowModal(false)
@@ -105,6 +116,6 @@ export default function ActivePlan() {
                     getDatas()
                 }} />
             </Modal>
-        }
+        } */}
     </View>
 }

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

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

+ 52 - 10
src/_health/pages/add_moment.scss

@@ -1,13 +1,13 @@
 
 
 .textarea{
-    height: 225px;
-    font-size: 50px;
-    margin-top: 16px;
+    height: 288px;
+    font-size: 30px;
     width: 670px;
     margin-bottom: 40px;
-    margin-left: -12px;
-    margin-right: -12px;
+    padding-left: 96px;
+    padding-right: 40px;
+    box-sizing: border-box;
 }
 
 .save{
@@ -20,10 +20,21 @@
     bottom: 100px;
 }
 
+.meal_name{
+    height: 96px;
+    padding-left: 96px;
+    padding-right: 40px;
+    padding-bottom: 24px;
+    box-sizing: border-box;
+    width: 750px;
+    flex-shrink: 0;
+}
+
 .form{
     display: flex;
-    flex-direction: column;
-    background-color: #fff;
+    flex-direction: row;
+    margin-left: 96px;
+    margin-bottom: 54px;
 }
 
 .cover{
@@ -33,6 +44,8 @@
     display: flex;
     align-items: center;
     justify-content: center;
+    border-radius: 16px;
+    overflow: hidden;
 }
 
 .input_title{
@@ -42,11 +55,14 @@
 }
 
 .addmoment_header{
-    height: 90px;
+    height: 84px;
     display: flex;
     flex-direction: row;
-    background-color: #fff;
-    align-items: center;
+    box-sizing: border-box;
+    padding-top: 36px;
+    padding-left: 40px;
+    padding-right: 40px;
+    justify-content: space-between;
 }
 
 .header_line{
@@ -61,4 +77,30 @@
     align-items: center;
     justify-content: center;
 
+}
+
+.tag_list{
+    display: flex;
+    position: fixed;
+    left: 0;
+    right: 0;
+    background-color: #fff;
+    height: 108px;
+    z-index: 100000;
+
+}
+
+.add_page_tag_btn{
+    flex-shrink: 0;
+    height: 64px;
+    margin-top: 22px;
+    margin-right: 12px;
+    padding: 0 24px;
+    border-radius: 32px;
+    background-color: #B2B2B21A;
+    color: #000;
+    font-size: 28px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
 }

+ 101 - 34
src/_health/pages/add_moment.tsx

@@ -1,5 +1,5 @@
-import { View, Text, Textarea, Image, Input } from "@tarojs/components";
-import Taro, { useRouter } from "@tarojs/taro";
+import { View, Text, Textarea, Image, Input, ScrollView } from "@tarojs/components";
+import Taro, { useLoad, useRouter, useUnload } from "@tarojs/taro";
 import { useTranslation } from "react-i18next";
 import './add_moment.scss'
 import { useEffect, useState } from "react";
@@ -22,6 +22,8 @@ import AddLabel from "../components/add_label";
 import showAlert from "@/components/basic/Alert";
 import NewButton, { NewButtonType } from "../base/new_button";
 import { rpxToPx } from "@/utils/tools";
+import StatusIndicator, { StatusType } from "../base/status_indicator";
+import { IconCheck } from "@/components/basic/Icons";
 
 
 let useRoute;
@@ -46,6 +48,7 @@ export default function AddMoment() {
     const [showTitlePicker, setShowTitlePicker] = useState(false)
     const [isYesterday, setIsYesterday] = useState(false)
     const [labels, setLabels] = useState<any>([])
+    const [bottom, setBottom] = useState(-120)
 
 
 
@@ -73,15 +76,42 @@ export default function AddMoment() {
     useEffect(() => {
         global.set_time = new Date().getTime()
 
+        // Taro.onKeyboardHeightChange(res => {
+        //     setBottom(res.height > 0 ? res.height : -120)
+        // })
+
 
         getLabelsEvent({ window: health.mode, use: is_temp ? 'ONE_RECORD' : '' }).then(res => {
             setLabels((res as any).labels)
             if (is_temp && title == '') {
-                setShowTitlePicker(true)
+                // setShowTitlePicker(true)
             }
         })
     }, [])
 
+    useLoad(()=>{
+        Taro.enableAlertBeforeUnload({
+            message:'hhh',
+            success(res) {
+                
+            },
+            fail(res) {
+                
+            },
+            complete(res) {
+                
+            },
+        })
+    })
+
+    useUnload(()=>{
+        Taro.disableAlertBeforeUnload({
+            
+        })
+    })
+
+
+
     function duration() {
         const seconds = durationT / 1000
         var hours = Math.floor(seconds / 3600)
@@ -105,12 +135,12 @@ export default function AddMoment() {
         setDurationPicker(true)
     }
 
-    function addImage() {
+    function addImage(isCamera) {
         Taro.chooseMedia({
             count: 1,
             sizeType: ['compressed'],
             mediaType: ['image'],
-            sourceType: ['album'],
+            sourceType: [isCamera?'camera':'album'],
             success: function (res) {
                 chooseSuccess(res, true)
                 checkAuthorized()
@@ -340,44 +370,65 @@ export default function AddMoment() {
         <View style={{
             display: 'flex',
             backgroundColor: '#fff',
-            padding: rpxToPx(40),
+            // padding: rpxToPx(40),
             flexDirection: 'column',
             height: rpxToPx(550),
             width: rpxToPx(750),
             boxSizing: 'border-box'
 
         }}>
-            <View className="addmoment_header">
-                <Text onClick={() => {
-                    setShowTimePicker(true)
-                }} style={{ marginRight: rpxToPx(24), color: '#5C7099' }}>{getDate()}{time}</Text>
-                <Text
-                    onClick={() => {
-                        setShowTitlePicker(true)
-                    }}
-                    style={{ marginRight: 20, color: '#5C7099' }}>{title}</Text>
+            <View className="addmoment_header" onClick={() => {
+                setShowTimePicker(true)
+            }}>
+                <StatusIndicator type={StatusType.big}
+                    color={getThemeColor(health.mode)}
+                    fontSize={rpxToPx(30)}
+                    fontColor={getThemeColor(health.mode)}
+                    text={getDate() + time}>
+                    <IconCheck color="#fff" width={rpxToPx(24)} height={24} />
+                </StatusIndicator>
+                <View className="h22" style={{ color: MainColorType.link, marginTop: rpxToPx(8) }}>编辑打卡</View>
+
             </View>
 
+            <Input className="meal_name" value={title}
+                placeholder={health.mode == 'EAT' ? 'Meal Name' : 'Active Name'}
+                style={{ caretColor: getThemeColor(health.mode) }}
+                // cursorColor='#ff0000'
+                // onFocus={() => {
+                //     setTitleFocus(true)
+                // }}
+                // onBlur={() => {
+                //     setTitleFocus(false)
+                // }}
+                onInput={(e: any) => {
+                    setTitle(e.target.value)
+                }}
+                onKeyboardHeightChange={(e) => {
+                    setBottom(e.detail.height > 0 ? e.detail.height : -120)
+                }}
+
+            />
+
+            <Textarea placeholder="简单描述(选填)" className="textarea"
+                placeholder-style="color:#B2B2B2"
+                onInput={e => {
+                    setDesc(e.detail.value)
+                }} />
+
             <View className="form">
-                <View>
-                    {
-                        (health.mode == 'FAST' || health.mode == 'SLEEP') &&
-                        <Input className="input_title" placeholder="标题文字" onInput={(e: any) => {
-                            setTitle(e.target.value)
-                        }} />
-                    }
-                    <Textarea placeholder="简单描述(选填)" className="textarea"
-                        placeholder-style="color:#B2B2B2"
-                        onInput={e => {
-                            setDesc(e.detail.value)
-                        }} />
-                </View>
                 {
-                    imgUrl.length > 0 ? <View className="cover" ><NewButton type={NewButtonType.img} onClick={addImage}><Image src={imgUrl} mode="aspectFill" className="cover" onClick={addImage} /></NewButton></View> :
-                        <View className="cover" ><NewButton type={NewButtonType.img} onClick={addImage}><View className="cover" >
-                            <Image src={require('@assets/images/add3.png')} style={{ width: 24, height: 24 }} />
+                    imgUrl.length > 0 && <View className="cover" ><NewButton type={NewButtonType.img} onClick={()=>addImage(false)}><Image src={imgUrl} mode="aspectFill" className="cover" onClick={addImage} /></NewButton></View>
+                }
+                {
+                    imgUrl.length == 0 && <View style={{ display: 'flex', flexDirection: 'row' }}>
+                        <View className="cover" ><NewButton type={NewButtonType.img} onClick={()=>addImage(false)}><View className="cover" >
+                            <Image src={require('@assets/_health/album.png')} style={{ width: 40, height: 40 }} />
                         </View></NewButton></View>
-
+                        <View className="cover" style={{marginLeft:rpxToPx(40)}}><NewButton type={NewButtonType.img} onClick={()=>addImage(true)}><View className="cover" >
+                            <Image src={require('@assets/_health/camera.png')} style={{ width: 40, height: 40 }} />
+                        </View></NewButton></View>
+                    </View>
                 }
 
             </View>
@@ -417,7 +468,7 @@ export default function AddMoment() {
                     setShowTimePicker(false)
                 }} />
         }
-        {
+        {/* {
             showTitlePicker && <Modal testInfo={null}
                 catchDismiss={true}
                 dismiss={() => {
@@ -443,7 +494,7 @@ export default function AddMoment() {
                         // setShowTitlePicker(false)
                     }} />
             </Modal>
-        }
+        } */}
 
         {/* {
             durationPicker && <DurationPicker
@@ -462,5 +513,21 @@ export default function AddMoment() {
 
         }
         {/* <Text> add eat detail</Text> */}
+        {
+            <View className="tag_list" style={{ bottom: bottom }}>
+                <ScrollView style={{ width: rpxToPx(750), flexDirection: 'row', display: 'flex', height: rpxToPx(108) }} scrollX enableFlex showScrollbar={false}>
+                    <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
+                    {
+                        labels.map((item, index) => {
+                            return <View className="add_page_tag_btn" key={index} onClick={() => {
+                                setTitle(item.title)
+                            }}>{item.title}</View>
+                        })
+                    }
+                    <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
+                </ScrollView>
+            </View>
+        }
+
     </View>
 }

+ 1 - 1
src/_health/pages/edit_schedule.tsx

@@ -23,7 +23,7 @@ export default function EditSchedule() {
     }, [])
 
     function schedules() {
-        getSchedules({ window: health.mode, is_all_day: false }).then(res => {
+        getSchedules({ window: health.mode, specific_time: true }).then(res => {
             console.log('sss', res)
             if ((res as any).data && (res as any).data.length > 0) {
                 setList((res as any).data)

+ 26 - 3
src/_health/pages/guide_active.tsx

@@ -198,7 +198,7 @@ export default function GuideActive() {
             <View className='item_add'
                 onClick={() => add()}>
                 <StatusIndicator type={StatusType.normal} text={t('health.add_active')}
-                    color={MainColorType.active} fontColor={MainColorType.active} fontSize={rpxToPx(34)}/>
+                    color={MainColorType.active} fontColor={MainColorType.active} fontSize={rpxToPx(34)} />
                 <View style={{ flex: 1 }} />
             </View>
         </Card>
@@ -290,8 +290,31 @@ export default function GuideActive() {
                 }}
             />
         </View>
-
         {
+            showModal && <AddLabel labels={labels}
+                window='ACTIVE'
+                disMiss={() => setShowModal(false)}
+                onlyCheck={true}
+                schedules={list}
+                confirm={(res) => {
+                    setShowModal(false)
+                    if ((res as any).result) {
+                        dispatch(setSchedules((res as any).schedules))
+                        dispatch(setFooter((res as any).footer))
+                        setList((res as any).schedules)
+                        setErrors([])
+                    }
+                    else {
+                        setList((res as any).schedules)
+                        dispatch(setFooter((res as any).footer))
+                        setErrors((res as any).error_messages ? (res as any).error_messages : [])
+                    }
+
+                }}
+                color={MainColorType.active} />
+        }
+
+        {/* {
             showModal && <Modal testInfo={null}
                 dismiss={() => {
                     setShowModal(false)
@@ -318,6 +341,6 @@ export default function GuideActive() {
                     }}
                     color={MainColorType.active} />
             </Modal>
-        }
+        } */}
     </View>
 }

+ 27 - 2
src/_health/pages/guide_eat.tsx

@@ -124,6 +124,8 @@ export default function GuideEat() {
         return ''
     }
 
+    
+
     function items() {
         var items = list.filter(item => item.window == 'EAT')
         return <Card>
@@ -187,7 +189,7 @@ export default function GuideEat() {
             <View className='item_add'
                 onClick={() => add()}>
                 <StatusIndicator type={StatusType.normal} text={t('health.add_meal')}
-                    color={MainColorType.eat} fontColor={MainColorType.eat} fontSize={rpxToPx(34)}/>
+                    color={MainColorType.eat} fontColor={MainColorType.eat} fontSize={rpxToPx(34)} />
                 <View style={{ flex: 1 }} />
             </View>
         </Card>
@@ -255,6 +257,7 @@ export default function GuideEat() {
         <View style={{ height: 300, flexShrink: 0 }} />
         <View style={{ flex: 1 }} />
         <View className="main_footer">
+            
             <NewButton
                 type={NewButtonType.fill}
                 title="下一步"
@@ -268,6 +271,28 @@ export default function GuideEat() {
             />
         </View>
         {
+            showModal && <AddLabel labels={labels}
+                window='EAT'
+                disMiss={() => setShowModal(false)}
+                onlyCheck={true}
+                schedules={list}
+                confirm={(res) => {
+                    setShowModal(false)
+                    if ((res as any).result) {
+                        dispatch(setSchedules((res as any).schedules))
+                        dispatch(setFooter((res as any).footer))
+                        setList((res as any).schedules)
+                        setErrors([])
+                    }
+                    else {
+                        setList((res as any).schedules)
+                        dispatch(setFooter((res as any).footer))
+                        setErrors((res as any).error_messages ? (res as any).error_messages : [])
+                    }
+                }}
+                color={MainColorType.eat} />
+        }
+        {/* {
             showModal && <Modal testInfo={null}
                 dismiss={() => {
                     setShowModal(false)
@@ -293,6 +318,6 @@ export default function GuideEat() {
                     }}
                     color={MainColorType.eat} />
             </Modal>
-        }
+        } */}
     </View>
 }

+ 70 - 3
src/_health/pages/guide_sleep.tsx

@@ -18,12 +18,15 @@ import ScheduleItem from "../components/schedule_item";
 import { useTranslation } from "react-i18next";
 import CellFooter, { CellFooterType } from "../base/cell_footer";
 import CellFooterText from "../base/cell_footer_text";
+import FastSleepPopupContent from "../components/fast_sleep_popup_content";
+import { StatusType } from "../base/status_indicator";
 
 export default function GuideSleep() {
     const health = useSelector((state: any) => state.health);
     const [errors, setErrors] = useState<any>([])
     const [highlight, setHighlight] = useState(true)
     const [list, setList] = useState<any>(health.schedules)
+    const [showPopCard, setShowPopCard] = useState(false)
     const { t } = useTranslation()
     const dispatch = useDispatch()
     const selMode = 'SLEEP'
@@ -79,6 +82,10 @@ export default function GuideSleep() {
         return ''
     }
 
+    function more() {
+        setShowPopCard(true)
+    }
+
     function items() {
         var items = list.filter(item => item.window == 'FAST' || item.window == 'SLEEP')
         return <Card>
@@ -92,7 +99,7 @@ export default function GuideSleep() {
                     return <ScheduleItem
                         key={i * 100}
                         obj={obj}
-                        highlight={highlight?obj.window=='SLEEP':false}
+                        highlight={highlight ? obj.window == 'SLEEP' : false}
                         showLine={i < items.length - 1}
                         errors={errors}
                         selMode={selMode}
@@ -117,19 +124,65 @@ export default function GuideSleep() {
             }
         </Card>
     }
+
+    function getTime(event){
+        var t = ''
+        list.forEach(item => {
+            if (item.event==event){
+                t = item.time
+            }
+        });
+        return t
+    }
+
+    function calculateTimeDifference(startTime, endTime) {
+        // 将时间字符串转换为小时和分钟
+        const [startHours, startMinutes] = startTime.split(':').map(Number);
+        const [endHours, endMinutes] = endTime.split(':').map(Number);
+      
+        // 将起始时间和结束时间转换为分钟
+        const startTotalMinutes = startHours * 60 + startMinutes;
+        let endTotalMinutes = endHours * 60 + endMinutes;
+      
+        // 如果结束时间小于起始时间,表示跨天
+        if (endTotalMinutes < startTotalMinutes) {
+          endTotalMinutes += 24 * 60; // 加24小时
+        }
+      
+        // 计算时间差
+        const diffMinutes = endTotalMinutes - startTotalMinutes;
+        const hours = Math.floor(diffMinutes / 60);
+        const minutes = diffMinutes % 60;
+      
+        // 格式化返回结果
+        if (hours > 0 && minutes > 0) {
+          return `${hours}小时${minutes}分钟`;
+        } else if (hours > 0) {
+          return `${hours}小时`;
+        } else {
+          return `${minutes}分钟`;
+        }
+      }
+
     return <View style={{ flex: 1, display: 'flex', flexDirection: 'column', height: '100vh' }}>
         <NewHeader type={NewHeaderType.center_subtitle} title={t('health.guide_1_title')} subtitle={t('health.guide_1_desc')} />
         {
             items()
         }
         <CellFooter type={CellFooterType.left}>
-            <View style={{display:'flex',flexDirection:'column'}}>
-                <CellFooterText text={footerTitle()} isBold/>
+            <View style={{ display: 'flex', flexDirection: 'column' }}>
+                <CellFooterText text={footerTitle()} isBold />
                 <CellFooterText text={footerDesc()} />
             </View>
         </CellFooter>
         <View style={{ flex: 1 }} />
         <View className="main_footer">
+            <NewButton
+                type={NewButtonType.link}
+                title="了解更多"
+                onClick={more}
+            />
+            <View style={{ height: rpxToPx(60) }} />
             <NewButton
                 type={NewButtonType.fill}
                 title="下一步"
@@ -143,5 +196,19 @@ export default function GuideSleep() {
                 }}
             />
         </View>
+
+        {
+            showPopCard && <FastSleepPopupContent
+                close={() => { setShowPopCard(false) }}
+                beforeStatus={StatusType.normal}
+                sleepStatus={StatusType.normal}
+                afterStatus={StatusType.normal}
+                total={calculateTimeDifference(getTime('FAST_START'),getTime('FAST_END'))}
+                total1={calculateTimeDifference(getTime('FAST_START'),getTime('SLEEP_BEDTIME'))}
+                total2={calculateTimeDifference(getTime('SLEEP_BEDTIME'),getTime('SLEEP_WAKE_UP'))}
+                total3={calculateTimeDifference(getTime('SLEEP_WAKE_UP'),getTime('FAST_END'))}
+                showStep={false}
+            />
+        }
     </View>
 }

+ 7 - 2
src/_health/pages/schedules.tsx

@@ -520,7 +520,12 @@ export default function Schedules() {
                     }
                 </Modal>
             }
-
+            {
+                showModal && <AddLabel labels={isEat ? labels : labels2} 
+                color={isEat ? MainColorType.eat : MainColorType.active} 
+                disMiss={() => setShowModal(false)} />
+            }
+{/* 
             {
                 showModal && <Modal testInfo={null}
                     dismiss={() => {
@@ -529,7 +534,7 @@ export default function Schedules() {
                     confirm={() => { }}>
                     <AddLabel labels={isEat ? labels : labels2} color={isEat ? MainColorType.eat : MainColorType.active} disMiss={() => setShowModal(false)} />
                 </Modal>
-            }
+            } */}
         </View>
     </View>
 }

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

@@ -212,7 +212,7 @@ export default function SchedulesEdit() {
     }
 
     function reminder(obj) {
-        if (!obj.is_all_day || health.mode == 'DAY' || health.mode == 'NIGHT') {
+        if (obj.specific_time || health.mode == 'DAY' || health.mode == 'NIGHT') {
             return <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
                 {
                     obj.reminder ? <IconNotification color={MainColorType.g03} width={rpxToPx(28)} /> : <IconNotificationOff color={MainColorType.g03} width={rpxToPx(28)} />
@@ -340,14 +340,14 @@ export default function SchedulesEdit() {
                                                     } */}
                                                 </View>
                                                 {
-                                                    !obj.is_all_day && <View className="h22" style={{ color: MainColorType.g02 }}>{obj.time}</View>
+                                                    obj.specific_time && <View className="h22" style={{ color: MainColorType.g02 }}>{obj.time}</View>
                                                 }
                                             </View>
                                             {
                                                 router.params.type == 'reminder' ? reminder(obj) : editName(item, obj, index, i)
                                             }
 
-                                            {/* {router.params.type == 'reminder' && (!obj.is_all_day || health.mode == 'DAY' || health.mode == 'NIGHT') && <Switch checked={obj.reminder}
+                                            {/* {router.params.type == 'reminder' && (obj.specific_time || health.mode == 'DAY' || health.mode == 'NIGHT') && <Switch checked={obj.reminder}
                                                 color={getThemeColor(obj.window)}
                                                 onChange={e => {
                                                     if (process.env.TARO_ENV == 'weapp') {

+ 1 - 0
src/app.scss

@@ -525,6 +525,7 @@ text{
 /* #ifdef weapp */
 .main_footer {
     display: flex;
+    flex-direction: column;
     width: 750px;
     align-items: center;
     justify-content: center;

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

@@ -390,7 +390,7 @@ export default function MainConsole(props: { type: WindowType }) {
             time: strTime,
             event: selItem.event,
             title: selItem.title,
-            is_all_day: false
+            specific_time: true
         }, selItem.schedule_id).then(res => {
             global.refreshWindow()
             global.refreshHistory()