leon 1 год назад
Родитель
Сommit
2538f12019

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

@@ -7,6 +7,7 @@
     align-items: center;
     justify-content: center;
     width: 750px;
+    background-color: #fff;
 }
 
 .no_more {

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

@@ -1,12 +1,13 @@
 .photo_wall{
-    height: 108px;
+    // height: 108px;
     // background-color: #fff;
     position: relative;
     display: flex;
     flex-direction: row;
     align-items: center;
     padding-right: 40px;
-    width: 750px;
+    // width: 750px;
+    flex: 1;
     box-sizing: border-box;
 }
 

+ 7 - 3
src/_health/components/right_arrow_row.tsx

@@ -5,9 +5,13 @@ 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'>
+export default function RightArrowRow(props: { title: string, onClick: any, showBadge?: boolean, showLine?: boolean,height?:number,bgColor?:string }) {
+    return <View style={{ backgroundColor: props.bgColor??'#fff' }}>
+        <View className="photo_wall" onClick={props.onClick}
+         hoverStayTime={50} 
+         hoverClass='right_arrow_cell_hover'
+         style={{height:props.height??rpxToPx(108)}}
+         >
             <View style={{ flex: 1 }} />
             <Text className="photo_wall_text">{props.title}</Text>
 

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

@@ -258,8 +258,8 @@ export default function AddMoment() {
             global.refreshWindow()
             global.refreshHistory()
 
-            if (global.postMementSuccess) {
-                global.postMementSuccess()
+            if (global.postMomentSuccess) {
+                global.postMomentSuccess()
             }
         }).catch(e => {
             debugger
@@ -268,7 +268,7 @@ export default function AddMoment() {
     }
 
     function edit() {
-        var date = new Date(selDate + ' ' + time + ':'+dayjs(enterTimestamp).format('ss'))
+        var date = new Date(selDate + ' ' + time + ':'+dayjs(enterTimestmap).format('ss'))
 
         var params: any = {
             schedule_id: schedule_id,

+ 14 - 10
src/_health/pages/post_result.tsx

@@ -102,10 +102,10 @@ export default function PostResult() {
     function headerIcon() {
         if (data.current_window) {
             return <View style={{
-                width: rpxToPx(128), height: rpxToPx(128), 
+                width: rpxToPx(128), height: rpxToPx(128),
                 borderRadius: rpxToPx(64),
                 borderWidth: rpxToPx(4),
-                boxSizing:'border-box',
+                boxSizing: 'border-box',
                 borderColor: getThemeColor(data.current_window),
                 borderStyle: 'solid',
                 display: 'flex',
@@ -116,7 +116,7 @@ export default function PostResult() {
                     background: user.isLogin ? 'transparent' : '#fff',
                     width: rpxToPx(108),
                     height: rpxToPx(108),
-                    borderRadius:rpxToPx(54)
+                    borderRadius: rpxToPx(54)
                 }} />
             </View>
         }
@@ -130,7 +130,7 @@ export default function PostResult() {
         }
 
         if (data.scenario == 'MOVE') {
-            return data.extra.move_status == 'ACTIVE' ?<IconActive width={rpxToPx(128)} color={MainColorType.active}/>:<IconSit width={rpxToPx(128)} color={MainColorType.g02}/>
+            return data.extra.move_status == 'ACTIVE' ? <IconActive width={rpxToPx(128)} color={MainColorType.active} /> : <IconSit width={rpxToPx(128)} color={MainColorType.g02} />
         }
         return <View className="result_icon_bg" style={{ backgroundColor: getMainColor() }}>
             <IconCheck color="#fff" width={rpxToPx(88)} height={rpxToPx(88)} />
@@ -181,11 +181,11 @@ export default function PostResult() {
                             setShowSetting(true)
                         }}
                     >
-                        <View style={{marginRight:rpxToPx(8)}}>
-                        {
-                            data.next.reminder ? <IconNotification color={MainColorType.link} width={rpxToPx(26)} /> :
-                                <IconNotificationOff color={MainColorType.link} width={rpxToPx(26)} />
-                        }
+                        <View style={{ marginRight: rpxToPx(8) }}>
+                            {
+                                data.next.reminder ? <IconNotification color={MainColorType.link} width={rpxToPx(26)} /> :
+                                    <IconNotificationOff color={MainColorType.link} width={rpxToPx(26)} />
+                            }
                         </View>
 
                     </NewButton>
@@ -213,7 +213,11 @@ export default function PostResult() {
                 title="Done"
                 bold
                 onClick={() => {
+                    if (global.tapDone) {
+                        global.tapDone()
+                    }
                     if (data.current_window) {
+                        
                         Taro.navigateBack({
                             delta: 10
                         })
@@ -222,7 +226,7 @@ export default function PostResult() {
                         Taro.navigateBack()
                     }
 
-                    if (data.status_change){
+                    if (data.status_change) {
                         if (data.status_change.previous != data.status_change.current) {
                             //灵动岛弹窗
                             dispatch(setShowActionTip({

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

@@ -586,8 +586,8 @@ export default function Schedules() {
                 }
 
 
-                {/* <View style={{ height: 100, flexShrink: 0 }} /> */}
-                <ListFooter />
+                <View style={{ height: 100, flexShrink: 0 }} />
+                {/* <ListFooter /> */}
 
                 <View style={{ flex: 1 }} />
                 {

+ 27 - 11
src/_health/pages/timeline_detail.tsx

@@ -61,6 +61,7 @@ export default function TimelineDetail() {
     const [selDate, setSelDate] = useState(dayjs().format('YYYY-MM-DD'))
     const [count, setCount] = useState(0)
     const [fastSleepPop, setFastSleepPop] = useState(false)
+    const [shareUser, setShareUser] = useState<any>(null)
     const dispatch = useDispatch()
 
     const { t } = useTranslation()
@@ -84,7 +85,7 @@ export default function TimelineDetail() {
         useShareAppMessage((e) => {
             return {
                 title: t('feature.track_time_duration.common.share_title'),
-                path: '/_health/pages/timeline_detail?type=share'
+                path: `/_health/pages/timeline_detail?type=${router.params.type}&schedule_id=${schedule_id}&window_id=${window_id}&event_id=${event_id}&uid=${user.id}&isfastsleep=${isfastsleep}&disable_edit=1&enter_type=share`
             }
         })
     }
@@ -153,10 +154,14 @@ export default function TimelineDetail() {
 
     function getDatas() {
         if (router.params.type == 'recent') {
-            var params = {
-                op_page: 'FAST_WITH_SLEEP'
+            var params: any = {}
+            if (router.params.isfastsleep == '1') {
+                params.op_page = 'FAST_WITH_SLEEP'
             }
-            getRecordDetail(window_id, router.params.isfastsleep == '1' ? params : null).then(res => {
+            if (router.params.uid) {
+                params.share_user_id = router.params.uid
+            }
+            getRecordDetail(window_id, params).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)
@@ -164,16 +169,27 @@ export default function TimelineDetail() {
                 setHistory((res as any).events)
                 // setList((res as any).moments)
                 setPublish((res as any).publish)
+
+                if ((res as any).share_user) {
+                    setShareUser((res as any).share_user)
+                }
             })
         }
         else {
-            getEvents(event_id).then(res => {
+            var params: any = {}
+            if (router.params.uid) {
+                params.share_user_id = router.params.uid
+            }
+            getEvents(event_id, params).then(res => {
                 if ((res as any).time)
                     setTitle((res as any).time.timestamp)
                 setLoaded(true)
                 setDetail(res)
                 setList((res as any).moments)
                 setPublish((res as any).publish)
+                if ((res as any).share_user) {
+                    setShareUser((res as any).share_user)
+                }
             })
         }
 
@@ -372,7 +388,7 @@ export default function TimelineDetail() {
 
     function delHistory() {
         var ids: any = [window_id]
-        if (isfastsleep=='1') {
+        if (isfastsleep == '1') {
             ids = [detail.windows[0].id, detail.windows[1].id]
         }
         showAlert({
@@ -535,13 +551,13 @@ export default function TimelineDetail() {
     return <View style={{ display: 'flex', flex: 1, flexDirection: 'column', backgroundColor: '#fff' }}>
         <View className="detail_header">
             <Image className="detail_header_header"
-                src={user.avatar}
+                src={shareUser ? shareUser.avatar : user.avatar}
                 mode="aspectFill"
             />
             <View className="detail_header_content">
-                <Text className="detail_nickname">{user.nickname}</Text>
+                <Text className="detail_nickname">{shareUser ? shareUser.nickname : user.nickname}</Text>
                 {
-                    !window_id && (detail.scenario != 'MEAL' && detail.scenario != 'ACTIVITY') &&
+                    (!window_id||window_id=='undefined') && (detail.scenario != 'MEAL' && detail.scenario != 'ACTIVITY') &&
                     <TimeTitleDesc
                         timeObj={detail.time}
                         time={dayjs(detail.time.timestamp).format('HH:mm')}
@@ -681,10 +697,10 @@ 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">{footerTime(publish)}</Text>
-                        <NewButton
+                        {!router.params.uid && <NewButton
                             type={NewButtonType.more}
                             onClick={tapMore}
-                        />
+                        />}
                     </View>
                 }
             </View>

+ 6 - 1
src/app.config.ts

@@ -34,7 +34,8 @@ const appConfig = defineAppConfig({
     'pages/account/Album',
     'pages/account/Journal',
     'pages/account/JournalDetail',
-    'pages/account/PhotoWall'
+    'pages/account/PhotoWall',
+    'pages/discover/discover'
   ],
   entryPagePath: 'pages/clock/Clock',
   // subPackages: [
@@ -148,6 +149,10 @@ process.env.TARO_ENV === 'weapp' && (appConfig.tabBar = {
       pagePath: 'pages/clock/Clock',
       text: '生物钟',
     },
+    {
+      pagePath: 'pages/discover/discover',
+      text: '发现',
+    },
     {
       pagePath: 'pages/explore/Index',
       text: '发现',

+ 6 - 2
src/app.scss

@@ -643,7 +643,7 @@ page {
     position: relative;
     display: flex;
     margin-right: 0px;
-    margin-top: -4px;
+    margin-top: 0px;
     width: 122px;
     height: 60px;
     flex-shrink: 0;
@@ -680,6 +680,7 @@ page {
     flex-direction: row;
     align-items: center;
     justify-content: center;
+    
 }
 
 .new_header_bg {
@@ -692,5 +693,8 @@ page {
     padding-right: 52px;
     width: 750px;
     box-sizing: border-box;
-    // background-color: palegoldenrod;
+}
+
+.italic{
+    font-style: italic;
 }

+ 4 - 1
src/components/navigation/TabBar.tsx

@@ -24,7 +24,7 @@ export default function Component(props: { index: number }) {
                 break;
             case 1:
                 Taro.switchTab({
-                    url: '/pages/metric/Metric'
+                    url: '/pages/discover/discover'
                 })
                 break;
             // case 2:
@@ -54,6 +54,9 @@ export default function Component(props: { index: number }) {
         <View className={selIndex == 0 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(0)}>
             <Image className='tabbar-icon' src={selIndex == 0 ?require('@assets/_health/home_sel.png'):require('@assets/_health/home.png')}/>
         </View>
+        <View className={selIndex == 1 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(1)}>
+            <Image className='tabbar-icon' src={selIndex == 1 ?require('@assets/_health/home_sel.png'):require('@assets/_health/home.png')}/>
+        </View>
         <View className={selIndex == 3 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(3)}>
             <Image className='tabbar-icon' src={selIndex == 3 ?require('@assets/_health/user_sel.png'):require('@assets/_health/user.png')}/>
         </View>

+ 5 - 3
src/context/locales/en.js

@@ -992,7 +992,7 @@ export default {
         journal_end:'Recents',
         new_journal_created:'1 New Journal Entry',
         show_journal:'Show Journal',
-        tonight_at:'Tonight at {{time}}',
+        today_at:'At {{time}}',
         tomorrow_at:'Tomorrow at {{time}}',
         detail_complete_tip_head:'All Completed Activity Logs will appear as a single ',
         detail_complete_tip_end:'Journal Entry for the Day.',
@@ -1001,10 +1001,12 @@ export default {
         title_food_journal:'Food Journal',
         title_active_journal:'Activity Journal',
         journal_detail:'Journal Details',
+        my_journal:'My Journal',
 
         missing_date_time:'Missing Date or Time',
         log_updated:'Log updated On {{date_time}}',
         journal_created:'Journal created on {{date_time}}',
+        journal_updated:'Journal updated on {{date_time}}',
 
         metric:'Metrics',
         photos:'Photos',
@@ -1012,7 +1014,7 @@ export default {
         streaks:'Streaks',
         windows:'Windows',
         settings:'Settings',
-
-        my_journal:'My Journal',
+        
+        discover:'Discover',
     }
 }

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

@@ -993,7 +993,7 @@ export default {
         journal_end: '最近',
         new_journal_created: '1 篇新日记',
         show_journal: '显示日记',
-        tonight_at: '今晚 {{time}}',
+        today_at: '今天 {{time}}',
         tomorrow_at: '明天 {{time}}',
         detail_complete_tip_head:'所有完成的活动记录将显示为 ',
         detail_complete_tip_end:'当天的一篇日记',
@@ -1002,11 +1002,13 @@ export default {
         title_food_journal:'饮食日记',
         title_active_journal:'活动日记',
         journal_detail:'日记详情',
+        my_journal:'我的日记',
 
         missing_date_time:'日期或时间缺失',
 
         log_updated:'记录更新于 {{date_time}}',
         journal_created:'日记创建于 {{date_time}}',
+        journal_updated:'日记更新于 {{date_time}}',
 
         metric:'指标',
         photos:'照片',
@@ -1015,6 +1017,6 @@ export default {
         windows:'时段统计',
         settings:'设置',
 
-        my_journal:'我的日记',
+        discover:'发现'
     }
 }

+ 18 - 1
src/features/health/History.scss

@@ -3,7 +3,8 @@
     flex-direction: row;
     width: 750px;
     padding: 40px;
-    padding-bottom: 20px;
+    padding-top: 0;
+    padding-bottom: 60px;
     box-sizing: border-box;
     position: relative;
     background-color: #fff;
@@ -131,4 +132,20 @@
     align-items: center;
     justify-content: center;
     border-radius: 11px;
+}
+
+
+.new_header_bg2 {
+    padding-top: 80px;
+    padding-bottom: 20px;
+    // margin-bottom: 36px;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    padding-left: 40px;
+    align-items: center;
+    // padding-right: 52px;
+    width: 750px;
+    box-sizing: border-box;
+    // background-color: #fff;
 }

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

@@ -278,8 +278,8 @@ export default function HistoryItem(props: {
     function temp() {
         return <View className="history_item2" onClick={goDetail}>
             <View className="cell_date" >
-                <View className="h42 bold" style={{ lineHeight: rpxToPx(60) + 'px' }}>{historyDate()}</View>
-                <View className="h24 bold" style={{ marginLeft: rpxToPx(6), marginTop: rpxToPx(13), lineHeight: rpxToPx(47) + 'px' }}>{historyMonth()}</View>
+                <View className="h42 w500" style={{ lineHeight: rpxToPx(60) + 'px' }}>{historyDate()}</View>
+                <View className="h24 w500" style={{ marginLeft: rpxToPx(6), marginTop: rpxToPx(13), lineHeight: rpxToPx(47) + 'px' }}>{historyMonth()}</View>
             </View>
             <View className="history_content" style={{ paddingTop: rpxToPx(4) }}>
                 {
@@ -639,10 +639,10 @@ export default function HistoryItem(props: {
 
     return <View className="history_item2" onClick={goDetail}>
         <View className="cell_date" >
-            <View className="h42 bold" style={{ lineHeight: rpxToPx(60) + 'px' }}>{historyDate()}</View>
-            <View className="h24 bold" style={{ marginLeft: rpxToPx(6), marginTop: rpxToPx(13), lineHeight: rpxToPx(47) + 'px' }}>{historyMonth()}</View>
+            <View className="h42 w500" style={{ lineHeight: rpxToPx(60) + 'px' }}>{historyDate()}</View>
+            <View className="h24 w500" style={{ marginLeft: rpxToPx(6), marginTop: rpxToPx(13), lineHeight: rpxToPx(47) + 'px' }}>{historyMonth()}</View>
         </View>
-        <View className="history_content" style={{ paddingTop: rpxToPx(4) }}>
+        <View className="history_content" style={{ paddingTop: rpxToPx(0) }}>
             {
                 props.mode != 'EAT' && props.mode != 'ACTIVE' && props.data.dataArray.map((content, i) => {
                     return <View style={{ display: 'flex', flexDirection: 'row', marginBottom: rpxToPx(12), flex: 1 }} key={i}>

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

@@ -235,7 +235,7 @@
   flex-direction: row;
   align-items: center;
   padding: 24px 28px;
-  padding-left: 52px;
+  padding-left: 40px;
   width: 750px;
   box-sizing: border-box;
 }

+ 112 - 24
src/features/health/MainConsole.tsx

@@ -56,6 +56,8 @@ export default function MainConsole(props: { type: WindowType }) {
 
     const [hideEatArchiveTip, setHideEatArchiveTip] = useState(false)
     const [hideActiveArchiveTip, setHideActiveArchiveTip] = useState(false)
+    const [hideFastTip, setHideFastTip] = useState(false)
+    const [hideSleepTip, setHideSleepTip] = useState(false)
     const { t } = useTranslation()
     const dispatch = useDispatch()
 
@@ -84,7 +86,7 @@ export default function MainConsole(props: { type: WindowType }) {
         chooseLocation()
     }
 
-    global.postMementSuccess = () => {
+    global.postMomentSuccess = () => {
         if (health.mode == 'ACTIVE') {
             setHideActiveArchiveTip(false)
             global.hideActiveArchiveTip = false
@@ -95,6 +97,16 @@ export default function MainConsole(props: { type: WindowType }) {
         }
     }
 
+    global.postFastBeginSuccess = () => {
+        setHideFastTip(false)
+        global.hideFastTip = false
+    }
+
+    global.postSleepBeginSuccess = () => {
+        setHideSleepTip(false)
+        global.hideSleepTip = false
+    }
+
     function edit(item) {
         if (item.scenario != 'FAST' && item.scenario != 'SLEEP') {
             return
@@ -516,7 +528,7 @@ export default function MainConsole(props: { type: WindowType }) {
                         content: '确认删除此记录?',
                         showCancel: true,
                         confirm: () => {
-                            delRecord({ids:[obj.window_id]}).then(res => {
+                            delRecord({ ids: [obj.window_id] }).then(res => {
                                 global.refreshWindow()
 
                                 if ((res as any).status_change) {
@@ -656,7 +668,7 @@ export default function MainConsole(props: { type: WindowType }) {
                                     showCancel: true,
                                     cancelText: '稍后',
                                     confirmText: '立即设置',
-                                    cancel:()=>{
+                                    cancel: () => {
                                         global.showIndexAddActive(labels)
                                     },
                                     confirm: () => {
@@ -881,46 +893,122 @@ export default function MainConsole(props: { type: WindowType }) {
     }
 
     function markDoneTip() {
-        if (health.mode != 'EAT' && health.mode != 'ACTIVE') return
+        if (health.mode == 'DAY' && health.mode != 'NIGHT') return
         var scenario = getScenario(health.windows, health.mode)
         if (scenario.status != 'OG') return
 
         if (health.mode == 'EAT' && hideEatArchiveTip) return
         if (health.mode == 'ACTIVE' && hideActiveArchiveTip) return
+        if (health.mode == 'FAST' && hideFastTip) return
+        if (health.mode == 'SLEEP' && hideSleepTip) return
 
-        var strTitle = ''
-        if (scenario.archive_timestamp) {
+        function tipContent() {
+            var strTime = ''
             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') })
+                strTime = t('health.today_at', { time: dayjs(scenario.archive_timestamp).format('HH:mm') })
             }
             else {
-                strTitle = t('health.tomorrow_at', { time: dayjs(scenario.archive_timestamp).format('HH:mm') })
+                strTime = t('health.tomorrow_at', { time: dayjs(scenario.archive_timestamp).format('HH:mm') })
             }
+            switch (health.mode) {
+                case 'FAST':
+                    if (global.language == 'en') {
+                        return <Text className="h28">After you log <Text className="italic">End Fast</Text>,{'\n'}
+                            Your moments <Text className="bold">today</Text> will appear in <Text className="bold">Recents</Text>.</Text>
+                    }
+                    return <Text className="h28">在您记录完 <Text className="italic">结束断食</Text> 之后,{'\n'}
+                        您<Text className="bold">今天</Text>的时刻将出现在<Text className="bold">最近</Text>中。</Text>
+                case 'SLEEP':
+                    if (global.language == 'en') {
+                        return <Text className="h28">After you log <Text className="italic">Wake Up</Text>,{'\n'}
+                            Your moments <Text className="bold">today</Text> will appear in <Text className="bold">Recents</Text>.</Text>
+                    }
+                    return <Text className="h28">在您记录完 <Text className="italic">起床</Text> 之后,{'\n'}
+                        您<Text className="bold">今天</Text>的时刻将出现在<Text className="bold">最近</Text>中。</Text>
+                case 'EAT':
+                    if (global.language == 'en') {
+                        return <Text className="h28"><Text style={{ color: MainColorType.eat }}>{strTime}</Text> or after you <Text className="italic">Mark Done</Text>,{'\n'}
+                            Your moments <Text className="bold">today</Text> will appear in <Text className="bold">Recents</Text>.</Text>
+                    }
+                    return <Text className="h28"><Text style={{ color: MainColorType.eat }}>{strTime}</Text> 或在您 <Text className="italic">标记完成</Text> 之后,{'\n'}
+                        您<Text className="bold">今天</Text>的时刻将出现在<Text className="bold">最近</Text>中。</Text>
+                case 'ACTIVE':
+                    if (global.language == 'en') {
+                        return <Text className="h28"><Text style={{ color: MainColorType.active }}>{strTime}</Text> or after you <Text className="italic">Mark Done</Text>,{'\n'}
+                            Your moments <Text className="bold">today</Text> will appear in <Text className="bold">Recents</Text>.</Text>
+                    }
+                    return <Text className="h28"><Text style={{ color: MainColorType.active }}>{strTime}</Text> 或在您 <Text className="italic">标记完成</Text> 之后,{'\n'}
+                        您<Text className="bold">今天</Text>的时刻将出现在<Text className="bold">最近</Text>中。</Text>
+            }
+            return <Text className="h28">1</Text>
         }
 
+
         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">{t('health.all_logs', { scenario: health.mode == 'EAT' ? t('health.meals') : t('health.activities') })}<Text style={{ fontWeight: 'normal' }}>{t('health.will_collected')}</Text>{t('health.journal_end')}</Text>
+                {
+                    tipContent()
+                }
             </View>
             <NewButton type={NewButtonType.img} btnStyle={{
                 height: rpxToPx(32),
                 width: rpxToPx(32)
             }} onClick={() => {
-                if (health.mode == 'EAT') {
-                    setHideEatArchiveTip(true)
-                }
-                else {
-                    setHideActiveArchiveTip(true)
+                switch (health.mode) {
+                    case 'FAST':
+                        setHideFastTip(true)
+                        break;
+                    case 'EAT':
+                        setHideEatArchiveTip(true)
+                        break;
+                    case 'SLEEP':
+                        setHideSleepTip(true)
+                        break
+                    case 'ACTIVE':
+                        setHideActiveArchiveTip(true)
+                        break
                 }
             }}>
                 <IconClose color={MainColorType.g01} width={rpxToPx(32)} height={rpxToPx(32)} />
             </NewButton>
         </View>
+        // 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="h24 bold" style={{ color: getThemeColor(health.mode) }}>{strTitle}</Text>
+        //         <Text className="h24 bold">{t('health.all_logs', { scenario: health.mode == 'EAT' ? t('health.meals') : t('health.activities') })}<Text style={{ fontWeight: 'normal' }}>{t('health.will_collected')}</Text>{t('health.journal_end')}</Text>
+        //     </View>
+        //     <NewButton type={NewButtonType.img} btnStyle={{
+        //         height: rpxToPx(32),
+        //         width: rpxToPx(32)
+        //     }} onClick={() => {
+        //         if (health.mode == 'EAT') {
+        //             setHideEatArchiveTip(true)
+        //         }
+        //         else {
+        //             setHideActiveArchiveTip(true)
+        //         }
+        //     }}>
+        //         <IconClose color={MainColorType.g01} width={rpxToPx(32)} height={rpxToPx(32)} />
+        //     </NewButton>
+        // </View>
     }
 
     return <View className="main-console-bg">
@@ -988,10 +1076,10 @@ export default function MainConsole(props: { type: WindowType }) {
 
             </View>
         }
-        {
+        {/* {
             markDoneTip()
-        }
-        {
+        } */}
+        {/* {
             health.mode == 'ACTIVE' && <View>
                 <View className="main_column_space" /><IconTitleCell
                     icon={<IconActive width={rpxToPx(32)} color={MainColorType.active} />}
@@ -1000,8 +1088,8 @@ export default function MainConsole(props: { type: WindowType }) {
                         jumpPage('/_health/pages/move')
                     }}
                 /></View>
-        }
-        {
+        } */}
+        {/* {
             (health.mode == 'FAST' || health.mode == 'SLEEP') && <View >
                 <View className="main_column_space" />
                 <IconTitleCell
@@ -1051,8 +1139,8 @@ export default function MainConsole(props: { type: WindowType }) {
 
 
             </View>
-        }
-        {
+        } */}
+        {/* {
             health.mode == 'FAST' && <IconTitleCell
                 onClick={() => {
                     jumpPage('/_health/pages/long_fast')
@@ -1063,7 +1151,7 @@ export default function MainConsole(props: { type: WindowType }) {
                     longFastStatus()
                 }
             />
-        }
+        } */}
         <View className="circle" />
         {
             durationPicker && <DurationPicker
@@ -1092,7 +1180,7 @@ export default function MainConsole(props: { type: WindowType }) {
                         // setErrors([])
                     }
                     else {
-                        jumpPage('/_health/pages/schedules?mode=' + health.mode+'&error='+JSON.stringify(res))
+                        jumpPage('/_health/pages/schedules?mode=' + health.mode + '&error=' + JSON.stringify(res))
                         // setList((res as any).schedules)
                         // dispatch(setFooter((res as any).footer))
                         // setErrors((res as any).error_messages ? (res as any).error_messages : [])

+ 115 - 106
src/features/health/MainHistory.tsx

@@ -12,12 +12,13 @@ import { getScenario, getThemeColor } from "./hooks/health_hooks";
 import { TimeFormatter } from "@/utils/time_format";
 import dayjs from "dayjs";
 import { MainColorType } from "@/context/themes/color";
-import { IconArrow, IconCellArrow } from "@/components/basic/Icons";
+import { IconArrow, IconCellArrow, IconClose } from "@/components/basic/Icons";
 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";
+import NewButton, { NewButtonType } from "@/_health/base/new_button";
 
 let lastMode = ''
 let myScrollTop = 0
@@ -38,6 +39,12 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
     const [activeList, setActiveList] = useState<any>([])
     const [sleepList, setSleepList] = useState<any>([])
 
+
+    const [hideEatArchiveTip, setHideEatArchiveTip] = useState(false)
+    const [hideActiveArchiveTip, setHideActiveArchiveTip] = useState(false)
+    const [hideFastTip, setHideFastTip] = useState(false)
+    const [hideSleepTip, setHideSleepTip] = useState(false)
+
     const dispatch = useDispatch()
     const { t } = useTranslation()
 
@@ -71,7 +78,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         //     }
         // }
         // else {
-            
+
         // }
     }, [])
 
@@ -443,7 +450,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                         setList(array)
                     }
                 }
-                
+
                 setTotal((res as any).total)
                 if (props.refreshSuccess) {
                     props.refreshSuccess()
@@ -512,51 +519,6 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         return false
     }
 
-    function archiveContent() {
-        if (health.mode != 'EAT' && health.mode != 'ACTIVE') {
-            return
-        }
-
-        if (health.mode == 'EAT') {
-            if (!showEatArchive || !health.eatArchived || !health.eatArchived.archived) {
-                return
-            }
-        }
-
-        if (health.mode == 'ACTIVE') {
-            if (!showActiveArchive || !health.activeArchived || !health.activeArchived.archived) {
-                return
-            }
-        }
-
-        return <View style={{
-            display: 'flex',
-            flexDirection: 'column',
-            alignItems: 'center',
-            paddingTop: rpxToPx(82),
-            paddingBottom: rpxToPx(82),
-            backgroundColor: '#fff',
-            position: 'relative'
-        }}>
-            <View className="archived_bg" onClick={() => {
-                jumpPage('/_health/pages/archive')
-                setTimeout(() => {
-                    health.mode == 'EAT' ? setShowEatArchive(false) : setShowActiveArchive(false)
-                }, 1000)
-
-            }}>
-                <Text className="archived_text bold" style={{ color: getThemeColor(health.mode) }}>[{health.eatArchived.real_count}/{health.eatArchived.target_count} Meals] Archived {TimeFormatter.dateDescription(new Date(health.eatArchived.timestamp).getTime(), true, false)}</Text>
-                {
-                    health.eatArchived.images.map((item, index) => {
-                        return <Image src={item} key={index} className="archived_img" mode="aspectFill" />
-                    })
-                }
-                <IconArrow color={MainColorType.g02} width={rpxToPx(34)} />
-            </View>
-            <View className="border_footer_line" />
-        </View>
-    }
-
     if (!loaded || health.mode == 'DAY' || health.mode == 'NIGHT')
         return <View />
 
@@ -655,77 +617,124 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         return <View />
     }
 
-    return <View style={{ width: rpxToPx(750), marginTop: rpxToPx(60) }}>
+    function markDoneTip() {
+        if (health.mode == 'DAY' && health.mode != 'NIGHT') return
+        var scenario = getScenario(health.windows, health.mode)
+        if (scenario.status != 'OG') return
+
+        if (health.mode == 'EAT' && hideEatArchiveTip) return
+        if (health.mode == 'ACTIVE' && hideActiveArchiveTip) return
+        if (health.mode == 'FAST' && hideFastTip) return
+        if (health.mode == 'SLEEP' && hideSleepTip) return
+
+        function tipContent() {
+            var strTime = ''
+            var today = new Date().getDate()
+            var date = new Date(scenario.archive_timestamp).getDate()
+            var time = dayjs(scenario.archive_timestamp).format('HH:mm')
+            if (today == date) {
+                strTime = t('health.today_at', { time: time })
+                if (global.language == 'en'){
+                    if (time == '23:59'){
+                        strTime = 'at midnight'
+                    }
+                    else {
+                        strTime = `today at ${time}`
+                    }
+                }
+            }
+            else {
+                strTime = t('health.tomorrow_at', { time: time })
+                if (global.language == 'en'){
+                    strTime = `tomorrow at ${time}`
+                }
+            }
+            switch (health.mode) {
+                case 'FAST':
+                    if (global.language == 'en') {
+                        return <Text className="h26 g01"><Text className="bold">Today's Moments</Text> will appear in Recents when you <Text className="italic">log end fast</Text>.</Text>
+                    }
+                    return <Text className="h26 g01"><Text className="bold">今天的时刻</Text> 将在您 <Text className="italic">记录结束断食</Text> 之际,出现在最近记录中。</Text>
+                case 'SLEEP':
+                    if (global.language == 'en') {
+                        return <Text className="h26 g01"><Text className="bold">Today's Moments</Text> will appear in Recents when you <Text className="italic">log wake up</Text>.</Text>
+                    }
+                    return <Text className="h26 g01"><Text className="bold">今天的时刻</Text> 将在您 <Text className="italic">记录起床</Text> 之际,出现在最近记录中。</Text>
+                case 'EAT':
+                case 'ACTIVE':
+                    if (global.language == 'en') {
+                        return <Text className="h26 g01"><Text className="bold">Today's Moments</Text> will appear in Recents {strTime} or when you <Text className="italic">mark done</Text>.</Text>
+                    }
+                    return <Text className="h26 g01"><Text className="bold">今天的时刻</Text> 将在今夜或在您 <Text className="italic">标记完成</Text> 之际,出现在最近记录中。</Text>
+            }
+            return <Text className="h26">1</Text>
+        }
+
+
+        return <View className="mark_done_tip" style={{
+            backgroundColor: getThemeColor(health.mode) + '1A'
+        }}>
+            <View style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>
+                {
+                    tipContent()
+                }
+            </View>
+            <NewButton type={NewButtonType.img} btnStyle={{
+                paddingLeft:20,
+                height: rpxToPx(32),
+                width: rpxToPx(32)
+            }} onClick={() => {
+                switch (health.mode) {
+                    case 'FAST':
+                        setHideFastTip(true)
+                        break;
+                    case 'EAT':
+                        setHideEatArchiveTip(true)
+                        break;
+                    case 'SLEEP':
+                        setHideSleepTip(true)
+                        break
+                    case 'ACTIVE':
+                        setHideActiveArchiveTip(true)
+                        break
+                }
+            }}>
+                <IconClose color={MainColorType.g01} width={rpxToPx(32)} height={rpxToPx(32)} />
+            </NewButton>
+        </View>
+    }
+
+    return <View style={{ width: rpxToPx(750) }}>
 
         {
-            (list.length >= 0 || health.mode == 'EAT') && <View className="new_header_bg">
-                <Text className="h50 bold">{t('health.recents')}</Text>
-                {
-                    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)
-                    }} 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),
-                                    height: rpxToPx(12),
-                                    borderRadius: rpxToPx(6),
-                                    backgroundColor: 'red',
-                                    position: 'absolute',
-                                    right: -6,
-                                    top: 0
-                                }} />
-                        } */}
+            (list.length >= 0 || health.mode == 'EAT' || health.mode == 'ACTIVE') && <View className="new_header_bg2">
+                <Text className="h50 w500">{t('health.recents')}</Text>
 
+                {
+                    (health.mode == 'EAT' || health.mode == 'ACTIVE') && <View style={{ marginTop: rpxToPx(0) }}><RightArrowRow
+                        height={rpxToPx(50)}
+                        title={t('health.my_journal')}
+                        bgColor="transparent"
+                        onClick={() => {
+                            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() && false ? '1' : '0'}&show_badge=${showBadge ? 1 : 0}`)
+                        }} />
                     </View>
                 }
+
             </View>
         }
-        {/* {
-            archiveContent()
-        } */}
-        {/* {
-            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() && false ? '1' : '0'}&show_badge=${showBadge ? 1 : 0}`)
-                }} />
+            markDoneTip()
         }
+
+
         {
             list.length == 0 && <NoRecord />
         }
         {
-            list.length > 0 && <View style={{ minHeight: rpxToPx(464), backgroundColor: '#fff' }}>
+            list.length > 0 && <View style={{ minHeight: rpxToPx(464), backgroundColor: '#fff', paddingTop: rpxToPx(60) }}>
                 {
                     list.map((item, index) => {
                         return <View id={`history-${index}`} key={index}>

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

@@ -722,7 +722,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
             list.length == 0 && <NoRecord />
         }
         {
-            list.length > 0 && <View style={{ minHeight: rpxToPx(464), backgroundColor: '#fff' }}>
+            list.length > 0 && <View style={{ minHeight: rpxToPx(464), backgroundColor: '#fff',paddingTop:rpxToPx(60) }}>
                 {
                     list.map((item, index) => {
                         return <View id={`history-${index}`} key={index}>

+ 16 - 13
src/pages/account/Album.tsx

@@ -32,11 +32,14 @@ export default function Album() {
     const [page, setPage] = useState(1)
     const [total, setTotal] = useState(0)
     const [loading, setLoading] = useState(false)
-    const [loaded,setLoaded] = useState(false)
+    const [loaded, setLoaded] = useState(false)
     const { t } = useTranslation()
 
     useEffect(() => {
         getAlbumsData('')
+        Taro.setNavigationBarTitle({
+            title: t('health.photos')
+        })
     }, [])
 
     useEffect(() => {
@@ -129,16 +132,16 @@ export default function Album() {
         var top = e.detail.scrollTop
         myScrollTop = top
 
-        if (e.detail.scrollTop > 60) {
-            Taro.setNavigationBarTitle({
-                title: t('health.photos')
-            })
-        }
-        else {
-            Taro.setNavigationBarTitle({
-                title: ''
-            })
-        }
+        // if (e.detail.scrollTop > 60) {
+        //     Taro.setNavigationBarTitle({
+        //         title: t('health.photos')
+        //     })
+        // }
+        // else {
+        //     Taro.setNavigationBarTitle({
+        //         title: ''
+        //     })
+        // }
 
         if (itemLayouts.length > 0) {
             var i = -1
@@ -247,7 +250,7 @@ export default function Album() {
         loadMore={more}
     >
         <View style={{ display: 'flex', flexDirection: 'column' }}>
-            <NewHeader type={NewHeaderType.left} title={t('health.photos')} />
+            {/* <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={() => {
@@ -294,7 +297,7 @@ export default function Album() {
                 <View className="album_line" />
             </View> */}
 
-            <RightArrowRow title={t('health.photo_wall')} onClick={() => {
+            <RightArrowRow title={t('health.photo_wall')} height={rpxToPx(184)} onClick={() => {
                 jumpPage('/pages/account/PhotoWall?window=' + window)
             }} />
             <View style={{

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

@@ -576,7 +576,7 @@ export default function Journal() {
                                         }} />
                                     } */}
                                 </View>
-                                <View style={{ display: 'flex', flexDirection: 'column', flex: 1, paddingTop: rpxToPx(4),width:rpxToPx(552), }}>
+                                <View style={{ display: 'flex', flexDirection: 'column', flex: 1, width:rpxToPx(552), }}>
                                     {/* {
                                     item.windows.map((window, i) => {
                                         return journalItem(window, i)

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

@@ -1,5 +1,5 @@
 import { View, Image, Text } from "@tarojs/components";
-import { useRouter } from "@tarojs/taro";
+import { useLoad, useRouter, useShareAppMessage } from "@tarojs/taro";
 import { useEffect, useState } from "react";
 import { useSelector } from "react-redux";
 import './JournalDetail.scss'
@@ -29,6 +29,7 @@ if (process.env.TARO_ENV == 'rn') {
 export default function JournalDetail() {
     const health = useSelector((state: any) => state.health);
     const user = useSelector((state: any) => state.user);
+    const [shareUser,setShareUser] = useState<any>(null)
     const [imgs, setImgs] = useState<any>([])
     const [events, setEvents] = useState<any>([])
     const [loaded, setLoaded] = useState(false)
@@ -47,23 +48,65 @@ export default function JournalDetail() {
         router = useRouter()
     }
     const [data, setData] = useState<any>()
-    const date = router.params.date
+    const [date,setDate] = useState<any>(router.params?router.params.date:0)
     // const [detail, setDetail] = useState(JSON.parse(router.params.detail))
 
     useEffect(() => {
-        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)
+        if (date || router.params.window){
+            var params:any = {
+                window: router.params.window
             }
-            setData(res)
-            updateData(res)
-            setLoaded(true)
-        })
+            if (router.params.uid){
+                params.share_user_id=router.params.uid
+            }
+            journalDetail(date, params).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)
+                }
+                if ((res as any).share_user){
+                    setShareUser((res as any).share_user)
+                }
+                
+                setData(res)
+                updateData(res)
+                setLoaded(true)
+            })
+        }
+            
     }, [])
 
+    if (process.env.TARO_ENV == 'weapp') {
+        useShareAppMessage((e) => {
+            return {
+                title: t('feature.track_time_duration.common.share_title'),
+                path: `pages/account/JournalDetail?date=${date}&uid=${user.id}&window=${router.params.window}`
+            }
+        })
+    }
+
+    // useLoad((res2) => {
+    //     console.log('share:', res2)
+    //     if (res2.date && res2.uid) {
+    //         setDate(res2.date)
+    //         journalDetail(res2.date, { window: res2.window,share_user_id:res2.uid }).then(res => {
+    //             console.log('dsasfads',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)
+    //             }
+    //             // console.log('aaaaa')
+    //             setData(res)
+    //             updateData(res)
+    //             setLoaded(true)
+    //         })
+    //     }
+    // })
+
     function setTitle(timestamp) {
         var title = ''
         var t = parseInt(timestamp + '')
@@ -155,7 +198,7 @@ export default function JournalDetail() {
     function dayTag(event, moment) {
         // 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') {
@@ -209,9 +252,9 @@ export default function JournalDetail() {
 
     return <View style={{ backgroundColor: '#fff' }}>
         <View className="journal_detail">
-            <Image className="header_avatar" src={user.avatar} mode="aspectFill" />
+            <Image className="header_avatar" src={shareUser?shareUser.avatar:user.avatar} mode="aspectFill" />
             <View className="jounal_content">
-                <Text className="journal_nickname">{user.nickname}</Text>
+                <Text className="journal_nickname">{shareUser?shareUser.nickname:user.nickname}</Text>
                 <View style={{ flexDirection: 'column', display: 'flex', marginTop: rpxToPx(24) }}>
                     {
                         events.map((item, index) => {
@@ -245,10 +288,10 @@ export default function JournalDetail() {
                         />
                     })
                 }
-                <Text className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(17), lineHeight: rpxToPx(60) + 'px' }}>{t('health.journal_created', {
+                <Text className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(17), lineHeight: rpxToPx(60) + 'px' }}>{t(data.publish.edited ? 'health.journal_updated' : 'health.journal_created', {
                     date_time: global.language == 'en' ?
-                        dayjs(data.timestamp).format('MMM D HH:mm') :
-                        dayjs(data.timestamp).format('M月D日 HH:mm')
+                        dayjs(data.publish.timestamp).format('MMM D HH:mm') :
+                        dayjs(data.publish.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 - 0
src/pages/account/Profile.scss

@@ -19,6 +19,7 @@
     display: flex;
     flex-direction: column;
     align-items: center;
+    position: relative;
 }
 
 .balance {

+ 18 - 14
src/pages/account/Profile.tsx

@@ -20,7 +20,7 @@ import { kIsAndroid, kIsIOS, rpxToPx } from "@/utils/tools";
 import dayjs from "dayjs";
 import { MainColorType } from "@/context/themes/color";
 import NewHeader, { NewHeaderType } from "@/_health/components/new_header";
-import { IconCellArrow, IconVip } from "@/components/basic/Icons";
+import { IconArrow, IconCellArrow, IconVip } from "@/components/basic/Icons";
 import IconTitleCell from "@/_health/components/icon_title_cell";
 
 let useNavigation, SwitchRN;
@@ -332,7 +332,8 @@ export default function Page() {
             <View style={{
                 display: 'flex', flexDirection: 'column',
                 width: rpxToPx(750),
-                alignItems: 'center'
+                alignItems: 'center',
+                position:'relative'
             }}
                 onClick={() => {
                     if (!user.isLogin) {
@@ -354,43 +355,46 @@ export default function Page() {
                         <View className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(12) }}>{isMember() ? memberdesc() : '解锁会员专项功能'}</View>
                         <View style={{ height: rpxToPx(18), flexShrink: 0 }} />
                     </View>
-                    <IconCellArrow color={MainColorType.g03} width={rpxToPx(34)} />
+                    <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
                 </View>
+                <View className="border_footer_line" style={{ left: rpxToPx(0) }} />
             </View>
 
-            <View className="profile_cell_space" />
+            {/* <View className="profile_cell_space" />
             <IconTitleCell
                 onClick={goMetric}
                 title={t('health.metric')}
                 icon={<Image src={require('@assets/_health/setting_body.png')} className="profile_cell_icon" />}
             />
 
-            <View className="profile_cell_space" />
+            <View className="profile_cell_space" /> */}
             <IconTitleCell
                 onClick={() => {
-                    jumpPage('/pages/account/Album')
+                    jumpPage('/_health/pages/schedules?mode=')
                 }}
-                title={t('health.photos')}
+                title={t('health.schedules')}
                 showLine
-                icon={<Image src={require('@assets/_health/setting_album.png')} className="profile_cell_icon" />}
+                icon={<Image src={require('@assets/_health/setting_calendar.png')} className="profile_cell_icon" />}
             />
             <IconTitleCell
                 onClick={() => {
                     jumpPage('/pages/account/Journal')
                 }}
                 title={t('health.title_journal')}
+                showLine
                 icon={<Image src={require('@assets/_health/setting_journal.png')} className="profile_cell_icon" />}
             />
-
-            <View className="profile_cell_space" />
             <IconTitleCell
                 onClick={() => {
-                    jumpPage('/_health/pages/schedules?mode=')
+                    jumpPage('/pages/account/Album')
                 }}
-                title={t('health.schedules')}
-                showLine
-                icon={<Image src={require('@assets/_health/setting_calendar.png')} className="profile_cell_icon" />}
+                title={t('health.photos')}
+                icon={<Image src={require('@assets/_health/setting_album.png')} className="profile_cell_icon" />}
             />
+            
+
+            <View className="profile_cell_space" />
+            
             <IconTitleCell
                 onClick={goCalendar}
                 title={t('health.streaks')}

+ 7 - 5
src/pages/clock/ClockNew.tsx

@@ -37,7 +37,7 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
     const health = useSelector((state: any) => state.health);
     const [type, setType] = useState(WindowType.day)
     const [needShowAddTip, setNeedShowAddTip] = useState(false)
-    const [reminderAdd, setReminderAdd] = useState(true)
+    const [reminderAdd, setReminderAdd] = useState(false)
     const [showDate, setShowDate] = useState(false)
     const [date, setDate] = useState('')
     const [isPulling, setIsPulling] = useState(false)
@@ -58,6 +58,10 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
 
     };
 
+    global.tapDone = ()=>{
+        setReminderAdd(true)
+    }
+
     useDidShow(() => {
         if (process.env.TARO_ENV == 'weapp') {
             checkTimeZone()
@@ -258,7 +262,7 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
     }
 
     function checkAddToMini() {
-        if (process.env.TARO_ENV == 'weapp' && user.isLogin && reminderAdd) {
+        if (process.env.TARO_ENV == 'weapp' && user.isLogin) {
             const version = Taro.getAppBaseInfo().SDKVersion
             if (compareVersion(version, '2.30.3') >= 0) {
                 wx.checkIsAddedToMyMiniProgram({
@@ -283,7 +287,6 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
 
         const showAlert1 = await getStorage('148alert') || false;
         Taro.setStorage({ key: '148alert', data: true })
-        console.log('test abc')
         if (!showAlert1 && !health.finish_setup){
             jumpPage('/_health/pages/guide_begin')
         }
@@ -369,7 +372,7 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
         >
             <View style={{ display: 'flex', flexDirection: 'column' }}>
                 {
-                    needShowAddTip && reminderAdd && <View className="guide_tip h26">{t('health.add_mini_guide_tip')}
+                    needShowAddTip && reminderAdd && user.isLogin && <View className="guide_tip h26">{t('health.add_mini_guide_tip')}
                         <NewButton type={NewButtonType.img} btnStyle={{
                             position: 'absolute',
                             right: 0,
@@ -378,7 +381,6 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
                             width: rpxToPx(92)
                         }} onClick={() => {
                             setReminderAdd(false)
-                            console.log('ssssss')
                         }}>
                             <IconClose color={MainColorType.g01} width={rpxToPx(32)} height={rpxToPx(32)} />
                         </NewButton>

+ 7 - 0
src/pages/discover/discover.config.ts

@@ -0,0 +1,7 @@
+export default definePageConfig({
+    // "disableScroll": false,
+    // "navigationBarTitleText":"",
+    // "enablePullDownRefresh":true,
+    "navigationBarBackgroundColor":"#f5f5f5"
+    // "enablePageMeta":true
+})

+ 4 - 0
src/pages/discover/discover.scss

@@ -0,0 +1,4 @@
+.discover_space{
+    height: 16px;
+    flex-shrink: 0;
+}

+ 169 - 0
src/pages/discover/discover.tsx

@@ -0,0 +1,169 @@
+
+import IconTitleCell from "@/_health/components/icon_title_cell";
+import showAlert from "@/components/basic/Alert";
+import { IconActive } from "@/components/basic/Icons";
+import TabBar from "@/components/navigation/TabBar";
+import { MainColorType } from "@/context/themes/color";
+import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
+import { updateFast } from "@/services/health";
+import { rpxToPx } from "@/utils/tools";
+import { View, Image } from "@tarojs/components";
+import Taro from "@tarojs/taro";
+import { useEffect, useState } from "react";
+import { useTranslation } from "react-i18next";
+import { useSelector } from "react-redux";
+import './discover.scss'
+
+let useNavigation;
+if (process.env.TARO_ENV == 'rn') {
+    useNavigation = require("@react-navigation/native").useNavigation
+}
+
+export default function Discover() {
+    const health = useSelector((state: any) => state.health);
+    const user = useSelector((state: any) => state.user);
+    const [hideErrorTip, setHideErrorTip] = useState(false)
+    const { t } = useTranslation()
+
+    let navigation, showActionSheetWithOptions;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
+
+    useEffect(() => {
+        Taro.setNavigationBarTitle({
+            title: t('health.discover')
+        })
+    }, [])
+
+    function fastWithSleepStatus() {
+        const { status } = health.fast_with_sleep
+        var str = ''
+        switch (status) {
+            case 'OG1':
+                str = t('health.fast_before_bed')
+                break;
+            case 'OG2_NO1':
+                str = t('health.fast_missing')
+                break;
+            case 'OG2':
+                str = t('health.fast_while_sleep')
+                break;
+            case 'OG2_MISALIGNED':
+                str = t('health.misaligned')
+                break;
+            case 'OG3':
+                str = t('health.fast_after_sleep')
+                break
+        }
+        return <View className="H26" style={{ color: MainColorType.g02 }}>{str}</View>
+    }
+
+    function longFastStatus() {
+        const { status } = health.long_fast
+        return <View className="h26" style={{ color: MainColorType.g02 }}>{status == 'OG' ? 'In progress' : ''}</View>
+    }
+
+
+    return <View>
+        <View >
+            <View className="main_column_space" />
+            <IconTitleCell
+                onClick={() => {
+                    if (!user.isLogin) {
+                        jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
+                        return
+                    }
+                    if (health.long_fast.status == 'OG') {
+                        showAlert({
+                            title: '长断食进行中',
+                            content: '当前有一个正在进行的长断食记录,要转换为间歇性断食吗?',
+                            showCancel: true,
+                            cancelText: '取消',
+                            confirmText: '确定',
+                            confirm: () => {
+                                updateFast({ fast_type: 'IF' }).then(res => {
+                                    global.refreshWindow()
+                                    jumpPage('/_health/pages/fast_sleep')
+                                })
+                            }
+                        })
+                        return
+                    }
+                    setTimeout(() => {
+                        setHideErrorTip(true)
+                    }, 1000)
+
+                    jumpPage('/_health/pages/fast_sleep')
+                }}
+                showLine={health.mode == 'FAST'}
+                icon={<Image className="active_icon" src={require('@assets/_health/fast.png')} />}
+                title={t('health.fast_with_sleep')}
+                desc={<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
+                    {
+                        fastWithSleepStatus()
+                    }
+                    {
+                        !hideErrorTip && (health.fast_with_sleep.status == 'OG2_MISALIGNED' || health.fast_with_sleep.status == 'OG2_NO1') && <View style={{
+                            backgroundColor: MainColorType.error,
+                            width: rpxToPx(12),
+                            height: rpxToPx(12),
+                            borderRadius: rpxToPx(6),
+                            marginLeft: rpxToPx(12),
+                            marginRight: rpxToPx(0)
+                        }} />
+                    }
+                </View>}
+            />
+
+
+        </View>
+        <View>
+            <View className="discover_space" />
+            <IconTitleCell
+                icon={<IconActive width={rpxToPx(32)} color={MainColorType.active} />}
+                title={t('health.metric')}
+                onClick={() => {
+                    if (!user.isLogin) {
+                        jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
+                        return
+                    }
+                    jumpPage('/pages/metric/Metric')
+                    // jumpPage('/_health/pages/move')
+                }}
+            /></View>
+        <View>
+            <View className="discover_space" />
+            <IconTitleCell
+                icon={<IconActive width={rpxToPx(32)} color={MainColorType.active} />}
+                title={t('health.move_more')}
+                onClick={() => {
+                    if (!user.isLogin) {
+                        jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
+                        return
+                    }
+                    jumpPage('/_health/pages/move')
+                }}
+            /></View>
+        <View>
+            <View className="discover_space" />
+            <IconTitleCell
+                onClick={() => {
+                    if (!user.isLogin) {
+                        jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
+                        return
+                    }
+                    jumpPage('/_health/pages/long_fast')
+                }}
+                icon={<Image className="active_icon" src={require('@assets/_health/fast.png')} />}
+                title={t('health.long_fast')}
+                desc={
+                    longFastStatus()
+                }
+            />
+        </View>
+        {
+            process.env.TARO_ENV == 'weapp' && <TabBar index={1} />
+        }
+    </View>
+}

+ 4 - 4
src/services/health.tsx

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