leon 1 år sedan
förälder
incheckning
a11c0eebb6
37 ändrade filer med 815 tillägg och 215 borttagningar
  1. 1 1
      src/_health/base/new_button.tsx
  2. 2 2
      src/_health/components/fast_sleep_console.tsx
  3. 1 1
      src/_health/components/icon_title_cell.tsx
  4. 0 9
      src/_health/components/new_header.scss
  5. 1 1
      src/_health/components/new_header.tsx
  6. 12 0
      src/_health/components/post_moment_time.tsx
  7. 27 0
      src/_health/components/right_arrow_row.scss
  8. 32 0
      src/_health/components/right_arrow_row.tsx
  9. 13 5
      src/_health/components/time_title_desc.tsx
  10. 20 20
      src/_health/pages/add_moment.tsx
  11. 38 5
      src/_health/pages/log_time.tsx
  12. 1 1
      src/_health/pages/move.tsx
  13. 1 1
      src/_health/pages/schedules.tsx
  14. 3 1
      src/_health/pages/streak_calendar.tsx
  15. 2 2
      src/_health/pages/streak_weekly.tsx
  16. 35 3
      src/_health/pages/timeline_detail.tsx
  17. 25 0
      src/app.scss
  18. BIN
      src/assets/_health/arrow2.png
  19. 12 2
      src/context/locales/en.js
  20. 14 4
      src/context/locales/zh.js
  21. 2 2
      src/features/health/History.scss
  22. 2 2
      src/features/health/HistoryItem.tsx
  23. 5 5
      src/features/health/MainConsole.tsx
  24. 272 29
      src/features/health/MainHistory.tsx
  25. 0 21
      src/pages/account/Album.scss
  26. 17 10
      src/pages/account/Album.tsx
  27. 66 7
      src/pages/account/Journal.tsx
  28. 27 18
      src/pages/account/JournalDetail.tsx
  29. 1 1
      src/pages/account/PhotoWall.config.ts
  30. 1 1
      src/pages/account/PhotoWall.scss
  31. 4 3
      src/pages/account/PhotoWall.tsx
  32. 12 0
      src/pages/account/Profile.scss
  33. 21 16
      src/pages/account/Profile.tsx
  34. 112 28
      src/pages/clock/ClockNew.tsx
  35. 28 12
      src/services/health.tsx
  36. 2 1
      src/services/http/api.js
  37. 3 1
      src/store/health.tsx

+ 1 - 1
src/_health/base/new_button.tsx

@@ -308,7 +308,7 @@ export default function NewButton(props: {
 
     return <View
         style={{ ...style, ...props.btnStyle, display: 'flex', flexDirection: 'row', alignItems: 'center' }}
-        catchMove
+        // catchMove
         onClick={(e) => {
             if (process.env.TARO_ENV == 'weapp') {
                 e.stopPropagation()

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

@@ -314,7 +314,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                 if (item.timeline.action && item.timeline.action != 'NA') {
 
                     if (item.timeline.action == 'POST_MOMENT') {
-                        return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
+                        return <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
                     }
                     return <NewButton
                         color={(item.timeline.target.timestamp >= new Date().getTime() || status == 'OG2_MISALIGNED') ? MainColorType.g02 : getThemeColor(item.mode)}
@@ -337,7 +337,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                             className="console_item_img" />
                     }
                     else {
-                        return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
+                        return <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
                     }
 
                     // }

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

@@ -42,7 +42,7 @@ export default function IconTitleCell(props: {
                 props.desc
             }
             <View style={{ width: rpxToPx(12) }} />
-            <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
+            <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
             {
                 props.showLine && <View className="border_footer_line" style={{ left: rpxToPx(98) }} />
             }

+ 0 - 9
src/_health/components/new_header.scss

@@ -1,9 +0,0 @@
-.new_header_bg {
-    padding-top: 24px;
-    padding-bottom: 24px;
-    margin-bottom: 36px;
-    display: flex;
-    flex-direction: column;
-    margin-left: 52px;
-    margin-right: 52px;
-}

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

@@ -11,7 +11,7 @@ export enum NewHeaderType {
 }
 export default function NewHeader(props: { type: NewHeaderType, title: string, subtitle?: string }) {
     return <View className='new_header_bg' style={{
-        alignItems: (props.type == NewHeaderType.center || props.type == NewHeaderType.center_subtitle) ? 'center' : 'flex-start'
+        alignItems: (props.type == NewHeaderType.center || props.type == NewHeaderType.center_subtitle) ? 'center' : 'flex-start',
     }}>
         <View className='h50 bold'>{props.title}</View>
         {

+ 12 - 0
src/_health/components/post_moment_time.tsx

@@ -15,6 +15,7 @@ import CellFooter, { CellFooterType } from '../base/cell_footer';
 import CellFooterText from '../base/cell_footer_text';
 import ChooseDateTime from './choose_date_time';
 import { MainColorType } from '@/context/themes/color';
+import Taro from '@tarojs/taro';
 
 let isYesterdayTarget = false
 export default function PostMomentTime(props: {
@@ -150,6 +151,17 @@ export default function PostMomentTime(props: {
         title='开始时间'
         dismiss={props.dismiss}
         confirm={() => {
+            var date = new Date(selDate+' '+time+':00')
+            var now = new Date()
+            if (date.getTime()>now.getTime()){
+                setTime(dayjs(now.getTime()).format('HH:mm'))
+                Taro.showToast({
+                    title:'不能超过当前时间',
+                    icon:'none'
+                })
+                return
+            }
+            
             props.onChange({
                 date: selDate,
                 time: time,

+ 27 - 0
src/_health/components/right_arrow_row.scss

@@ -0,0 +1,27 @@
+.photo_wall{
+    height: 108px;
+    // background-color: #fff;
+    position: relative;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    padding-right: 40px;
+    width: 750px;
+    box-sizing: border-box;
+}
+
+
+.photo_wall_text{
+    color: #5C7099;
+    font-size: 26px;
+    // font-weight: bold;
+}
+
+.photo_wall_arrow{
+    width: 34px;
+    height: 34px;
+}
+
+.right_arrow_cell_hover{
+    opacity: 0.6;
+}

+ 32 - 0
src/_health/components/right_arrow_row.tsx

@@ -0,0 +1,32 @@
+import { View, Text, Image } from "@tarojs/components"
+import './right_arrow_row.scss'
+import Cell from "../base/cell"
+import { rpxToPx } from "@/utils/tools"
+import { IconArrow } from "@/components/basic/Icons"
+import { MainColorType } from "@/context/themes/color"
+
+export default function RightArrowRow(props: { title: string, onClick: any, showBadge?: boolean, showLine?: boolean }) {
+    return <View style={{ backgroundColor: '#fff' }}>
+        <View className="photo_wall" onClick={props.onClick} hoverStayTime={50} hoverClass='right_arrow_cell_hover'>
+            <View style={{ flex: 1 }} />
+            <Text className="photo_wall_text">{props.title}</Text>
+
+            {
+                props.showBadge && <View style={{
+                    backgroundColor: MainColorType.error,
+                    width: rpxToPx(12),
+                    height: rpxToPx(12),
+                    borderRadius: rpxToPx(6),
+                    marginLeft: rpxToPx(12),
+                    marginRight: rpxToPx(0)
+                }} />
+            }
+            <IconArrow width={rpxToPx(34)} color={MainColorType.link} />
+
+            {
+                props.showLine && <View className="album_line" />
+            }
+
+        </View>
+    </View>
+}

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

@@ -3,6 +3,7 @@ import { rpxToPx } from "@/utils/tools";
 import { Text } from "@tarojs/components";
 import Taro from "@tarojs/taro";
 import dayjs from "dayjs";
+import './time_title_desc.scss'
 
 export default function TimeTitleDesc(props: {
     time: string,
@@ -43,20 +44,27 @@ export default function TimeTitleDesc(props: {
             icon: 'none'
         })
     }
-    return <Text key={props.key} className={props.className} style={{ lineHeight: rpxToPx(48) + 'px', ...props.style }}>
+
+    function titleFunc(){
+        // if (props.title && props.title.length>0 && props.desc && props.desc.length>0){
+        //     return props.title+':'
+        // }
+        return props.title
+    }
+    return <Text key={props.key} className={props.className} style={{ lineHeight: rpxToPx(48) + 'px',marginLeft:props.showPoint?5:0, ...props.style }}>
         {
-            props.showPoint && <Text className="h32" style={{ color: '#000' }}>· </Text>
+            props.showPoint && <Text className="h32 w400" style={{ color: '#000' }}>· </Text>
         }
-        <Text style={{ color: MainColorType.link }} className="h32" onClick={tapTime}>{props.time}</Text>
+        <Text style={{ color: MainColorType.link }} className="h32 w400" onClick={tapTime}>{props.time}</Text>
         {
             props.dayTag && <Text style={{ color: MainColorType.link, fontSize: 9, lineHeight: '20px', fontWeight: 'bold', verticalAlign: 'text-top' }}>{props.dayTag}</Text>
         }
         <Text> {' '} </Text>
         {
-            props.title && <Text className="h32" style={{ color: '#000' }}> {props.title} </Text>
+            props.title && <Text className="h32 w400" style={{ color: '#000' }}> {titleFunc()} </Text>
         }
         {
-            props.desc && <Text className="h32" style={{ color: '#000' }}> {props.desc} </Text>
+            props.desc && <Text className="h32 w300" style={{ color: '#000' }}> {props.desc} </Text>
         }
     </Text>
 }

+ 20 - 20
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)
+    const [posting, setPosting] = useState(false)
 
 
     let router
@@ -256,10 +256,11 @@ export default function AddMoment() {
             global.refreshWindow()
             global.refreshHistory()
 
-            if (global.postMementSuccess){
+            if (global.postMementSuccess) {
                 global.postMementSuccess()
             }
-        }).catch(e=>{
+        }).catch(e => {
+            debugger
             setPosting(false)
         })
     }
@@ -324,7 +325,7 @@ export default function AddMoment() {
             global.refreshWindow()
             global.refreshHistory()
             global.refreshMoment()
-        }).catch(e=>{
+        }).catch(e => {
             setPosting(false)
         })
     }
@@ -514,22 +515,21 @@ export default function AddMoment() {
                 <View className="border_footer_line" style={{ left: rpxToPx(96) }} />
             </View>
 
-            {
-                titleFocus && <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>
-            }
-            <View style={{height:rpxToPx(40),flexShrink:0}}/>
+            <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>
+
+            <View style={{ height: rpxToPx(40), flexShrink: 0 }} />
 
 
             <Textarea placeholder="简单描述(选填)" className="textarea g01"

+ 38 - 5
src/_health/pages/log_time.tsx

@@ -68,7 +68,7 @@ export default function LogTime() {
     const [count, setCount] = useState(0)
 
     const [ignoreCheck, setIgnoreCheck] = useState(false)
-    const [posting,setPosting] = useState(false)
+    const [posting, setPosting] = useState(false)
 
 
 
@@ -312,17 +312,50 @@ export default function LogTime() {
         return timestamp
     }
 
+    function tapDone(){
+        var findError = false
+        for (var i = 0; i < array.length; i++) {
+            var obj = array[i]
+            var str = dayjs().format('HH:mm')
+            var date = new Date(obj.date + ' ' + obj.time + ':00')
+            var now = new Date()
+            if (date.getTime() > now.getTime()) {
+                // setTime(str)
+                array[i].time = str
+                console.log(str)
+                setArray(array)
+                setCount(count => count + 1)
+                findError = true
+
+            }
+        }
+        if (findError) {
+            Taro.showToast({
+                title: '不能超过当前时间',
+                icon: 'none'
+            })
+            return
+        }
+        tapCommit(false)
+    }
+
     function tapCommit(onlyCheck, firstCheck = false, save_confirm = null) {
-        for (i = 0; i < array.length; i++) {
+        
+        for (var i = 0; i < array.length; i++) {
             var obj = array[i]
-            if (obj.time == '' || obj.data == '') {
+            if (obj.time == '' || obj.date == '') {
                 Taro.showToast({
                     title: t('health.missing_date_time'),
                     icon: 'none'
                 })
                 return;
             }
+
+            
         }
+        
+
+
 
         var list: any = []
         if (isSingle) {
@@ -523,7 +556,7 @@ export default function LogTime() {
             // Taro.navigateBack({
             //     delta: 1
             // })
-        }).catch(e=>{
+        }).catch(e => {
             setPosting(false)
         })
     }
@@ -993,7 +1026,7 @@ export default function LogTime() {
                 height={rpxToPx(96)}
                 disable={errors.length > 0}
                 bold={true}
-                onClick={() => tapCommit(false)} />
+                onClick={() => tapDone()} />
         </View>
 
     </View>

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

@@ -873,7 +873,7 @@ export default function Move() {
             {
                 list.length > 0 && <View className="history">
                     <View className="history_header">
-                        <Text className="h42 bold">{t('health.recents')}</Text>
+                        <Text className="h50 bold">{t('health.recents')}</Text>
                     </View>
                     {
                         list.map((item, index) => {

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

@@ -155,7 +155,7 @@ export default function Schedules() {
             case 'NIGHT':
                 return '夜晚和白天';
         }
-        return '全部'
+        return t('health.schedules')
     }
 
     function modalContent() {

+ 3 - 1
src/_health/pages/streak_calendar.tsx

@@ -10,6 +10,7 @@ import { getScenario, getThemeColor } from "@/features/health/hooks/health_hooks
 import NewButton, { NewButtonType } from "../base/new_button";
 import { MainColorType } from "@/context/themes/color";
 import Calendar from "@/features/health/calendar";
+import { useTranslation } from "react-i18next";
 
 
 export default function StreakCalendar() {
@@ -24,6 +25,7 @@ export default function StreakCalendar() {
     const [month, setMonth] = useState(new Date().getMonth() + 1)
     const [current, setCurrent] = useState<any>(null)
     const [loaded, setLoaded] = useState(false)
+    const {t} = useTranslation()
 
     useEffect(() => {
         // loadData()
@@ -261,7 +263,7 @@ export default function StreakCalendar() {
 
     console.log(mode)
     return <View style={{ display: 'flex', flexDirection: 'column', height: '100vh' }}>
-        <NewHeader type={NewHeaderType.left} title="Calendar" />
+        <NewHeader type={NewHeaderType.left} title={t('health.streaks')} />
         <ScrollView style={{ width: rpxToPx(750), flexDirection: 'row', display: 'flex', height: rpxToPx(72) }} scrollX enableFlex showScrollbar={false}>
             <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
             <NewButton type={NewButtonType.img} onClick={() => setMode('EAT')}>

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

@@ -23,7 +23,7 @@ export default function StreakWeekly() {
     function eatCalendarContent() {
         return <View style={{ display: 'flex', flexDirection: 'column' }}>
             <View className="index_section">
-                <Text className="index_section_title">{t('feature.track_time_duration.weekly.title')}</Text>
+                <Text className="index_section_title">{t('health.windows')}</Text>
             </View>
             <WeekCalendar isFastSleep={false} />
             <View className="vip_calendar" style={{ marginBottom: 40 }} onClick={() => setShowEatCalendar(false)}>
@@ -35,7 +35,7 @@ export default function StreakWeekly() {
     return <View>
         <View style={{ display: 'flex', flexDirection: 'column' }}>
             <View className="index_section">
-                <Text className="index_section_title">{t('feature.track_time_duration.weekly.title')}</Text>
+                <Text className="index_section_title">{t('health.windows')}</Text>
             </View>
             <WeekCalendar isFastSleep={true} />
             <View style={{marginTop:30}}>

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

@@ -57,7 +57,7 @@ export default function TimelineDetail() {
     const [time, setTime] = useState(dayjs().format('HH:mm'))
     const [selTime, setSelTime] = useState(dayjs().format('HH:mm'))
     const [selDate, setSelDate] = useState(dayjs().format('YYYY-MM-DD'))
-
+    const [count, setCount] = useState(0)
     const [fastSleepPop, setFastSleepPop] = useState(false)
     const dispatch = useDispatch()
 
@@ -442,7 +442,7 @@ export default function TimelineDetail() {
                         dispatch(setFirstActiveId(''))
                         del()
                     }
-                    else if  (list[res] == '编辑') {
+                    else if (list[res] == '编辑') {
                         edit()
                     }
                 }
@@ -492,6 +492,23 @@ export default function TimelineDetail() {
     }
 
 
+    function footerTime(publish) {
+        if (publish.edited) {
+            //dayjs(publish.timestamp).format('M月D日 HH:mm')
+            return t('health.log_updated', {
+                date_time: global.language == 'en' ?
+                    dayjs(publish.timestamp).format('MMM D HH:mm') :
+                    dayjs(publish.timestamp).format('M月D日 HH:mm')
+            })
+        }
+        else {
+            return t('health.journal_created', {
+                date_time: global.language == 'en' ?
+                    dayjs(publish.timestamp).format('MMM D HH:mm') :
+                    dayjs(publish.timestamp).format('M月D日 HH:mm')
+            })
+        }
+    }
 
 
     return <View style={{ display: 'flex', flex: 1, flexDirection: 'column', backgroundColor: '#fff' }}>
@@ -641,7 +658,8 @@ export default function TimelineDetail() {
                 }
                 {
                     publish && <View style={{ display: 'flex', flexDirection: 'row', height: rpxToPx(60), marginTop: rpxToPx(17), alignItems: 'center', justifyContent: 'space-between' }}>
-                        <Text className="h24 g02">{publish.edited ? '编辑于' : '发布于'}{dayjs(publish.timestamp).format('M月D日 HH:mm')}</Text>
+                        {/* <Text className="h24 g02">{publish.edited ? '编辑于' : '发布于'}{dayjs(publish.timestamp).format('M月D日 HH:mm')}</Text> */}
+                        <Text className="h24 g02">{footerTime(publish)}</Text>
                         <NewButton
                             type={NewButtonType.more}
                             onClick={tapMore}
@@ -650,6 +668,7 @@ export default function TimelineDetail() {
                 }
             </View>
         </View>
+        <Text style={{opacity:0}}>{count}</Text>
         <ListFooter />
         {
             !window_id && health.mode != 'ACTIVE' && health.mode != 'EAT' && <View className="add_note"><NewButton type={NewButtonType.link} title="写个笔记" onClick={() => {
@@ -702,6 +721,7 @@ export default function TimelineDetail() {
                     <View style={{ flex: 1 }} />
                     <View className="btn" style={{ backgroundColor: btnDisable ? '#b2b2b2' : getThemeColor(health.mode) }} onClick={tapPost}>发布</View>
                 </View>
+                
                 <View style={{ height: bottom, flexShrink: 0 }} />
             </View>
         }
@@ -710,6 +730,18 @@ export default function TimelineDetail() {
                 title='时间'
                 dismiss={() => setShowTimePicker(false)}
                 confirm={() => {
+                    var str = dayjs().format('HH:mm')
+                    var date = new Date(selDate + ' ' + selTime + ':00')
+                    var now = new Date()
+                    if (date.getTime() > now.getTime()) {
+                        setTime(str)
+                        setCount(count => count + 1)
+                        Taro.showToast({
+                            title: '不能超过当前时间',
+                            icon: 'none'
+                        })
+                        return
+                    }
                     // props.onChange({
                     //     date: selDate,
                     //     time: time,

+ 25 - 0
src/app.scss

@@ -520,6 +520,18 @@ page {
     line-height: 24px;
 }
 
+.w300{
+    font-weight: 300;
+}
+
+.w400{
+    font-weight: 400;
+}
+
+.w500{
+    font-weight: 500;
+}
+
 // view{
 //     letter-spacing: 0px;
 // }
@@ -628,6 +640,7 @@ page {
 
 .cell_date {
     // background-color: pink;
+    position: relative;
     display: flex;
     margin-right: 0px;
     margin-top: -4px;
@@ -667,4 +680,16 @@ page {
     flex-direction: row;
     align-items: center;
     justify-content: center;
+}
+
+.new_header_bg {
+    padding-top: 24px;
+    padding-bottom: 40px;
+    // margin-bottom: 36px;
+    display: flex;
+    flex-direction: column;
+    padding-left: 40px;
+    padding-right: 52px;
+    width: 750px;
+    // background-color: palegoldenrod;
 }

BIN
src/assets/_health/arrow2.png


+ 12 - 2
src/context/locales/en.js

@@ -890,7 +890,7 @@ export default {
         nighttime:'Nighttime',
         switch_to:'Switch to {{scenario}}',
 
-        live_now:'Live Now',
+        live_now:'Now',
         next_up:'Up Next',
         in_progress:'In Progress',
         longfast_wait:'Awaiting Start',
@@ -997,12 +997,22 @@ export default {
         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_journal:'Journals',
         title_food_journal:'Food Journal',
         title_active_journal:'Activity Journal',
         journal_detail:'Journal Details',
 
         missing_date_time:'Missing Date or Time',
+        log_updated:'Log updated On {{date_time}}',
+        journal_created:'Journal created on {{date_time}}',
 
+        metric:'Metrics',
+        photos:'Photos',
+        schedules:'Schedules',
+        streaks:'Streaks',
+        windows:'Windows',
+        settings:'Settings',
+
+        my_journal:'My Journal',
     }
 }

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

@@ -889,7 +889,7 @@ export default {
         nighttime: '夜晚',
         switch_to: '切换到{{scenario}}',
 
-        live_now: '正在进行',
+        live_now: '现在',
         next_up: '接下来',
         in_progress: '进行中',
         longfast_wait: '待开始',
@@ -973,7 +973,7 @@ export default {
 
         logging: '记录中',
         log: '记录',
-        recents: '最近记录',
+        recents: '最近',
         language: '语言',
 
         fast_with_sleep: '断食与睡眠',
@@ -999,12 +999,22 @@ export default {
         detail_complete_tip_end:'当天的一篇日记',
 
         title_journal:'日记',
-        title_food_journal:'食日记',
+        title_food_journal:'食日记',
         title_active_journal:'活动日记',
         journal_detail:'日记详情',
 
         missing_date_time:'日期或时间缺失',
 
-        log_updated:'Log updated On {{date_time}}',
+        log_updated:'记录更新于 {{date_time}}',
+        journal_created:'日记创建于 {{date_time}}',
+
+        metric:'指标',
+        photos:'照片',
+        schedules:'日程',
+        streaks:'连续天数',
+        windows:'时段统计',
+        settings:'设置',
+
+        my_journal:'我的日记',
     }
 }

+ 2 - 2
src/features/health/History.scss

@@ -48,14 +48,14 @@
 .recent {
     background-color: transparent;
     position: relative;
-    height: 120px;
+    // height: 120px;
     padding-left: 40px;
     padding-right: 28px;
     display: flex;
     flex-direction: row;
     justify-content: space-between;
     padding-top: 36px;
-    padding-bottom: 25px;
+    padding-bottom: 36px;
     box-sizing: border-box;
 }
 

+ 2 - 2
src/features/health/HistoryItem.tsx

@@ -298,7 +298,7 @@ export default function HistoryItem(props: {
                                 }}>{content.data.map((detail, j) => {
                                     return <TimeTitleDesc
                                         key={j * 100}
-                                        className={'line2'}
+                                        className={'line3'}
                                         time=''
                                         title={detail.title}
                                         desc={detail.description}
@@ -516,7 +516,7 @@ export default function HistoryItem(props: {
                     paddingTop: rpxToPx(12),
                     paddingBottom: rpxToPx(12)
                 }}><TimeTitleDesc
-                        className={'line2'}
+                        className={'line3'}
                         time=''
                         title={obj.title}
                         desc={obj.description}

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

@@ -207,7 +207,7 @@ export default function MainConsole(props: { type: WindowType }) {
         if (item.action && item.action != 'NA') {
             if (health.mode == 'FAST' || health.mode == 'SLEEP') {
                 if (item.action == 'POST_MOMENT') {
-                    return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
+                    return <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
                 }
 
             }
@@ -240,7 +240,7 @@ export default function MainConsole(props: { type: WindowType }) {
                     className="console_item_img" />
             }
             else {
-                return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
+                return <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
             }
 
             // }
@@ -814,12 +814,12 @@ export default function MainConsole(props: { type: WindowType }) {
                 str = t('health.fast_after_sleep')
                 break
         }
-        return <View className="h26" style={{ color: MainColorType.g01 }}>{str}</View>
+        return <View className="H26" style={{ color: MainColorType.g02 }}>{str}</View>
     }
 
     function longFastStatus() {
         const { status } = health.long_fast
-        return <View className="h26" style={{ color: MainColorType.g01 }}>{status == 'OG' ? 'In progress' : ''}</View>
+        return <View className="h26" style={{ color: MainColorType.g02 }}>{status == 'OG' ? 'In progress' : ''}</View>
     }
 
     function showMoreBtn() {
@@ -1033,7 +1033,7 @@ export default function MainConsole(props: { type: WindowType }) {
                                 height: rpxToPx(12),
                                 borderRadius: rpxToPx(6),
                                 marginLeft: rpxToPx(12),
-                                marginRight: rpxToPx(12)
+                                marginRight: rpxToPx(0)
                             }} />
                         }
                     </View>}

+ 272 - 29
src/features/health/MainHistory.tsx

@@ -1,6 +1,6 @@
 import { View, Text, Image } from "@tarojs/components";
 import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
-import { records } from "@/services/health";
+import { getLatestJournal, records } from "@/services/health";
 import './History.scss'
 import Calendar from "./calendar";
 import { useDispatch, useSelector } from "react-redux";
@@ -17,6 +17,7 @@ import NoRecord from "@/_health/components/no_record";
 import ListFooter from "@/_health/components/list_footer";
 import { useTranslation } from "react-i18next";
 import { setActiveTip, setEatTip, setFirstActiveId, setFirstEatId } from "@/store/health";
+import RightArrowRow from "@/_health/components/right_arrow_row";
 
 let lastMode = ''
 let myScrollTop = 0
@@ -64,6 +65,9 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
 
     global.refreshHistory = () => {
         refresh()
+
+        refreshEat()
+        refreshActive()
     }
 
     useEffect(() => {
@@ -174,6 +178,210 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         loadData(index)
     }
 
+    function refreshEat() {
+        var params: any = {
+            window: 'EAT',
+            limit: 10,
+            page: 1
+        }
+
+        records(params).then(res => {
+            var array = (res as any).data
+
+            array.map(item => {
+                var temps: any = []
+                var lastType = ''
+                var lastTextArray: any = []
+                var lastImageArray: any = []
+                item.events.map(event => {
+                    event.moments && event.moments.map(moment => {
+                        switch (moment.type) {
+                            case 'TEXT':
+                                {
+                                    lastTextArray.push({
+                                        title: moment.title,
+                                        description: moment.description,
+                                        event_id: event.id
+                                    })
+                                    if (lastType == 'PIC') {
+                                        temps.push({
+                                            type: 'PIC',
+                                            data: JSON.parse(JSON.stringify(lastImageArray))
+                                        })
+                                        lastImageArray = []
+                                    }
+                                    lastType = 'TEXT'
+                                }
+                                break;
+                            case 'PIC':
+                                {
+                                    lastImageArray.push(moment.media[0].url)
+                                    if (lastType == 'TEXT') {
+                                        temps.push({
+                                            type: 'TEXT',
+                                            data: JSON.parse(JSON.stringify(lastTextArray))
+                                        })
+                                        lastTextArray = []
+                                    }
+                                    lastType = 'PIC'
+                                }
+                                break;
+                            case 'PIC_TEXT':
+                                if (lastType == 'PIC') {
+                                    temps.push({
+                                        type: 'PIC',
+                                        data: JSON.parse(JSON.stringify(lastImageArray))
+                                    })
+                                    lastImageArray = []
+                                }
+                                if (lastType == 'TEXT') {
+                                    temps.push({
+                                        type: 'TEXT',
+                                        data: JSON.parse(JSON.stringify(lastTextArray))
+                                    })
+                                    lastTextArray = []
+                                }
+                                temps.push({
+                                    type: 'PIC_TEXT',
+                                    data: [
+                                        {
+                                            title: moment.title,
+                                            description: moment.description,
+                                            url: moment.media[0].url,
+                                            event_id: event.id
+                                        }
+                                    ]
+                                })
+                                lastType = 'PIC_TEXT'
+                                break;
+                        }
+                    })
+                })
+
+                if (lastType == 'PIC') {
+                    temps.push({
+                        type: 'PIC',
+                        data: JSON.parse(JSON.stringify(lastImageArray))
+                    })
+                    lastImageArray = []
+                }
+                if (lastType == 'TEXT') {
+                    temps.push({
+                        type: 'TEXT',
+                        data: JSON.parse(JSON.stringify(lastTextArray))
+                    })
+                    lastTextArray = []
+                }
+
+                item.dataArray = temps;
+            })
+
+            setEatList(array)
+        })
+    }
+
+    function refreshActive() {
+        var params: any = {
+            window: 'ACTIVE',
+            limit: 10,
+            page: 1
+        }
+
+        records(params).then(res => {
+            var array = (res as any).data
+
+            array.map(item => {
+                var temps: any = []
+                var lastType = ''
+                var lastTextArray: any = []
+                var lastImageArray: any = []
+                item.events.map(event => {
+                    event.moments && event.moments.map(moment => {
+                        switch (moment.type) {
+                            case 'TEXT':
+                                {
+                                    lastTextArray.push({
+                                        title: moment.title,
+                                        description: moment.description,
+                                        event_id: event.id
+                                    })
+                                    if (lastType == 'PIC') {
+                                        temps.push({
+                                            type: 'PIC',
+                                            data: JSON.parse(JSON.stringify(lastImageArray))
+                                        })
+                                        lastImageArray = []
+                                    }
+                                    lastType = 'TEXT'
+                                }
+                                break;
+                            case 'PIC':
+                                {
+                                    lastImageArray.push(moment.media[0].url)
+                                    if (lastType == 'TEXT') {
+                                        temps.push({
+                                            type: 'TEXT',
+                                            data: JSON.parse(JSON.stringify(lastTextArray))
+                                        })
+                                        lastTextArray = []
+                                    }
+                                    lastType = 'PIC'
+                                }
+                                break;
+                            case 'PIC_TEXT':
+                                if (lastType == 'PIC') {
+                                    temps.push({
+                                        type: 'PIC',
+                                        data: JSON.parse(JSON.stringify(lastImageArray))
+                                    })
+                                    lastImageArray = []
+                                }
+                                if (lastType == 'TEXT') {
+                                    temps.push({
+                                        type: 'TEXT',
+                                        data: JSON.parse(JSON.stringify(lastTextArray))
+                                    })
+                                    lastTextArray = []
+                                }
+                                temps.push({
+                                    type: 'PIC_TEXT',
+                                    data: [
+                                        {
+                                            title: moment.title,
+                                            description: moment.description,
+                                            url: moment.media[0].url,
+                                            event_id: event.id
+                                        }
+                                    ]
+                                })
+                                lastType = 'PIC_TEXT'
+                                break;
+                        }
+                    })
+                })
+
+                if (lastType == 'PIC') {
+                    temps.push({
+                        type: 'PIC',
+                        data: JSON.parse(JSON.stringify(lastImageArray))
+                    })
+                    lastImageArray = []
+                }
+                if (lastType == 'TEXT') {
+                    temps.push({
+                        type: 'TEXT',
+                        data: JSON.parse(JSON.stringify(lastTextArray))
+                    })
+                    lastTextArray = []
+                }
+
+                item.dataArray = temps;
+            })
+
+            setActiveList(array)
+        })
+    }
+
     function loadData(index: number) {
         var params: any = {
             window: props.type ? props.type : health.mode,
@@ -284,22 +492,22 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                 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))
-                        }
+                        // 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))
-                        }
+                        // 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'){
+                    else if (health.mode == 'FAST') {
                         setFastList(array)
                     }
-                    else if (health.mode == 'SLEEP'){
+                    else if (health.mode == 'SLEEP') {
                         setSleepList(array)
                     }
                 }
@@ -350,7 +558,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(list[index-1].window_range.start_timestamp).format('YYYY') : dayjs(list[index-1].window_range.start_timestamp).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
@@ -411,7 +619,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                         return <Image src={item} key={index} className="archived_img" mode="aspectFill" />
                     })
                 }
-                <IconArrow color={MainColorType.g03} width={rpxToPx(34)} />
+                <IconArrow color={MainColorType.g02} width={rpxToPx(34)} />
             </View>
             <View className="border_footer_line" />
         </View>
@@ -422,13 +630,13 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
 
     if (!user.isLogin) return <View />
 
-    function showTipF(){
+    function showTipF() {
         var showTip = false
-        if (getScenario(health.windows,health.mode).status == 'OG'){
-            if (health.mode == 'EAT'){
+        if (getScenario(health.windows, health.mode).status == 'OG') {
+            if (health.mode == 'EAT') {
                 showTip = !global.hideEatArchiveTip
             }
-            else if (health.mode == 'ACTIVE'){
+            else if (health.mode == 'ACTIVE') {
                 showTip = !global.hideActiveArchiveTip
             }
         }
@@ -438,15 +646,15 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
     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={{
@@ -461,9 +669,14 @@ 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}`)
+
+                        getLatestJournal(false, {
+                            id: health.mode == 'EAT' ? global.eatTipId : global.activeTipId,
+                            user_confirmed: true
+                        }).then(res => {
+
+                        })
                         setTimeout(() => {
                             if (health.mode == 'EAT') {
                                 dispatch(setEatTip(false))
@@ -480,7 +693,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                 return <Image src={item} key={index} className="archived_img" mode="aspectFill" />
                             })
                         } */}
-                        <IconArrow color={MainColorType.g03} width={rpxToPx(34)} />
+                        <IconArrow color={MainColorType.g02} width={rpxToPx(34)} />
                     </View>
                     <View className="border_footer_line" />
                 </View>
@@ -510,14 +723,14 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         return <View />
     }
 
-    return <View style={{ width: rpxToPx(750), marginTop: rpxToPx(36) }}>
+    return <View style={{ width: rpxToPx(750), marginTop: rpxToPx(60) }}>
 
         {
-            (list.length >= 0 || health.mode == 'EAT') && <View className="recent">
-                <Text className="h42 bold" >{t('health.recents')}</Text>
+            (list.length >= 0 || health.mode == 'EAT') && <View className="new_header_bg">
+                <Text className="h50 bold">{t('health.recents')}</Text>
                 {
-                    (health.mode == 'EAT' || health.mode == 'ACTIVE') && <View onClick={() => {
-                        jumpPage('/pages/account/Journal?type=' + health.mode+`&show_tip=${showTipF()?'1':'0'}`)
+                    false && (health.mode == 'EAT' || health.mode == 'ACTIVE') && <View onClick={() => {
+                        jumpPage('/pages/account/Journal?type=' + health.mode + `&show_tip=${showTipF() ? '1' : '0'}`)
                         setTimeout(() => {
                             health.mode == 'EAT' ? setShowEatArchive(false) : setShowActiveArchive(false)
                         }, 1000)
@@ -546,6 +759,36 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         {
             newJournalTip()
         }
+        {
+            (health.mode == 'EAT' || health.mode == 'ACTIVE') && <RightArrowRow title={health.mode == 'ACTIVE' ? t('health.title_active_journal') : t('health.title_food_journal')}
+                showBadge={(health.mode == 'EAT' && health.eat_journal_tip) ||
+                    (health.mode == 'ACTIVE' && health.active_journal_tip)}
+                onClick={() => {
+                    if ((health.mode == 'EAT' && health.eat_journal_tip) ||
+                        (health.mode == 'ACTIVE' && health.active_journal_tip)) {
+                        getLatestJournal(false, {
+                            id: health.mode == 'EAT' ? global.eatTipId : global.activeTipId,
+                            user_confirmed: true
+                        }).then(res => {
+
+                        })
+                    }
+
+
+                    setTimeout(() => {
+                        if (health.mode == 'EAT') {
+                            dispatch(setEatTip(false))
+                        }
+                        else {
+                            dispatch(setActiveTip(false))
+                        }
+                    }, 1000)
+
+                    var showBadge = (health.mode == 'EAT' && health.eat_journal_tip) ||
+                        (health.mode == 'ACTIVE' && health.active_journal_tip)
+                    jumpPage('/pages/account/Journal?type=' + health.mode + `&show_tip=${showTipF() ? '1' : '0'}&show_badge=${showBadge ? 1 : 0}`)
+                }} />
+        }
         {
             list.length == 0 && <NoRecord />
         }

+ 0 - 21
src/pages/account/Album.scss

@@ -1,24 +1,3 @@
-.photo_wall{
-    height: 108px;
-    background-color: #fff;
-    position: relative;
-    display: flex;
-    flex-direction: row;
-    align-items: center;
-    padding-right: 42px;
-}
-
-
-.photo_wall_text{
-    color: #5C7099;
-    font-size: 26px;
-    font-weight: bold;
-}
-
-.photo_wall_arrow{
-    width: 34px;
-    height: 34px;
-}
 
 
 .album_container{

+ 17 - 10
src/pages/account/Album.tsx

@@ -15,6 +15,8 @@ import StickyDateList from "@/_health/components/sticky_date_list";
 import ListFooter from "@/_health/components/list_footer";
 import CoverList from "@/_health/components/cover_list";
 import { TimeFormatter } from "@/utils/time_format";
+import { useTranslation } from "react-i18next";
+import RightArrowRow from "@/_health/components/right_arrow_row";
 
 let myScrollTop = 0
 export default function Album() {
@@ -29,6 +31,7 @@ export default function Album() {
     const [page, setPage] = useState(1)
     const [total, setTotal] = useState(0)
     const [loading, setLoading] = useState(false)
+    const { t } = useTranslation()
 
     useEffect(() => {
         getAlbumsData('')
@@ -125,7 +128,7 @@ export default function Album() {
 
         if (e.detail.scrollTop > 60) {
             Taro.setNavigationBarTitle({
-                title: 'Album'
+                title: t('health.photos')
             })
         }
         else {
@@ -171,7 +174,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(medias[index-1].timestamp).format('YYYY') : dayjs(medias[index-1].timestamp).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
@@ -241,8 +244,8 @@ export default function Album() {
         loadMore={more}
     >
         <View style={{ display: 'flex', flexDirection: 'column' }}>
-            <NewHeader type={NewHeaderType.left} title="Album" />
-            {stat && <ScrollView style={{ width: rpxToPx(750), flexDirection: 'row', display: 'flex', height: rpxToPx(72) }} scrollX enableFlex showScrollbar={false}>
+            <NewHeader type={NewHeaderType.left} title={t('health.photos')} />
+            {/* {stat && <ScrollView style={{ width: rpxToPx(750), flexDirection: 'row', display: 'flex', height: rpxToPx(72) }} scrollX enableFlex showScrollbar={false}>
                 <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
                 <NewButton type={NewButtonType.img} onClick={() => {
                     setWindow('')
@@ -252,7 +255,7 @@ export default function Album() {
                         style={{ backgroundColor: window == '' ? '#B2B2B21A' : 'transparent' }}
                     >
                         <Text className={window == '' ? 'bold h30' : 'h30'}
-                            style={{ color: window == '' ? '#000' : MainColorType.g01,marginRight:5 }}>全部 </Text>
+                            style={{ color: window == '' ? '#000' : MainColorType.g01, marginRight: 5 }}>全部 </Text>
                         <Text className="h20" style={{ color: window == '' ? '#000' : MainColorType.g01 }}>{stat.total}</Text>
                     </View>
                 </NewButton>
@@ -268,7 +271,7 @@ export default function Album() {
                                     style={{ backgroundColor: window == item.window ? getThemeColor(item.window) + '1A' : 'transparent' }}
                                 >
                                     <Text className={window == item.window ? 'bold h30' : 'h30'}
-                                        style={{ color: window == item.window ? getThemeColor(item.window) : MainColorType.g01,marginRight:5  }}>{item.window} </Text>
+                                        style={{ color: window == item.window ? getThemeColor(item.window) : MainColorType.g01, marginRight: 5 }}>{item.window} </Text>
                                     <Text className="h20" style={{ color: window == item.window ? getThemeColor(item.window) : MainColorType.g01 }}>{' ' + item.image_count}</Text>
                                 </View>
                             </NewButton>
@@ -276,17 +279,21 @@ export default function Album() {
                     })
                 }
                 <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
-            </ScrollView>}
-            <View style={{ height: rpxToPx(36) }} />
+            </ScrollView>} */}
+            {/* <View style={{ height: rpxToPx(36) }} /> */}
 
-            <View className="photo_wall" onClick={() => {
+            {/* <View className="photo_wall" onClick={() => {
                 jumpPage('/pages/account/PhotoWall?window=' + window)
             }}>
                 <View style={{ flex: 1 }} />
                 <Text className="photo_wall_text">Photo Wall</Text>
                 <Image className="photo_wall_arrow" src={require('@assets/_health/arrow2.png')} />
                 <View className="album_line" />
-            </View>
+            </View> */}
+
+            <RightArrowRow title={t('health.photo_wall')} onClick={() => {
+                jumpPage('/pages/account/PhotoWall?window=' + window)
+            }} />
             {
                 medias.map((item, index) => {
                     return <View key={index} id={`history-${index}`} style={{ display: 'flex', flexDirection: 'column', paddingTop: rpxToPx(6), backgroundColor: '#fff' }}>

+ 66 - 7
src/pages/account/Journal.tsx

@@ -59,6 +59,7 @@ export default function Journal() {
     const items = ['FAST', 'SLEEP', 'EAT', 'ACTIVE']
 
     const [showTip, setShowTip] = useState(router.params.show_tip == '1')
+    const [showBadge, setShowBadge] = useState(router.params.show_badge == '1')
     // useEffect(() => {
 
     // }, [])
@@ -313,6 +314,38 @@ export default function Journal() {
         return dayjs(item.timestamp).format('MMM')
     }
 
+    function journalCellText(index) {
+        var windows = journals[index].windows
+        var array: any = []
+        windows.map(window => {
+            window.events.map(event => {
+                event.moments && event.moments.map(moment => {
+                    array.push({
+                        title: moment.title,
+                        description: moment.description
+                    })
+                })
+            })
+
+        })
+        return array
+        if (array.length > 0) {
+            return <View style={{ display: 'flex', flexDirection: 'column' }}>
+                {
+                    array.map((item, index) => {
+                        if (index >= 3) return <View key={index * 10000} />
+                        return <TimeTitleDesc key={index * 10000}
+                            time=''
+                            title={item.title}
+                            desc={item.description}
+                        />
+                    })
+                }
+            </View>
+        }
+        return <View />
+    }
+
     function journalCell(item, index) {
         if (item.show_ring) {
             if (item.windows) {
@@ -367,17 +400,29 @@ export default function Journal() {
                     item.texts.map((item2, index2) => {
                         return <TimeTitleDesc
                             key={index2 * 1000}
-                            className={item.pics.length == 0 ? 'line2' : 'line3'}
+                            className='line1'//{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')}
                             time=''
-                            title={item2}
-                            desc={''}
+                            title={item2.title}
+                            desc={item2.description}
                         />
                     })
                 }
 
+                {/* {
+                    journalCellText(index).map((obj2, k) => {
+                        if (k >= 3) return <View key={k * 10000} />
+                        return <TimeTitleDesc key={k * 10000}
+                            time=''
+                            className='line1'
+                            style={{ width: item.pics.length > 0 ? rpxToPx(350) : rpxToPx(512) }}
+                            title={obj2.title}
+                            desc={obj2.description}
+                        />
+                    })
+                } */}
+
+
 
 
             </View>
@@ -454,7 +499,7 @@ export default function Journal() {
             {
                 markDoneTip()
             }
-            {
+            {/* {
                 !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={() => {
@@ -486,7 +531,7 @@ export default function Journal() {
                     }
                     <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
                 </ScrollView>
-            }
+            } */}
             {
                 journals.map((item, index) => {
                     // if (index>0) return <View key={index}/>
@@ -495,12 +540,26 @@ export default function Journal() {
                             historyYear(index)
                         }
                         <View className="history_item2" id={`history-${index}`} onClick={() => {
+                            if (index == 0) {
+                                setTimeout(() => { setShowBadge(false) }, 1000)
+                            }
                             jumpPage('/pages/account/JournalDetail?date=' + item.date + '&window=' + window) //JSON.stringify(item))
                         }}>
 
                             <View className="cell_date" >
                                 <View className="h42 bold" style={{ lineHeight: rpxToPx(60) + 'px' }}>{historyDate(item, index)}</View>
                                 <View className="h24 bold" style={{ marginLeft: rpxToPx(6), marginTop: rpxToPx(13), lineHeight: rpxToPx(47) + 'px' }}>{historyMonth(item, index)}</View>
+                                {
+                                    index == 0 && showBadge && <View style={{
+                                        position:'absolute',
+                                        backgroundColor: MainColorType.error,
+                                        width: rpxToPx(12),
+                                        height: rpxToPx(12),
+                                        borderRadius: rpxToPx(6),
+                                        right:10,
+                                        top:0
+                                    }} />
+                                }
                             </View>
                             <View style={{ display: 'flex', flexDirection: 'column', flex: 1, paddingTop: rpxToPx(4) }}>
                                 {/* {

+ 27 - 18
src/pages/account/JournalDetail.tsx

@@ -16,6 +16,7 @@ import { getThemeColor } from "@/features/health/hooks/health_hooks";
 import formatMilliseconds from "@/utils/format_time";
 import SingleImage from "@/_health/components/single_img";
 import { journalDetail } from "@/services/health";
+import { useTranslation } from "react-i18next";
 
 let useRoute;
 let useNavigation;
@@ -31,6 +32,7 @@ export default function JournalDetail() {
     const [imgs, setImgs] = useState<any>([])
     const [events, setEvents] = useState<any>([])
     const [loaded, setLoaded] = useState(false)
+    const { t } = useTranslation()
 
     let router
     let navigation;
@@ -72,7 +74,7 @@ export default function JournalDetail() {
             title = TimeFormatter.getYesterdayUnit()
         }
         else {
-            if (global.languange == 'en') {
+            if (global.language == 'en') {
                 title = dayjs(t).format('dddd, MMM D')
             }
             else {
@@ -151,21 +153,24 @@ export default function JournalDetail() {
     }
 
     function dayTag(event, moment) {
-        if (event.event == 'FAST_END' || event.event == 'SLEEP_WAKE_UP') {
-            var data = events.filter(item => {
-                if (event.event == 'FAST_END') {
-                    return item.event == 'FAST_START'
-                }
-                if (event.event == 'SLEEP_WAKE_UP') {
-                    return item.event == 'SLEEP_BEDTIME'
-                }
-            })
-            var begin = data[0].time.timestamp
-
-            var end = moment ? moment.time.timestamp : event.time.timestamp
-            return TimeFormatter.dayTagText(begin, end)
-        }
-        return ''
+        // debugger
+        // if (!data ||data.length==0) return ''
+        
+        // // if (event.event == 'FAST_END' || event.event == 'SLEEP_WAKE_UP') {
+        // var data = events.filter(item => {
+        //     if (event.event == 'FAST_END') {
+        //         return item.event == 'FAST_START'
+        //     }
+        //     if (event.event == 'SLEEP_WAKE_UP') {
+        //         return item.event == 'SLEEP_BEDTIME'
+        //     }
+        // })
+        var begin = data.timestamp//data[0].time.timestamp
+
+        var end = moment ? moment.time.timestamp : event.time.timestamp
+        return TimeFormatter.dayTagText(begin, end)
+        // }
+        // return ''
     }
 
     function eventList(detail, index) {
@@ -240,8 +245,12 @@ 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>
+                <Text className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(17), lineHeight: rpxToPx(60) + 'px' }}>{t('health.journal_created', {
+                    date_time: global.language == 'en' ?
+                        dayjs(data.timestamp).format('MMM D HH:mm') :
+                        dayjs(data.timestamp).format('M月D日 HH:mm')
+                })}</Text>
+                {/* <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>
 
 

+ 1 - 1
src/pages/account/PhotoWall.config.ts

@@ -3,7 +3,7 @@ export default definePageConfig({
       // 'ec-canvas': '../../lib/ec-canvas/ec-canvas',
       // 'demo':'../../components/demo'
     },
-    "navigationBarTitleText":"Photo Wall",
+    "navigationBarTitleText":"",
     "enablePullDownRefresh":true,
     "navigationBarBackgroundColor":"#f5f5f5"
   })

+ 1 - 1
src/pages/account/PhotoWall.scss

@@ -1,4 +1,4 @@
-.photo_wall {
+.photo_wall2 {
     display: flex;
     flex-direction: row;
     flex-wrap: wrap;

+ 4 - 3
src/pages/account/PhotoWall.tsx

@@ -121,7 +121,7 @@ export default function PhotoWall() {
 
     function detail() {
         return <View style={{ display: 'flex', flexDirection: 'column' }}>
-            <View className="photo_wall">
+            <View className="photo_wall2">
                 {
                     list.map((item, index) => {
                         return <Image key={index}
@@ -149,11 +149,12 @@ export default function PhotoWall() {
     return <View style={{ position: 'relative' }}>
         <Layout children={detail()}
             // title={router.params.title}
+            
             isFastSleepTheme={router.params.type == 'time'}
             secondPage={true}
             titleColor={'#fff'}
-            title={''}
-            type={TemplateType.flex}
+            title={t('health.photo_wall')}
+            type={TemplateType.customHeader}
             refresh={() => { refresh() }}
             triggered={triggered}
             more={() => { more() }}

+ 12 - 0
src/pages/account/Profile.scss

@@ -209,3 +209,15 @@
     font-size: 40px;
     font-weight: 900;
 }
+
+.b1{
+    font-style: normal;
+}
+
+.b2{
+    font-style: italic;
+}
+
+.b3{
+    font-style: oblique;
+}

+ 21 - 16
src/pages/account/Profile.tsx

@@ -338,7 +338,7 @@ export default function Page() {
             <View className="profile_cell_space" />
             <IconTitleCell
                 onClick={goMetric}
-                title="Body Metrics"
+                title={t('health.metric')}
                 icon={<Image src={require('@assets/_health/setting_body.png')} className="profile_cell_icon" />}
             />
 
@@ -347,7 +347,7 @@ export default function Page() {
                 onClick={() => {
                     jumpPage('/pages/account/Album')
                 }}
-                title="Photo Album"
+                title={t('health.photos')}
                 showLine
                 icon={<Image src={require('@assets/_health/setting_album.png')} className="profile_cell_icon" />}
             />
@@ -355,7 +355,7 @@ export default function Page() {
                 onClick={() => {
                     jumpPage('/pages/account/Journal')
                 }}
-                title="Journal"
+                title={t('health.title_journal')}
                 icon={<Image src={require('@assets/_health/setting_journal.png')} className="profile_cell_icon" />}
             />
 
@@ -364,19 +364,19 @@ export default function Page() {
                 onClick={() => {
                     jumpPage('/_health/pages/schedules?mode=')
                 }}
-                title="Schedule"
+                title={t('health.schedules')}
                 showLine
                 icon={<Image src={require('@assets/_health/setting_calendar.png')} className="profile_cell_icon" />}
             />
             <IconTitleCell
                 onClick={goCalendar}
-                title="Streaks"
+                title={t('health.streaks')}
                 showLine
                 icon={<Image src={require('@assets/_health/setting_streak.png')} className="profile_cell_icon" />}
             />
             <IconTitleCell
                 onClick={goWeekly}
-                title="Windows"
+                title={t('health.windows')}
                 showLine
                 icon={<Image src={require('@assets/_health/setting_chart.png')} className="profile_cell_icon" />}
             />
@@ -384,19 +384,24 @@ export default function Page() {
             <View className="profile_cell_space" />
             <IconTitleCell
                 onClick={goSetting}
-                title="Settings"
+                title={t('health.settings')}
                 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 className="a1">测试ABCDabcd1234 weight 100</View>
+            <View className="a2">测试ABCDabcd1234 weight 200</View>
+            <View className="a3">测试ABCDabcd1234 weight 300</View>
+            <View className="a3" style={{fontWeight:'normal'}}>测试ABCDabcd1234 weight normal</View>
+            <View className="a4">测试ABCDabcd1234 weight 400</View>
+            <View className="a5">测试ABCDabcd1234 weight 500</View>
+            <View className="a6">测试ABCDabcd1234 weight 600</View>
+            <View className="a7">测试ABCDabcd1234 weight 700</View>
+            <View className="a8">测试ABCDabcd1234 weight 800</View>
+            <View className="a9">测试ABCDabcd1234 weight 900</View>
+
+            <View className="a3 b1">测试ABCDabcd1234 weight 300</View>
+            <View className="a3 b2">测试ABCDabcd1234 weight 300</View>
+            <View className="a3 b3">测试ABCDabcd1234 weight 300</View>
             <View style={{ height: 140, flexShrink: 0 }}></View>
         </View>
     }

+ 112 - 28
src/pages/clock/ClockNew.tsx

@@ -2,14 +2,14 @@ import { View, ScrollView, Swiper, SwiperItem, Image } from "@tarojs/components"
 import './Clock.scss'
 import { useEffect, useRef, useState } from "react";
 import TabBar from "@/components/navigation/TabBar";
-import { compareVersion, rpxToPx } from "@/utils/tools";
+import { compareVersion, getTimezone, rpxToPx } from "@/utils/tools";
 import MainSwiper from "@/features/health/MainSwiper";
 import MainConsole from "@/features/health/MainConsole";
 import MainHistory from "@/features/health/MainHistory";
 import { WindowType } from "@/utils/types";
-import { getArchived, windows } from "@/services/health";
+import { getLatestJournal, windows } from "@/services/health";
 import { useDispatch, useSelector } from "react-redux";
-import health, { setActiveArchived, setActiveArchivedTotal, setEatArchived, setEatArchivedTotal, setFastWithSleep, setFinishSetup, setLongFast, setRefreshs, setTitle, setWindows } from "@/store/health";
+import health, { setActiveArchived, setActiveArchivedTotal, setActiveTip, setEatArchived, setEatArchivedTotal, setEatTip, setFastWithSleep, setFinishSetup, setLongFast, setRefreshs, setTitle, setWindows } from "@/store/health";
 import dayjs from "dayjs";
 import { MainColorType } from "@/context/themes/color";
 import NewButton, { NewButtonType } from "@/_health/base/new_button";
@@ -18,10 +18,16 @@ import StatusIndicator, { StatusType } from "@/_health/base/status_indicator";
 import { useTranslation } from "react-i18next";
 import StickyDateList from "@/_health/components/sticky_date_list";
 import NoData from "@/_health/components/no_data";
-import Taro from "@tarojs/taro";
+import Taro, { useDidShow } from "@tarojs/taro";
 import { IconClose } from "@/components/basic/Icons";
+import showAlert from "@/components/basic/Alert";
 
-export default function ClockNew(props:{children:any,onScroll:any}) {
+let AppState;
+if (process.env.TARO_ENV == 'rn') {
+    AppState = require("react-native").AppState
+}
+
+export default function ClockNew(props: { children: any, onScroll: any }) {
     const [count, setCount] = useState(0)
     const [loaded, setLoaded] = useState(false)
     const [showRetry, setShowRetry] = useState(false)
@@ -40,15 +46,67 @@ export default function ClockNew(props:{children:any,onScroll:any}) {
     const { t } = useTranslation()
     global.dispatch = dispatch;
 
+    const handleAppStateChange = (nextAppState) => {
+        if (nextAppState != 'active') {
+            return
+        }
+        if (nextAppState == 'active') {
+            checkTimeZone()
+            refreshData()
+        }
+
+    };
+
+    useDidShow(() => {
+        if (process.env.TARO_ENV == 'weapp') {
+            checkTimeZone()
+            
+        }
+    })
+
+    function refreshData() {
+        global.refreshWindow()
+        global.refreshHistory()
+    }
+
+    function checkTimeZone() {
+        if (!user.isLogin) return
+        var timeZoneFormatted = getTimezone()
+        Taro.getStorage({
+            key: 'last_tz',
+            success: function (res) {
+                if (res.data && res.data != timeZoneFormatted) {
+                    showAlert({
+                        title: t('feature.track_time_duration.change_tz_alert.title'),
+                        content: t('feature.track_time_duration.change_tz_alert.content', { tz: timeZoneFormatted }),
+                        showCancel: false,
+                        confirmText: t('feature.track_time_duration.change_tz_alert.confirm'),
+                    })
+                    // }
+                }
+            },
+            complete: function () {
+                Taro.setStorage({ key: 'last_tz', data: timeZoneFormatted })
+            }
+        })
+    }
+
+
     useEffect(() => {
         healthRef.current = health;
     }, [health])
 
-    useEffect(() => {
-        archived()
-    }, [health.mode])
+    // useEffect(() => {
+    //     archived()
+    // }, [health.mode])
 
     useEffect(() => {
+        if (process.env.TARO_ENV == 'rn') {
+            AppState.addEventListener('change', handleAppStateChange);
+        }
+        Taro.onAppShow(()=>{
+            refreshData()
+        })
         setInterval(() => {
             setCount(index => index + 1)
             healthRef.current.refreshs.map((item) => {
@@ -56,16 +114,12 @@ export default function ClockNew(props:{children:any,onScroll:any}) {
                 const now = dayjs().format('YYYY-MM-DDTHH:mm:ss')
                 if (strTime == now) {
                     getWindows()
-                    // archived();
-                    getArchived('EAT').then(res => {
-                        dispatch(setEatArchived((res as any).latest))
-                    })
 
-                    if (global.refreshHistory){
+                    if (global.refreshHistory) {
                         global.refreshHistory()
                     }
 
-                    
+
                 }
             })
         }, 1000)
@@ -83,7 +137,6 @@ export default function ClockNew(props:{children:any,onScroll:any}) {
 
     global.refreshWindow = () => {
         getWindows();
-        archived();
 
     }
 
@@ -150,18 +203,49 @@ export default function ClockNew(props:{children:any,onScroll:any}) {
     }
 
     function archived() {
-        if (health.mode == 'EAT' || health.mode == 'ACTIVE') {
-            getArchived(health.mode).then(res => {
-                if (health.mode == 'EAT') {
-                    dispatch(setEatArchived((res as any).latest))
-                    dispatch(setEatArchivedTotal((res as any).archived_total))
-                }
-                else if (health.mode == 'ACTIVE') {
-                    dispatch(setActiveArchived((res as any).latest))
-                    dispatch(setActiveArchivedTotal((res as any).archived_total))
-                }
-            })
-        }
+        getLatestJournal(true, {
+            window:'EAT',
+        }).then(res => {
+            if (!(res as any).user_confirmed && (res as any).id) {
+                global.eatTipId = (res as any).id
+                dispatch(setEatTip(true))
+            }
+        })
+        getLatestJournal(true, {
+            window:'ACTIVE'
+        }).then(res => {
+            if (!(res as any).user_confirmed && (res as any).id) {
+                global.activeTipId = (res as any).id
+                dispatch(setActiveTip(true))
+            }
+        })
+
+        // if (health.mode == 'EAT' || health.mode == 'ACTIVE') {
+        //     getLatestJournal(true, health.mode).then(res => {
+        //         if (!(res as any).user_confirmed && (res as any).id) {
+        //             if (health.mode == 'EAT') {
+        //                 // dispatch(setEatArchived((res as any).latest))
+        //                 // dispatch(setEatArchivedTotal((res as any).archived_total))
+        //                 dispatch(setEatTip(true))
+        //             }
+        //             else if (health.mode == 'ACTIVE') {
+        //                 dispatch(setActiveTip(true))
+        //                 // dispatch(setActiveArchived((res as any).latest))
+        //                 // dispatch(setActiveArchivedTotal((res as any).archived_total))
+        //             }
+        //         }
+        //     })
+        //     // getArchived(health.mode).then(res => {
+        //     //     if (health.mode == 'EAT') {
+        //     //         dispatch(setEatArchived((res as any).latest))
+        //     //         dispatch(setEatArchivedTotal((res as any).archived_total))
+        //     //     }
+        //     //     else if (health.mode == 'ACTIVE') {
+        //     //         dispatch(setActiveArchived((res as any).latest))
+        //     //         dispatch(setActiveArchivedTotal((res as any).archived_total))
+        //     //     }
+        //     // })
+        // }
     }
 
     function checkAddToMini() {
@@ -228,7 +312,7 @@ export default function ClockNew(props:{children:any,onScroll:any}) {
             onRefresherRefresh={() => {
                 global.refreshWindow()
                 setIsPulling(true)
-                if (global.refreshHistory){
+                if (global.refreshHistory) {
                     global.refreshHistory()
                 }
             }}

+ 28 - 12
src/services/health.tsx

@@ -1,4 +1,5 @@
-import { API_ACTIVE_MOVES, API_ACTIVE_MOVES_CURRENT, API_ACTIVE_MOVES_SCHEDULES, API_HEALTH_ARCHIVED, API_HEALTH_CLOCK, API_HEALTH_EVENTS, API_HEALTH_FAST_SLEEP, API_HEALTH_LABELS_EVENT, API_HEALTH_LABELS_TIME, API_HEALTH_MOMENT, API_HEALTH_RECORD, API_HEALTH_SCHEDULES, API_HEALTH_STREAKS, API_HEALTH_WINDOWS, API_HEALTH_FAST, API_ME_ALBUMS, API_ME_ALBUMS_STAT, API_ME_JOURNALS, API_HEALTH_SCHEDULES_ORDERS } from "./http/api";
+import { reject } from "lodash";
+import { API_ACTIVE_MOVES, API_ACTIVE_MOVES_CURRENT, API_ACTIVE_MOVES_SCHEDULES, API_HEALTH_ARCHIVED, API_HEALTH_CLOCK, API_HEALTH_EVENTS, API_HEALTH_FAST_SLEEP, API_HEALTH_LABELS_EVENT, API_HEALTH_LABELS_TIME, API_HEALTH_MOMENT, API_HEALTH_RECORD, API_HEALTH_SCHEDULES, API_HEALTH_STREAKS, API_HEALTH_WINDOWS, API_HEALTH_FAST, API_ME_ALBUMS, API_ME_ALBUMS_STAT, API_ME_JOURNALS, API_HEALTH_SCHEDULES_ORDERS, API_LASTEST_JOURNAL } from "./http/api";
 import { request } from "./http/request";
 
 export const getLabelsEvent = (params) => {
@@ -184,29 +185,33 @@ export const getArchived = (mode) => {
 }
 
 export const createMoment = (params) => {
-    return new Promise((resolve) => {
+    return new Promise((resolve, reject) => {
         request({
             url: API_HEALTH_MOMENT, method: 'POST', data: { ...params }
         }).then(res => {
             resolve(res);
             // dispatch(loginSuccess(res));
+        }).catch(e => {
+            reject(e)
         })
     })
 }
 
-export const updateMoment = (params,id) => {
-    return new Promise((resolve) => {
+export const updateMoment = (params, id) => {
+    return new Promise((resolve, reject) => {
         request({
-            url: API_HEALTH_MOMENT+'/'+id, method: 'PUT', data: { ...params }
+            url: API_HEALTH_MOMENT + '/' + id, method: 'PUT', data: { ...params }
         }).then(res => {
             resolve(res);
             // dispatch(loginSuccess(res));
+        }).catch(e => {
+            reject(e)
         })
     })
 }
 
 export const updateEventDuration = (id, duration) => {
-    return new Promise((resolve) => {
+    return new Promise((resolve, reject) => {
         request({
             url: API_HEALTH_EVENTS + `/${id}/duration`, method: 'PUT', data: { target_duration: duration }
         }).then(res => {
@@ -254,7 +259,7 @@ export const getActiveMovesCurrent = () => {
 export const getActiveMoves = (params) => {
     return new Promise((resolve) => {
         request({
-            url: API_ACTIVE_MOVES, method: 'GET', data: {...params}
+            url: API_ACTIVE_MOVES, method: 'GET', data: { ...params }
         }).then(res => {
             resolve(res);
             // dispatch(loginSuccess(res));
@@ -296,10 +301,10 @@ export const getJournals = (params) => {
     })
 }
 
-export const journalDetail = (date,window) => {
+export const journalDetail = (date, window) => {
     return new Promise((resolve) => {
         request({
-            url: API_ME_JOURNALS+'/'+date+'?window='+window, method: 'GET', data: { }
+            url: API_ME_JOURNALS + '/' + date + '?window=' + window, method: 'GET', data: {}
         }).then(res => {
             resolve(res);
             // dispatch(loginSuccess(res));
@@ -363,10 +368,10 @@ export const getEvents = (id) => {
     })
 }
 
-export const getRecordDetail = (id,params) =>{
+export const getRecordDetail = (id, params) => {
     return new Promise((resolve) => {
         request({
-            url: API_HEALTH_RECORD + '/' + id, method: 'GET', data: {...params}
+            url: API_HEALTH_RECORD + '/' + id, method: 'GET', data: { ...params }
         }).then(res => {
             resolve(res);
             // dispatch(loginSuccess(res));
@@ -407,7 +412,7 @@ export const updateFast = (params) => {
     })
 }
 
-export const delRecord = (id, params={}) => {
+export const delRecord = (id, params = {}) => {
     return new Promise((resolve) => {
         request({
             url: API_HEALTH_WINDOWS + '/' + id, method: 'DELETE', data: { ...params }
@@ -415,4 +420,15 @@ export const delRecord = (id, params={}) => {
             resolve(res)
         })
     })
+}
+
+export const getLatestJournal = (isGet: boolean, params: any) => {
+    return new Promise((resolve) => {
+        request({
+            url: API_LASTEST_JOURNAL, method: isGet ? 'GET' : 'POST', data: { ...params }
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        })
+    })
 }

+ 2 - 1
src/services/http/api.js

@@ -114,4 +114,5 @@ export const API_ACTIVE_MOVES_SCHEDULES = `${baseUrl}/api/health/schedules/activ
 export const API_ACTIVE_MOVES= `${baseUrl}/api/health/active/moves`
 export const API_ME_JOURNALS = `${baseUrl}/api/health/wo/journals`
 export const API_ME_ALBUMS = `${baseUrl}/api/health/wo/albums`
-export const API_ME_ALBUMS_STAT = `${baseUrl}/api/health/wo/albums-stat`
+export const API_ME_ALBUMS_STAT = `${baseUrl}/api/health/wo/albums-stat`
+export const API_LASTEST_JOURNAL = `${baseUrl}/api/health/journals/latest/generated-info`

+ 3 - 1
src/store/health.tsx

@@ -46,7 +46,9 @@ const initialState: HealthState = {
     first_eat_id: '',
     first_active_id: '',
     eat_journal_tip: false,
-    active_journal_tip: false
+    active_journal_tip: false,
+
+    
 }
 
 const healthSlice = createSlice({