Leon 1 سال پیش
والد
کامیت
a72736ad41

+ 5 - 3
src/_health/base/new_button.tsx

@@ -200,6 +200,8 @@ export default function NewButton(props: {
                 justifyContent: 'center',
                 flexDirection: 'row',
                 flex: 1,
+                width:'100%',
+                height:'100%',
                 color: props.color?props.color:'#5C7099',
                 fontSize: props.fontSize ? props.fontSize : rpxToPx(26),
                 opacity: isTouched ? 0.4 : 1,
@@ -251,7 +253,7 @@ export default function NewButton(props: {
                     setNoTouch(true)
                     setTimeout(() => {
                         setNoTouch(false)
-                    }, 500)
+                    }, 1000)
                 }}
                 onTouchStart={(e) => {
                     if (process.env.TARO_ENV == 'weapp') {
@@ -283,7 +285,7 @@ export default function NewButton(props: {
                 setNoTouch(true)
                 setTimeout(() => {
                     setNoTouch(false)
-                }, 500)
+                }, 1000)
             }}
                 onTouchStart={(e) => {
                     if (process.env.TARO_ENV == 'weapp') {
@@ -320,7 +322,7 @@ export default function NewButton(props: {
             setNoTouch(true)
             setTimeout(() => {
                 setNoTouch(false)
-            }, 500)
+            }, 1000)
         }}
         onTouchStart={(e) => {
             if (process.env.TARO_ENV == 'weapp') {

+ 18 - 1
src/_health/base/new_date_picker.tsx

@@ -16,6 +16,7 @@ export default function NewDatePicker(props: {
     color?: string,
     type?: NewDatePickerType,
     isToday?: boolean,
+    count?: number,
     minTimestamp?: number,
     maxTimestamp?: number
 }) {
@@ -37,6 +38,22 @@ export default function NewDatePicker(props: {
         setLoaded(true)
     }, [])
 
+    useEffect(() => {
+        console.log('oppsu')
+        switch (props.type) {
+            case NewDatePickerType.normal:
+                setItems(itemDatas())
+                setValues(itemValues())
+                break;
+            case NewDatePickerType.date:
+                setItems(longDatas())
+                setValues(longValues())
+                break;
+        }
+
+        setLoaded(true)
+    }, [props.count])
+
     function itemDatas() {
         return [['Yesterday', 'Today']]
     }
@@ -47,7 +64,7 @@ export default function NewDatePicker(props: {
 
     function longDatas() {
         let result: any = []
-        var max = props.maxTimestamp??new Date().getTime()
+        var max = props.maxTimestamp ?? new Date().getTime()
         const currentDate = new Date(max)
         currentDate.setHours(23)
         currentDate.setMinutes(59)

+ 9 - 8
src/_health/components/choose_date_time.tsx

@@ -65,14 +65,14 @@ export default function ChooseDateTime(props: {
                     <View style={{ flex: 1 }} />
             }
 
-            {/* <View style={{
+            <View style={{
                 borderColor: props.showError ? 'red' : (props.expand && chooseDate) ?props.color:'transparent',
                 borderWidth: rpxToPx(2),
                 borderRadius: rpxToPx(88 / 4),
                 borderStyle: 'solid'
-            }}> */}
+            }}>
             <NewButton
-                type={(props.expand && chooseDate) ? NewButtonType.alpha : NewButtonType.gray}
+                type={(props.expand && chooseDate && !props.showError) ? NewButtonType.alpha : NewButtonType.gray}
                 // type={NewButtonType.gray}
                 color={props.color}
                 title={dateTitle()}
@@ -93,16 +93,16 @@ export default function ChooseDateTime(props: {
                     // setArray(list)
                 }}
             />
-            {/* </View> */}
+            </View>
             <View style={{ width: rpxToPx(12) }} />
-            {/* <View style={{
+            <View style={{
                 borderColor: props.showError ? 'red' : (props.expand && !chooseDate) ? props.color : 'transparent',
                 borderWidth: rpxToPx(2),
                 borderRadius: rpxToPx(88 / 4),
                 borderStyle: 'solid'
-            }}> */}
+            }}>
             <NewButton
-                type={(props.expand && !chooseDate) ? NewButtonType.alpha : NewButtonType.gray}
+                type={(props.expand && !chooseDate && !props.showError) ? NewButtonType.alpha : NewButtonType.gray}
                 // type={NewButtonType.gray}
                 color={props.color}
                 title={timeTitle()}
@@ -118,7 +118,7 @@ export default function ChooseDateTime(props: {
                     }
                 }}
             />
-            {/* </View> */}
+            </View>
             {
                 !props.title && <View style={{ flex: 1 }} />
             }
@@ -141,6 +141,7 @@ export default function ChooseDateTime(props: {
                     minTimestamp={props.minTimestamp ? props.minTimestamp : new Date().getTime() - 24 * 3600 * 1000}
                     maxTimestamp={props.maxTimestamp ?? new Date().getTime()}
                     value={props.date}
+                    count={props.count}
                     onChange={(e) => {
                         // var list = JSON.parse(JSON.stringify(array))
                         // list[index].today = e == 1

+ 22 - 19
src/_health/components/fast_sleep_console.tsx

@@ -16,7 +16,7 @@ import { useTranslation } from "react-i18next";
 import ConsoleCell from "./console_cell";
 import StatusIndicator, { StatusType } from "../base/status_indicator";
 
-export default function FastSleepConsole(props: { step: number, data: any, del: any,showDetail:any }) {
+export default function FastSleepConsole(props: { step: number, data: any, del: any, showDetail: any }) {
     const health = useSelector((state: any) => state.health);
     let navigation, showActionSheetWithOptions;
     const { t } = useTranslation()
@@ -172,7 +172,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
         if (finish) {
             return <Image style={{ width: rpxToPx(24), height: rpxToPx(24) }} src={require('@assets/_health/checked.png')} />
         }
-        return <IconCircle width={rpxToPx(32)} color={MainColorType.g02}/>
+        return <IconCircle width={rpxToPx(32)} color={MainColorType.g02} />
         // return <View style={{ width: rpxToPx(26), height: rpxToPx(26), borderRadius: rpxToPx(13), backgroundColor: '#fff' }} />
         // if (item.timeline.reminder) {
         //     return <IconNotification color="#fff" width={rpxToPx(24)} />
@@ -221,7 +221,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
     }
 
 
-    function timelineItem(item: any, index: number, count: number,fullLine:boolean) {
+    function timelineItem(item: any, index: number, count: number, fullLine: boolean) {
         const { fast, sleep, status } = props.data
         var showBtn = true;
         var time = ''
@@ -286,7 +286,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
         }
 
         function rightView() {
-            if (index==2 && status=='OG3') return null
+            if (index == 2 && status == 'OG3') return null
             if (isError) {
                 return <View style={{
                     borderColor: MainColorType.error,
@@ -317,8 +317,8 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                         return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
                     }
                     return <NewButton
-                        color={item.timeline.target.timestamp >= new Date().getTime() ? MainColorType.g02 : getThemeColor(item.mode)}
-                        type={item.timeline.target.timestamp >= new Date().getTime() ? NewButtonType.alpha2 : NewButtonType.alpha}
+                        color={(item.timeline.target.timestamp >= new Date().getTime() || status == 'OG2_MISALIGNED') ? MainColorType.g02 : getThemeColor(item.mode)}
+                        type={(item.timeline.target.timestamp >= new Date().getTime() || status == 'OG2_MISALIGNED') ? NewButtonType.alpha2 : NewButtonType.alpha}
                         title={t('health.log')}
                         width={rpxToPx(128)}
                         height={rpxToPx(72)}
@@ -370,9 +370,9 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
         return <ConsoleCell
             status={
                 <StatusIndicator type={StatusType.console}
-                    color={isError ? MainColorType.error : getIconColor(index, finish)==MainColorType.g02?'transparent':getIconColor(index, finish)}
-                    fontColor={isError ? MainColorType.error : getIconColor(index, finish)==MainColorType.g02?MainColorType.g01:getIconColor(index, finish)}
-                    bold={getIconColor(index, finish)!=MainColorType.g02}
+                    color={isError ? MainColorType.error : getIconColor(index, finish) == MainColorType.g02 ? 'transparent' : getIconColor(index, finish)}
+                    fontColor={isError ? MainColorType.error : getIconColor(index, finish) == MainColorType.g02 ? MainColorType.g01 : getIconColor(index, finish)}
+                    bold={getIconColor(index, finish) != MainColorType.g02}
                     fontSize={rpxToPx(24)}
                     text={time}
                 >{
@@ -408,8 +408,8 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                 action: props.data.fast.timeline[0].action,
                 moment: props.data.fast.timeline[0].moment,
                 timeline: props.data.fast.timeline[0],
-                
-            }, 0, 4,false)
+
+            }, 0, 4, false)
         }
         {
             props.step != 3 && timelineItem({
@@ -419,7 +419,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                 action: props.data.fast.timeline[0].action,
                 moment: props.data.sleep.timeline[0].moment,
                 timeline: props.data.sleep.timeline[0]
-            }, 1, 4,props.step==1)
+            }, 1, 4, props.step == 1)
         }
         {
             props.step != 1 && timelineItem({
@@ -428,7 +428,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                 is_start: false,
                 moment: props.data.sleep.timeline[1].moment,
                 timeline: props.data.sleep.timeline[1]
-            }, 2, 4,props.step==2)
+            }, 2, 4, props.step == 2)
         }
         {
             props.step != 1 && props.step != 2 && timelineItem({
@@ -437,15 +437,18 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                 is_start: false,
                 moment: props.data.fast.timeline[1].moment,
                 timeline: props.data.fast.timeline[1]
-            }, 3, 4,true)
+            }, 3, 4, true)
         }
         {
             <View className="main_console_footer">
-                <NewButton 
-                    type={NewButtonType.link}
-                    title={props.data.status=='WFS'?t('health.three_stages'):t('health.current_progress')}
-                    onClick={props.showDetail}
-                />
+                {
+                    props.data.status != 'OG2_MISALIGNED' && <NewButton
+                        type={NewButtonType.link}
+                        title={props.data.status == 'WFS' ? t('health.three_stages') : t('health.current_progress')}
+                        onClick={props.showDetail}
+                    />
+                }
+
                 <NewButton
                     btnStyle={{
                         position: 'absolute',

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

@@ -127,7 +127,7 @@ export default function PostMomentTime(props: {
 
     function scheduleTime() {
         if (props.moment) {
-            var timestamp = props.moment.target.timestamp
+            var timestamp = props.moment.target?props.moment.target.timestamp:new Date().getTime()
             var time1 = parseInt(dayjs(timestamp).format('HHmm'))
             var now = parseInt(dayjs().format('HHmm'))
             if (time == dayjs(timestamp).format('HH:mm')) {

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

@@ -41,7 +41,7 @@ export default function StickyDateList(props: {
             <View className="border_footer_line" />
         </View>
         <ScrollView style='height:100vh'
-            
+            enableBackToTop
             scrollY={!props.disable}
             refresherEnabled
             refresherBackground={MainColorType.g05}

+ 12 - 1
src/_health/pages/add_moment.tsx

@@ -50,7 +50,7 @@ export default function AddMoment() {
     const [bottom, setBottom] = useState(-120)
 
     const [titleFocus, setTitleFocus] = useState(false)
-
+    const [posting,setPosting] = useState(false)
 
 
     let router
@@ -231,7 +231,10 @@ export default function AddMoment() {
             set_time: global.set_time ? global.set_time : new Date().getTime(),
             confirm_time: new Date().getTime()
         }
+        if (posting) return
+        setPosting(true)
         createMoment(params).then(res => {
+            setPosting(false)
             if (process.env.TARO_ENV == 'weapp') {
                 // Taro.navigateBack();
                 Taro.redirectTo({
@@ -256,6 +259,8 @@ export default function AddMoment() {
             if (global.postMementSuccess){
                 global.postMementSuccess()
             }
+        }).catch(e=>{
+            setPosting(false)
         })
     }
 
@@ -304,7 +309,11 @@ export default function AddMoment() {
             set_time: global.set_time ? global.set_time : new Date().getTime(),
             confirm_time: new Date().getTime()
         }
+
+        if (posting) return
+        setPosting(true)
         updateMoment(params, router.params.id).then(res => {
+            setPosting(false)
             if (process.env.TARO_ENV == 'weapp') {
                 Taro.navigateBack();
                 // Taro.redirectTo({
@@ -315,6 +324,8 @@ export default function AddMoment() {
             global.refreshWindow()
             global.refreshHistory()
             global.refreshMoment()
+        }).catch(e=>{
+            setPosting(false)
         })
     }
 

+ 61 - 14
src/_health/pages/log_time.tsx

@@ -5,7 +5,7 @@ import { useSelector } from "react-redux";
 import { useEffect, useRef, useState } from "react";
 import NewButton, { NewButtonType } from "../base/new_button";
 import { rpxToPx } from "@/utils/tools";
-import { getThemeColor } from "@/features/health/hooks/health_hooks";
+import { getScenario, getThemeColor } from "@/features/health/hooks/health_hooks";
 import NewTimePicker from "../base/new_timepicker";
 import { IconCalendar, IconError } from "@/components/basic/Icons";
 import dayjs from "dayjs";
@@ -68,6 +68,9 @@ export default function LogTime() {
     const [count, setCount] = useState(0)
 
     const [ignoreCheck, setIgnoreCheck] = useState(false)
+    const [posting,setPosting] = useState(false)
+
+
 
     const enter_timestamp = new Date().getTime()
 
@@ -91,6 +94,7 @@ export default function LogTime() {
 
         //前端待处理,日期更新
         setTimeout(() => {
+            console.log('zzzzzzzzzzzzzzzzzzzz')
             setCount(count => count + 1)
             setArray(array => {
                 array.map((item) => {
@@ -138,7 +142,7 @@ export default function LogTime() {
     }
 
     function initDatas(res = data) {
-        const { fast, sleep,status } = res
+        const { fast, sleep, status } = res
 
         var list: any = []
         if (isSingle) {
@@ -274,7 +278,8 @@ export default function LogTime() {
                 list[2].time = dayjs(sleep.real.end_timestamp).format('HH:mm')
             }
         }
-        if (status == 'OG2_NO1'){
+
+        if (status == 'OG2_NO1' && isFastWithSleep) {
             list[0].time = ''
             list[0].date = ''
         }
@@ -308,12 +313,12 @@ export default function LogTime() {
     }
 
     function tapCommit(onlyCheck, firstCheck = false, save_confirm = null) {
-        for (i = 0;i<array.length;i++){
+        for (i = 0; i < array.length; i++) {
             var obj = array[i]
-            if (obj.time == ''||obj.data==''){
+            if (obj.time == '' || obj.data == '') {
                 Taro.showToast({
-                    title:t('health.missing_date_time'),
-                    icon:'none'
+                    title: t('health.missing_date_time'),
+                    icon: 'none'
                 })
                 return;
             }
@@ -350,7 +355,6 @@ export default function LogTime() {
         }
         else {
             if (type == 'home') {
-                debugger
                 if (parseInt(tapIndex + '') == 2) {
                     var obj = array[1]
                     var timestamp = getTimestamp(obj)
@@ -429,7 +433,6 @@ export default function LogTime() {
     }
 
     function commit(list, onlyCheck, save_confirm) {
-        console.log(list)
         const sortedData = list.sort((a, b) => {
             return b.extra.confirm_time - a.extra.confirm_time; // 降序
         });
@@ -445,7 +448,11 @@ export default function LogTime() {
         if (save_confirm) {
             params.save_confirm = save_confirm
         }
+
+        if (posting) return
+        setPosting(true)
         clockTimes(params).then(res => {
+            setPosting(false)
             if ((res as any).result) {
                 setErrors([])
                 setConflicts([])
@@ -516,6 +523,8 @@ export default function LogTime() {
             // Taro.navigateBack({
             //     delta: 1
             // })
+        }).catch(e=>{
+            setPosting(false)
         })
     }
 
@@ -596,14 +605,42 @@ export default function LogTime() {
         var max = new Date().getTime()
         if (iFast) {
             var timeline = index == 0 ? fast.timeline[0] : fast.timeline[1]
-            if (status == 'WFS') {
-                min = enter_timestamp - 24 * 3600 * 1000
-                max = new Date().getTime()
+            if (!isFastWithSleep) {
+                //首页单场景进入时时间限制处理逻辑
+                var fastScenario = getScenario(health.windows, 'FAST')
+                timeline = iStart ? fastScenario.timeline[0] : fastScenario.timeline[1]
+                if (fastScenario.status == 'WFS') {
+                    min = enter_timestamp - 24 * 3600 * 1000
+                    max = new Date().getTime()
+                }
+                else {
+                    min = timeline.picker.min_timestamp
+                    max = timeline.picker.max_timestamp ?? new Date().getTime()
+                }
             }
             else {
-                min = timeline.picker.min_timestamp
-                max = timeline.picker.max_timestamp ?? new Date().getTime()
+                //fast_sleep 进入时,除了wfs情况前端处理,其他case后端处理
+                if (status == 'WFS') {
+                    min = enter_timestamp - 24 * 3600 * 1000
+                    max = new Date().getTime()
+                }
+                else if (status == 'OG2_MISALIGNED') {
+                    if (index == 0) {
+                        min = sleep.real.start_timestamp - 24 * 3600 * 1000
+                        max = sleep.real.start_timestamp
+                    }
+                    else {
+                        min = fast.real.start_timestamp
+                        max = new Date().getTime()
+                    }
+
+                }
+                else {
+                    min = timeline.picker.min_timestamp
+                    max = timeline.picker.max_timestamp ?? new Date().getTime()
+                }
             }
+
         }
         else {
             var timeline = index == 1 ? sleep.timeline[0] : sleep.timeline[1]
@@ -611,6 +648,16 @@ export default function LogTime() {
                 min = enter_timestamp - 24 * 3600 * 1000
                 max = new Date().getTime()
             }
+            else if (status == 'OG2_MISALIGNED') {
+                if (index == 1) {
+                    min = fast.real.start_timestamp
+                }
+                else {
+                    min = sleep.real.start_timestamp
+
+                }
+                max = new Date().getTime()
+            }
             else {
                 min = timeline.picker.min_timestamp
                 max = timeline.picker.max_timestamp ?? new Date().getTime()

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

@@ -1004,5 +1004,7 @@ export default {
         journal_detail:'日记详情',
 
         missing_date_time:'日期或时间缺失',
+
+        log_updated:'Log updated On {{date_time}}',
     }
 }

+ 2 - 7
src/features/health/MainConsole.tsx

@@ -59,13 +59,6 @@ export default function MainConsole(props: { type: WindowType }) {
         navigation = useNavigation()
     }
 
-
-    useEffect(() => {
-        global.hideEatArchiveTip = hideEatArchiveTip
-        global.hideActiveArchiveTip = hideActiveArchiveTip
-    }, [hideEatArchiveTip,hideActiveArchiveTip])
-
-    //
     useEffect(() => {
         if (health.fast_with_sleep.status == 'OG2_MISALIGNED' || health.fast_with_sleep.status == 'OG2_NO1') {
             if (lastFastSleepStatus != health.fast_with_sleep.status) {
@@ -83,9 +76,11 @@ export default function MainConsole(props: { type: WindowType }) {
     global.postMementSuccess = ()=>{
         if (health.mode == 'ACTIVE'){
             setHideActiveArchiveTip(false)
+            global.hideActiveArchiveTip = false
         }
         else {
             setHideEatArchiveTip(false)
+            global.hideEatArchiveTip = false
         }
     }
 

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

@@ -350,7 +350,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         }
         else {
             var currentDate = global.language == 'en' ? dayjs(list[index].window_range.start_timestamp).format('YYYY') : dayjs(list[index].window_range.start_timestamp).format('YYYY年')
-            var now = global.language == 'en' ? dayjs().format('YYYY') : dayjs().format('YYYY年')
+            var now = global.language == 'en' ? dayjs(list[index-1].window_range.start_timestamp).format('YYYY') : dayjs(list[index-1].window_range.start_timestamp).format('YYYY年')
             if (currentDate != now) {
                 showDate = true
                 dateStr = currentDate

+ 1 - 1
src/pages/account/Album.tsx

@@ -171,7 +171,7 @@ export default function Album() {
         }
         else {
             var currentDate = global.language == 'en' ? dayjs(medias[index].timestamp).format('YYYY') : dayjs(medias[index].timestamp).format('YYYY年')
-            var now = global.language == 'en' ? dayjs().format('YYYY') : dayjs().format('YYYY年')
+            var now = global.language == 'en' ? dayjs(medias[index-1].timestamp).format('YYYY') : dayjs(medias[index-1].timestamp).format('YYYY年')
             if (currentDate != now) {
                 showDate = true
                 dateStr2 = currentDate

+ 27 - 21
src/pages/account/Journal.tsx

@@ -255,7 +255,7 @@ export default function Journal() {
         }
         else {
             var currentDate = global.language == 'en' ? dayjs(journals[index].timestamp).format('YYYY') : dayjs(journals[index].timestamp).format('YYYY年')
-            var now = global.language == 'en' ? dayjs().format('YYYY') : dayjs().format('YYYY年')
+            var now = global.language == 'en' ? dayjs(journals[index - 1].timestamp).format('YYYY') : dayjs(journals[index - 1].timestamp).format('YYYY年')
             if (currentDate != now) {
                 showDate = true
                 dateStr2 = currentDate
@@ -316,19 +316,24 @@ export default function Journal() {
     function journalCell(item, index) {
         if (item.show_ring) {
             if (item.windows) {
-                return <TargetProgress key={index} showLine={false}
-                    color={getThemeColor(item.windows[0].window)}
-                    showRing={true}
-                    desc={item.windows[0].description}
-                    icon={
-                        null
-                    }
-                    canvasId={`${item.windows[0].window}${item.windows[0].window_range.start_timestamp}${index}`}
-                    startTimestamp={item.windows[0].window_range.start_timestamp}
-                    endTimerstamp={item.windows[0].window_range.end_timestamp}
-                />
+                return <View key={index}>{
+                    item.windows.map((temp, i) => {
+                        return <TargetProgress key={i * 1000} showLine={i < item.windows.length - 1 ? true : false}
+                            color={getThemeColor(temp.window)}
+                            showRing={true}
+                            desc={temp.description}
+                            icon={
+                                null
+                            }
+                            canvasId={`${temp.window}${temp.window_range.start_timestamp}${index}`}
+                            startTimestamp={temp.window_range.start_timestamp}
+                            endTimerstamp={temp.window_range.end_timestamp}
+                        />
+                    })
+                }</View>
+
             }
-            return <View key={index}/>
+            return <View key={index} />
         }
         return <View style={{ display: 'flex', flexDirection: 'row', marginBottom: rpxToPx(12), overflow: 'hidden', flexShrink: 0 }} key={index}>
             {
@@ -362,7 +367,7 @@ export default function Journal() {
                     item.texts.map((item2, index2) => {
                         return <TimeTitleDesc
                             key={index2 * 1000}
-                            className="line1"
+                            className={item.pics.length == 0 ? 'line2' : 'line3'}
                             style={{ width: item.pics.length > 0 ? rpxToPx(350) : rpxToPx(512) }}
                             // timeObj={item2.time}
                             // time={dayjs(item2.time.timestamp).format('HH:mm')}
@@ -419,12 +424,12 @@ export default function Journal() {
                 width: rpxToPx(32)
             }} onClick={() => {
                 setShowTip(false)
-                // if (health.mode == 'EAT'){
-                //     setHideEatArchiveTip(true)
-                // }
-                // else {
-                //     setHideActiveArchiveTip(true)
-                // }
+                if (health.mode == 'EAT') {
+                    global.hideEatArchiveTip = true
+                }
+                else {
+                    global.hideActiveArchiveTip = true
+                }
             }}>
                 <IconClose color={MainColorType.g01} width={rpxToPx(32)} height={rpxToPx(32)} />
             </NewButton>
@@ -444,10 +449,11 @@ export default function Journal() {
             more()
         }}
     ><View style={{ display: 'flex', flexDirection: 'column', minHeight: rpxToPx(464), backgroundColor: '#f5f5f5' }}>
+
+            <NewHeader type={NewHeaderType.left} title={pageTitle()} />
             {
                 markDoneTip()
             }
-            <NewHeader type={NewHeaderType.left} title={pageTitle()} />
             {
                 !router.params.type && <ScrollView style={{ width: rpxToPx(750), flexDirection: 'row', display: 'flex', height: rpxToPx(72), marginBottom: rpxToPx(20) }} scrollX enableFlex showScrollbar={false}>
                     <View style={{ width: rpxToPx(40), flexShrink: 0 }} />

+ 8 - 1
src/pages/clock/ClockNew.tsx

@@ -61,7 +61,11 @@ export default function ClockNew(props:{children:any,onScroll:any}) {
                         dispatch(setEatArchived((res as any).latest))
                     })
 
-                    global.refreshHistory()
+                    if (global.refreshHistory){
+                        global.refreshHistory()
+                    }
+
+                    
                 }
             })
         }, 1000)
@@ -224,6 +228,9 @@ export default function ClockNew(props:{children:any,onScroll:any}) {
             onRefresherRefresh={() => {
                 global.refreshWindow()
                 setIsPulling(true)
+                if (global.refreshHistory){
+                    global.refreshHistory()
+                }
             }}
             loadMore={() => {
                 if (historyRef) {