leon 1 سال پیش
والد
کامیت
0aa25ff924

+ 11 - 9
src/_health/base/new_date_picker.tsx

@@ -16,7 +16,8 @@ export default function NewDatePicker(props: {
     color?: string,
     type?: NewDatePickerType,
     isToday?: boolean,
-    minTimestamp?: number
+    minTimestamp?: number,
+    maxTimestamp?: number
 }) {
     const [items, setItems] = useState<any>([[0]])
     const [values, setValues] = useState<any>([0])
@@ -46,7 +47,8 @@ export default function NewDatePicker(props: {
 
     function longDatas() {
         let result: any = []
-        const currentDate = new Date()
+        var max = props.maxTimestamp??new Date().getTime()
+        const currentDate = new Date(max)
         currentDate.setHours(23)
         currentDate.setMinutes(59)
         currentDate.setSeconds(59)
@@ -58,16 +60,16 @@ export default function NewDatePicker(props: {
         while (date <= currentDate) {
             var dt = dayjs(date.getTime())
             var string = global.language == 'en' ? dt.format('MMM D') : dt.format('MMMD日')
-            if (dt.isSame(today, 'day')&&dt.isSame(today, 'month')&&dt.isSame(today, 'year')) {
+            if (dt.isSame(today, 'day') && dt.isSame(today, 'month') && dt.isSame(today, 'year')) {
                 string = (global.language == 'en' ? 'Today, ' : '今天 ') + string
             }
-            else if (dt.isSame(yesterday, 'day')&&dt.isSame(yesterday, 'month')&&dt.isSame(yesterday, 'year')) {
+            else if (dt.isSame(yesterday, 'day') && dt.isSame(yesterday, 'month') && dt.isSame(yesterday, 'year')) {
                 string = (global.language == 'en' ? 'Yesterday, ' : '昨天 ') + string
             }
             result.push(string)
             date.setDate(date.getDate() + 1)
         }
-        
+
         return [result]
     }
 
@@ -77,12 +79,12 @@ export default function NewDatePicker(props: {
             const startDate = new Date(props.minTimestamp!)
             let date = startDate
             for (var i = 0; i < longDatas()[0].length; i++) {
-                
+
                 var dt = dayjs(date.getTime())
-                if (dt.isSame(obj,'day') && dt.isSame(obj,'month') && dt.isSame(obj,'year')){
+                if (dt.isSame(obj, 'day') && dt.isSame(obj, 'month') && dt.isSame(obj, 'year')) {
                     return [i]
                 }
-                date.setDate(date.getDate()+1)
+                date.setDate(date.getDate() + 1)
             }
 
 
@@ -101,7 +103,7 @@ export default function NewDatePicker(props: {
                     break
                 case NewDatePickerType.date:
                     {
-                        var timestamp = props.minTimestamp!+list[0]*24*3600*1000
+                        var timestamp = props.minTimestamp! + list[0] * 24 * 3600 * 1000
                         props.onChange(dayjs(timestamp).format('YYYY-MM-DD'))
                     }
                     break

+ 19 - 3
src/_health/components/choose_date_time.tsx

@@ -2,7 +2,7 @@ import { View, Image } from "@tarojs/components"
 import './choose_date_time.scss'
 import { rpxToPx } from "@/utils/tools"
 import NewButton, { NewButtonType } from "../base/new_button"
-import { useState } from "react"
+import { useEffect, useState } from "react"
 import NewDatePicker, { NewDatePickerType } from "../base/new_date_picker"
 import NewTimePicker from "../base/new_timepicker"
 import { IconCalendar } from "@/components/basic/Icons"
@@ -14,9 +14,11 @@ export default function ChooseDateTime(props: {
     showError?: boolean,
     showLine?: boolean,
     minTimestamp?: number,
+    maxTimestamp?: number,
     hideFooter?: boolean,
     footerTitle?: string,
     tapFooter?: any,
+    count?: number,
     color: string,
     date: string,
     time: string,
@@ -26,8 +28,14 @@ export default function ChooseDateTime(props: {
     dateChange: any
 }) {
     const [chooseDate, setChooseDate] = useState(false)
+    const [count, setCount] = useState(0)
+
+    useEffect(() => {
+        setCount(count => count + 1)
+    }, [props.count])
 
     function dateTitle() {
+        if (props.date == '') return global.language == 'en' ? 'Date' : '日期'
         var today = dayjs()
         const yesterday = today.subtract(1, 'day');
         var date = dayjs(props.date)
@@ -43,10 +51,17 @@ export default function ChooseDateTime(props: {
         }
     }
 
+    function timeTitle() {
+        if (props.time == '')
+            return global.language == 'en' ? 'Time' : '时间'
+        return props.time
+
+    }
+
     return <View style={{ position: 'relative' }}>
         <View className="card_header">
             {
-                props.title ? <View className="h34" style={{ flex: 1,color:'#000' }}>{props.title}</View> :
+                props.title ? <View className="h34" style={{ flex: 1, color: '#000' }}>{props.title}</View> :
                     <View style={{ flex: 1 }} />
             }
 
@@ -90,7 +105,7 @@ export default function ChooseDateTime(props: {
                 type={(props.expand && !chooseDate) ? NewButtonType.alpha : NewButtonType.gray}
                 // type={NewButtonType.gray}
                 color={props.color}
-                title={props.time}
+                title={timeTitle()}
                 fontSize={rpxToPx(34)}
                 width={rpxToPx(196)}
                 height={rpxToPx(84)}
@@ -124,6 +139,7 @@ export default function ChooseDateTime(props: {
                 <NewDatePicker
                     type={NewDatePickerType.date}
                     minTimestamp={props.minTimestamp ? props.minTimestamp : new Date().getTime() - 24 * 3600 * 1000}
+                    maxTimestamp={props.maxTimestamp ?? new Date().getTime()}
                     value={props.date}
                     onChange={(e) => {
                         // var list = JSON.parse(JSON.stringify(array))

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

@@ -10,7 +10,7 @@ export default function StickyDateList(props: {
     onScroll: any,
     showDate: boolean,
     date: string,
-    disable?:boolean
+    disable?:boolean,
 }) {
 
     function headerDate(){

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

@@ -329,8 +329,8 @@ 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)
+        // await Taro.setStorage({ key: 'pic', data: savedFilePath })
+        // setImgUrl(savedFilePath as any)
 
         uploadFile(savedFilePath, isAlbum ? 'album' : 'camera')
 

+ 47 - 12
src/_health/pages/log_time.tsx

@@ -65,9 +65,12 @@ export default function LogTime() {
     const [loaded, setLoaded] = useState(false)
     const [autoCheck, setAutoCheck] = useState(false)
     const [initCheck, setInitCheck] = useState(router.params.initCheck == '1')
+    const [count, setCount] = useState(0)
 
     const [ignoreCheck, setIgnoreCheck] = useState(false)
 
+    const enter_timestamp = new Date().getTime()
+
 
     useEffect(() => {
         // if (isSingle) {
@@ -88,6 +91,7 @@ export default function LogTime() {
 
         //前端待处理,日期更新
         setTimeout(() => {
+            setCount(count => count + 1)
             setArray(array => {
                 array.map((item) => {
                     item.today = false
@@ -134,7 +138,7 @@ export default function LogTime() {
     }
 
     function initDatas(res = data) {
-        const { fast, sleep } = res
+        const { fast, sleep,status } = res
 
         var list: any = []
         if (isSingle) {
@@ -270,6 +274,10 @@ export default function LogTime() {
                 list[2].time = dayjs(sleep.real.end_timestamp).format('HH:mm')
             }
         }
+        if (status == 'OG2_NO1'){
+            list[0].time = ''
+            list[0].date = ''
+        }
         setArray(list)
 
         setLoaded(true)
@@ -300,6 +308,17 @@ export default function LogTime() {
     }
 
     function tapCommit(onlyCheck, firstCheck = false, save_confirm = null) {
+        for (i = 0;i<array.length;i++){
+            var obj = array[i]
+            if (obj.time == ''||obj.data==''){
+                Taro.showToast({
+                    title:t('health.missing_date_time'),
+                    icon:'none'
+                })
+                return;
+            }
+        }
+
         var list: any = []
         if (isSingle) {
             var obj = array[0]
@@ -331,6 +350,7 @@ export default function LogTime() {
         }
         else {
             if (type == 'home') {
+                debugger
                 if (parseInt(tapIndex + '') == 2) {
                     var obj = array[1]
                     var timestamp = getTimestamp(obj)
@@ -397,10 +417,6 @@ export default function LogTime() {
             }
         }
 
-
-
-
-
         if (firstCheck && parseInt(router.params.initIndex) == 1) {
             var temps = [list[1], list[0]]
             commit(temps, onlyCheck, save_confirm)
@@ -553,11 +569,11 @@ export default function LogTime() {
         var obj = array[0]
         var timestamp = getTimestamp(obj)
         var duration = isFast ? data.fast.target.duration : data.sleep.target.duration
-        if (router.params.longfast){
-            duration = longDuration*1000*3600
+        if (router.params.longfast) {
+            duration = longDuration * 1000 * 3600
         }
         var time2 = timestamp + duration
-        if (router.params.longfast){
+        if (router.params.longfast) {
             return 'Expect to end fast at ' + dayjs(time2).format('MM-DD HH:mm')
         }
         var strTime = TimeFormatter.dayjsFormat(time2, false)
@@ -570,18 +586,35 @@ export default function LogTime() {
     }
 
     function logItem(index: number, iFast: boolean, iStart: boolean, showLine: boolean) {
-        const { fast, sleep } = data
+        const { fast, sleep, status } = data
         var schedule_time = ''
         var title = ''
 
         var date = array[index].date//array[index].today ? "Today" : "Yesterday"
         var time = array[index].time
-        var min = new Date().getTime()
+        var min = enter_timestamp
+        var max = new Date().getTime()
         if (iFast) {
-            min = fast.picker_min_timestamp
+            var timeline = index == 0 ? fast.timeline[0] : fast.timeline[1]
+            if (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 = sleep.picker_min_timestamp
+            var timeline = index == 1 ? sleep.timeline[0] : sleep.timeline[1]
+            if (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()
+            }
         }
 
         const today = dayjs();
@@ -659,8 +692,10 @@ export default function LogTime() {
             tapFooter={() => tapChangeTime(schedule_time, time, index)}
             color={iFast ? MainColorType.fast : MainColorType.sleep}
             minTimestamp={min}
+            maxTimestamp={max}
             date={date}
             time={time}
+            count={count}
             expand={expandIndex == index}
             choose={() => {
                 setExpandIndex(index)

+ 71 - 35
src/_health/pages/timeline_detail.tsx

@@ -5,7 +5,7 @@ import '@features/health/History.scss'
 import { useEffect, useState } from "react";
 import Taro, { useRouter } from "@tarojs/taro";
 import dayjs from "dayjs";
-import { getThemeColor } from "@/features/health/hooks/health_hooks";
+import { getScenario, getThemeColor } from "@/features/health/hooks/health_hooks";
 import { baseUrl } from "@/services/http/api";
 import { checkAuthorized } from "@/utils/check_authorized";
 import { createMoment, delEvents, delRecord, getEvents, getRecordDetail, makeDone } from "@/services/health";
@@ -27,7 +27,7 @@ import { TimeFormatter } from "@/utils/time_format";
 import TargetProgress from "../components/target_progress";
 import formatMilliseconds from "@/utils/format_time";
 import SingleImage from "../components/single_img";
-import { setShowActionTip } from "@/store/health";
+import { setFirstActiveId, setFirstEatId, setShowActionTip } from "@/store/health";
 import FastSleepPopupContent from "../components/fast_sleep_popup_content";
 import { StatusType } from "../base/status_indicator";
 
@@ -75,7 +75,9 @@ export default function TimelineDetail() {
         router = useRouter()
     }
 
-    const { schedule_id, event_id, window_id, isfastsleep } = router.params
+    const { schedule_id, event_id, window_id, isfastsleep, disable_edit } = router.params
+
+
 
     useEffect(() => {
         Taro.setNavigationBarColor({
@@ -87,29 +89,36 @@ export default function TimelineDetail() {
             backgroundColorBottom: '#ffffff'
         })
 
-        var title = '详情'
-        if (router.params.timestamp){
-            var t = parseInt(router.params.timestamp+'')
-            if (TimeFormatter.isToday(t)){
-                title = TimeFormatter.getTodayUnit()
-            }
-            else if (TimeFormatter.isYesterday(t)){
-                title = TimeFormatter.getYesterdayUnit()
+        var title = ''
+        if (router.params.timestamp) {
+            setTitle(router.params.timestamp)
+        }
+        Taro.setNavigationBarTitle({
+            title: title
+        })
+    }, [showPop])
+
+    function setTitle(timestamp) {
+        var title = ''
+        var t = parseInt(timestamp + '')
+        if (TimeFormatter.isToday(t)) {
+            title = TimeFormatter.getTodayUnit()
+        }
+        else if (TimeFormatter.isYesterday(t)) {
+            title = TimeFormatter.getYesterdayUnit()
+        }
+        else {
+            if (global.languange == 'en') {
+                title = dayjs(t).format('dddd, MMM D')
             }
             else {
-                if (global.languange == 'en'){
-                    title = dayjs(t).format('dddd, MMM D')
-                }
-                else {
-                    title = dayjs(t).format('MMMD日 dddd')
-                }
+                title = dayjs(t).format('MMMD日 dddd')
             }
-            // title = t('health.journal_detail')
         }
         Taro.setNavigationBarTitle({
-            title:title
+            title: title
         })
-    }, [showPop])
+    }
 
     useEffect(() => {
         Taro.onKeyboardHeightChange(res => {
@@ -138,6 +147,8 @@ export default function TimelineDetail() {
                 op_page: 'FAST_WITH_SLEEP'
             }
             getRecordDetail(window_id, router.params.isfastsleep == '1' ? params : null).then(res => {
+                if ((res as any).events && (res as any).events.length > 0 && (res as any).events[0].time)
+                    setTitle((res as any).events[0].time.timestamp)
                 setLoaded(true)
                 setDetail(res)
                 setHistory((res as any).events)
@@ -147,6 +158,8 @@ export default function TimelineDetail() {
         }
         else {
             getEvents(event_id).then(res => {
+                if ((res as any).time)
+                    setTitle((res as any).time.timestamp)
                 setLoaded(true)
                 setDetail(res)
                 setList((res as any).moments)
@@ -182,8 +195,8 @@ export default function TimelineDetail() {
         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)
+        // await Taro.setStorage({ key: 'pic', data: savedFilePath })
+        // setImgUrl(savedFilePath as any)
 
         uploadFile(savedFilePath, isAlbum ? 'album' : 'camera')
 
@@ -324,6 +337,7 @@ export default function TimelineDetail() {
                 delEvents(event_id).then(res => {
                     Taro.navigateBack()
                     global.refreshWindow()
+                    global.refreshHistory()
                     if ((res as any).status_change) {
                         if ((res as any).status_change.previous != (res as any).status_change.current) {
                             //灵动岛弹窗
@@ -387,7 +401,15 @@ export default function TimelineDetail() {
                 itemList: list,
                 success: (res) => {
                     if (res == 0) {
-                        delHistory()
+                        dispatch(setFirstEatId(''))
+                        dispatch(setFirstActiveId(''))
+                        if (event_id) {
+                            del()
+                        }
+                        else {
+                            delHistory()
+                        }
+
                     }
                     else if (res == 1) {
                         tapMarkdone()
@@ -401,18 +423,28 @@ export default function TimelineDetail() {
             list = ['删除']
         }
         else {
-            list = ['编辑', '删除']
+            if (disable_edit == '1') {
+                list = ['删除']
+            }
+            else {
+                list = ['编辑', '删除']
+            }
+
         }
         showActionSheet({
             showActionSheetWithOptions: showActionSheetWithOptions,
             title: t('health.more_actions'),
             itemList: list,
             success: (res) => {
-                if (res == 0 && (health.mode == 'ACTIVE' || health.mode == 'EAT')) {
-                    edit()
-                }
-                else {
-                    del()
+                if (res >= 0) {
+                    if (list[res] == '删除') {
+                        dispatch(setFirstEatId(''))
+                        dispatch(setFirstActiveId(''))
+                        del()
+                    }
+                    else if  (list[res] == '编辑') {
+                        edit()
+                    }
                 }
             }
         })
@@ -434,8 +466,8 @@ export default function TimelineDetail() {
 
     function fastSleepPopContent() {
 
-        function stepContent(str,index){
-            return <View className="bold h30" style={{color:index==1?MainColorType.sleep:MainColorType.fast}}>{str}</View>
+        function stepContent(str, index) {
+            return <View className="bold h30" style={{ color: index == 1 ? MainColorType.sleep : MainColorType.fast }}>{str}</View>
         }
         if (fastSleepPop) {
             var fast = detail.windows[0]
@@ -451,13 +483,17 @@ export default function TimelineDetail() {
                 // total1={total1()}
                 // total2={total2()}
                 // total3={total3()}
-                step1={stepContent(TimeFormatter.calculateTimeDifference(fast.window_range.start_timestamp, sleep.window_range.start_timestamp),0)}
-                step2={stepContent(TimeFormatter.calculateTimeDifference(sleep.window_range.start_timestamp, sleep.window_range.end_timestamp),1)}
-                step3={stepContent(TimeFormatter.calculateTimeDifference(sleep.window_range.end_timestamp, fast.window_range.end_timestamp),2)}
+                step1={stepContent(TimeFormatter.calculateTimeDifference(fast.window_range.start_timestamp, sleep.window_range.start_timestamp), 0)}
+                step2={stepContent(TimeFormatter.calculateTimeDifference(sleep.window_range.start_timestamp, sleep.window_range.end_timestamp), 1)}
+                step3={stepContent(TimeFormatter.calculateTimeDifference(sleep.window_range.end_timestamp, fast.window_range.end_timestamp), 2)}
             />
         }
         return null
     }
+
+
+
+
     return <View style={{ display: 'flex', flex: 1, flexDirection: 'column', backgroundColor: '#fff' }}>
         <View className="detail_header">
             <Image className="detail_header_header"
@@ -578,7 +614,7 @@ export default function TimelineDetail() {
                 {
                     isfastsleep == '0' && history && detail.windows && detail.windows.map((item, index) => {
                         return <TargetProgress key={index} showLine={index < detail.windows.length - 1}
-                            onClick={()=>{
+                            onClick={() => {
                                 vibrate()
                             }}
                             color={getThemeColor(item.window)}

BIN
src/assets/_health/journal.png


+ 10 - 6
src/context/locales/en.js

@@ -985,20 +985,24 @@ export default {
 
         photo_wall:'Photo Wall',
 
-        all_logs:'All logged {{scenario}} ',
-        activities:'activities',
-        meals:'meals',
-        will_collected:'will be collected in ',
-        journal_end:'Journal.',
-        new_journal_created:'New Journal Created',
+        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',
         tonight_at:'Tonight 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:'Journal',
         title_food_journal:'Food Journal',
         title_active_journal:'Activity Journal',
         journal_detail:'Journal Details',
 
+        missing_date_time:'Missing Date or Time',
+
     }
 }

+ 7 - 4
src/context/locales/zh.js

@@ -986,20 +986,23 @@ export default {
 
         photo_wall: '照片墙',
 
-        all_logs: '所有记录的{{scenario}} ',
+        all_logs: '所有完成的{{scenario}}记录 ',
         activities: '活动',
         meals: '饮食',
-        will_collected: '将被收录到 ',
-        journal_end: '日记。',
-        new_journal_created: '新日记已成功创建',
+        will_collected: '将移至 ',
+        journal_end: '最近',
+        new_journal_created: '1 篇新日记',
         show_journal: '显示日记',
         tonight_at: '今晚 {{time}}',
         tomorrow_at: '明天 {{time}}',
+        detail_complete_tip_head:'所有完成的活动记录将显示为 ',
+        detail_complete_tip_end:'当天的一篇日记',
 
         title_journal:'日记',
         title_food_journal:'食物日记',
         title_active_journal:'活动日记',
         journal_detail:'日记详情',
 
+        missing_date_time:'日期或时间缺失',
     }
 }

+ 2 - 2
src/features/food/FoodConsole.tsx

@@ -134,8 +134,8 @@ export default function Component(props: { addItem: Function, firstItem: any })
         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)
+        // await Taro.setStorage({key:'pic', data:savedFilePath})
+        // setImgUrl(savedFilePath as any)
 
         uploadFile(savedFilePath, isAlbum ? 'album' : 'camera')
 

+ 11 - 3
src/features/health/History.scss

@@ -50,7 +50,7 @@
     position: relative;
     height: 120px;
     padding-left: 40px;
-    padding-right: 40px;
+    padding-right: 28px;
     display: flex;
     flex-direction: row;
     justify-content: space-between;
@@ -78,11 +78,19 @@
     justify-content: center;
 }
 
+.archive_bg{
+    width: 60px;
+    height: 60px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
 .archive {
     width: 36px;
     height: 36px;
-    padding-top: 12px;
-    padding-bottom: 12px;
+    // padding-top: 12px;
+    // padding-bottom: 12px;
 }
 
 .archived_bg {

+ 38 - 5
src/features/health/HistoryItem.tsx

@@ -20,6 +20,7 @@ import { TimeFormatter } from "@/utils/time_format";
 import { jumpPage } from "../trackTimeDuration/hooks/Common";
 import TargetProgress from "@/_health/components/target_progress";
 import Cell from "@/_health/base/cell";
+import { setFirstActiveId, setFirstEatId } from "@/store/health";
 
 export default function HistoryItem(props: {
     data: any,
@@ -211,6 +212,7 @@ export default function HistoryItem(props: {
     function del() {
         const { window_id } = props.data
         delRecord(window_id).then(res => {
+            
             global.refreshWindow()
             global.refreshHistory()
         })
@@ -228,8 +230,15 @@ export default function HistoryItem(props: {
         }
     }
 
-    function goDetail() {
-        jumpPage(`/_health/pages/timeline_detail?window_id=${props.data.window_id}&fast_type=${props.fast_type}&type=recent&isfastsleep=${props.mode == 'FAST,SLEEP' ? 1 : 0}`)
+    function goDetail(event_id?: any) {
+        // debugger
+        if (props.mode == 'EAT' || props.mode == 'ACTIVE') {
+            // jumpPage(`/_health/pages/timeline_detail?event_id=${event_id}&fast_type=${props.fast_type}&isfastsleep=0`)
+        }
+        else {
+            jumpPage(`/_health/pages/timeline_detail?disable_edit=1&window_id=${props.data.window_id}&fast_type=${props.fast_type}&type=recent&isfastsleep=${props.mode == 'FAST,SLEEP' ? 1 : 0}`)
+        }
+
     }
 
     // if (props.mode == 'FAST,SLEEP'){
@@ -470,7 +479,31 @@ export default function HistoryItem(props: {
     }
 
     function singleItem(type, url, obj, key) {
-        return <View style={{ display: 'flex', flexDirection: 'row', marginBottom: rpxToPx(12), flex: 1 }} key={key * 1000}>
+        return <View
+            onClick={(e) => {
+                if (process.env.TARO_ENV == 'weapp') {
+                    e.stopPropagation()
+                }
+                if (type == 'PIC') {
+                    var temp: any = null
+                    props.data.events.map(item => {
+                        item.moments && item.moments.map(moment => {
+                            if (moment.media && moment.media.length > 0) {
+                                if (moment.media[0].url==url) {
+                                    temp = item
+                                }
+                            }
+                        })
+                    })
+                    if (temp) {
+                        jumpPage(`/_health/pages/timeline_detail?disable_edit=1&event_id=${temp.id}&isfastsleep=0`)
+                    }
+                }
+                else {
+                    jumpPage(`/_health/pages/timeline_detail?disable_edit=1&event_id=${obj.event_id}&isfastsleep=0`)
+                }
+            }}
+            style={{ display: 'flex', flexDirection: 'row', marginBottom: rpxToPx(12), flex: 1 }} key={key * 1000}>
             {
                 type == 'TEXT' && <View style={{
                     display: 'flex',
@@ -609,14 +642,14 @@ export default function HistoryItem(props: {
                         case 'TEXT':
                             {
                                 return content.data.map((detail, j) => {
-                                    return singleItem('TEXT', '', detail, j*10)
+                                    return singleItem('TEXT', '', detail, j * 10)
                                 })
                             }
                             break
                         case 'PIC':
                             {
                                 return content.data.map((detail, j) => {
-                                    return singleItem('PIC', detail, '', j*10)
+                                    return singleItem('PIC', detail, '', j * 10)
                                 })
                             }
                             break

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

@@ -61,8 +61,9 @@ export default function MainConsole(props: { type: WindowType }) {
 
 
     useEffect(() => {
-
-    }, [props.type])
+        global.hideEatArchiveTip = hideEatArchiveTip
+        global.hideActiveArchiveTip = hideActiveArchiveTip
+    }, [hideEatArchiveTip,hideActiveArchiveTip])
 
     //
     useEffect(() => {

+ 76 - 10
src/features/health/MainHistory.tsx

@@ -8,7 +8,7 @@ import HistoryItem from "./HistoryItem";
 import { rpxToPx } from "@/utils/tools";
 import { jumpPage } from "../trackTimeDuration/hooks/Common";
 import Taro, { useReady } from "@tarojs/taro";
-import { getThemeColor } from "./hooks/health_hooks";
+import { getScenario, getThemeColor } from "./hooks/health_hooks";
 import { TimeFormatter } from "@/utils/time_format";
 import dayjs from "dayjs";
 import { MainColorType } from "@/context/themes/color";
@@ -32,6 +32,11 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
     const [loading, setLoading] = useState(false)
     const [showEatArchive, setShowEatArchive] = useState(true)
     const [showActiveArchive, setShowActiveArchive] = useState(true)
+
+    const [fastList, setFastList] = useState<any>([])
+    const [eatList, setEatList] = useState<any>([])
+    const [activeList, setActiveList] = useState<any>([])
+    const [sleepList, setSleepList] = useState<any>([])
     const healthRef = useRef(health)
     const dispatch = useDispatch()
     const { t } = useTranslation()
@@ -63,6 +68,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
 
     useEffect(() => {
         if (props.type) {
+            debugger
             loadData(1)
         }
     }, [props.type])
@@ -71,6 +77,38 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
     useEffect(() => {
         if (lastMode != health.mode) {
             lastMode = health.mode
+            // loadData(1)
+            setPage(1)
+            switch (health.mode) {
+                case 'DAY':
+                case 'NIGHT':
+                    setList([])
+                    return
+                case 'FAST':
+                    if (fastList.length > 0) {
+                        setList(fastList)
+                        return;
+                    }
+                    break
+                case 'EAT':
+                    if (eatList.length > 0) {
+                        setList(eatList)
+                        return;
+                    }
+                    break
+                case 'SLEEP':
+                    if (sleepList.length > 0) {
+                        setList(sleepList)
+                        return;
+                    }
+                    break
+                case 'ACTIVE':
+                    if (activeList.length > 0) {
+                        setList(activeList)
+                        return;
+                    }
+                    break
+            }
             loadData(1)
         }
 
@@ -162,7 +200,8 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                 {
                                     lastTextArray.push({
                                         title: moment.title,
-                                        description: moment.description
+                                        description: moment.description,
+                                        event_id: event.id
                                     })
                                     if (lastType == 'PIC') {
                                         temps.push({
@@ -208,7 +247,8 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                         {
                                             title: moment.title,
                                             description: moment.description,
-                                            url: moment.media[0].url
+                                            url: moment.media[0].url,
+                                            event_id: event.id
                                         }
                                     ]
                                 })
@@ -243,17 +283,25 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                 // console.log(props.type,health.mode)
                 if (!props.type && array.length > 0) {
                     if (health.mode == 'EAT') {
+                        setEatList(array)
                         dispatch(setFirstEatId(array[0].window_id))
                         if (health.first_eat_id.length > 0 && health.first_eat_id != array[0].window_id) {
                             dispatch(setEatTip(true))
                         }
                     }
                     else if (health.mode == 'ACTIVE') {
+                        setActiveList(array)
                         dispatch(setFirstActiveId(array[0].window_id))
                         if (health.first_active_id.length > 0 && health.first_active_id != array[0].window_id) {
                             dispatch(setActiveTip(true))
                         }
                     }
+                    else if (health.mode == 'FAST'){
+                        setFastList(array)
+                    }
+                    else if (health.mode == 'SLEEP'){
+                        setSleepList(array)
+                    }
                 }
                 setList(array)
                 setTotal((res as any).total)
@@ -374,15 +422,31 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
 
     if (!user.isLogin) return <View />
 
+    function showTipF(){
+        var showTip = false
+        if (getScenario(health.windows,health.mode).status == 'OG'){
+            if (health.mode == 'EAT'){
+                showTip = !global.hideEatArchiveTip
+            }
+            else if (health.mode == 'ACTIVE'){
+                showTip = !global.hideActiveArchiveTip
+            }
+        }
+        return showTip
+    }
+
     function newJournalTip() {
         if (!props.type) {
             var show = false
+            
             if (health.mode == 'EAT' && health.eat_journal_tip) {
                 show = true
             }
             else if (health.mode == 'ACTIVE' && health.active_journal_tip) {
                 show = true
             }
+            
+            
 
             if (show) {
                 return <View style={{
@@ -397,7 +461,9 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                     <View className="archived_bg" onClick={() => {
                         // jumpPage('/_health/pages/archive')
                         var data = list[0]
-                        jumpPage(`/_health/pages/timeline_detail?window_id=${data.window_id}&type=recent&isfastsleep=0&timestamp=${data.publish.timestamp}`)
+                        jumpPage(`/_health/pages/timeline_detail?window_id=${data.window_id}&type=recent&isfastsleep=0&
+                            
+                            timestamp=${data.publish.timestamp}`)
                         setTimeout(() => {
                             if (health.mode == 'EAT') {
                                 dispatch(setEatTip(false))
@@ -451,13 +517,13 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                 <Text className="h42 bold" >{t('health.recents')}</Text>
                 {
                     (health.mode == 'EAT' || health.mode == 'ACTIVE') && <View onClick={() => {
-                        jumpPage('/pages/account/Journal?type='+health.mode)
+                        jumpPage('/pages/account/Journal?type=' + health.mode+`&show_tip=${showTipF()?'1':'0'}`)
                         setTimeout(() => {
                             health.mode == 'EAT' ? setShowEatArchive(false) : setShowActiveArchive(false)
                         }, 1000)
-                    }} style={{ position: 'relative' }}>
-                        <Image className="archive" src={require('@assets/_health/archive.png')} />
-                        {
+                    }} className="archive_bg" style={{ position: 'relative' }}>
+                        <Image className="archive_bg" src={require('@assets/_health/journal.png')} />
+                        {/* {
                             ((health.mode == 'EAT' && health.eatArchivedTotal > 0) ||
                                 (health.mode == 'ACTIVE' && health.activeArchivedTotal > 0)) && <View style={{
                                     width: rpxToPx(12),
@@ -468,7 +534,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                     right: -6,
                                     top: 0
                                 }} />
-                        }
+                        } */}
 
                     </View>
                 }
@@ -500,7 +566,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                 type={props.type}
                                 hideLine={hideLine(index)}
                                 onClick={() => {
-                                    
+
                                 }} />
 
                         </View>

+ 4 - 3
src/features/health/Streak.scss

@@ -3,9 +3,10 @@
     position: fixed;
     top: -2px;
     left: 0;
-    z-index: 10;
+    z-index: 1000000;
     right: 0;
-    bottom: 0;
+    height: 100vh;
+    // bottom: 0;
     overflow: hidden;
     display: flex;
     flex-direction: column;
@@ -17,7 +18,7 @@
     position: fixed;
     top: -2px;
     left: 0;
-    z-index: 10;
+    z-index: 100000000;
     right: 0;
     bottom: 0;
     overflow: hidden;

+ 4 - 3
src/features/health/Streak.tsx

@@ -22,6 +22,7 @@ export default function Streak(props: {
     themeColor?: string,
     modalType?: ModalType,
     cancelCatchMove?: boolean,
+    top?:number,
     themeIsWhite?: boolean
 }) {
 
@@ -124,10 +125,10 @@ export default function Streak(props: {
         </View>
     }
 
+    console.log(props.top)
+    return <View className={isDismiss ? 'modal1 modal_dismiss1' : 'modal1'} style={{ flexShrink: 0,top:props.top??-2 }} catchMove onLongPress={longPress}>
 
-    return <View className={isDismiss ? 'modal1 modal_dismiss1' : 'modal1'} catchMove onLongPress={longPress}>
-
-        <View className={isDismiss ? 'modal_bottom_content1 modal_bottom_dismiss1' : 'modal_bottom_content1'} style={{ flexShrink: 0 }} onClick={onClick}>
+        <View className={isDismiss ? 'modal_bottom_content1 modal_bottom_dismiss1' : 'modal_bottom_content1'} style={{ flexShrink: 0,}} onClick={onClick}>
             {
                 props.children
             }

+ 13 - 0
src/pages/account/Journal.scss

@@ -40,4 +40,17 @@
     height: 155px;
     margin-left: 4px;
     margin-bottom: 4px;
+}
+
+.streak_toolbar_btn{
+    height: 72px;
+    border-radius: 18px;
+    display: flex;
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+    padding-left: 48px;
+    padding-right: 48px;
+    margin-right: 12px;
+    flex-shrink: 0;
 }

+ 129 - 17
src/pages/account/Journal.tsx

@@ -1,6 +1,6 @@
 import JournalCover from "@/features/journal/components/journal_cover";
 import { getJournals } from "@/services/health";
-import { View, Text, Image } from "@tarojs/components";
+import { View, Text, Image, ScrollView } from "@tarojs/components";
 import { useEffect, useState } from "react";
 import './Journal.scss'
 import dayjs from "dayjs";
@@ -14,6 +14,11 @@ import ListFooter from "@/_health/components/list_footer";
 import TimeTitleDesc from "@/_health/components/time_title_desc";
 import { TimeFormatter } from "@/utils/time_format";
 import { useTranslation } from "react-i18next";
+import NewButton, { NewButtonType } from "@/_health/base/new_button";
+import { getScenario, getThemeColor } from "@/features/health/hooks/health_hooks";
+import { useSelector } from "react-redux";
+import { IconClose } from "@/components/basic/Icons";
+import TargetProgress from "@/_health/components/target_progress";
 
 let myScrollTop = 0
 let useRoute;
@@ -25,16 +30,17 @@ if (process.env.TARO_ENV == 'rn') {
 }
 
 export default function Journal() {
+    const health = useSelector((state: any) => state.health);
     const [journals, setJournals] = useState<any>([])
     const [isPulling, setIsPulling] = useState(false)
     const [itemLayouts, setItemLayouts] = useState<any>([])
     const [showDate, setShowDate] = useState(false)
     const [date, setDate] = useState('')
-
+    const [loaded, setLoaded] = useState(false)
     const [page, setPage] = useState(1)
     const [total, setTotal] = useState(0)
     const [loading, setLoading] = useState(false)
-    const {t} = useTranslation()
+    const { t } = useTranslation()
 
     let router
     let navigation;
@@ -48,11 +54,18 @@ export default function Journal() {
     else {
         router = useRouter()
     }
-    
+
+    const [window, setWindow] = useState(router.params.type ?? '')
+    const items = ['FAST', 'SLEEP', 'EAT', 'ACTIVE']
+
+    const [showTip, setShowTip] = useState(router.params.show_tip == '1')
+    // useEffect(() => {
+
+    // }, [])
 
     useEffect(() => {
         getJounalsData(1)
-    }, [])
+    }, [window])
 
     useEffect(() => {
         if (journals.length > 0) {
@@ -73,10 +86,13 @@ export default function Journal() {
 
     function getJounalsData(index = 1) {
         setLoading(true)
-        getJournals({
+        var params: any = {
             page: index,
-            limit: 10
-        }).then(res => {
+            limit: 10,
+        }
+        params.window = window
+        getJournals(params).then(res => {
+            setLoaded(true)
             let list = (res as any).data
             // list.forEach(element => {
             //     let array: any = []
@@ -131,7 +147,7 @@ export default function Journal() {
         myScrollTop = top
 
         if (e.detail.scrollTop > 60) {
-            
+
             Taro.setNavigationBarTitle({
                 title: pageTitle()
             })
@@ -298,15 +314,31 @@ 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}/>
+        }
         return <View style={{ display: 'flex', flexDirection: 'row', marginBottom: rpxToPx(12), overflow: 'hidden', flexShrink: 0 }} key={index}>
             {
-                item.pics.length > 0 && <View onClick={(e)=>{
-                    if (process.env.TARO_ENV=='weapp'){
+                item.pics.length > 0 && <View onClick={(e) => {
+                    if (process.env.TARO_ENV == 'weapp') {
                         e.stopPropagation()
                     }
                     Taro.previewImage({
-                        current:item.pics[0],
-                        urls:item.pics
+                        current: item.pics[0],
+                        urls: item.pics
                     })
                 }}>
                     <JournalCover imgs={item.pics} />
@@ -347,16 +379,60 @@ export default function Journal() {
         </View>
     }
 
-    function pageTitle(){
-        if (router.params.type == 'EAT'){
+    function pageTitle() {
+        if (router.params.type == 'EAT') {
             return t('health.title_food_journal')
         }
-        else if (router.params.type == 'ACTIVE'){
+        else if (router.params.type == 'ACTIVE') {
             return t('health.title_active_journal')
         }
         return t('health.title_journal')
     }
 
+    function markDoneTip() {
+        if (health.mode != 'EAT' && health.mode != 'ACTIVE') return
+        var scenario = getScenario(health.windows, health.mode)
+        if (scenario.status != 'OG') return
+        if (!showTip) return
+
+        var strTitle = ''
+        if (scenario.archive_timestamp) {
+            var today = new Date().getDate()
+            var date = new Date(scenario.archive_timestamp).getDate()
+            if (today == date) {
+                strTitle = t('health.tonight_at', { time: dayjs(scenario.archive_timestamp).format('HH:mm') })
+            }
+            else {
+                strTitle = t('health.tomorrow_at', { time: dayjs(scenario.archive_timestamp).format('HH:mm') })
+            }
+        }
+
+        return <View className="mark_done_tip" style={{
+            backgroundColor: getThemeColor(health.mode) + '1A'
+        }}>
+            <View style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>
+                <Text className="h28 bold" style={{ color: getThemeColor(health.mode) }}>{strTitle}</Text>
+                <Text className="h24 bold"><Text style={{ fontWeight: 'normal' }}>{t('health.detail_complete_tip_head')}</Text>{t('health.detail_complete_tip_end')}</Text>
+            </View>
+            <NewButton type={NewButtonType.img} btnStyle={{
+                height: rpxToPx(32),
+                width: rpxToPx(32)
+            }} onClick={() => {
+                setShowTip(false)
+                // if (health.mode == 'EAT'){
+                //     setHideEatArchiveTip(true)
+                // }
+                // else {
+                //     setHideActiveArchiveTip(true)
+                // }
+            }}>
+                <IconClose color={MainColorType.g01} width={rpxToPx(32)} height={rpxToPx(32)} />
+            </NewButton>
+        </View>
+    }
+
+    if (!loaded) return <View />
+
     return <StickyDateList onRefresherRefresh={() => {
         setIsPulling(true)
         getJounalsData()
@@ -368,7 +444,43 @@ export default function Journal() {
             more()
         }}
     ><View style={{ display: 'flex', flexDirection: 'column', minHeight: rpxToPx(464), backgroundColor: '#f5f5f5' }}>
+            {
+                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 }} />
+                    <NewButton type={NewButtonType.img} onClick={() => {
+                        setWindow('')
+                    }}>
+                        <View className="streak_toolbar_btn"
+                            style={{ backgroundColor: window == '' ? '#B2B2B21A' : 'transparent' }}
+                        >
+                            <Text className={window == '' ? 'bold h30' : 'h30'}
+                                style={{ color: window == '' ? '#000' : MainColorType.g01, marginRight: 5 }}>全部</Text>
+                        </View>
+                    </NewButton>
+
+                    {
+                        items.map((item, index) => {
+                            return <View key={index}>
+                                <NewButton type={NewButtonType.img} onClick={() => {
+                                    setWindow(item)
+                                }}>
+                                    <View className="streak_toolbar_btn"
+                                        style={{ backgroundColor: window == item ? getThemeColor(item) + '1A' : 'transparent' }}
+                                    >
+                                        <Text className={window == item ? 'bold h30' : 'h30'}
+                                            style={{ color: window == item ? getThemeColor(item) : MainColorType.g01, marginRight: 5 }}>{item}</Text>
+                                    </View>
+                                </NewButton>
+                            </View>
+                        })
+                    }
+                    <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
+                </ScrollView>
+            }
             {
                 journals.map((item, index) => {
                     // if (index>0) return <View key={index}/>
@@ -377,7 +489,7 @@ export default function Journal() {
                             historyYear(index)
                         }
                         <View className="history_item2" id={`history-${index}`} onClick={() => {
-                            jumpPage('/pages/account/JournalDetail?date=' +item.date) //JSON.stringify(item))
+                            jumpPage('/pages/account/JournalDetail?date=' + item.date + '&window=' + window) //JSON.stringify(item))
                         }}>
 
                             <View className="cell_date" >

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

@@ -49,15 +49,42 @@ export default function JournalDetail() {
     // const [detail, setDetail] = useState(JSON.parse(router.params.detail))
 
     useEffect(() => {
-        journalDetail(date).then(res => {
+        journalDetail(date, router.params.window).then(res => {
+            if ((res as any).windows.length > 0 &&
+                (res as any).windows[0].events.length > 0 &&
+                (res as any).windows[0].events[0].time
+            ) {
+                setTitle((res as any).windows[0].events[0].time.timestamp)
+            }
             setData(res)
             updateData(res)
             setLoaded(true)
         })
     }, [])
 
-    function updateData(obj) {
+    function setTitle(timestamp) {
+        var title = ''
+        var t = parseInt(timestamp + '')
+        if (TimeFormatter.isToday(t)) {
+            title = TimeFormatter.getTodayUnit()
+        }
+        else if (TimeFormatter.isYesterday(t)) {
+            title = TimeFormatter.getYesterdayUnit()
+        }
+        else {
+            if (global.languange == 'en') {
+                title = dayjs(t).format('dddd, MMM D')
+            }
+            else {
+                title = dayjs(t).format('MMMD日 dddd')
+            }
+        }
+        Taro.setNavigationBarTitle({
+            title: title
+        })
+    }
 
+    function updateData(obj) {
         var array: any = []
 
         obj.windows.map(item => {
@@ -72,24 +99,24 @@ export default function JournalDetail() {
         // 返回一个新数组
         const newArray = [...sortedArray];
 
-        const order = {
-            'FAST_START': 1,
-            'FAST_END': 2,
-            'SLEEP_BEDTIME': 3,
-            'SLEPP_WAKE_UP': 4
-        }
+        // const order = {
+        //     'FAST_START': 1,
+        //     'FAST_END': 2,
+        //     'SLEEP_BEDTIME': 3,
+        //     'SLEEP_WAKE_UP': 4
+        // }
 
-        // 分离出需要排序的项和其他项
-        const otherItems = newArray.filter(item => !order[item.event]);
-        const fastStartItems = newArray.filter(item => order[item.event]);
+        // // 分离出需要排序的项和其他项
+        // const otherItems = newArray.filter(item => !order[item.event]);
+        // const fastStartItems = newArray.filter(item => order[item.event]);
 
-        // 排序 fastStartItems
-        fastStartItems.sort((a, b) => {
-            return (order[a.event] || 0) - (order[b.event] || 0);
-        });
+        // // 排序 fastStartItems
+        // fastStartItems.sort((a, b) => {
+        //     return (order[a.event] || 0) - (order[b.event] || 0);
+        // });
 
-        // 合并其他项和排序后的 fastStartItems
-        const result = otherItems.concat(fastStartItems);
+        // // 合并其他项和排序后的 fastStartItems
+        // const result = otherItems.concat(fastStartItems);
 
 
 
@@ -110,7 +137,8 @@ export default function JournalDetail() {
 
 
         setImgs(obj.imgs)
-        setEvents(result)
+        // setEvents(result)
+        setEvents(newArray)
     }
 
 
@@ -142,7 +170,7 @@ export default function JournalDetail() {
 
     function eventList(detail, index) {
         // const list = detail.moments
-        return <View key={index} style={{ marginBottom: rpxToPx(48) }}>
+        return <View key={index} style={{ marginBottom: rpxToPx(24) }}>
             {
                 detail.show && <TimeTitleDesc
                     timeObj={detail.time}
@@ -188,7 +216,7 @@ export default function JournalDetail() {
                 </View>
 
 
-                <View className="img_container" style={{ marginTop: -rpxToPx(24), marginBottom: rpxToPx(17) }}>
+                <View className="img_container" style={{ marginTop: 0, marginBottom: rpxToPx(17) }}>
                     {
                         imgs.length == 1 ? <SingleImage url={imgs[0]} /> : <CoverList
                             imgs={imgs}

+ 47 - 1
src/pages/account/Profile.scss

@@ -162,4 +162,50 @@
     background-color: #B2B2B2;
     opacity: 0.4;
     left: 112px;
-}
+}
+
+
+.a1{
+    font-size: 40px;
+    font-weight:100;
+}
+
+.a2{
+    font-size: 40px;
+    font-weight: 200;
+}
+
+.a3{
+    font-size: 40px;
+    font-weight: 300;
+}
+
+.a4{
+    font-size: 40px;
+    font-weight: 400;
+}
+
+.a5{
+    font-size: 40px;
+    font-weight: 500;
+}
+
+.a6{
+    font-size: 40px;
+    font-weight: 600;
+}
+
+.a7{
+    font-size: 40px;
+    font-weight: 700;
+}
+
+.a8{
+    font-size: 40px;
+    font-weight: 800;
+}
+
+.a9{
+    font-size: 40px;
+    font-weight: 900;
+}

+ 9 - 0
src/pages/account/Profile.tsx

@@ -388,6 +388,15 @@ export default function Page() {
                 showLine
                 icon={<Image src={require('@assets/_health/setting_more.png')} className="profile_cell_icon" />}
             />
+            {/* <View className="a1">测试ABCDabcd1234</View>
+            <View className="a2">测试ABCDabcd1234</View>
+            <View className="a3">测试ABCDabcd1234</View>
+            <View className="a4">测试ABCDabcd1234</View>
+            <View className="a5">测试ABCDabcd1234</View>
+            <View className="a6">测试ABCDabcd1234</View>
+            <View className="a7">测试ABCDabcd1234</View>
+            <View className="a8">测试ABCDabcd1234</View>
+            <View className="a9">测试ABCDabcd1234</View> */}
             <View style={{ height: 140, flexShrink: 0 }}></View>
         </View>
     }

+ 30 - 18
src/pages/clock/Clock.tsx

@@ -20,14 +20,16 @@ if (process.env.TARO_ENV == 'rn') {
     useNavigation = require("@react-navigation/native").useNavigation
 }
 
+let scrollTop = 0
 export default function Clock() {
     const dispatch = useDispatch();
     const [loaded, setLoaded] = useState(false)
-    
+
     const { t } = useTranslation()
     const health = useSelector((state: any) => state.health);
     const user = useSelector((state: any) => state.user);
     const [showCalendar, setShowCalendar] = useState(false)
+    const [showStreak,setShowStreak] = useState(true)
 
     const systemInfo: any = Taro.getWindowInfo();
     const navigationBarHeight = systemInfo.statusBarHeight + 44;
@@ -202,7 +204,7 @@ export default function Clock() {
         var scenario = getScenario(health.windows, health.mode)
         if ((health.mode == 'DAY' || health.mode == 'NIGHT') && scenario.extra.address) {
             return <View className="navi-streak"
-                onClick={()=>{
+                onClick={() => {
                     global.chooseLocation()
                 }}
                 style={{ height: 44, marginTop: systemInfo.statusBarHeight, }}>
@@ -215,6 +217,12 @@ export default function Clock() {
         return null
     }
 
+    function onScroll(e){
+        scrollTop = e.detail.scrollTop
+
+        setShowStreak(scrollTop<240)
+    }
+
     if (!loaded)
         return <View />
 
@@ -227,12 +235,12 @@ export default function Clock() {
                 alignItems: 'center',
                 justifyContent: 'center',
                 paddingLeft: 0,
-                fontWeight:'bold',
-                fontSize:17
+                fontWeight: 'bold',
+                fontSize: 17
             }} >{health.title}</View>
 
             {
-                steakIcon()
+                showStreak&&steakIcon()
             }
             {
                 locationIcon()
@@ -253,18 +261,22 @@ export default function Clock() {
 
 
         </View>
-        <ClockNew />
-        {
-            showCalendar && <Streak testInfo={null}
-                dismiss={() => {
-                    setShowCalendar(false)
-                }}
-                confirm={() => { }}>
-                <View style={{ display: 'flex', flexDirection: 'column' }}>
-                    <View style={{ height: navigationBarHeight }} />
-                    <Calendar year={2024} month={new Date().getMonth()+1} mode={health.mode}/>
-                </View>
-            </Streak>
-        }
+        <ClockNew onScroll={onScroll}>
+            {
+                showCalendar && <Streak testInfo={null}
+                    top={scrollTop}
+                    dismiss={() => {
+                        setShowCalendar(false)
+                    }}
+                    confirm={() => { }}>
+                    <View style={{ display: 'flex', flexDirection: 'column' }}>
+                        {/* <View style={{ height: navigationBarHeight }} /> */}
+                        <Calendar year={2024} month={new Date().getMonth() + 1} mode={health.mode} />
+                    </View>
+                </Streak>
+            }
+        </ClockNew>
+
+
     </View>
 }

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

@@ -21,7 +21,7 @@ import NoData from "@/_health/components/no_data";
 import Taro from "@tarojs/taro";
 import { IconClose } from "@/components/basic/Icons";
 
-export default function ClockNew() {
+export default function ClockNew(props:{children:any,onScroll:any}) {
     const [count, setCount] = useState(0)
     const [loaded, setLoaded] = useState(false)
     const [showRetry, setShowRetry] = useState(false)
@@ -220,6 +220,7 @@ export default function ClockNew() {
             isPulling={isPulling}
             showDate={showDate}
             date={date}
+            disable={props.children}
             onRefresherRefresh={() => {
                 global.refreshWindow()
                 setIsPulling(true)
@@ -230,6 +231,7 @@ export default function ClockNew() {
                 }
             }}
             onScroll={e => {
+                props.onScroll(e)
                 if (e.detail.scrollTop > 240) {
                     dispatch(setTitle(pageTitle()))
                 }
@@ -270,6 +272,9 @@ export default function ClockNew() {
                 {
                     (health.mode == 'DAY' || health.mode == 'NIGHT') && <View style={{ height: 150, flexShrink: 0 }} />
                 }
+                {
+                    props.children
+                }
             </View>
         </StickyDateList>
     }
@@ -296,6 +301,9 @@ export default function ClockNew() {
                 {
                     detail()
                 }
+                {
+                    props.children()
+                }
 
             </ScrollView>
         }

+ 2 - 2
src/services/health.tsx

@@ -296,10 +296,10 @@ export const getJournals = (params) => {
     })
 }
 
-export const journalDetail = (date) => {
+export const journalDetail = (date,window) => {
     return new Promise((resolve) => {
         request({
-            url: API_ME_JOURNALS+'/'+date, method: 'GET', data: { }
+            url: API_ME_JOURNALS+'/'+date+'?window='+window, method: 'GET', data: { }
         }).then(res => {
             resolve(res);
             // dispatch(loginSuccess(res));