leon 1 年之前
父節點
當前提交
f776c35a00

+ 26 - 16
src/_health/components/add_label.tsx

@@ -15,6 +15,7 @@ import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import NewModal from "../base/new_modal";
 import Card from "./card";
 import { rpxToPx } from "@/utils/tools";
+import { useTranslation } from "react-i18next";
 
 export default function AddLabel(props: {
     labels: any,
@@ -35,6 +36,7 @@ export default function AddLabel(props: {
     const [timeLabels, setTimeLabels] = useState<any>([])
     const [strTime, setStrTime] = useState(dayjs().format('HH:mm'))
     const [strLabel, setStrLabel] = useState('')
+    const { t } = useTranslation()
 
     useEffect(() => {
         getData()
@@ -59,26 +61,26 @@ export default function AddLabel(props: {
         if (props.onlyCheck) {
             array = [...props.schedules, {
                 event: event,
-                title: value,
+                title: value.trim(),
                 time: isFullday ? null : strTime,
                 specific_time: !isFullday,
-                time_label: isFullday ? strLabel : null
+                time_label: isFullday ? strLabel.trim() : null
             }]
         }
         else {
             array = [{
                 event: event,
-                title: value,
+                title: value.trim(),
                 time: isFullday ? null : strTime,
                 specific_time: !isFullday,
-                time_label: isFullday ? strLabel : null
+                time_label: isFullday ? strLabel.trim() : null
             }]
         }
         createSchedule({
             only_check: props.onlyCheck,
             schedules: array,
             op_page: props.op_page ?? null,
-            sort_by:'EVENT'
+            sort_by: 'EVENT'
         }).then(res => {
             if ((res as any).result) {
                 if (global.refreshWindow) {
@@ -125,10 +127,10 @@ export default function AddLabel(props: {
             props.confirm(value)
         }
         else {
-            if (value.length==0){
+            if (value.length == 0) {
                 Taro.showToast({
-                    title:'请选择或输入标签',
-                    icon:'none'
+                    title: '请选择或输入标签',
+                    icon: 'none'
                 })
                 return;
             }
@@ -159,7 +161,7 @@ export default function AddLabel(props: {
                         paddingRight: rpxToPx(54),
                         justifyContent: 'space-between'
                     }}>
-                        <Text className="h34">具体时间</Text>
+                        <Text className="h34">{t('health.fix_time')}</Text>
                         <Switch
                             color={props.color ? props.color : getThemeColor(health.mode)}
                             checked={!isFullday}
@@ -175,7 +177,7 @@ export default function AddLabel(props: {
             {
                 isFullday ? <View>
                     <Card>
-                        <Input className="input_lb" placeholder="选择或输入时间标签" value={strLabel} onInput={(e: any) => {
+                        <Input className="input_lb" placeholder={t('health.chose_enter_time_desc')} value={strLabel} onInput={(e: any) => {
                             setStrLabel(e.target.value)
                         }} />
                     </Card>
@@ -183,7 +185,11 @@ export default function AddLabel(props: {
                         <View className="label_bg">
                             {
                                 timeLabels.map((item, index) => {
-                                    return <View className="label" key={index} onClick={() => setStrLabel(item.title)}>{item.title}</View>
+                                    return <View className="label"
+                                        style={{
+                                            backgroundColor: item.title == strLabel ? (isEat() ? getThemeColor('EAT') + '1A' : getThemeColor('ACTIVE') + '1A') : '#B2B2B21A'
+                                        }}
+                                        key={index} onClick={() => setStrLabel(item.title)}>{item.title}</View>
                                 })
                             }
                         </View>
@@ -201,7 +207,7 @@ export default function AddLabel(props: {
                             justifyContent: 'center'
                             , width: rpxToPx(698)
                         }}>
-                            <Text className="h34" style={{ color: isEat() ? MainColorType.eat : MainColorType.active }}>{strTime}</Text>
+                            <Text className="h44" style={{ color: isEat() ? MainColorType.eat : MainColorType.active }}>{strTime}</Text>
                             <View className="border_footer_line" style={{ left: rpxToPx(40), right: rpxToPx(40) }} />
                         </View>
                         <NewTimePicker
@@ -221,7 +227,7 @@ export default function AddLabel(props: {
     }
 
 
-    return <NewModal title="标签" dismiss={props.disMiss}
+    return <NewModal title={isEat() ? t('health.my_meal') : t('health.my_activity')} dismiss={props.disMiss}
         themeColor={props.color ? props.color : getThemeColor(health.mode)}
         btnTitle={props.justLabel ? '完成' : '下一步'}
         confirm={() => {
@@ -231,7 +237,7 @@ export default function AddLabel(props: {
     >
         <View>
             <View className="body1">
-                <Input className="input_lb" placeholder="选择或输入标签" value={value} onInput={(e: any) => {
+                <Input className="input_lb" placeholder={isEat() ? t('health.choose_enter_meal_label') : t('health.choose_enter_activity_name')} value={value} onInput={(e: any) => {
                     setValue(e.target.value)
                 }} />
                 <ScrollView scrollX style={{ width: rpxToPx(750), height: rpxToPx(164) }} showScrollbar={false}>
@@ -240,7 +246,11 @@ export default function AddLabel(props: {
 
                         {
                             props.labels.map((item, index) => {
-                                return <View className="label" key={index} onClick={() => setValue(item.title)}>{item.title}</View>
+                                return <View className="label"
+                                    style={{
+                                        backgroundColor: item.title == value ? (isEat() ? getThemeColor('EAT') + '1A' : getThemeColor('ACTIVE') + '1A') : '#B2B2B21A'
+                                    }}
+                                    key={index} onClick={() => setValue(item.title)}>{item.title}</View>
                             })
                         }
                     </View>
@@ -249,7 +259,7 @@ export default function AddLabel(props: {
             {/* <View className="pop_footer" style={{ backgroundColor: props.color ? props.color : getThemeColor(health.mode) }} onClick={tapDone}>{props.justLabel ? '完成' : '下一步'}</View> */}
             {
                 showTimePicker && <NewModal
-                    title="Set Time"
+                    title={t('health.schedule_time')}
                     themeColor={props.color ? props.color : getThemeColor(health.mode)}
                     btnTitle='完成'
                     dismiss={() => {

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

@@ -126,7 +126,7 @@ export default function ChooseDateTime(props: {
             }
             {/* <View className="h34" style={{color:props.color}}>{dateTitle()} {timeTitle()}</View> */}
             {
-                !props.title ? <View className="h34" style={{ color: props.color }}>{dateTitle()} {timeTitle()}</View> :
+                !props.title ? <View className="h44" style={{ color: props.color }}>{dateTitle()} {timeTitle()}</View> :
                     <View style={{
                         borderColor: props.showError ? 'red' : (props.expand && !chooseDate) ? props.color : 'transparent',
                         borderWidth: rpxToPx(2),

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

@@ -2,7 +2,7 @@ import { View, Text, Image } from "@tarojs/components";
 import './fast_sleep_console.scss'
 import { rpxToPx, vibrate } from "@/utils/tools";
 import NewButton, { NewButtonType } from "../base/new_button";
-import { getThemeColor } from "@/features/health/hooks/health_hooks";
+import { durationTime, getScenario, getThemeColor } from "@/features/health/hooks/health_hooks";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import dayjs from "dayjs";
 import { MainColorType } from "@/context/themes/color";
@@ -116,8 +116,10 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
 
 
         showAlert({
-            title: 'del',
-            content: '确认删除此记录?',
+            title: t('health.del_title'),
+            content: '',
+            cancelText: t('health.del_cancel'),
+            confirmText: t('health.del_confirm'),
             showCancel: true,
             confirm: () => {
                 delRecord({ ids: array }).then(res => {
@@ -188,7 +190,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
             list.push(t('health.finish_setup'))
         }
         if (props.data.status != 'WFS') {
-            list.push(t('health.delete_current_record'))
+            list.push(t('health.delete_log'))
         }
         if (health.finish_setup) {
             list.push(t('health.edit_schedule'))
@@ -197,9 +199,10 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
     }
 
     function showAction() {
+        const scenario = getScenario(health.windows, 'FAST')
         showActionSheet({
             showActionSheetWithOptions: showActionSheetWithOptions,
-            title: t('health.more_actions'),
+            title: props.data.status == 'WFS' ? durationTime(scenario.target.start_timestamp, scenario.target.end_timestamp) : t('health.log_progress'),
             itemList: actionList(),
             success: (res) => {
                 tapActionSheet(res)
@@ -213,7 +216,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
             case t('health.finish_setup'):
                 jumpPage('/_health/pages/guide_begin')
                 break;
-            case t('health.delete_current_record'):
+            case t('health.delete_log'):
                 delConfirm()
                 break;
             case t('health.edit_schedule'):

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

@@ -186,7 +186,7 @@ export default function PostMomentTime(props: {
 
                 // footerTitle={scheduleTime()}
                 enterTimestamp={global.set_time}
-                targetTimestamp={props.moment.target?props.moment.target.timestamp:new Date().getTime()}
+                targetTimestamp={props.moment && props.moment.target?props.moment.target.timestamp:new Date().getTime()}
 
                 // tapFooter={() => {
                 //     if (time == dayjs(props.moment.target.timestamp).format('HH:mm')) {

+ 0 - 1
src/_health/components/schedule_item.scss

@@ -4,7 +4,6 @@
     display: flex;
     align-items: center;
     justify-content: center;
-    font-size: 50px;
 }
 
 .ss{

+ 147 - 6
src/_health/components/schedule_item.tsx

@@ -1,7 +1,7 @@
 import showAlert from "@/components/basic/Alert";
 import { getThemeColor } from "@/features/health/hooks/health_hooks";
 import { rpxToPx } from "@/utils/tools";
-import { View, Text } from "@tarojs/components";
+import { View, Text, Switch, ScrollView, Input } from "@tarojs/components";
 import { AtSwipeAction } from "taro-ui";
 import StatusIndicator, { StatusType } from "../base/status_indicator";
 import { MainColorType } from "@/context/themes/color";
@@ -11,6 +11,8 @@ import NewModal from "../base/new_modal";
 import Card from "./card";
 import NewTimePicker from "../base/new_timepicker";
 import './schedule_item.scss'
+import dayjs from "dayjs";
+import { useTranslation } from "react-i18next";
 
 export default function ScheduleItem(props: {
     key: any,
@@ -25,12 +27,23 @@ export default function ScheduleItem(props: {
     hideReminderIcon?: boolean,
     onDelete?: Function,
     onChange?: Function,
+    tapSpecificTime?: Function,
+    labels?: any,
     index: number,
     count: number
 }) {
     const [showTimePicker, setShowTimePicker] = useState(false)
     const [time, setTime] = useState(props.obj.time)
 
+    const [showFullPicker, setShowFullPicker] = useState(false)
+    const [isFullday, setIsFullday] = useState(false)
+    const [timeLabels, setTimeLabels] = useState<any>(props.labels ?? [])
+    const [strTime, setStrTime] = useState(dayjs().format('HH:mm'))
+    const [strLabel, setStrLabel] = useState('')
+    const { t } = useTranslation()
+
+
+
     function itemStyle(obj) {
         if (obj.is_conflict) {
             return {
@@ -45,7 +58,7 @@ export default function ScheduleItem(props: {
             return {
                 backgroundColor: '#B2B2B21A',
                 color: '#000',
-                borderColor:'transparent'
+                borderColor: 'transparent'
             }
         }
         return {
@@ -58,6 +71,106 @@ export default function ScheduleItem(props: {
         //     color: obj.window == props.selMode ? getThemeColor(props.selMode) : '#000'
         // }
     }
+
+    function tapSpecificTime() {
+        console.log(props.obj)
+        setIsFullday(!props.obj.specific_time)
+        setStrLabel(props.obj.time_label)
+        setShowFullPicker(true)
+    }
+
+    function done() {
+        console.log(isFullday, strTime, strLabel)
+        setShowFullPicker(false)
+        if (props.tapSpecificTime) {
+            props.tapSpecificTime({
+                is_full_day: isFullday,
+                time: strTime,
+                label: strLabel.trim()
+            })
+        }
+
+    }
+
+    function timeContent() {
+        return <View style={{ display: 'flex', flexDirection: 'column' }}>
+            {
+                <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">{t('health.fix_time')}</Text>
+                        <Switch
+                            color={getThemeColor(props.obj.window)}
+                            checked={!isFullday}
+                            onChange={(e) => {
+                                setIsFullday(!e.detail.value)
+                            }} />
+                    </View>
+                </Card>
+            }
+            {
+                <View style={{ height: rpxToPx(36) }} />
+            }
+            {
+                isFullday ? <View>
+                    <Card>
+                        <Input className="input_lb" placeholder={t('health.chose_enter_time_desc')} value={strLabel} onInput={(e: any) => {
+                            setStrLabel(e.target.value)
+                        }} />
+                    </Card>
+                    <ScrollView scrollX style={{ width: rpxToPx(750), height: rpxToPx(164) }} showScrollbar={false}>
+                        <View className="label_bg">
+                            {
+                                timeLabels.map((item, index) => {
+                                    return <View className="label"
+                                        style={{
+                                            backgroundColor: item.title == strLabel ? getThemeColor('ACTIVE') + '1A' : '#B2B2B21A'
+                                        }}
+                                        key={index} onClick={() => setStrLabel(item.title)}>{item.title}</View>
+                                })
+                            }
+                        </View>
+                    </ScrollView>
+                </View> : <Card>
+                    <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', width: rpxToPx(700) }}>
+                        <View style={{
+                            position: 'relative',
+                            display: 'flex', flexDirection: 'row',
+                            height: rpxToPx(128),
+                            alignItems: 'center',
+                            boxSizing: 'border-box',
+                            paddingLeft: rpxToPx(54),
+                            paddingRight: rpxToPx(54),
+                            justifyContent: 'center'
+                            , width: rpxToPx(698)
+                        }}>
+                            <Text className="h44" style={{ color: getThemeColor(props.obj.window) }}>{strTime}</Text>
+                            <View className="border_footer_line" style={{ left: rpxToPx(40), right: rpxToPx(40) }} />
+                        </View>
+                        <NewTimePicker
+                            color={getThemeColor(props.obj.window)}
+                            time={strTime}
+                            onChange={e => {
+                                console.log(e)
+                                setStrTime(e)
+                            }} />
+
+                    </View>
+
+                </Card>
+            }
+
+        </View>
+    }
+
     return <View key={props.key}>
         <View className="ss" style={{
             borderTopLeftRadius: props.index == 0 ? rpxToPx(26) : 0,
@@ -123,9 +236,9 @@ export default function ScheduleItem(props: {
                         {
                             props.days && <View className="h30" style={{ color: MainColorType.g02 }}>+{props.days} day</View>
                         }
-                        {
+                        {/* {
                             !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.specific_time && <View className='edit_item_time schedule_border' onClick={() => {
@@ -138,7 +251,17 @@ export default function ScheduleItem(props: {
                             }} style={itemStyle(props.obj)}>{props.obj.time}</View>
                         }
                         {
-                            props.disable && <View className="schedule_border" style={{borderColor:'transparent'}}>
+                            !props.obj.specific_time && <View className="edit_item_time2" onClick={() => {
+                                // if (props.tapSpecificTime){
+                                //     props.tapSpecificTime()
+                                // }
+                                tapSpecificTime()
+                            }}>
+                                <Text className="h34 line1" style={{ textAlign: 'center' }}>{props.obj.time_label}</Text>
+                            </View>
+                        }
+                        {
+                            props.disable && <View className="schedule_border" style={{ borderColor: 'transparent' }}>
                                 <View className="edit_item_time" style={{ backgroundColor: 'transparent', color: props.gray ? MainColorType.g02 : '#000' }}>{props.obj.time}</View>
                             </View>
                         }
@@ -167,7 +290,7 @@ export default function ScheduleItem(props: {
                 themeColor={getThemeColor(props.obj.window)}>
                 <Card>
                     <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
-                        <View className="picker_title" style={{ color: getThemeColor(props.obj.window), width: rpxToPx(618) }}>{time}
+                        <View className="picker_title h44" style={{ color: getThemeColor(props.obj.window), width: rpxToPx(618) }}>{time}
                             <View className="border_footer_line" />
                         </View>
                         <NewTimePicker time={time}
@@ -181,5 +304,23 @@ export default function ScheduleItem(props: {
 
             </NewModal>
         }
+
+        {
+            showFullPicker && <NewModal
+                title={t('health.schedule_time')}
+                themeColor={getThemeColor(props.obj.window)}
+                btnTitle='完成'
+                dismiss={() => {
+                    setShowFullPicker(false)
+                }}
+                confirm={done}
+            >
+                <View style={{ height: rpxToPx(698) }}>
+                    {
+                        timeContent()
+                    }
+                </View>
+            </NewModal>
+        }
     </View>
 }

+ 13 - 5
src/_health/components/schedule_move_list.tsx

@@ -153,17 +153,25 @@ export default function ScheduleMoveList(props: { array: any, itemHeight: number
         }
     }
 
-    return <View id="myScrollView" ref={ref} style={{ height: '100%', overflow: canScroll ? 'scroll' : 'hidden',position:'relative' }} 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>
                 {
                     list.map((item, index) => {
-                        return <View key={index} style={{ opacity: changedIndex == index && hiddenContent ? 0 : 1, height: props.itemHeight, width: rpxToPx(700) }}
+                        return <View key={index} style={{
+                            opacity: changedIndex == index && hiddenContent ? 0 : 1, height: props.itemHeight, width: rpxToPx(700),
+                            // borderTopLeftRadius: index == 0 ? rpxToPx(26) : 0,
+                            // borderTopRightRadius: index == 0 ? rpxToPx(26) : 0,
+                            // borderBottomLeftRadius: index == list.count - 1 ? rpxToPx(26) : 0,
+                            // borderBottomRightRadius: index == list.count - 1 ? rpxToPx(26) : 0,
+                            borderRadius:rpxToPx(26),
+                            backgroundColor: '#fff'
+                        }}
                             onLongPress={(e) => longPress(e, index)}
                             onTouchMove={(e) => touchMove(e)}
                             onTouchEnd={(e) => touchEnd(e)}
                         >
-                            <View className='schedule_item' style={{ width: rpxToPx(700), height: rpxToPx(128), boxSizing: 'border-box' }}>
+                            <View className='schedule_item' style={{ width: rpxToPx(700), height: rpxToPx(128), boxSizing: 'border-box', backgroundColor: 'transparent' }}>
                                 <View style={{ display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', flex: 1 }}>
                                     <View className='item_left2'>
                                         <StatusIndicator type={StatusType.normal} color={MainColorType.active} text={item.title} fontSize={rpxToPx(34)} />
@@ -181,13 +189,13 @@ export default function ScheduleMoveList(props: { array: any, itemHeight: number
                     })
                 }
 
-                <MovableView style={{ height: changedIndex >= 0 ? props.itemHeight : 0, width: rpxToPx(700) }}
+                <MovableView style={{ height: changedIndex >= 0 ? props.itemHeight : 0, width: rpxToPx(700), borderRadius: rpxToPx(26), overflow: 'hidden' }}
                     direction='vertical'
                     disabled
                     animation={false}
                     y={movaleViewY}
                 >
-                    <View className='drag_item2' style={{ backgroundColor: props.color }}>
+                    <View className='drag_item2' style={{ backgroundColor: props.color, borderRadius: rpxToPx(26), overflow: 'hidden' }}>
                         {
                             dragIndex >= 0 && <View className='modal_sel_item2' style={{ height: props.itemHeight, border: 'none' }}>
                                 <View className='schedule_item' style={{ width: rpxToPx(700), height: rpxToPx(128), boxSizing: 'border-box' }}>

+ 28 - 100
src/_health/pages/add_moment.tsx

@@ -39,13 +39,11 @@ export default function AddMoment() {
     const { t } = useTranslation()
     const [imgUrl, setImgUrl] = useState('')
     const [showPicker, setShowPicker] = useState(false)
-    const [durationPicker, setDurationPicker] = useState(false)
     const [durationT, setDurationT] = useState(0)
     const dispatch = useDispatch()
     const health = useSelector((state: any) => state.health);
     const [timestamp, setTimestamp] = useState(new Date().getTime())
     const [showTimePicker, setShowTimePicker] = useState(false)
-    const [showTitlePicker, setShowTitlePicker] = useState(false)
     const [isYesterday, setIsYesterday] = useState(false)
     const [labels, setLabels] = useState<any>([])
     const [bottom, setBottom] = useState(-120)
@@ -78,11 +76,6 @@ 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 == '') {
@@ -129,37 +122,14 @@ export default function AddMoment() {
         })
     })
 
-
-
-    function duration() {
-        const seconds = durationT / 1000
-        var hours = Math.floor(seconds / 3600)
-        var minutes = Math.floor((seconds % 3600) / 60)
-        // const { hours, minutes } = getIntervalHoursAndMinutes(meal.schedule_end_time, meal.schedule_start_time)
-        var time = ''
-        if (hours > 0) {
-            time = hours + '小时'
-        }
-        if (minutes > 0) {
-            time += minutes + '分钟'
-        }
-        return time
-    }
-
-    function tapTime() {
-        setShowPicker(true)
-    }
-
-    function tapDuration() {
-        setDurationPicker(true)
-    }
-
     function addImage(isCamera) {
+        var source: any = isCamera ? ['camera'] : ['album']
+        console.log(source)
         Taro.chooseMedia({
             count: 1,
             sizeType: ['compressed'],
             mediaType: ['image'],
-            sourceType: [isCamera ? 'camera' : 'album'],
+            sourceType: source,
             success: function (res) {
                 chooseSuccess(res, true)
                 checkAuthorized()
@@ -170,27 +140,10 @@ export default function AddMoment() {
     }
 
     function save() {
-        // if (desc.length == 0 && imgUrl.length == 0) {
-        //     Taro.showToast({
-        //         icon: 'none',
-        //         title: '请输入描述或添加图片'
-        //     })
-        //     return
-        // }
         if (router.params.edit) {
             edit()
             return
         }
-        // var date = new Date(timestamp)
-        // var hour = parseInt(time.split(':')[0] + '')
-        // var minute = parseInt(time.split(':')[1] + '')
-        // date.setHours(hour)
-        // date.setMinutes(minute)
-        // var timestamp1 = date.getTime()
-        // if (isYesterday) {
-        //     timestamp1 -= 24 * 3600 * 1000
-        // }
-        // debugger
 
         var date = new Date(selDate + ' ' + time + ':' + dayjs(enterTimestmap).format('ss'))
         date.setMilliseconds(new Date(enterTimestmap).getMilliseconds())
@@ -247,13 +200,6 @@ export default function AddMoment() {
                 })
             }
 
-            // if (health.mode == 'EAT') {
-            //     dispatch(setShowActionTip({
-            //         isShow: true,
-            //         isCompleted: false
-            //     }))
-            // }
-
             Taro.disableAlertBeforeUnload({
 
             })
@@ -298,9 +244,6 @@ export default function AddMoment() {
         if (is_temp) {
             params.event = health.mode == 'EAT' ? 'EAT_CUSTOM' : 'ACTIVE_CUSTOM'
         }
-        // if (moment.target && moment.target.duration) {
-        //     params.duration = durationT//moment.target.duration
-        // }
 
         if (durationT) {
             params.duration = durationT * 60 * 1000
@@ -322,9 +265,6 @@ export default function AddMoment() {
             setPosting(false)
             if (process.env.TARO_ENV == 'weapp') {
                 Taro.navigateBack();
-                // Taro.redirectTo({
-                //     url: '/_health/pages/post_result?data=' + JSON.stringify(res)
-                // })
             }
 
             global.refreshWindow()
@@ -345,10 +285,6 @@ export default function AddMoment() {
 
         var savedFilePath = process.env.TARO_ENV == 'rn' ? res.tempFiles[0].path : res.tempFiles[0].tempFilePath
 
-        // var savedFilePath = res.savedFilePath
-        // await Taro.setStorage({ key: 'pic', data: savedFilePath })
-        // setImgUrl(savedFilePath as any)
-
         uploadFile(savedFilePath, isAlbum ? 'album' : 'camera')
 
 
@@ -438,10 +374,6 @@ export default function AddMoment() {
         setShowPicker(false)
     }
 
-    function durationContent() {
-        return <View></View>
-    }
-
     function getDate() {
         var sel = dayjs(selDate)
         var now = dayjs().format('YYYY-MM-DD')
@@ -455,24 +387,16 @@ export default function AddMoment() {
         else {
             return global.language == 'en' ? sel.format('MMM D ') : sel.format('MMMD日 ')
         }
+    }
+
+    function showTags() {
+        if (router.params.edit || !router.params.is_temp) return false
 
+        return true
     }
 
 
     return <View>
-        {/* {
-            health.mode != 'FAST' && health.mode != 'SLEEP' &&
-            <View className="addmoment_header">
-                <Text className="header_time" onClick={tapTime} style={{ color: getThemeColor(health.mode) }}>{dayjs().format('HH:mm')}</Text>
-                {
-                    (health.mode == 'EAT' || health.mode == 'ACTIVE') && <View className="header_line" />
-                }
-                {
-                    (health.mode == 'EAT' || health.mode == 'ACTIVE') && <Text className="header_time" style={{ color: getThemeColor(health.mode) }} onClick={tapDuration}>{duration()}</Text>
-                }
-            </View>
-        } */}
-
         <View style={{
             display: 'flex',
             backgroundColor: '#fff',
@@ -520,19 +444,25 @@ export default function AddMoment() {
                 <View className="border_footer_line" style={{ left: rpxToPx(96) }} />
             </View>
 
-            <View className="tag_list">
-                <ScrollView style={{ width: rpxToPx(750), flexDirection: 'row', display: 'flex', height: rpxToPx(108) }} scrollX enableFlex showScrollbar={false}>
-                    <View style={{ width: rpxToPx(96), 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>
+            {
+                showTags() && <View className="tag_list">
+                    <ScrollView style={{ width: rpxToPx(750), flexDirection: 'row', display: 'flex', height: rpxToPx(108) }} scrollX enableFlex showScrollbar={false}>
+                        <View style={{ width: rpxToPx(96), flexShrink: 0 }} />
+                        {
+                            labels.map((item, index) => {
+                                return <View className="add_page_tag_btn"
+                                style={{
+                                    backgroundColor:item.title==title?getThemeColor(health.mode)+'1A':'#B2B2B21A'
+                                }}
+                                key={index} onClick={() => {
+                                    setTitle(item.title)
+                                }}>{item.title}</View>
+                            })
+                        }
+                        <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
+                    </ScrollView>
+                </View>
+            }
 
             <View style={{ height: rpxToPx(40), flexShrink: 0 }} />
 
@@ -546,7 +476,7 @@ export default function AddMoment() {
 
             <View className="form">
                 {
-                    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 className="cover" ><NewButton type={NewButtonType.img} onClick={() => addImage(false)}><Image src={imgUrl} mode="aspectFill" className="cover" /></NewButton></View>
                 }
                 {
                     imgUrl.length == 0 && <View style={{ display: 'flex', flexDirection: 'row' }}>
@@ -574,8 +504,6 @@ export default function AddMoment() {
             onClick={save}
         /></View>
 
-
-        {/* <View className="save" style={{ backgroundColor: getThemeColor(health.mode) }} onClick={save}>Save</View> */}
         {
             showPicker && timeContent()
         }

+ 11 - 0
src/_health/pages/fast_sleep.tsx

@@ -99,6 +99,17 @@ export default function FastSleep() {
                 if (historyRef) {
                     (historyRef.current as any).onScroll(e)
                 }
+
+                if (e.detail.scrollTop>100){
+                    Taro.setNavigationBarTitle({
+                        title:t('health.fast_with_sleep')
+                    })
+                }
+                else {
+                    Taro.setNavigationBarTitle({
+                        title:''
+                    })
+                }
             }}
             loadMore={() => {
                 if (historyRef) {

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

@@ -104,7 +104,7 @@ export default function LongFast() {
     }
 
     function tapMore() {
-        var listItems = ['编辑目标', t('health.delete_current_record')]
+        var listItems = ['编辑目标', t('health.delete_log')]
         if (long_fast.status == 'OG') {
             listItems.push('结束断食')
             // listItems.push(t('health.edit_fast_goal'))

+ 5 - 3
src/_health/pages/post_result.tsx

@@ -217,10 +217,12 @@ export default function PostResult() {
                         global.tapDone()
                     }
                     if (data.current_window) {
-                        
-                        Taro.navigateBack({
-                            delta: Taro.getCurrentPages().length-1
+                        Taro.reLaunch({
+                            url:'/pages/clock/Clock'
                         })
+                        // Taro.navigateBack({
+                        //     delta: Taro.getCurrentPages().length-1
+                        // })
                     }
                     else {
                         Taro.navigateBack()

+ 92 - 75
src/_health/pages/schedules.tsx

@@ -1,4 +1,4 @@
-import { createSchedule, delSchedule, getLabelsEvent, getSchedules } from "@/services/health";
+import { createSchedule, delSchedule, getLabelsEvent, getLabelsTime, getSchedules } from "@/services/health";
 import { View, Text, Image } from "@tarojs/components";
 import { useRouter } from "@tarojs/taro";
 import { useEffect, useState } from "react";
@@ -66,6 +66,7 @@ export default function Schedules() {
     const [selMode, setSleMode] = useState(router.params.mode);
     const [isEat, setIsEat] = useState(false)
     const [loaded, setLoaded] = useState(false)
+    const [timeLabels, setTimeLabels] = useState<any>([])
     const { t } = useTranslation()
 
     useEffect(() => {
@@ -86,6 +87,10 @@ export default function Schedules() {
 
         }
 
+        getLabelsTime({}).then(res => {
+            setTimeLabels((res as any).labels)
+        })
+
     }, [])
 
 
@@ -123,6 +128,10 @@ export default function Schedules() {
                 windows = 'NIGHT,DAY';
                 break
         }
+
+        if (selMode == '') {
+            windows = ''
+        }
         getSchedules({ window: windows }).then(res => {
             setList((res as any).data)
             setErrors([])
@@ -151,21 +160,21 @@ export default function Schedules() {
         switch (selMode) {
             case 'FAST':
                 if (router.params.isFastSleep) {
-                    return '断食和睡眠';
+                    return t('health.fast_sleep_schedule');
                 }
-                return '断食和进食';
+                return t('health.eat_fast_schedule');
             case 'EAT':
-                return '进食和断食';
+                return t('health.eat_fast_schedule');
             case 'SLEEP':
-                return '睡眠和活动';
+                return t('health.active_sleep_schedule');
             case 'ACTIVE':
-                return '活动和睡眠';
+                return t('health.active_sleep_schedule');
             case 'DAY':
                 return '白天和夜晚';
             case 'NIGHT':
                 return '夜晚和白天';
         }
-        return t('health.schedules')
+        return t('health.full_schedule')
     }
 
     function modalContent() {
@@ -197,6 +206,7 @@ export default function Schedules() {
         setTempArray(array)
         createSchedule({
             schedules: array,
+            op_page: getOpPage()
             // only_check: true
         }).then(res => {
             checkResultData(res)
@@ -211,37 +221,16 @@ export default function Schedules() {
             setErrors([])
             setList((res as any).schedules)
             global.refreshWindow()
-            if (global.refreshSchedules) {
-                global.refreshSchedules()
-            }
-            if (global.refreshSchedules2) {
-                global.refreshSchedules2()
-            }
+            // if (global.refreshSchedules) {
+            //     global.refreshSchedules()
+            // }
+            // if (global.refreshSchedules2) {
+            //     global.refreshSchedules2()
+            // }
         }
         else {
             setShowAutoSave(false)
-            // setList((res as any).schedules)
-            // setErrors((res as any).error_messages ? (res as any).error_messages : [])
-            var array = (res as any).conflict_windows;
-            var showMore = false;
-            if (array.length > 2) {
-                showMore = true;
-            }
-            else if (array.length == 1) {
-                showMore = false;
-            }
-            else {
-                // 判断是否同时存在 FAST 和 EAT
-                const containsFastAndEat = array.includes('FAST') && array.includes('EAT');
-
-                // 判断是否同时存在 SLEEP 和 ACTIVE
-                const containsSleepAndActive = array.includes('SLEEP') && array.includes('ACTIVE');
-
-                // 最终结果
-                const result = containsFastAndEat || containsSleepAndActive;
-                showMore = !result;
-            }
-            if (selMode != '' && showMore) {
+            if (selMode != '' && (res as any).show_conflict_dialog) {
                 showAlert({
                     title: t('health.schedule_conflict'),
                     content: t('health.conflict_desc'),
@@ -301,34 +290,6 @@ export default function Schedules() {
         return getThemeColor('ACTIVE')
     }
 
-    function tapEdit() {
-
-    }
-
-    function itemStyle(obj) {
-        if (obj.is_conflict) {
-            return {
-                // backgroundColor: '#FF00001A',
-                // color: '#FF0000'
-                backgroundColor: '#B2B2B21A',
-                color: '#000',
-                borderWidth: 2,
-                borderColor: '#FF0000',
-                borderStyle: 'solid'
-            }
-        }
-        if (errors.length > 0) {
-            return {
-                backgroundColor: '#B2B2B21A',
-                color: '#000'
-            }
-        }
-        return {
-            backgroundColor: obj.window == selMode ? getThemeColor(selMode) + '1A' : '#B2B2B21A',
-            color: obj.window == selMode ? getThemeColor(selMode) : '#000'
-        }
-    }
-
     function showAll() {
         if (!btnEnable) {
             return
@@ -351,6 +312,44 @@ export default function Schedules() {
     }
 
     function more() {
+        var items: any = [t('health.edit_name')];
+        var temps = list.filter(item => {
+            return !item.specific_time
+        })
+        var needOrder = false
+        if (temps.length > 1) {
+            needOrder = true
+            items.push(t('health.edit_order'))
+        }
+        if (errors.length == 0) {
+            items.push(t('health.reset_schedule'))
+        }
+        showActionSheet({
+            showActionSheetWithOptions: showActionSheetWithOptions,
+            title: t('health.more_actions'),
+            itemList: items,
+            success: (res) => {
+                if (res == 0 ) {
+                    var url = `./schedules_edit?type=name&mode=${selMode}`
+                    jumpPage(url)
+                }
+                else if (res == 1) {
+                    if (needOrder) {
+                        jumpPage('./schedules_order?list=' + JSON.stringify(temps))
+                        return
+                    }
+                    jumpPage('/_health/pages/guide_begin')
+                }
+                else if (res == 2) {
+                    jumpPage('/_health/pages/guide_begin')
+                }
+
+            }
+        });
+    }
+
+
+    function more2() {
         var items: any = ['设置提醒', '个性化名称'];
         var temps = list.filter(item => {
             return !item.specific_time
@@ -365,12 +364,11 @@ export default function Schedules() {
         }
         showActionSheet({
             showActionSheetWithOptions: showActionSheetWithOptions,
-            title: 'Operate Title',
+            title: t('health.more_actions'),
             itemList: items,
             success: (res) => {
                 if (res == 0 || res == 1) {
                     var url = `./schedules_edit?type=${res == 0 ? 'reminder' : 'name'}&mode=${selMode}`
-                    console.log(url)
                     jumpPage(url)
                 }
                 else if (res == 2) {
@@ -397,11 +395,14 @@ export default function Schedules() {
         if (selMode == '') return 'SCHEDULE_ALL'
         switch (selMode) {
             case 'FAST':
-                return 'SCHEDULE_FAST_EAT';
+                if (router.params.isFastSleep) {
+                    return 'SCHEDULE_FAST_SLEEP';
+                }
+                return 'SCHEDULE_EAT_FAST';
             case 'EAT':
                 return 'SCHEDULE_EAT_FAST';
             case 'SLEEP':
-                return 'SCHEDULE_SLEEP_ACTIVE';
+                return 'SCHEDULE_ACTIVE_SLEEP';
             case 'ACTIVE':
                 return 'SCHEDULE_ACTIVE_SLEEP';
         }
@@ -451,11 +452,27 @@ export default function Schedules() {
                                     key={i * 100}
                                     obj={obj}
                                     highlight={highlight && selMode == obj.window}
-                                    hideReminderIcon={errors.length>0}
+                                    hideReminderIcon={errors.length > 0}
                                     showLine={i < list.length - 1}
                                     errors={errors}
                                     selMode={selMode}
                                     disable={!health.finish_setup}
+                                    labels={timeLabels}
+                                    tapSpecificTime={(detail) => {
+                                        obj.time = detail.time
+                                        obj.specific_time = !detail.is_full_day
+                                        obj.time_label = detail.label
+
+                                        setSelItem(obj)
+                                        setShowTimePicker(false)
+                                        var array = JSON.parse(JSON.stringify(list))
+                                        array[i].time = detail.time
+                                        array[i].specific_time = !detail.is_full_day
+                                        array[i].time_label = detail.label
+                                        array[i].op_ms = new Date().getTime()
+                                        setList(array)
+                                        checkData(array)
+                                    }}
                                     onChange={time => {
                                         obj.time = time
                                         setSelItem(obj)
@@ -467,10 +484,10 @@ export default function Schedules() {
                                         checkData(array)
                                     }}
                                     onDelete={() => {
-                                        if (errors.length>0){
+                                        if (errors.length > 0) {
                                             Taro.showToast({
-                                                title:'请先解决冲突',
-                                                icon:'none'
+                                                title: '请先解决冲突',
+                                                icon: 'none'
                                             })
                                             return
                                         }
@@ -489,7 +506,7 @@ export default function Schedules() {
                 </Card>
                 <View style={{ height: 20, flexShrink: 0 }} />
                 {
-                    errors.length == 0 &&!router.params.isFastSleep && selMode != '' && selMode != 'DAY' && selMode != 'NIGHT' && <Card><View className='item_add'
+                    errors.length == 0 && !router.params.isFastSleep && selMode != '' && selMode != 'DAY' && selMode != 'NIGHT' && <Card><View className='item_add'
                         onClick={() => add((selMode == 'FAST' || selMode == 'EAT'))}>
                         <StatusIndicator type={StatusType.img}
                             fontColor={getAddColor()}
@@ -504,7 +521,7 @@ export default function Schedules() {
                     </View></Card>
                 }
                 {
-                    errors.length == 0 &&selMode == '' && <Card>
+                    errors.length == 0 && selMode == '' && <Card>
                         <View className='item_add'
                             style={{ position: 'relative' }}
                             onClick={() => add(true)}>
@@ -546,7 +563,7 @@ export default function Schedules() {
                             selMode != '' && <View style={{ width: rpxToPx(316), height: rpxToPx(128), display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
                                 <NewButton
                                     type={NewButtonType.link}
-                                    title='View Full Schedule'
+                                    title={t('health.see_full_schedule')}
                                     onClick={showAll}
                                 >
                                 </NewButton>
@@ -576,7 +593,7 @@ export default function Schedules() {
                         <View style={{ width: rpxToPx(316), height: rpxToPx(128), display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
                             <NewButton
                                 type={NewButtonType.link}
-                                title='Reset Schedule'
+                                title={t('health.reset_schedule')}
                                 onClick={reset}
                             >
                             </NewButton>

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

@@ -65,6 +65,21 @@
     border-radius: 20px;
 }
 
+.edit_item_time2{
+    color: #000;
+    font-size: 34px;
+    min-width: 142px;
+    max-width: 300px;
+    box-sizing: border-box;
+    padding: 0 20px;
+    height: 88px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background-color: #B2B2B21A;
+    border-radius: 20px;
+}
+
 .toolbar{
     display: flex;
     flex-direction: row;

+ 46 - 76
src/_health/pages/schedules_edit.tsx

@@ -239,7 +239,7 @@ export default function SchedulesEdit() {
     function editName(item, obj, index, i) {
         if ((item.window == 'EAT' || item.window == 'ACTIVE') &&
             !(editIndex.row == index && editIndex.index == i)) {
-            return <View style={{marginRight:rpxToPx(12)}}>
+            return <View style={{ marginRight: rpxToPx(12) }}>
                 <NewButton type={NewButtonType.link}
                     title="更改"
                     onClick={() => {
@@ -263,85 +263,56 @@ export default function SchedulesEdit() {
                     <View style={{ display: 'flex', flexDirection: 'column' }}>
                         {
                             list.map((item, index) => {
-                                return <View key={index} style={{ display: 'flex', flexDirection: 'column' }}>
+                                return <View key={index} style={{
+                                    display: 'flex', flexDirection: 'column',
+                                    backgroundColor: '#fff',
+                                    borderTopLeftRadius: index == 0 ? rpxToPx(26) : 0,
+                                    borderTopRightRadius: index == 0 ? rpxToPx(26) : 0,
+                                    borderBottomLeftRadius: index == list.count - 1 ? rpxToPx(26) : 0,
+                                    borderBottomRightRadius: index == list.count - 1 ? rpxToPx(26) : 0,
+                                }}>
                                     {
                                         item.list.map((obj, i) => {
                                             if (!obj.specific_time && router.params.type == 'reminder') return <View key={i * 100} />
-                                            return <AtSwipeAction key={i * 100}
-                                                isOpened={false}
-                                                autoClose
-                                                disabled={true}
-                                                options={[
-                                                    {
-                                                        text: '删除',
-                                                        style: {
-                                                            backgroundColor: '#FF4949'
-                                                        }
-                                                    }
-                                                ]}
-                                                onClick={() => {
-                                                    if (item.window == 'ACTIVE' || item.window == 'EAT') {
-                                                        if (item.list.length == 1) {
-                                                            Taro.showToast({
-                                                                title: '至少保留一项',
-                                                                icon: 'none'
-                                                            })
-                                                            return;
-                                                        }
-                                                    }
-                                                    showAlert({
-                                                        title: '删除',
-                                                        content: '确认删除此计划',
-                                                        showCancel: true,
-                                                        cancel: () => {
-                                                            console.log('cancel')
-                                                        },
-                                                        confirm: () => {
-                                                            delItem(index, i)
-                                                        }
-                                                    })
-                                                }}
-                                            >
-
-                                                <View className='schedule_item' style={{ width: rpxToPx(700), boxSizing: 'border-box' }}>
-                                                    <View style={{ display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', flex: 1 }}>
-                                                        <View className='item_left2'>
-                                                            <StatusIndicator type={StatusType.normal} space={rpxToPx(12)} color={getThemeColor(obj.window)} />
-
-                                                            {
-                                                                editIndex.row == index && editIndex.index == i ?
-                                                                    <Input className='item_name2' style={{ flex: 1 }}
-                                                                        value={selItem.title}
-                                                                        autoFocus={true}
-                                                                        focus={true}
-                                                                        onBlur={() => {
-                                                                            setEditIndex({
-                                                                                row: -1,
-                                                                                index: -1
-                                                                            })
-                                                                        }}
-                                                                        onInput={(e) => {
-                                                                            var temp = JSON.parse(JSON.stringify(selItem))
-                                                                            temp.title = e.detail.value
-                                                                            obj.title = e.detail.value
-                                                                            setSelItem(temp)
-                                                                        }} /> : <Text className='item_name2'>{obj.title}</Text>
-                                                            }
-
-
-                                                        </View>
-                                                        {
-                                                            obj.specific_time && <View className="h22" style={{ color: MainColorType.g02, marginLeft: rpxToPx(38) }}>{obj.time}</View>
-                                                        }
+                                            return <View key={i * 100} className='schedule_item' style={{ width: rpxToPx(700), boxSizing: 'border-box', backgroundColor: 'transparent' }}>
+                                                <View style={{ display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', flex: 1 }}>
+                                                    <View className='item_left2'>
+                                                        <StatusIndicator type={StatusType.normal} space={rpxToPx(12)} color={getThemeColor(obj.window)} />
+
                                                         {
-                                                            !obj.specific_time && <View className="h22" style={{ color: MainColorType.g02, marginLeft: rpxToPx(38) }}>{obj.time_label}</View>
+                                                            editIndex.row == index && editIndex.index == i ?
+                                                                <Input className='item_name2' style={{ flex: 1 }}
+                                                                    value={selItem.title}
+                                                                    autoFocus={true}
+                                                                    focus={true}
+                                                                    onBlur={() => {
+                                                                        setEditIndex({
+                                                                            row: -1,
+                                                                            index: -1
+                                                                        })
+                                                                    }}
+                                                                    onInput={(e) => {
+                                                                        var temp = JSON.parse(JSON.stringify(selItem))
+                                                                        temp.title = e.detail.value
+                                                                        obj.title = e.detail.value
+                                                                        setSelItem(temp)
+                                                                    }} /> : <Text className='item_name2'>{obj.title}</Text>
                                                         }
+
+
                                                     </View>
                                                     {
-                                                        router.params.type == 'reminder' ? reminder(obj) : editName(item, obj, index, i)
+                                                        obj.specific_time && <View className="h22" style={{ color: MainColorType.g02, marginLeft: rpxToPx(38) }}>{obj.time}</View>
+                                                    }
+                                                    {
+                                                        !obj.specific_time && <View className="h22" style={{ color: MainColorType.g02, marginLeft: rpxToPx(38) }}>{obj.time_label}</View>
                                                     }
+                                                </View>
+                                                {
+                                                    router.params.type == 'reminder' ? reminder(obj) : editName(item, obj, index, i)
+                                                }
 
-                                                    {/* {router.params.type == 'reminder' && (obj.specific_time || 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') {
@@ -351,12 +322,11 @@ export default function SchedulesEdit() {
                                                     obj.reminder = e.detail.value;
                                                     setList([...list])
                                                 }} />} */}
-                                                    {
-                                                        (index < list.length - 1 || i < item.list.length - 1) && <View className='border_footer_line' style={{ left: rpxToPx(66), flexShrink: 0 }} />
-                                                    }
+                                                {
+                                                    (index < list.length - 1 || i < item.list.length - 1) && <View className='border_footer_line' style={{ left: rpxToPx(66), flexShrink: 0 }} />
+                                                }
 
-                                                </View>
-                                            </AtSwipeAction>
+                                            </View>
                                         })
                                     }
                                 </View>

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

@@ -95,7 +95,7 @@ export default function SchedulesOrder() {
             {/* <MoveList itemHeight={rpxToPx(128)} components={items()} array={list} color="#fff" update={array => {
                 setList(array)
             }} /> */}
-            <ScheduleMoveList itemHeight={rpxToPx(128)} array={list} color="red" update={array => {
+            <ScheduleMoveList itemHeight={rpxToPx(128)} array={list} color="#fff" update={array => {
                 setList(array)
             }}/>
         </Card>

+ 32 - 9
src/_health/pages/timeline_detail.tsx

@@ -385,8 +385,10 @@ export default function TimelineDetail() {
 
     function del() {
         showAlert({
-            title: '删除',
-            content: '确认删除此记录吗?',
+            title: t('health.del_title'),
+            content: '',
+            cancelText: t('health.del_cancel'),
+            confirmText: t('health.del_confirm'),
             showCancel: true,
             confirm: () => {
                 delEvents(event_id).then(res => {
@@ -420,8 +422,10 @@ export default function TimelineDetail() {
             ids = [detail.windows[0].id, detail.windows[1].id]
         }
         showAlert({
-            title: '删除',
-            content: '确认删除此记录吗?',
+            title: t('health.del_title'),
+            content: '',
+            cancelText: t('health.del_cancel'),
+            confirmText: t('health.del_confirm'),
             showCancel: true,
             confirm: () => {
                 delRecord({ ids: ids }).then(res => {
@@ -575,8 +579,14 @@ export default function TimelineDetail() {
         }
     }
 
+    function backHome() {
+        Taro.reLaunch({
+            url: '/pages/clock/Clock'
+        })
+    }
 
-    return <View style={{ display: 'flex', flex: 1, flexDirection: 'column', backgroundColor: '#fff' }}>
+
+    return <View style={{ display: 'flex', flex: 1, flexDirection: 'column', backgroundColor: '#fff', height: '101vh' }}>
         <View className="detail_header">
             <Image className="detail_header_header"
                 src={shareUser ? shareUser.avatar : user.avatar}
@@ -751,6 +761,19 @@ export default function TimelineDetail() {
             }} /></View>
         }
 
+        {
+            uid && <View className="main_footer" style={{ backgroundColor: '#fff' }}>
+                <NewButton
+                    type={NewButtonType.fill}
+                    color={MainColorType.success}
+                    title={t('health.back_home')}
+                    width={rpxToPx(646)}
+                    height={rpxToPx(96)}
+                    onClick={backHome}
+                />
+            </View>
+        }
+
 
         {
             showPop && <View className="publish_bg">
@@ -769,7 +792,7 @@ export default function TimelineDetail() {
                 </NewButton>
                 <View onClick={() => setShowTimePicker(true)} style={{ height: rpxToPx(88), marginTop: rpxToPx(120), width: rpxToPx(80), color: MainColorType.link }}>{time}
                 </View>
-                <Textarea className="myTextarea" placeholder="What's on your mind?" style={{ flex: 1, color: '#fff', caretColor: getThemeColor(health.mode) }} focus value={desc} onInput={(e) => {
+                <Textarea className="myTextarea" placeholder="What's on your mind?" style={{ flex: 1, color: '#fff', caretColor: getThemeColor(detail.window) }} focus value={desc} onInput={(e) => {
                     setDesc(e.detail.value)
                 }} />
                 <View className="toolbar2">
@@ -792,7 +815,7 @@ export default function TimelineDetail() {
 
 
                     <View style={{ flex: 1 }} />
-                    <View className="btn" style={{ backgroundColor: btnDisable ? '#b2b2b2' : getThemeColor(health.mode) }} onClick={tapPost}>发布</View>
+                    <View className="btn" style={{ backgroundColor: btnDisable ? '#b2b2b2' : getThemeColor(detail.window) }} onClick={tapPost}>发布</View>
                 </View>
 
                 <View style={{ height: bottom, flexShrink: 0 }} />
@@ -824,11 +847,11 @@ export default function TimelineDetail() {
                     setTime(selTime)
                     setShowTimePicker(false)
                 }}
-                themeColor={getThemeColor(health.mode)}>
+                themeColor={getThemeColor(detail.window)}>
                 <Card>
                     <ChooseDateTime title={null}
                         disable={false}
-                        color={getThemeColor(health.mode)}
+                        color={getThemeColor(detail.window)}
                         expand={true}
                         time={time}
                         hideFooter={true}

+ 171 - 133
src/context/locales/en.js

@@ -850,10 +850,10 @@ export default {
         }
     },
     health: {
-        guide_begin_title:'Getting Started',
-        guide_begin_desc:'Set Up My Daily Schedule',
-        guide_begin_btn:'Start with Fasting Schedule',
-        guide_begin_later:'Set Up Later',
+        guide_begin_title: 'Getting Started',
+        guide_begin_desc: 'Set Up My Daily Schedule',
+        guide_begin_btn: 'Start with Fasting Schedule',
+        guide_begin_later: 'Set Up Later',
 
         guide_0_title: 'My Fasting Schedule',
         guide_0_desc: 'Overnight Intermittent Fasting',
@@ -869,41 +869,41 @@ export default {
         guide_done_desc: 'Your daily schedule has gone live',
         guide_current_scenario: 'Live Now: {{scenario}} Schedule',
 
-        console_guide_tip:'Remember to finish setting up my schedule here 👆',
-        add_mini_guide_tip:'Add to My Mini Programs for easy access 👆',
+        console_guide_tip: 'Remember to finish setting up my schedule here 👆',
+        add_mini_guide_tip: 'Add to My Mini Programs for easy access 👆',
 
 
         add_meal: 'Add Meal',
         add_active: 'Add Activity',
-        mark_done:'Mark Done',
+        mark_done: 'Mark Done',
         i_know: 'Got it',
 
-        fasting:'Fasting',
-        eating:'Eating',
+        fasting: 'Fasting',
+        eating: 'Eating',
         fast: 'Fast',
         eat: 'Eat',
         sleep: 'Sleep',
         active: 'Active',
         window_day: 'Day',
         night: 'Night',
-        daytime:'Daytime',
-        nighttime:'Nighttime',
-        switch_to:'Switch to {{scenario}}',
+        daytime: 'Daytime',
+        nighttime: 'Nighttime',
+        switch_to: 'Switch to {{scenario}}',
 
-        live_now:'Now',
-        next_up:'Up Next',
-        in_progress:'In Progress',
-        longfast_wait:'Awaiting Start',
+        live_now: 'Now',
+        next_up: 'Up Next',
+        in_progress: 'In Progress',
+        longfast_wait: 'Awaiting Start',
 
-        fasting_log:'Fasting Log',
-        meal_log:'Meal Log',
-        active_log:'Activity Log',
-        sleep_log:'Sleep Log',
+        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',
+        fasting_schedule: 'Fasting Schedule',
+        eating_schedule: 'Eating Schedule',
+        active_schedule: 'Activity Schedule',
+        sleep_schedule: 'Sleep Schedule',
 
         faststreak: 'Faststreak',
         eatstreak: 'Eatstreak',
@@ -918,7 +918,7 @@ export default {
         since_date: 'Since {{date}}',
         until_date_time: 'Active until tomorrow {{date}} {{time}}',
         expire_date_time: 'Expiring tonight {{date}} {{time}}',
-        last_expire_date_time:'Last streak expired on {{date}} at {{time}}',
+        last_expire_date_time: 'Last streak expired on {{date}} at {{time}}',
 
         day: 'Day',
         days: 'Days',
@@ -931,113 +931,151 @@ export default {
 
         finish_setup: 'Finish Schedule Setup',
         reset_schedule: 'Reset Schedule',
-        edit_schedule:'Edit Schedule',
-        enable_location:'Enable Location',
-        choose_location:'Choose Location',
-        change_location:'Change Location',
-        clear_location:'Clear Location',
-        delete_current_record:'Delete Current Record',
-        edit_fast_goal:'Edit Fast Goal',
-        change_step_goal:'Change Step Goal',
-
-        create_my_active:'Create My Activities',
-
-        sunset_to_sunrise:'Sunset to Sunrise',
-        sunrise_to_sunset:'Sunrise to Sunset',
-        choose_location:'Choose Location',
-        set_to_rise_desc:'To calculate nighttime from Sunset to Sunrise, we need to use your location information.',
-        rise_to_set_desc:'To calculate daytime from Sunrise to Sunset, we need to use your location information.',
-
-        more_actions:'More Actions',
-
-        misaligned:'Misaligned',
-        fast_missing:'Fasting Backlog',
-        fast_before_bed:'Fasting before Bedtime',
-        fast_while_sleep:'Fasting while Sleeping',
-        fast_after_sleep:'Fasting after Waking Up',
-        my_fast_journal:'My Fasting Journey',
-        my_fast_duration:'Total {{time}}',
-        three_stages:'The Three Stages of Fasting',
-        current_progress:'Current Progress',
-        stage_detail:'Stage Details',
-
-        ready_for_logging:'Ready for Logging',
-        logging_progress:'Logging in Progress',
-        overview:'Overview',
-        stage1:'Stage 1',
-        stage2:'Stage 2',
-        stage3:'Stage 3',
-
-        ok:'OK',
-
-        logging:'logging',
-        log:'Log',
-        recents:'Recents',
-        language:'Language',
-
-        fast_with_sleep:'Fast with Sleep',
-        long_fast:'Long Fast',
-        move_more:'Move More',
-        move_every_hour:'Move Every Hour',
-
-        log_extra_meal:'Log Extra Meal',
-        log_extra_activity:'Log Extra Activity',
-
-        photo_wall:'Photo Wall',
-
-        all_logs:'All Completed {{scenario}} ',
-        activities:'Activity Logs',
-        meals:'Meal Logs',
-        will_collected:'will move to ',
-        journal_end:'Recents',
-        new_journal_created:'1 New Journal Entry',
-        show_journal:'Show Journal',
-        today_at:'At {{time}}',
-        tomorrow_at:'Tomorrow at {{time}}',
-        detail_complete_tip_head:'All Completed Activity Logs will appear as a single ',
-        detail_complete_tip_end:'Journal Entry for the Day.',
-
-        title_journal:'Journals',
-        title_food_journal:'Food Journal',
-        title_active_journal:'Activity Journal',
-        journal_detail:'Journal Details',
-        my_journal:'My Journal',
-
-        missing_date_time:'Missing Date or Time',
-        log_updated:'Log updated On {{date_time}}',
-        journal_created:'Journal created on {{date_time}}',
-        journal_updated:'Journal updated on {{date_time}}',
-
-        metric:'Metrics',
-        photos:'Photos',
-        schedules:'Schedules',
-        streaks:'Streaks',
-        windows:'Windows',
-        settings:'Settings',
-        
-        discover:'Discover',
-        this_week:'This Week',
-        me:'Me',
-
-        edit_time:'Edit Time',
-        quit_tip:'Your check-in will not be saved upon exit.',
-
-        select:'Select',
-        reset:'Reset',
-        select_schedule:'Selected as Schedules',
-        schedule_for:'Scheduled for {{time}}',
-        log_moment:'Log Moment',
-        log_moments:'Log Moments',
-
-        share_my_fasting:'My Fasting',
-        share_my_eating:'My Eating',
-        share_my_sleep:'My Sleep',
-        share_my_activity:'My Activity',
-        share_my_fast_sleep:'My Fasting with Sleep',
-        share_my_long_fast:'My Long Fast',
-        
-        share_my_food_journal:'My Food Journal',
-        share_my_activity_journal:'My Activity Journal',
-        share_my_journal:'My Journal'
+        edit_schedule: 'Edit My Schedule',
+        enable_location: 'Enable Location',
+        choose_location: 'Choose Location',
+        change_location: 'Change Location',
+        clear_location: 'Clear Location',
+        delete_current_record: 'Delete Current Record',
+        delete_log:'Delete Log',
+        edit_fast_goal: 'Edit Fast Goal',
+        change_step_goal: 'Change Step Goal',
+        log_more:'Log More',
+
+        create_my_active: 'Create My Activities',
+
+        sunset_to_sunrise: 'Sunset to Sunrise',
+        sunrise_to_sunset: 'Sunrise to Sunset',
+        choose_location: 'Choose Location',
+        set_to_rise_desc: 'To calculate nighttime from Sunset to Sunrise, we need to use your location information.',
+        rise_to_set_desc: 'To calculate daytime from Sunrise to Sunset, we need to use your location information.',
+
+        more_actions: 'More Actions',
+
+        misaligned: 'Misaligned',
+        fast_missing: 'Fasting Backlog',
+        fast_before_bed: 'Fasting before Bedtime',
+        fast_while_sleep: 'Fasting while Sleeping',
+        fast_after_sleep: 'Fasting after Waking Up',
+        my_fast_journal: 'My Fasting Journey',
+        my_fast_duration: 'Total {{time}}',
+        three_stages: 'The Three Stages of Fasting',
+        current_progress: 'Current Progress',
+        stage_detail: 'Stage Details',
+
+        ready_for_logging: 'Ready for Logging',
+        logging_progress: 'Logging in Progress',
+        overview: 'Overview',
+        stage1: 'Stage 1',
+        stage2: 'Stage 2',
+        stage3: 'Stage 3',
+
+        ok: 'OK',
+
+        logging: 'logging',
+        log: 'Log',
+        recents: 'Recents',
+        language: 'Language',
+
+        fast_with_sleep: 'Fast with Sleep',
+        long_fast: 'Long Fast',
+        move_more: 'Move More',
+        move_every_hour: 'Move Every Hour',
+
+        log_extra_meal: 'Log Extra Meal',
+        log_extra_activity: 'Log Extra Activity',
+
+        photo_wall: 'Photo Wall',
+
+        all_logs: 'All Completed {{scenario}} ',
+        activities: 'Activity Logs',
+        meals: 'Meal Logs',
+        will_collected: 'will move to ',
+        journal_end: 'Recents',
+        new_journal_created: '1 New Journal Entry',
+        show_journal: 'Show Journal',
+        today_at: 'At {{time}}',
+        tomorrow_at: 'Tomorrow at {{time}}',
+        detail_complete_tip_head: 'All Completed Activity Logs will appear as a single ',
+        detail_complete_tip_end: 'Journal Entry for the Day.',
+
+        title_journal: 'Journals',
+        title_food_journal: 'Food Journal',
+        title_active_journal: 'Activity Journal',
+        journal_detail: 'Journal Details',
+        my_journal: 'My Journal',
+
+        missing_date_time: 'Missing Date or Time',
+        log_updated: 'Log updated On {{date_time}}',
+        journal_created: 'Journal created on {{date_time}}',
+        journal_updated: 'Journal updated on {{date_time}}',
+
+        metric: 'Metrics',
+        photos: 'Photos',
+        schedules: 'Schedules',
+        streaks: 'Streaks',
+        windows: 'Windows',
+        settings: 'Settings',
+
+        discover: 'Discover',
+        this_week: 'This Week',
+        me: 'Me',
+
+        edit_time: 'Edit Time',
+
+        select: 'Select',
+        reset: 'Reset',
+        select_schedule: 'Selected as Schedules',
+        schedule_for: 'Scheduled for {{time}}',
+        log_moment: 'Log Moment',
+        log_moments: 'Log Moments',
+
+        share_my_fasting: 'My Fasting',
+        share_my_eating: 'My Eating',
+        share_my_sleep: 'My Sleep',
+        share_my_activity: 'My Activity',
+        share_my_fast_sleep: 'My Fasting with Sleep',
+        share_my_long_fast: 'My Long Fast',
+
+        share_my_food_journal: 'My Food Journal',
+        share_my_activity_journal: 'My Activity Journal',
+        share_my_journal: 'My Journal',
+
+        eat_fast_schedule: 'Eating and Fasting Schedule',
+        active_sleep_schedule: 'Activity and Sleep Schedule',
+        fast_sleep_schedule: 'Fasting and Sleep Schedule',
+        full_schedule: 'Full Schedule',
+
+        back_home: 'Back to My Homepage',
+
+        // my_fast_period:'My Fasting Schedule {{time}}',
+        // my_sleep_period:'My Sleep Schedule {{time}}',
+        // my_activity_period:'My Activity Schedule {{time}}',
+        // my_eating_period:'My Eating Schedule {{time}}',
+        my_period:'From {{start}} to {{end}}',
+
+        // fasting_progress:'Fasting Log in Progress',
+        // sleep_progress:'Sleep Log in Progress',
+        // meal_progress:'Meal Log in Progress',
+        // activity_progress:'Activity Log in Progress',
+        log_progress:'Log in Progress',
+
+        my_activity:'My Activity',
+        my_meal:'My Meal',
+        schedule_time:'Scheduled Time',
+        choose_enter_activity_name:'Enter or Choose Activity Name',
+        chose_enter_time_desc:'Enter or Choose Time Description',
+        choose_enter_meal_label:'Enter or Choose Meal Label',
+        fix_time:'At Fixed Time Every Day',
+        see_full_schedule:'See Full Schedule',
+        edit_name:'Edit Names',
+        edit_order:'Edit Orders',
+        back_no_save:'Exit without Saving',
+
+        verion_tip:'You are upgraded to the latest version',
+        verion_done:'Finish Setup',
+        del_title:'Confirm Delete',
+        del_confirm:'Delete',
+        del_cancel:'Cancel',
     }
 }

+ 87 - 47
src/context/locales/zh.js

@@ -931,14 +931,16 @@ export default {
 
         finish_setup: '完成日程设置',
         reset_schedule: '重置日程',
-        edit_schedule: '编辑日程',
+        edit_schedule: '编辑我的日程',
         enable_location: 'Enable Location',
         choose_location: '选择位置',
         change_location: '更改位置',
         clear_location: '清除位置',
         delete_current_record: '删除当前记录',
+        delete_log: '删除记录',
         edit_fast_goal: '编辑断食目标',
         change_step_goal: '更改步数目标',
+        log_more: '记录更多',
 
         create_my_active: '创建我的活动',
 
@@ -995,51 +997,89 @@ export default {
         show_journal: '显示日记',
         today_at: '今天 {{time}}',
         tomorrow_at: '明天 {{time}}',
-        detail_complete_tip_head:'所有完成的活动记录将显示为 ',
-        detail_complete_tip_end:'当天的一篇日记',
-
-        title_journal:'日记',
-        title_food_journal:'饮食日记',
-        title_active_journal:'活动日记',
-        journal_detail:'日记详情',
-        my_journal:'我的日记',
-
-        missing_date_time:'日期或时间缺失',
-
-        log_updated:'记录更新于 {{date_time}}',
-        journal_created:'日记创建于 {{date_time}}',
-        journal_updated:'日记更新于 {{date_time}}',
-
-        metric:'指标',
-        photos:'照片',
-        schedules:'日程',
-        streaks:'连续天数',
-        windows:'时段统计',
-        settings:'设置',
-
-        discover:'发现',
-        this_week:'本周',
-        me:'我',
-        edit_time:'编辑时间',
-        quit_tip:'退出后不会保存打卡',
-
-        select:'选择',
-        reset:'重置',
-        select_schedule:'已选为预订时间',
-        schedule_for:'预订时间为{{time}}',
-
-        log_moment:'记录时刻',
-        log_moments:'记录时刻',
-
-        share_my_fasting:'我的断食',
-        share_my_eating:'我的饮食',
-        share_my_sleep:'我的睡眠',
-        share_my_activity:'我的活动',
-        share_my_fast_sleep:'我的断食与睡眠',
-        share_my_long_fast:'我的长断食',
-        
-        share_my_food_journal:'我的饮食日记',
-        share_my_activity_journal:'我的活动记录',
-        share_my_journal:'我的日记'
+        detail_complete_tip_head: '所有完成的活动记录将显示为 ',
+        detail_complete_tip_end: '当天的一篇日记',
+
+        title_journal: '日记',
+        title_food_journal: '饮食日记',
+        title_active_journal: '活动日记',
+        journal_detail: '日记详情',
+        my_journal: '我的日记',
+
+        missing_date_time: '日期或时间缺失',
+
+        log_updated: '记录更新于 {{date_time}}',
+        journal_created: '日记创建于 {{date_time}}',
+        journal_updated: '日记更新于 {{date_time}}',
+
+        metric: '指标',
+        photos: '照片',
+        schedules: '日程',
+        streaks: '连续天数',
+        windows: '时段统计',
+        settings: '设置',
+
+        discover: '发现',
+        this_week: '本周',
+        me: '我',
+        edit_time: '编辑时间',
+
+        select: '选择',
+        reset: '重置',
+        select_schedule: '已选为预订时间',
+        schedule_for: '预订时间为{{time}}',
+
+        log_moment: '记录时刻',
+        log_moments: '记录时刻',
+
+        share_my_fasting: '我的断食',
+        share_my_eating: '我的饮食',
+        share_my_sleep: '我的睡眠',
+        share_my_activity: '我的活动',
+        share_my_fast_sleep: '我的断食与睡眠',
+        share_my_long_fast: '我的长断食',
+
+        share_my_food_journal: '我的饮食日记',
+        share_my_activity_journal: '我的活动记录',
+        share_my_journal: '我的日记',
+
+        eat_fast_schedule: '饮食和断食日程',
+        active_sleep_schedule: '活动和睡眠日程',
+        fast_sleep_schedule: '断食和睡眠日程',
+        full_schedule: '完整日程',
+
+        back_home: '返回到我的首页',
+
+        // my_fast_period: '断食日程 {{time}}',
+        // my_sleep_period: '睡眠日程 {{time}}',
+        // my_activity_period: '活动日程 {{time}}',
+        // my_eating_period: '饮食日程 {{time}}',
+        my_period: '{{start}} 至 {{end}}',
+
+        // fasting_progress: '断食记录进行中',
+        // sleep_progress: '睡眠记录进行中',
+        // meal_progress: '饮食记录进行中',
+        // activity_progress: '活动记录进行中',
+        log_progress: '记录进行中',
+
+        my_activity: '我的活动',
+        my_meal: '我的餐次',
+        schedule_time: '计划时间',
+
+        choose_enter_activity_name:'输入或选择活动名称',
+        chose_enter_time_desc:'输入或选择时间描述',
+        choose_enter_meal_label:'输入或选择餐次标签',
+        fix_time:'每天固定时间',
+        see_full_schedule:'查看完整日程',
+        edit_name:'编辑名称',
+        edit_order:'编辑排序',
+        back_no_save:'退出不保存',
+
+        verion_tip:'您已升级到最新版本',
+        verion_done:'完成设置',
+        del_title:'确认删除',
+        del_confirm:'删除',
+        del_cancel:'取消',
+
     }
 }

+ 34 - 31
src/features/health/MainConsole.tsx

@@ -13,7 +13,7 @@ import TimePicker from "../common/TimePicker";
 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 { durationTime, getCountownTime, getDuration, getScenario, getThemeColor, getWindowStatus } from "./hooks/health_hooks";
 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";
@@ -377,7 +377,7 @@ export default function MainConsole(props: { type: WindowType }) {
                     if (!health.finish_setup) {
                         list.push(t('health.finish_setup'))
                     }
-                    list.push(t('health.log_extra_activity'))
+                    list.push(t('health.log_more'))
                     var scenario = getScenario(health.windows, 'ACTIVE')
                     if (scenario.status != 'WFS') {
                         list.push(t('health.mark_done'))
@@ -394,7 +394,7 @@ export default function MainConsole(props: { type: WindowType }) {
                     if (!health.finish_setup) {
                         list.push(t('health.finish_setup'))
                     }
-                    list.push(t('health.log_extra_meal'))
+                    list.push(t('health.log_more'))
                     var scenario = getScenario(health.windows, 'EAT')
                     if (scenario.status != 'WFS') {
                         list.push(t('health.mark_done'))
@@ -412,7 +412,7 @@ export default function MainConsole(props: { type: WindowType }) {
                     }
                     const obj = getScenario(health.windows, health.mode)
                     if (obj.window_id) {
-                        list.push(t('health.delete_current_record'))
+                        list.push(t('health.delete_log'))
                     }
                     if (health.finish_setup) {
                         list.push(t('health.edit_schedule'))
@@ -439,27 +439,26 @@ export default function MainConsole(props: { type: WindowType }) {
         if (health.mode == 'DAY' || health.mode == 'NIGHT') {
             strTitle = getLocation()
         }
-        else if (health.mode == 'EAT' || health.mode == 'ACTIVE') {
+        else {
             const scenario = getScenario(health.windows, health.mode)
-            if (scenario.archive_timestamp) {
-                /*"Today's logs will be archived at 23:59."
-"Today's logs will be archived at 03:10 tomorrow."
-
-"今日记录将于 23:59 归档"
-"今日记录将于明天 23:59 归档"*/
-                var today = new Date().getDate()
-                var date = new Date(scenario.archive_timestamp).getDate()
-                strTitle = `今日记录将于${today == date ? '' : '明天'} ${dayjs(scenario.archive_timestamp).format('HH:mm')} 归档`
+
+            if (scenario.status == 'WFS') {
+                strTitle = durationTime(scenario.target.start_timestamp, scenario.target.end_timestamp)
+                // var time = scenario.period.start_time+'-'+scenario.period.end_time
+                // strTitle = t('health.my_period',{start:scenario.period.start_time,end:scenario.period.end_time})
+                // strTitle = health.mode == 'FAST' ? t('health.my_fast_period',{time:time}) :
+                //     health.mode == 'EAT' ? t('health.my_eating_period',{time:time}) :
+                //         health.mode == 'SLEEP' ? t('health.my_sleep_period',{time:time}) :
+                //             t('health.my_activity_period',{time:time})
             }
             else {
-                strTitle = t('health.more_actions')
+                strTitle = t('health.log_progress')
+                // strTitle = health.mode == 'FAST' ? t('health.fasting_progress') :
+                //     health.mode == 'EAT' ? t('health.meal_progress') :
+                //         health.mode == 'SLEEP' ? t('health.sleep_progress') :
+                //             t('health.activity_progress')
             }
         }
-        else {
-            strTitle = t('health.more_actions')
-        }
-
-
 
         showActionSheet({
             showActionSheetWithOptions: showActionSheetWithOptions,
@@ -501,7 +500,7 @@ export default function MainConsole(props: { type: WindowType }) {
             return ''
             // city = t('feature.track_time_duration.third_ring.unknown')
         }
-        return city +' | '
+        return city + ' | '
     }
 
     function tapActionSheet(index) {
@@ -510,11 +509,13 @@ export default function MainConsole(props: { type: WindowType }) {
             case t('health.finish_setup'):
                 tapGuide();
                 break;
-            case t('health.log_extra_activity'):
-                jumpPage(`/_health/pages/add_moment?title=&is_temp=${true}`)
-                break;
-            case t('health.log_extra_meal'):
-                jumpPage(`/_health/pages/add_moment?title=加餐&is_temp=${true}`)
+            case t('health.log_more'):
+                if (health.mode == 'EAT') {
+                    jumpPage(`/_health/pages/add_moment?title=加餐&is_temp=${true}`)
+                }
+                else {
+                    jumpPage(`/_health/pages/add_moment?title=&is_temp=${true}`)
+                }
                 break;
             case t('health.mark_done'):
                 tapMakeDone()
@@ -522,12 +523,14 @@ export default function MainConsole(props: { type: WindowType }) {
             case t('health.edit_schedule'):
                 jumpPage('/_health/pages/schedules?mode=' + health.mode)
                 break
-            case t('health.delete_current_record'):
+            case t('health.delete_log'):
                 {
                     const obj = getScenario(health.windows, health.mode)
                     showAlert({
-                        title: 'del',
-                        content: '确认删除此记录?',
+                        title: t('health.del_title'),
+                        content: '',
+                        cancelText: t('health.del_cancel'),
+                        confirmText: t('health.del_confirm'),
                         showCancel: true,
                         confirm: () => {
                             delRecord({ ids: [obj.window_id] }).then(res => {
@@ -1013,7 +1016,7 @@ export default function MainConsole(props: { type: WindowType }) {
         // </View>
     }
 
-    if (health.mode=='') return <View />
+    if (health.mode == '') return <View />
 
     return <View className="main-console-bg">
         <Image className="main_arrow" src={require('@assets/images/center_arrow.png')} />
@@ -1062,7 +1065,7 @@ export default function MainConsole(props: { type: WindowType }) {
 
         </View>
         {
-            user.isLogin && (health.mode !='DAY' && health.mode !='NIGHT') && !hideGuideTip && !health.finish_setup && <View className="guide_tip h26" onClick={() => {
+            user.isLogin && (health.mode != 'DAY' && health.mode != 'NIGHT') && !hideGuideTip && !health.finish_setup && <View className="guide_tip h26" onClick={() => {
                 tapGuide();
                 setHideGuideTip(true)
             }}>{t('health.console_guide_tip')}

+ 18 - 1
src/features/health/hooks/health_hooks.tsx

@@ -1,6 +1,7 @@
 import { MainColorType } from "@/context/themes/color"
 import { TimeFormatter } from "@/utils/time_format"
 import { WindowStatusType } from "@/utils/types"
+import dayjs from "dayjs"
 
 export function getScenario(windows: any, mode: string) {
     switch (mode) {
@@ -86,7 +87,7 @@ export function getCountownTime(windows: any, mode: any) {
             stringTime = TimeFormatter.countdown(scenario.real.start_timestamp, now)
         case WindowStatusType.open:
 
-        stringTime = TimeFormatter.countdown(scenario.target.start_timestamp, now)
+            stringTime = TimeFormatter.countdown(scenario.target.start_timestamp, now)
         case WindowStatusType.upcoming:
             stringTime = TimeFormatter.countdown(now, scenario.target.start_timestamp)
     }
@@ -107,4 +108,20 @@ export const getStartArc = (time: number) => {
 export const getDurationArc = (start_time: number, end_time: number) => {
     var duration = (end_time - start_time) / 1000;
     return duration / (24 * 3600) * 2 * Math.PI;
+}
+
+export const durationTime = (start_time: number, end_time: number) => {
+    var start = dayjs(start_time)
+    var current = dayjs()
+    var end = dayjs(end_time)
+    if (start.format('YYYY-MM-DD') == end.format('YYYY-MM-DD')) {
+        return global.language == 'en' ? `Today ${start.format('HH:mm')} - ${end.format('HH:mm')}` :
+            `今天 ${start.format('HH:mm')} - ${end.format('HH:mm')}`
+    }
+    if (start.format('YYYY-MM-DD') == current.format('YYYY-MM-DD')) {
+        return global.language == 'en' ? `Today ${start.format('HH:mm')} - Tomorrow ${end.format('HH:mm')}` :
+            `今天 ${start.format('HH:mm')} - 明天 ${end.format('HH:mm')}`
+    }
+    return global.language == 'en' ? `Yesterday ${start.format('HH:mm')} - Today ${end.format('HH:mm')}` :
+        `昨天 ${start.format('HH:mm')} - 今天 ${end.format('HH:mm')}`
 }

+ 20 - 0
src/pages/account/JournalDetail.tsx

@@ -18,6 +18,7 @@ import SingleImage from "@/_health/components/single_img";
 import { journalDetail } from "@/services/health";
 import { useTranslation } from "react-i18next";
 import { IconShare } from "@/components/basic/Icons";
+import NewButton, { NewButtonType } from "@/_health/base/new_button";
 
 let useRoute;
 let useNavigation;
@@ -267,6 +268,12 @@ export default function JournalDetail() {
         </View>
     }
 
+    function backHome(){
+        Taro.reLaunch({
+            url:'/pages/clock/Clock'
+        })
+    }
+
     if (!loaded) return <View />
 
 
@@ -327,6 +334,19 @@ export default function JournalDetail() {
                 {/* <Text className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(17), lineHeight: rpxToPx(60) + 'px' }}>发布于{dayjs(data.publish_timestamp).format('M月D日 HH:mm')}</Text> */}
             </View>
 
+            {
+            router.params.uid && <View className="main_footer" style={{backgroundColor:'#fff'}}>
+                <NewButton
+                    type={NewButtonType.fill}
+                    color={MainColorType.success}
+                    title={t('health.back_home')}
+                    width={rpxToPx(646)}
+                    height={rpxToPx(96)}
+                    onClick={backHome}
+                />
+            </View>
+        }
+
 
         </View>
         <ListFooter />

+ 14 - 3
src/pages/clock/ClockNew.tsx

@@ -261,13 +261,24 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
         if (!user.isLogin) {
             return
         }
-        return
+        // return
 
 
         const showAlert1 = await getStorage('148alert') || false;
         Taro.setStorage({ key: '148alert', data: true })
+
+
         if (!showAlert1 && !health.finish_setup) {
-            jumpPage('/_health/pages/guide_begin')
+            showAlert({
+                title: t('health.verion_tip'),
+                content: '',
+                showCancel: false,
+                confirmText: t('health.verion_done'),
+                confirm: () => {
+                    jumpPage('/_health/pages/guide_begin')
+                }
+
+            })
         }
 
     }
@@ -371,7 +382,7 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
                 }
                 <MainSwiper count={count} pageChanged={pageChanged} typeChanged={typeChanged} />
                 {
-                    process.env.TARO_ENV=='weapp' && <MainConsole type={type} />
+                    process.env.TARO_ENV == 'weapp' && <MainConsole type={type} />
                 }
 
                 <MainHistory ref={historyRef2} updateDate={(e) => {