leon há 1 ano atrás
pai
commit
192b83aa44
53 ficheiros alterados com 654 adições e 498 exclusões
  1. 5 4
      src/_health/base/new_button.tsx
  2. 1 22
      src/_health/base/new_date_time_picker.tsx
  3. 69 8
      src/_health/components/choose_date_time.tsx
  4. 2 1
      src/_health/components/fast_sleep_card.tsx
  5. 26 23
      src/_health/components/post_moment_time.tsx
  6. 8 7
      src/_health/components/sticky_date_list.tsx
  7. 1 20
      src/_health/components/timeline_date.tsx
  8. 7 4
      src/_health/pages/add_moment.tsx
  9. 51 30
      src/_health/pages/log_time.tsx
  10. 4 6
      src/_health/pages/long_fast_setting.tsx
  11. 1 0
      src/_health/pages/move.tsx
  12. 60 10
      src/_health/pages/move_setting_reminder.tsx
  13. 2 2
      src/_health/pages/move_setting_time.tsx
  14. 4 0
      src/_health/pages/post_result.scss
  15. 2 2
      src/_health/pages/post_result.tsx
  16. 50 29
      src/_health/pages/timeline_detail.scss
  17. 47 13
      src/_health/pages/timeline_detail.tsx
  18. 1 0
      src/app.scss
  19. BIN
      src/assets/_health/compass.png
  20. BIN
      src/assets/_health/compass_sel.png
  21. BIN
      src/assets/_health/fast_sleep.png
  22. BIN
      src/assets/_health/home.png
  23. BIN
      src/assets/_health/home_sel.png
  24. BIN
      src/assets/_health/long_fast.png
  25. BIN
      src/assets/_health/measurements.png
  26. BIN
      src/assets/_health/share_01.jpg
  27. BIN
      src/assets/_health/user.png
  28. BIN
      src/assets/_health/user_sel.png
  29. 19 11
      src/components/basic/Icons.tsx
  30. 9 8
      src/components/input/SlidngScale.tsx
  31. 4 2
      src/components/navigation/TabBar.scss
  32. 18 0
      src/context/locales/en.js
  33. 19 0
      src/context/locales/zh.js
  34. 1 0
      src/features/health/MainConsole.scss
  35. 25 64
      src/features/health/MainHistory.tsx
  36. 12 28
      src/features/health/MainHistory2.tsx
  37. 0 1
      src/features/trackSomething/components/MetricHistory.scss
  38. 1 1
      src/features/trackSomething/components/MetricHistory.tsx
  39. 2 2
      src/features/trackSomething/components/MetricItem.tsx
  40. 18 18
      src/features/trackSomething/components/MetricModalAdd.tsx
  41. 6 0
      src/pages/account/Album.tsx
  42. 4 0
      src/pages/account/Journal.scss
  43. 67 145
      src/pages/account/Journal.tsx
  44. 23 0
      src/pages/account/JournalDetail.scss
  45. 48 19
      src/pages/account/JournalDetail.tsx
  46. 6 0
      src/pages/account/Journal_副本.tsx
  47. 2 1
      src/pages/account/PhotoWall.tsx
  48. BIN
      src/pages/account/share_01.jpg
  49. 2 1
      src/pages/clock/Clock.tsx
  50. 13 11
      src/pages/clock/ClockNew.tsx
  51. 3 3
      src/pages/discover/discover.tsx
  52. 2 1
      src/pages/workout/Workout.tsx
  53. 9 1
      src/utils/time_format.ts

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

@@ -77,6 +77,7 @@ export default function NewButton(props: {
     fontNormal?: boolean,
     labelBorder?: boolean,
     btnStyle?: any,
+    postBtn?:boolean
 }) {
 
     const [isTouched, setIsTouched] = useState(false)
@@ -156,7 +157,7 @@ export default function NewButton(props: {
                 paddingLeft: props.width ? 0 : 15,
                 paddingRight: props.width ? 0 : 15,
                 borderRadius: props.height ? props.height / 4 : rpxToPx(72 / 4),
-                backgroundColor: isTouched ? '#b2b2b240' : '#b2b2b210',
+                backgroundColor: isTouched ? '#99999940' : '#9999991A',
                 color: props.disable ? '#b2b2b2' : '#000000',
                 fontSize: props.fontSize ?? rpxToPx(30),
                 fontWeight: props.fontNormal ? 'normal' : 'bold',//props.bold ? 'bold' : 'normal',
@@ -248,7 +249,7 @@ export default function NewButton(props: {
                         vibrate();
                         return;
                     }
-                    if (noTouch) return;
+                    if (noTouch && props.postBtn) return;
                     props.onClick()
                     setNoTouch(true)
                     setTimeout(() => {
@@ -280,7 +281,7 @@ export default function NewButton(props: {
                     vibrate();
                     return;
                 }
-                if (noTouch) return;
+                if (noTouch && props.postBtn) return;
                 props.onClick()
                 setNoTouch(true)
                 setTimeout(() => {
@@ -317,7 +318,7 @@ export default function NewButton(props: {
                 vibrate();
                 return;
             }
-            if (noTouch) return;
+            if (noTouch && props.postBtn) return;
             props.onClick()
             setNoTouch(true)
             setTimeout(() => {

+ 1 - 22
src/_health/base/new_date_time_picker.tsx

@@ -15,26 +15,6 @@ export default function NewDateTimePicker(props: {
     const [values, setValues] = useState<any>([0, 0, 0])
     const [loaded, setLoaded] = useState(false)
 
-    function isTimestampInThisWeek(timestamp) {
-        const date = new Date(timestamp);
-
-        // 获取当前日期
-        const now = new Date();
-
-        // 获取本周的第一天(周一)
-        const startOfWeek = new Date(now);
-        startOfWeek.setDate(now.getDate() - now.getDay() + 1); // 计算本周周一
-        startOfWeek.setHours(0, 0, 0, 0); // 设置为当天的开始时间
-
-        // 获取本周的最后一天(周日)
-        const endOfWeek = new Date(startOfWeek);
-        endOfWeek.setDate(startOfWeek.getDate() + 6); // 计算本周周日
-        endOfWeek.setHours(23, 59, 59, 999); // 设置为当天的结束时间
-
-        // 判断时间戳是否在本周范围内
-        return date >= startOfWeek && date <= endOfWeek;
-    }
-
 
     function longDatas() {
         let result: any = []
@@ -57,13 +37,12 @@ export default function NewDateTimePicker(props: {
             else if (TimeFormatter.isYesterday(date.getTime())) {
                 string = (global.language == 'en' ? 'Yesterday' : '昨天 ')// + string
             }
-            else if (isTimestampInThisWeek(date.getTime())){
+            else if (TimeFormatter.isTimestampInThisWeek(date.getTime())){
                 string = dt.format('dddd')
             }
             result.push(string)
             date.setDate(date.getDate() + 1)
         }
-        debugger
         return result
     }
 

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

@@ -1,6 +1,6 @@
 import { View, Image } from "@tarojs/components"
 import './choose_date_time.scss'
-import { rpxToPx } from "@/utils/tools"
+import { rpxToPx, vibrate } from "@/utils/tools"
 import NewButton, { NewButtonType } from "../base/new_button"
 import { useEffect, useState } from "react"
 import NewDatePicker, { NewDatePickerType } from "../base/new_date_picker"
@@ -9,6 +9,8 @@ import { IconCalendar } from "@/components/basic/Icons"
 import dayjs from "dayjs"
 import NewDateTimePicker from "../base/new_date_time_picker"
 import { TimeFormatter } from "@/utils/time_format"
+import { useTranslation } from "react-i18next"
+import { MainColorType } from "@/context/themes/color"
 
 export default function ChooseDateTime(props: {
     title?: any,
@@ -28,9 +30,12 @@ export default function ChooseDateTime(props: {
     choose?: any,
     timeChange?: any,
     dateChange?: any,
-    change?: any
+    change?: any,
+    enterTimestamp?: number,
+    targetTimestamp?: number
 }) {
     const [chooseDate, setChooseDate] = useState(false)
+    const { t } = useTranslation()
     const [count, setCount] = useState(0)
 
     useEffect(() => {
@@ -42,13 +47,13 @@ export default function ChooseDateTime(props: {
         if (props.date == '') return global.language == 'en' ? 'Date' : '日期'
         var date = dayjs(props.date)
 
-        if (TimeFormatter.isToday(date.unix()*1000)) {
+        if (TimeFormatter.isToday(date.unix() * 1000)) {
             return global.language == 'en' ? 'Today' : '今天'
         }
-        if (TimeFormatter.isYesterday(date.unix()*1000)) {
+        if (TimeFormatter.isYesterday(date.unix() * 1000)) {
             return global.language == 'en' ? 'Yesterday' : '昨天'
         }
-        else if (TimeFormatter.isTimestampInThisWeek(date.unix()*1000)){
+        else if (TimeFormatter.isTimestampInThisWeek(date.unix() * 1000)) {
             return date.format('dddd')
         }
         else {
@@ -63,6 +68,56 @@ export default function ChooseDateTime(props: {
 
     }
 
+    function reset() {
+        props.change([
+            dayjs(props.enterTimestamp).format('YYYY-MM-DD'),
+            dayjs(props.enterTimestamp).format('HH:mm')
+        ])
+    }
+
+    function tapTarget() {
+        props.change([
+            dayjs(props.targetTimestamp).format('YYYY-MM-DD'),
+            dayjs(props.targetTimestamp).format('HH:mm')
+        ])
+    }
+
+    function targetDate(){
+        if (TimeFormatter.isToday(props.targetTimestamp!)){
+            return TimeFormatter.getTodayUnit()+' '
+        }
+        if (TimeFormatter.isYesterday(props.targetTimestamp!)){
+            return TimeFormatter.getYesterdayUnit()+' '
+        }
+        if (TimeFormatter.isTomorrowday(props.targetTimestamp!)){
+            return TimeFormatter.getTomorrowUnit()+' '
+        }
+        return global.languange=='en'?dayjs(props.targetTimestamp).format('MMM D'):dayjs(props.targetTimestamp).format('MMMD日')
+
+    }
+
+    function footerTitle() {
+        if (dayjs(props.targetTimestamp!).format('YYYY-MM-DD HH:mm') == props.date + ' ' + props.time) {
+            return <View style={{ display: 'flex', flexDirection: 'row' }} onClick={reset}>
+                <View className="h26 g02">{t('health.select_schedule')}</View>
+                <View className="h26" style={{ color: MainColorType.link, marginLeft: rpxToPx(8) }}>{t('health.reset')}</View>
+            </View>
+        }
+        if (new Date().getTime() > props.targetTimestamp!) {
+            return <View style={{ display: 'flex', flexDirection: 'row' }} onClick={tapTarget}>
+                <View className="h26 g02">{t('health.schedule_for', { time: targetDate()+dayjs(props.targetTimestamp).format('HH:mm') })}</View>
+                <View className="h26" style={{ color: MainColorType.link, marginLeft: rpxToPx(8) }}>{t('health.select')}</View>
+            </View>
+        }
+        else {
+            return <View onClick={(e)=>{
+                vibrate()
+            }}>
+                <View className="h26 g02">{t('health.schedule_for', { time: targetDate()+dayjs(props.targetTimestamp).format('HH:mm') })}</View>
+            </View>
+        }
+    }
+
     return <View style={{ position: 'relative' }}>
         <View className="card_header">
             {
@@ -99,7 +154,7 @@ export default function ChooseDateTime(props: {
             {
                 !props.title && <View style={{ flex: 1 }} />
             }
-            <View className='border_footer_line' style={{ left: rpxToPx(66) }} />
+            <View className='border_footer_line' style={{ left: rpxToPx(40),right:rpxToPx(40) }} />
         </View>
 
         {
@@ -122,14 +177,20 @@ export default function ChooseDateTime(props: {
 
         {
             props.expand && !chooseDate && !props.hideFooter && <View className='card_footer'>
-                <NewButton type={NewButtonType.link}
+                {
+                    props.footerTitle
+                }
+                {
+                    props.targetTimestamp && footerTitle()
+                }
+                {/* <NewButton type={NewButtonType.link}
                     title={props.footerTitle}
                     onClick={props.tapFooter}
                 >
                     <View style={{ marginRight: rpxToPx(12), display: 'flex' }}>
                         <IconCalendar width={rpxToPx(24)} color='#5C7099' />
                     </View>
-                </NewButton>
+                </NewButton> */}
             </View>
         }
         {

+ 2 - 1
src/_health/components/fast_sleep_card.tsx

@@ -251,7 +251,8 @@ export default function FastSleepCard(props: { step: number, data: any }) {
     function currentDot(mode, outRange?: boolean) {
         return {
             color: outRange ? '#B2B2B2' : getThemeColor(mode),
-            fillColor: outRange ? MainColorType.g03 : '#ffffff00',
+            fillColor:'#ffffff00',
+            // fillColor: outRange ? MainColorType.g03 : '#ffffff00',
             lineWidth: 4,
             borderColor: '#ffffff',
             offset: 0

+ 26 - 23
src/_health/components/post_moment_time.tsx

@@ -20,7 +20,7 @@ import Taro from '@tarojs/taro';
 let isYesterdayTarget = false
 export default function PostMomentTime(props: {
     title?: string,
-    date?:string,
+    date?: string,
     time: string,
     isTemp: boolean,
     onChange: any,
@@ -30,7 +30,7 @@ export default function PostMomentTime(props: {
     const health = useSelector((state: any) => state.health);
     const [showDurationPicker, setShowDurationPicker] = useState(false)
     const [isYesterday, setIsYesterday] = useState(false)
-    const [selDate, setSelDate] = useState(props.date?props.date:dayjs().format('YYYY-MM-DD'))
+    const [selDate, setSelDate] = useState(props.date ? props.date : dayjs().format('YYYY-MM-DD'))
     const [showMore, setShowMore] = useState(false)
     const [time, setTime] = useState(props.time)
     const [minutes, setMinutes] = useState(30)
@@ -128,7 +128,7 @@ export default function PostMomentTime(props: {
 
     function scheduleTime() {
         if (props.moment) {
-            var timestamp = props.moment.target?props.moment.target.timestamp:new Date().getTime()
+            var timestamp = props.moment.target ? props.moment.target.timestamp : new Date().getTime()
             var time1 = parseInt(dayjs(timestamp).format('HHmm'))
             var now = parseInt(dayjs().format('HHmm'))
             if (time == dayjs(timestamp).format('HH:mm')) {
@@ -151,17 +151,17 @@ export default function PostMomentTime(props: {
         title='开始时间'
         dismiss={props.dismiss}
         confirm={() => {
-            var date = new Date(selDate+' '+time+':00')
+            var date = new Date(selDate + ' ' + time + ':00')
             var now = new Date()
-            if (date.getTime()>now.getTime()){
+            if (date.getTime() > now.getTime()) {
                 setTime(dayjs(now.getTime()).format('HH:mm'))
                 Taro.showToast({
-                    title:'不能超过当前时间',
-                    icon:'none'
+                    title: '不能超过当前时间',
+                    icon: 'none'
                 })
                 return
             }
-            
+
             props.onChange({
                 date: selDate,
                 time: time,
@@ -184,26 +184,29 @@ export default function PostMomentTime(props: {
                 // }}
                 minTimestamp={getMinTimestamp()}
 
-                footerTitle={scheduleTime()}
-                tapFooter={() => {
-                    if (time == dayjs(props.moment.target.timestamp).format('HH:mm')) {
-                        setSelDate(dayjs(global.set_time).format('YYYY-MM-DD'))
-                        setTime(dayjs(global.set_time).format('HH:mm'))
-                    }
-                    else {
-                        setSelDate(dayjs(props.moment.target.timestamp).format('YYYY-MM-DD'))
-                        setTime(dayjs(props.moment.target.timestamp).format('HH:mm'))
-                    }
+                // footerTitle={scheduleTime()}
+                enterTimestamp={global.set_time}
+                targetTimestamp={props.moment.target?props.moment.target.timestamp:new Date().getTime()}
 
-                }}
+                // tapFooter={() => {
+                //     if (time == dayjs(props.moment.target.timestamp).format('HH:mm')) {
+                //         setSelDate(dayjs(global.set_time).format('YYYY-MM-DD'))
+                //         setTime(dayjs(global.set_time).format('HH:mm'))
+                //     }
+                //     else {
+                //         setSelDate(dayjs(props.moment.target.timestamp).format('YYYY-MM-DD'))
+                //         setTime(dayjs(props.moment.target.timestamp).format('HH:mm'))
+                //     }
+
+                // }}
                 date={selDate}
-                change={(e)=>{
+                change={(e) => {
                     setSelDate(e[0])
                     setTime(e[1])
                 }}
-                // dateChange={(e) => {
-                //     setSelDate(e)
-                // }}
+            // dateChange={(e) => {
+            //     setSelDate(e)
+            // }}
             />
         </Card>
         {/* <Card>

+ 8 - 7
src/_health/components/sticky_date_list.tsx

@@ -4,8 +4,8 @@ import { ScrollView, View } from "@tarojs/components";
 
 export default function StickyDateList(props: {
     header?: any, children: any, footer?: any,
-    onRefresherRefresh: any,
-    isPulling: boolean,
+    onRefresherRefresh?: any,
+    isPulling?: boolean,
     loadMore?: any,
     onScroll: any,
     showDate: boolean,
@@ -28,7 +28,7 @@ export default function StickyDateList(props: {
             left: 0,
             top: 0,
             right: 0,
-            height: props.showDate ? rpxToPx(84) : 0,
+            height: props.showDate ? rpxToPx(66) : 0,
             backgroundColor: '#f5f5f5',
             paddingLeft: rpxToPx(40),
             display: 'flex',
@@ -37,17 +37,18 @@ export default function StickyDateList(props: {
             alignItems: 'center',
             zIndex: 1,
             opacity: props.showDate ? 1 : 0,
-            color: MainColorType.g01
+            color: MainColorType.g01,
+            
         }}>{headerDate()}
             <View className="border_header_line" />
-            <View className="border_footer_line" />
+            {/* <View className="border_footer_line" /> */}
         </View>
         <ScrollView style='height:100vh'
             enableBackToTop
             scrollY={!props.disable}
-            refresherEnabled
+            refresherEnabled={props.onRefresherRefresh}
             upperThreshold={70}
-            lowerThreshold={80}
+            lowerThreshold={140}
             refresherBackground={MainColorType.g05}
             onRefresherRefresh={props.onRefresherRefresh}
             refresherTriggered={props.isPulling}

+ 1 - 20
src/_health/components/timeline_date.tsx

@@ -5,25 +5,6 @@ import { TimeFormatter } from "@/utils/time_format";
 import { rpxToPx } from "@/utils/tools";
 
 export default function TimelineDate(props: { timestamp: number, pre_timestamp?: number, isJournal?: boolean }) {
-    function isTimestampInThisWeek(timestamp) {
-        const date = new Date(timestamp);
-
-        // 获取当前日期
-        const now = new Date();
-
-        // 获取本周的第一天(周一)
-        const startOfWeek = new Date(now);
-        startOfWeek.setDate(now.getDate() - now.getDay() + 1); // 计算本周周一
-        startOfWeek.setHours(0, 0, 0, 0); // 设置为当天的开始时间
-
-        // 获取本周的最后一天(周日)
-        const endOfWeek = new Date(startOfWeek);
-        endOfWeek.setDate(startOfWeek.getDate() + 6); // 计算本周周日
-        endOfWeek.setHours(23, 59, 59, 999); // 设置为当天的结束时间
-
-        // 判断时间戳是否在本周范围内
-        return date >= startOfWeek && date <= endOfWeek;
-    }
 
     function detail() {
         if (props.pre_timestamp && dayjs(props.timestamp).format('YYYY-MM-DD') == dayjs(props.pre_timestamp).format('YYYY-MM-DD')) {
@@ -57,7 +38,7 @@ export default function TimelineDate(props: { timestamp: number, pre_timestamp?:
             }
             
         }
-        else if (isTimestampInThisWeek(props.timestamp)) {
+        else if (TimeFormatter.isTimestampInThisWeek(props.timestamp)) {
             if (props.isJournal) {
                 title = dayjs(props.timestamp).format('DD')
                 month = dayjs(props.timestamp).format('MMM')

+ 7 - 4
src/_health/pages/add_moment.tsx

@@ -192,7 +192,7 @@ export default function AddMoment() {
         // }
         // debugger
 
-        var date = new Date(selDate + ' ' + time + ':'+dayjs(enterTimestmap).format('ss'))
+        var date = new Date(selDate + ' ' + time + ':' + dayjs(enterTimestmap).format('ss'))
         date.setMilliseconds(new Date(enterTimestmap).getMilliseconds())
 
         var params: any = {
@@ -236,7 +236,10 @@ export default function AddMoment() {
         if (posting) return
         setPosting(true)
         createMoment(params).then(res => {
-            setPosting(false)
+            setTimeout(() => {
+                setPosting(false)
+            }, 1000)
+
             if (process.env.TARO_ENV == 'weapp') {
                 // Taro.navigateBack();
                 Taro.redirectTo({
@@ -268,7 +271,7 @@ export default function AddMoment() {
     }
 
     function edit() {
-        var date = new Date(selDate + ' ' + time + ':'+dayjs(enterTimestmap).format('ss'))
+        var date = new Date(selDate + ' ' + time + ':' + dayjs(enterTimestmap).format('ss'))
 
         var params: any = {
             schedule_id: schedule_id,
@@ -567,7 +570,7 @@ export default function AddMoment() {
             color={getThemeColor(health.mode)}
             width={rpxToPx(646)}
             height={rpxToPx(96)}
-            title={t('health.log')}
+            title={t('health.log_moment')}
             onClick={save}
         /></View>
 

+ 51 - 30
src/_health/pages/log_time.tsx

@@ -46,7 +46,7 @@ export default function LogTime() {
         router = useRouter()
     }
     const [enterTime] = useState(new Date().getTime())
-    const [requestId,setRequestId]= useState(new Date().getTime())
+    const [requestId, setRequestId] = useState(new Date().getTime())
 
     const isSingle = router.params.single == '1'
     const isFast = router.params.window == 'FAST'
@@ -176,7 +176,7 @@ export default function LogTime() {
                 });
 
                 //特殊处理单场景下,结束,超过24小时,picker设置为target_end_time
-                if (!isStart && new Date().getTime() - fast.timeline[0].target.timestamp>=24*3600*1000) {
+                if (!isStart && new Date().getTime() - fast.timeline[0].target.timestamp >= 24 * 3600 * 1000) {
                     time = dayjs(fast.timeline[1].target.timestamp).format('HH:mm')
                     date = dayjs(fast.timeline[1].target.timestamp).format('YYYY-MM-DD')
                 }
@@ -188,7 +188,7 @@ export default function LogTime() {
                 });
 
                 //特殊处理单场景下,结束,超过24小时,picker设置为target_end_time
-                if (!isStart && new Date().getTime() - sleep.timeline[0].target.timestamp>=24*3600*1000) {
+                if (!isStart && new Date().getTime() - sleep.timeline[0].target.timestamp >= 24 * 3600 * 1000) {
                     time = dayjs(sleep.timeline[1].target.timestamp).format('HH:mm')
                     date = dayjs(sleep.timeline[1].target.timestamp).format('YYYY-MM-DD')
                 }
@@ -538,7 +538,7 @@ export default function LogTime() {
         // console.log(params)
 
         // return
-        if (onlyCheck){
+        if (onlyCheck) {
             var dt = new Date().getTime()
             params.requestId = dt
             setRequestId(dt)
@@ -547,12 +547,12 @@ export default function LogTime() {
             params.requestId = requestId
         }
 
-        
+
 
         if (posting) return
         setPosting(true)
         clockTimes(params).then(res => {
-            setPosting(false)
+
             if ((res as any).result) {
                 setErrors([])
                 setConflicts([])
@@ -571,12 +571,19 @@ export default function LogTime() {
                     Taro.redirectTo({
                         url: './post_result?data=' + JSON.stringify(res)
                     })
+                    setTimeout(() => {
+                        setPosting(false)
+                    }, 1000)
+                }
+                else {
+                    setPosting(false)
                 }
 
 
 
             }
             else {
+                setPosting(false)
                 if ((res as any).warn_code == 'SAVE_AS_LF') {
                     showAlert({
                         title: 'Saving as Long Fast',
@@ -662,12 +669,22 @@ export default function LogTime() {
         return str
     }
 
-    function changeTimeText(schedule_time, time) {
-        if (time == schedule_time) {
-            return `Check in:Today ${dayjs(enterTime).format('HH:mm')}`
-        }
-        return `Scheduled for ${schedule_time}`
-    }
+    // function changeTimeText(schedule_time, time) {
+    //     if (time == schedule_time) {
+    //         return `Check in:Today ${dayjs(enterTime).format('HH:mm')}`
+    //     }
+    //     return `Scheduled for ${schedule_time}`
+    // }
+
+    // function changeTimeText(timestamp,date, time) {
+    //     // if (new Date().getTime()>timestamp){
+    //         return t('health.schedule_for',{time:dayjs(timestamp).format('HH:mm')})
+    //     // }
+    //     // if (time == schedule_time) {
+    //     //     return `Check in:Today ${dayjs(enterTime).format('HH:mm')}`
+    //     // }
+    //     // return `Scheduled for ${schedule_time}`
+    // }
 
     function tapChangeTime(schedule_time, time, index) {
         if (time == schedule_time) {
@@ -701,6 +718,7 @@ export default function LogTime() {
 
     function logItem(index: number, iFast: boolean, iStart: boolean, showLine: boolean) {
         const { fast, sleep, status } = data
+
         var schedule_time = ''
         var title = ''
 
@@ -840,8 +858,11 @@ export default function LogTime() {
             disable={array[index].disable}
             showError={showError}
             showLine={showLine}
-            footerTitle={changeTimeText(schedule_time, time)}
-            tapFooter={() => tapChangeTime(schedule_time, time, index)}
+            targetTimestamp = {timeline.target.timestamp}
+            enterTimestamp={enterTime}
+            // footerTitle=""
+            // footerTitle={changeTimeText(timeline.target.timestamp,data, time)}
+            // tapFooter={() => tapChangeTime(schedule_time, time, index)}
             color={iFast ? MainColorType.fast : MainColorType.sleep}
             minTimestamp={min}
             maxTimestamp={max}
@@ -852,27 +873,27 @@ export default function LogTime() {
             choose={() => {
                 setExpandIndex(index)
             }}
-            change={(e)=>{
+            change={(e) => {
                 var list = JSON.parse(JSON.stringify(array))
                 list[index].date = e[0]
                 list[index].time = e[1]
                 list[index].extra.confirm_time = new Date().getTime()
                 setArray(list)
             }}
-            // dateChange={(e) => {
-            //     debugger
-            //     var list = JSON.parse(JSON.stringify(array))
-            //     list[index].date = e
-            //     list[index].extra.confirm_time = new Date().getTime()
-            //     setArray(list)
-            // }}
-            // timeChange={(e) => {
-            //     debugger
-            //     var list = JSON.parse(JSON.stringify(array))
-            //     list[index].time = e
-            //     list[index].extra.confirm_time = new Date().getTime()
-            //     setArray(list)
-            // }}
+        // dateChange={(e) => {
+        //     debugger
+        //     var list = JSON.parse(JSON.stringify(array))
+        //     list[index].date = e
+        //     list[index].extra.confirm_time = new Date().getTime()
+        //     setArray(list)
+        // }}
+        // timeChange={(e) => {
+        //     debugger
+        //     var list = JSON.parse(JSON.stringify(array))
+        //     list[index].time = e
+        //     list[index].extra.confirm_time = new Date().getTime()
+        //     setArray(list)
+        // }}
         />
     }
 
@@ -1103,7 +1124,7 @@ export default function LogTime() {
             <NewButton
                 color={footerBtnColor()}
                 type={NewButtonType.fill}
-                title={t('health.log')}
+                title={isSingle?t('health.log_moment'):t('health.log_moments')}
                 width={rpxToPx(646)}
                 height={rpxToPx(96)}
                 disable={errors.length > 0}

+ 4 - 6
src/_health/pages/long_fast_setting.tsx

@@ -127,17 +127,15 @@ export default function LongFastSetting() {
                 color={MainColorType.fast}
                 date={date}
                 time={time}
-                dateChange={(e) => {
-                    setDate(e)
-                    if (e == dayjs().format('YYYY-MM-DD')) {
+                change={(e)=>{
+                    setDate(e[0])
+                    if (e[0] == dayjs().format('YYYY-MM-DD')) {
                         setIsToday(true)
                     }
                     else {
                         setIsToday(false)
                     }
-                }}
-                timeChange={(e) => {
-                    setTime(e)
+                    setTime(e[1])
                 }}
             />
         </Card>

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

@@ -66,6 +66,7 @@ export default function Move() {
         }, 1000)
 
         return () => {
+            myScrollTop = 0
             clearInterval(timer)
         }
     }, [])

+ 60 - 10
src/_health/pages/move_setting_reminder.tsx

@@ -12,6 +12,8 @@ import { rpxToPx } from "@/utils/tools";
 import StatusIndicator, { StatusType } from "../base/status_indicator";
 import Layout from "@/components/layout/layout";
 import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
+import Card from "../components/card";
+import ConsoleCell from "../components/console_cell";
 
 export default function MoveSettingReminder() {
     const [selIndex, setSelIndex] = useState(-1)
@@ -31,22 +33,71 @@ export default function MoveSettingReminder() {
         })
     }
 
+
     if (!detail) return <View />
 
     function detailContent() {
         return <View>
             <NewHeader type={NewHeaderType.left} title="Full Check In Schedule" />
-            {
+            <Card>
+                <View style={{ display: 'flex', flexDirection: 'column', width: rpxToPx(700) }}>
+                    {
+                        detail.schedules.map((item, index) => {
+                            return <ConsoleCell key={index}
+                                moveCell
+                                status={<StatusIndicator type={StatusType.normal}
+                                    color={MainColorType.active}
+                                    text={'WAKING HOUR ' + (index + 1)} />}
+                                title={`Check in at ${item.reminder_time}`}
+                                description={`${item.title}`}
+                                subDesc={<Text className="schedule_item_time"></Text>}
+                                right={<View style={{
+                                    display: 'flex',
+                                    flexDirection: 'row',
+                                    alignItems: 'center'
+                                }}>
+                                    {
+                                        item.reminder ? <IconNotification color={MainColorType.g03} width={rpxToPx(28)} /> : <IconNotificationOff color={MainColorType.g03} width={rpxToPx(28)} />
+                                    }
+                                    <View style={{ width: rpxToPx(12) }} />
+                                    <Switch checked={item.reminder} color={getThemeColor('ACTIVE')} onChange={e => {
+                                        console.log(item)
+
+                                        createSchedule({
+                                            schedules: [{
+                                                id: item.id,
+                                                reminder: e.detail.value
+                                            }],
+                                        }).then(res => {
+                                            getData()
+                                            if (global.refreshWindow) {
+                                                global.refreshWindow()
+                                            }
+                                            if (global.refreshSchedules) {
+                                                global.refreshSchedules()
+                                            }
+                                            if (global.updateMove) {
+                                                global.updateMove()
+                                            }
+                                        })
+                                    }} />
+                                    <View style={{marginRight:-rpxToPx(14)}}/>
+                                </View>}
+                                disable={true}
+                                onClick={() => { }}
+                                showLine={true}
+                                fullLine={false}
+
+                            />
+
+                        })
+                    }
+                </View>
+            </Card>
+            {/* {
                 detail.schedules.map((item, index) => {
                     return <View key={index}>
                         <View key={index} className="schedule_item">
-                            {/* <View style={{ display: 'flex', flexDirection: 'column' }}>
-                            <Text>{item.reminder_time}</Text>
-                            <View>
-                                <Text style={{ flex: 1 }}>check in for {item.time}-{item.end_time}</Text>
-
-                            </View>
-                        </View> */}
                             <View className="schedule_item_left">
                                 <StatusIndicator type={StatusType.normal}
                                     color={MainColorType.active}
@@ -55,7 +106,6 @@ export default function MoveSettingReminder() {
                                 <Text className="h22" style={{ color: MainColorType.g02, marginTop: rpxToPx(12), marginLeft: rpxToPx(30) }}>
                                     {item.title}
                                 </Text>
-                                {/* <Text className="schedule_item_target">{item.real_steps}/{item.target_steps} steps</Text> */}
                             </View>
                             <View style={{ flex: 1 }} />
                             {
@@ -88,7 +138,7 @@ export default function MoveSettingReminder() {
                         </View>
                     </View>
                 })
-            }
+            } */}
 
         </View>
     }

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

@@ -63,11 +63,11 @@ export default function MoveSettingTime() {
                                 description={`${item.time}-${item.end_time}`}
                                 title={selIndex != index ? `Hit ${item.goal} Steps` : null}
                                 titleComponent={selIndex == index ? <Input className='item_name h34' style={{ flex: 1, height: rpxToPx(46), marginLeft: rpxToPx(32) }}
-                                    value={item.goal}
+                                    // value={item.goal}
                                     autoFocus={true}
                                     focus={true}
                                     type="number"
-                                    cursor={item.goal.length}
+                                    // cursor={item.goal.length}
                                     onBlur={() => {
                                         setSelIndex(-1)
                                         createSchedule({

+ 4 - 0
src/_health/pages/post_result.scss

@@ -1,3 +1,7 @@
+page{
+    background-color: #ffffff;
+}
+
 .post_result_container{
     display: flex;
     flex-direction: column;

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

@@ -238,7 +238,7 @@ export default function PostResult() {
 
                 }}
             />
-            {
+            {/* {
                 showSwitchBtn() && <View style={{ marginTop: rpxToPx(36), width: rpxToPx(400), height: rpxToPx(72), display: 'flex' }}>
                     <NewButton
                         type={NewButtonType.link}
@@ -246,7 +246,7 @@ export default function PostResult() {
                         onClick={tapSwitch}
                     />
                 </View>
-            }
+            } */}
 
 
         </View>

+ 50 - 29
src/_health/pages/timeline_detail.scss

@@ -1,7 +1,7 @@
-.detail_header{
+.detail_header {
     background-color: #fff;
     width: 750px;
-    padding:40px;
+    padding: 40px;
     padding-bottom: 20px;
     display: flex;
     flex-direction: row;
@@ -9,27 +9,25 @@
     min-height: 100vh;
 }
 
-html
-page
-{
+html page {
     background-color: #fff;
 }
 
-.detail_header_header{
-    margin-right:24px;
+.detail_header_header {
+    margin-right: 24px;
     width: 74px;
     height: 74px;
     border-radius: 37px;
 }
 
-.detail_header_content{
+.detail_header_content {
     display: flex;
     flex-direction: column;
     flex: 1;
 
 }
 
-.detail_nickname{
+.detail_nickname {
     color: #5C7099;
     font-weight: bold;
     font-size: 34px;
@@ -37,13 +35,13 @@ page
     margin-bottom: 24px;
 }
 
-.add_note{
+.add_note {
     background-color: #f5f5f5;
     position: fixed;
     left: 0;
-    right:0;
-    bottom:0;
-    height: 103px;
+    right: 0;
+    bottom: 0;
+    height: 112px;
     padding-bottom: constant(safe-area-inset-bottom);
     /* 兼容 iOS < 11.2 */
     padding-bottom: env(safe-area-inset-bottom);
@@ -55,47 +53,47 @@ page
 
 }
 
-.publish_bg{
+.publish_bg {
     position: absolute;
     left: 0;
     right: 0;
-    top:0;
-    bottom:0;
-    background-color: rgba(0,0,0,0.9);
+    top: 0;
+    bottom: 0;
+    background-color: rgba(0, 0, 0, 0.9);
     box-sizing: border-box;
-    padding-left:72px;
-    padding-right:72px;
+    padding-left: 72px;
+    padding-right: 72px;
     display: flex;
     flex-direction: column;
 }
 
-.time{
+.time {
     color: #5C7099;
     margin-bottom: 30px;
 }
 
-.toolbar2{
+.toolbar2 {
     height: 172px;
     display: flex;
     flex-direction: row;
     align-items: center;
-    padding-left:72px;
-    padding-right:72px;
-    margin-left:-72px;
-    margin-right:-72px;
+    padding-left: 72px;
+    padding-right: 72px;
+    margin-left: -72px;
+    margin-right: -72px;
     box-sizing: border-box;
     // margin-bottom: constant(safe-area-inset-bottom);
     // margin-bottom: env(safe-area-inset-bottom);
 }
 
-.album{
+.album {
     width: 72px;
     height: 72px;
     margin-right: 48px;
 
 }
 
-.btn{
+.btn {
     display: flex;
     color: #fff;
     width: 128px;
@@ -105,16 +103,39 @@ page
     justify-content: center;
 }
 
-.detail_time{
+.detail_time {
     color: #5C7099;
     margin-top: 10px;
 }
 
-.myTextarea{
+.myTextarea {
     line-height: 72px;
     font-size: 48px;
     // width: 606px;
     margin-left: -10px;
     width: 630px;
     color: #fff;
+}
+
+.share_btn_bg {
+    position: relative;
+    width: 80px;
+    height: 40px;
+}
+
+.share_icon_bg {
+    width: 80px;
+    height: 40px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.share_btn {
+    position: absolute;
+    opacity: 0;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
 }

+ 47 - 13
src/_health/pages/timeline_detail.tsx

@@ -1,4 +1,4 @@
-import { View, Image, Text, Input, Textarea } from "@tarojs/components";
+import { View, Image, Text, Input, Textarea, Button } from "@tarojs/components";
 import { useDispatch, useSelector } from "react-redux";
 import './timeline_detail.scss'
 import '@features/health/History.scss'
@@ -10,7 +10,7 @@ import { baseUrl } from "@/services/http/api";
 import { checkAuthorized } from "@/utils/check_authorized";
 import { createMoment, delEvents, delRecord, getEvents, getRecordDetail, makeDone } from "@/services/health";
 import NewButton, { NewButtonType } from "../base/new_button";
-import { IconClose, IconLongFast } from "@/components/basic/Icons";
+import { IconClose, IconLongFast, IconShare } from "@/components/basic/Icons";
 import { rpxToPx, vibrate } from "@/utils/tools";
 import { MainColorType } from "@/context/themes/color";
 import NewModal from "../base/new_modal";
@@ -78,14 +78,40 @@ export default function TimelineDetail() {
         router = useRouter()
     }
 
-    const { schedule_id, event_id, window_id, isfastsleep, disable_edit } = router.params
+    const { schedule_id, event_id, window_id, isfastsleep, islongfast, disable_edit } = router.params
 
 
     if (process.env.TARO_ENV == 'weapp') {
+
         useShareAppMessage((e) => {
+            var title = ''
+            if (isfastsleep == '1') {
+                title = t('health.share_my_fast_sleep')
+            }
+            else if (islongfast == '1') {
+                title = t('health.share_my_long_fast')
+            }
+            else {
+                switch (health.mode) {
+                    case 'FAST':
+                        title = t('health.share_my_fasting')
+                        break;
+                    case 'EAT':
+                        title = t('health.share_my_eating')
+                        break;
+                    case 'ACTIVE':
+                        title = t('health.share_my_activity')
+                        break;
+                    case 'SLEEP':
+                        title = t('health.share_my_sleep')
+                        break;
+
+                }
+            }
             return {
-                title: t('feature.track_time_duration.common.share_title'),
-                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`
+                title: title,
+                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`,
+                imageUrl: 'https://background-pictures.oss-cn-beijing.aliyuncs.com/windows/eat2.jpg'
             }
         })
     }
@@ -119,7 +145,7 @@ export default function TimelineDetail() {
             title = TimeFormatter.getYesterdayUnit()
         }
         else {
-            if (global.languange == 'en') {
+            if (global.language == 'en') {
                 title = dayjs(t).format('dddd, MMM D')
             }
             else {
@@ -557,7 +583,7 @@ export default function TimelineDetail() {
             <View className="detail_header_content">
                 <Text className="detail_nickname">{shareUser ? shareUser.nickname : user.nickname}</Text>
                 {
-                    (!window_id||window_id=='undefined') && (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')}
@@ -684,7 +710,7 @@ export default function TimelineDetail() {
                     })
                 }
                 {
-                    isfastsleep == '1' && history && detail.windows && detail.windows.length>=2 && <TargetProgress
+                    isfastsleep == '1' && history && detail.windows && detail.windows.length >= 2 && <TargetProgress
                         onClick={showFastSleepPopDetail}
                         showRing={true}
                         doubleRing={true}
@@ -694,9 +720,17 @@ export default function TimelineDetail() {
                     />
                 }
                 {
-                    publish && <View style={{ display: 'flex', flexDirection: 'row', height: rpxToPx(60), marginTop: rpxToPx(17), alignItems: 'center', justifyContent: 'space-between' }}>
+                    publish && <View style={{ display: 'flex', flexDirection: 'row', height: rpxToPx(60), marginTop: rpxToPx(17), alignItems: 'center' }}>
                         {/* <Text className="h24 g02">{publish.edited ? '编辑于' : '发布于'}{dayjs(publish.timestamp).format('M月D日 HH:mm')}</Text> */}
                         <Text className="h24 g02">{footerTime(publish)}</Text>
+                        <View style={{ flex: 1 }} />
+                        <View className="share_btn_bg">
+                            
+                            <View className="share_icon_bg">
+                                <IconShare color={MainColorType.link+'cc'} width={rpxToPx(32)}/>
+                            </View>
+                            <Button className="share_btn" openType="share">1</Button>
+                        </View>
                         {!router.params.uid && <NewButton
                             type={NewButtonType.more}
                             onClick={tapMore}
@@ -801,13 +835,13 @@ export default function TimelineDetail() {
                         // }}
                         minTimestamp={new Date().getTime()}
                         date={selDate}
-                        change={e=>{
+                        change={e => {
                             setSelDate(e[0])
                             setSelTime(e[1])
                         }}
-                        // dateChange={(e) => {
-                        //     setSelDate(e)
-                        // }}
+                    // dateChange={(e) => {
+                    //     setSelDate(e)
+                    // }}
                     />
                 </Card>
             </NewModal>

+ 1 - 0
src/app.scss

@@ -450,6 +450,7 @@ page {
     width: 698px;
     flex-shrink: 0;
     flex: 1;
+    position: relative;
 }
 
 .card_footer {

BIN
src/assets/_health/compass.png


BIN
src/assets/_health/compass_sel.png


BIN
src/assets/_health/fast_sleep.png


BIN
src/assets/_health/home.png


BIN
src/assets/_health/home_sel.png


BIN
src/assets/_health/long_fast.png


BIN
src/assets/_health/measurements.png


BIN
src/assets/_health/share_01.jpg


BIN
src/assets/_health/user.png


BIN
src/assets/_health/user_sel.png


+ 19 - 11
src/components/basic/Icons.tsx

@@ -27,17 +27,6 @@ export const IconClear = () => {
     </View>
 }
 
-
-
-export const IconShare = (props: { width: number, height: number, color: string }) => {
-    const icon = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="20.596546173095703" height="17.310691833496094" viewBox="0 0 20.596546173095703 17.310691833496094"><g><path d="M0.750904,17.3107C0.671866,17.3111,0.593304,17.2984,0.518404,17.2732C0.1964,17.1686,-0.0156423,16.8613,0.000903904,16.5232C0.000903904,16.4107,0.773404,5.52068,11.6934,4.66568L11.6934,0.750681C11.6931,0.445681,11.8776,0.170896,12.16,0.055638C12.4424,-0.0596205,12.7664,0.00760603,12.9797,0.225681L20.3822,7.78568C20.668,8.07731,20.668,8.54405,20.3822,8.83568L12.9797,16.3957C12.7664,16.6138,12.4424,16.681,12.16,16.5657C11.8776,16.4505,11.6931,16.1757,11.6934,15.8707L11.6934,12.0307C4.4034,12.3082,1.41465,16.9057,1.38465,16.9619C1.2472,17.1791,1.00803,17.3107,0.750904,17.3107ZM13.1934,2.58818L13.1934,5.36693C13.1937,5.77111,12.8736,6.10279,12.4697,6.11693C5.40465,6.37568,2.87715,11.0819,1.96965,14.1082C3.84465,12.4882,7.1859,10.5082,12.3984,10.5082L12.4322,10.5082C12.8464,10.5082,13.1822,10.844,13.1822,11.2582L13.1822,14.0369L18.8072,8.31443L13.1934,2.58818Z" fill="#FF7A4E" fill-opacity="1"/></g></svg>`
-    return <View style={{ width: props.width, height: props.height }}>
-        {
-            process.env.TARO_ENV == 'weapp' ? <mysvg src={icon} colors={[props.color]} /> :
-                <SvgXml xml={icon} width={props.width} height={props.width} />
-        }
-    </View>
-}
 export const IconCheck = (props: { width: number, height: number, color: string }) => {
     const icon = `
     <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none"
@@ -709,4 +698,23 @@ export const IconActive = (props: { width: number, color: string }) => {
     </g>
 </svg>`
     return Icon(props.width, props.width, icon);
+}
+
+export const IconShare = (props: { width: number, color: string }) => {
+    const icon = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none"
+    version="1.1" width="24" height="24" viewBox="0 0 24 24">
+    <defs>
+        <clipPath id="master_svg0_407_3325">
+            <rect x="0" y="0" width="24" height="24" rx="0" />
+        </clipPath>
+    </defs>
+    <g clip-path="url(#master_svg0_407_3325)">
+        <g transform="matrix(-1,0,0,1,46,0)">
+            <path
+                d="M31.37531,18.700200000000002L24.95217,13.56174C23.951359,12.76109,23.951359,11.23891,24.95217,10.43826L31.37531,5.29976C32.03007,4.775945,33,5.24212,33,6.08063L33,9C38.522800000000004,9,43,13.4772,43,19C43,19.0027,43,19.005499999999998,43,19.008200000000002C42.9998,19.2441,42.6832,19.3045,42.5548,19.1067C40.9506,16.634999999999998,38.1662,15,35,15L33,15L33,17.9194C33,18.7579,32.03007,19.2241,31.37531,18.700200000000002"
+                fill="${props.color}" fill-opacity="1" style="mix-blend-mode:passthrough" />
+        </g>
+    </g>
+</svg>`
+    return Icon(props.width, props.width, icon);
 }

+ 9 - 8
src/components/input/SlidngScale.tsx

@@ -5,6 +5,7 @@ import { useEffect, useRef, useState } from "react";
 import Taro from "@tarojs/taro";
 import { rpxToPx } from "@/utils/tools";
 import { throttle } from 'lodash';
+import { MainColorType } from "@/context/themes/color";
 // import { SvgXml } from "react-native-svg";
 
 var timerA = null
@@ -268,29 +269,29 @@ export default function Component(props: {
         {
             isFT_IN && <View className="number_bg" style={{ opacity: enableText ? 1 : 0.4 }}>
                 {
-                    parseInt(current / 12 + '') > 0 && (process.env.TARO_ENV == 'weapp' ? <Text className="number" style={{color:props.themeColor, fontFamily: "PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;" }}>{parseInt(current / 12 + '')}</Text> :
-                        <Text className="number" style={{color:props.themeColor}}>{parseInt(current / 12 + '')}</Text>)
+                    parseInt(current / 12 + '') > 0 && (process.env.TARO_ENV == 'weapp' ? <Text className="number" style={{color:MainColorType.black, fontFamily: "PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;" }}>{parseInt(current / 12 + '')}</Text> :
+                        <Text className="number" style={{color:MainColorType.black}}>{parseInt(current / 12 + '')}</Text>)
                 }
 
                 {parseInt(current / 12 + '') > 0 && <Text className="unit" style={{ marginRight: 2 }}>ft</Text>}
                 {
-                    current % 12 > 0 && (process.env.TARO_ENV == 'weapp' ? <Text className="number" style={{color:props.themeColor, fontFamily: "PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;" }}>{current % 12}</Text> :
-                        <Text className="number" style={{color:props.themeColor}}>{current % 12}</Text>)
+                    current % 12 > 0 && (process.env.TARO_ENV == 'weapp' ? <Text className="number" style={{color:MainColorType.black, fontFamily: "PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;" }}>{current % 12}</Text> :
+                        <Text className="number" style={{color:MainColorType.black}}>{current % 12}</Text>)
                 }
 
                 {
-                    current % 12 > 0 && <Text className="unit" style={{color:props.themeColor}}>in</Text>
+                    current % 12 > 0 && <Text className="unit" style={{color:MainColorType.black}}>in</Text>
                 }
             </View>
         }
         {
             !isFT_IN && <View className="number_bg" style={{ opacity: enableText ? 1 : 0.4 }}>
                 {
-                    process.env.TARO_ENV == 'weapp' ? <Text className="number" style={{ color:props.themeColor,fontFamily: "PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;" }}>{current}</Text> :
-                        <Text className="number" style={{color:props.themeColor}}>{current}</Text>
+                    process.env.TARO_ENV == 'weapp' ? <Text className="number" style={{ color:MainColorType.black,fontFamily: "PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;" }}>{current}</Text> :
+                        <Text className="number" style={{color:MainColorType.black}}>{current}</Text>
                 }
 
-                <Text className="unit" style={{color:props.themeColor}}>{props.unit}</Text>
+                <Text className="unit" style={{color:MainColorType.black}}>{props.unit}</Text>
             </View>
         }
 

+ 4 - 2
src/components/navigation/TabBar.scss

@@ -6,7 +6,7 @@
     bottom: 0;
     left: 0;
     right: 0;
-    height: 103px;
+    height: 112px;
     flex-direction: row;
     justify-content: space-around;
     background-color: #f5f5f5;
@@ -31,13 +31,15 @@
     // color: rgba(255,255,255,0.4);
     // font-size: 36px;
     // line-height: 36px;
+    padding-top: 24px;
     display: flex;
     flex-direction: column;
     flex: 1;
     align-items: center;
-    justify-content: center;
+    // justify-content: center;
     // font-weight: bold;
     position: relative;
+    // background-color: pink;
 }
 
 .tabbar-item-sel{

+ 18 - 0
src/context/locales/en.js

@@ -1021,5 +1021,23 @@ export default {
 
         edit_time:'Edit Time',
         quit_tip:'Your check-in will not be saved upon exit.',
+
+        select:'Select',
+        reset:'Reset',
+        select_schedule:'Selected as Schedules',
+        schedule_for:'Scheduled for {{time}}',
+        log_moment:'Log Moment',
+        log_moments:'Log Moments',
+
+        share_my_fasting:'My Fasting',
+        share_my_eating:'My Eating',
+        share_my_sleep:'My Sleep',
+        share_my_activity:'My Activity',
+        share_my_fast_sleep:'My Fasting with Sleep',
+        share_my_long_fast:'My Long Fast',
+        
+        share_my_food_journal:'My Food Journal',
+        share_my_activity_journal:'My Activity Journal',
+        share_my_journal:'My Journal'
     }
 }

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

@@ -1022,5 +1022,24 @@ export default {
         me:'我',
         edit_time:'编辑时间',
         quit_tip:'退出后不会保存打卡',
+
+        select:'选择',
+        reset:'重置',
+        select_schedule:'已选为预订时间',
+        schedule_for:'预订时间为{{time}}',
+
+        log_moment:'记录时刻',
+        log_moments:'记录时刻',
+
+        share_my_fasting:'我的断食',
+        share_my_eating:'我的饮食',
+        share_my_sleep:'我的睡眠',
+        share_my_activity:'我的活动',
+        share_my_fast_sleep:'我的断食与睡眠',
+        share_my_long_fast:'我的长断食',
+        
+        share_my_food_journal:'我的饮食日记',
+        share_my_activity_journal:'我的活动记录',
+        share_my_journal:'我的日记'
     }
 }

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

@@ -89,6 +89,7 @@
   flex-direction: column;
   align-items: center;
   justify-content: center;
+  margin-top: -1px;
 }
 
 .main_summary_time {

+ 25 - 64
src/features/health/MainHistory.tsx

@@ -41,6 +41,10 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
     const [activeList, setActiveList] = useState<any>([])
     const [sleepList, setSleepList] = useState<any>([])
 
+    const [fastTotal, setFastTotal] = useState(-1)
+    const [eatTotal, setEatTotal] = useState(-1)
+    const [activeTotal, setActiveTotal] = useState(-1)
+    const [sleepTotal, setSleepTotal] = useState(-1)
 
     const [hideEatArchiveTip, setHideEatArchiveTip] = useState(false)
     const [hideActiveArchiveTip, setHideActiveArchiveTip] = useState(false)
@@ -72,25 +76,14 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         }
     }, [user.isLogin])
 
-
-
-    useEffect(() => {
-        // if (props.type == 'FAST,SLEEP' || (props.fast_type && props.fast_type == 'LF')) {
-        //     global.refreshOtherHistory = () => {
-        //         refresh()
-        //     }
-        // }
-        // else {
-
-        // }
-    }, [])
+    useEffect(()=>{
+        return ()=>{
+            myScrollTop = 0
+        }
+    },[])
 
     global.refreshHistory = () => {
         refresh()
-        // refreshFast()
-        // refreshSleep()
-        // refreshEat()
-        // refreshActive()
         refreshItem('FAST')
         refreshItem('SLEEP')
         refreshItem('EAT')
@@ -117,24 +110,28 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                 case 'FAST':
                     if (fastList.length > 0) {
                         setList(fastList)
+                        setTotal(fastTotal)
                         return;
                     }
                     break
                 case 'EAT':
                     if (eatList.length > 0) {
                         setList(eatList)
+                        setTotal(eatTotal)
                         return;
                     }
                     break
                 case 'SLEEP':
                     if (sleepList.length > 0) {
                         setList(sleepList)
+                        setTotal(sleepTotal)
                         return;
                     }
                     break
                 case 'ACTIVE':
                     if (activeList.length > 0) {
                         setList(activeList)
+                        setTotal(activeTotal)
                         return;
                     }
                     break
@@ -163,26 +160,6 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         })
     }
 
-    function isTimestampInThisWeek(timestamp) {
-        const date = new Date(timestamp);
-
-        // 获取当前日期
-        const now = new Date();
-
-        // 获取本周的第一天(周一)
-        const startOfWeek = new Date(now);
-        startOfWeek.setDate(now.getDate() - now.getDay() + 1); // 计算本周周一
-        startOfWeek.setHours(0, 0, 0, 0); // 设置为当天的开始时间
-
-        // 获取本周的最后一天(周日)
-        const endOfWeek = new Date(startOfWeek);
-        endOfWeek.setDate(startOfWeek.getDate() + 6); // 计算本周周日
-        endOfWeek.setHours(23, 59, 59, 999); // 设置为当天的结束时间
-
-        // 判断时间戳是否在本周范围内
-        return date >= startOfWeek && date <= endOfWeek;
-    }
-
     function onScroll(e) {
         // var top = e.detail.scrollTop
         // myScrollTop = top
@@ -197,14 +174,14 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
             list.forEach((item, index) => {
                 if (top >= itemLayouts[index] - 50) {
                     i = index
-                    if (isTimestampInThisWeek(item.window_range.start_timestamp)) {
+                    if (TimeFormatter.isTimestampInThisWeek(item.window_range.start_timestamp)) {
                         date = t('health.this_week')
                     }
                     else if (dayjs(item.window_range.start_timestamp).format('YYYY') == dayjs().format('YYYY')) {
                         date = global.language == 'en' ? dayjs(item.window_range.start_timestamp).format('MMMM') : dayjs(item.window_range.start_timestamp).format('MMMM')
                     }
                     else {
-                        date = global.language == 'en' ? dayjs(item.window_range.start_timestamp).format('MMMM YYYY') : dayjs(item.window_range.start_timestamp).format('YYYY年M月')
+                        date = global.language == 'en' ? dayjs(item.window_range.start_timestamp).format('YYYY') : dayjs(item.window_range.start_timestamp).format('YYYY年')
                     }
 
 
@@ -345,15 +322,19 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
             switch (type) {
                 case 'FAST':
                     setFastList(array)
+                    setFastTotal((res as any).total)
                     break
                 case 'SLEEP':
                     setSleepList(array)
+                    setSleepTotal((res as any).total)
                     break
                 case 'EAT':
                     setEatList(array)
+                    setEatTotal((res as any).total)
                     break
                 case 'ACTIVE':
                     setActiveList(array)
+                    setActiveTotal((res as any).total)
                     break
             }
         })
@@ -478,26 +459,22 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                     if (health.mode == 'EAT') {
                         setEatList(array)
                         setList(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))
-                        // }
+                        setEatTotal((res as any).total)
                     }
                     else if (health.mode == 'ACTIVE') {
                         setActiveList(array)
                         setList(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))
-                        // }
+                        setActiveTotal((res as any).total)
                     }
                     else if (health.mode == 'FAST') {
                         setFastList(array)
                         setList(array)
+                        setFastTotal((res as any).total)
                     }
                     else if (health.mode == 'SLEEP') {
                         setSleepList(array)
                         setList(array)
+                        setSleepTotal((res as any).total)
                     }
                 }
 
@@ -510,22 +487,6 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                 setList([...list, ...array])
             }
 
-            // if ((res as any).data.length > 0) {
-            //     setTimeout(() => {
-            //         // var array:any = [];
-            //         // (res as any).data.map((item,index)=>{
-            //         //     array.push('#history_id_'+index)
-            //         // })
-            //         // var ids = array.join(',')
-            //         // console.log(array)
-            //         // console.log(ids)
-            //         const query = Taro.createSelectorQuery();
-            //         query.selectAll('#history_id_0').boundingClientRect((rect) => {
-            //             console.log(rect)
-            //         }).exec();
-            //     }, 1000)
-            // }
-
         }).catch(e => {
             setLoading(false)
         })
@@ -788,7 +749,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
             list.length > 0 && <View style={{ minHeight: rpxToPx(464), backgroundColor: '#fff', paddingTop: rpxToPx(60) }}>
                 {
                     list.map((item, index) => {
-                        if (itemLayouts.length >= index + 1) {
+                        if (itemLayouts.length >= index + 1 && pageTop > 0) {
                             // if (Math.abs(itemLayouts[index] - pageTop) > 2500) {
                             //     return <View style={{ height: itemHeights[index] }} id={`history-${index}`} key={index}>
                             //         {
@@ -810,7 +771,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                     flexDirection: 'row'
                                 }} id={`history-${index}`}>
                                     <TimelineDate timestamp={item.window_range.start_timestamp}
-                                        pre_timestamp={index>0 ? list[index - 1].window_range.start_timestamp : null}
+                                        pre_timestamp={index > 0 ? list[index - 1].window_range.start_timestamp : null}
                                     />
                                     <View style={{
                                         display: 'flex', flexDirection: 'column', flex: 1,

+ 12 - 28
src/features/health/MainHistory2.tsx

@@ -59,6 +59,12 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         }
     }, [list])
 
+    useEffect(()=>{
+        return ()=>{
+            myScrollTop = 0
+        }
+    },[])
+
 
     useEffect(() => {
         if (!user.isLogin) {
@@ -156,26 +162,6 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         })
     }
 
-    function isTimestampInThisWeek(timestamp) {
-        const date = new Date(timestamp);
-
-        // 获取当前日期
-        const now = new Date();
-
-        // 获取本周的第一天(周一)
-        const startOfWeek = new Date(now);
-        startOfWeek.setDate(now.getDate() - now.getDay()+1); // 计算本周周一
-        startOfWeek.setHours(0, 0, 0, 0); // 设置为当天的开始时间
-
-        // 获取本周的最后一天(周日)
-        const endOfWeek = new Date(startOfWeek);
-        endOfWeek.setDate(startOfWeek.getDate() + 6); // 计算本周周日
-        endOfWeek.setHours(23, 59, 59, 999); // 设置为当天的结束时间
-
-        // 判断时间戳是否在本周范围内
-        return date >= startOfWeek && date <= endOfWeek;
-    }
-
     function onScroll(e) {
         // var top = e.detail.scrollTop
         // myScrollTop = top
@@ -188,11 +174,11 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
             list.forEach((item, index) => {
                 if (top >= itemLayouts[index] - 50) {
                     i = index
-                    if (isTimestampInThisWeek(item.window_range.start_timestamp)) {
+                    if (TimeFormatter.isTimestampInThisWeek(item.window_range.start_timestamp)) {
                         date = t('health.this_week')
                     }
-                    else if (dayjs(item.window_range.start_timestamp).format('YYYY')==dayjs().format('YYYY')){
-                        date = global.language=='en'?dayjs(item.window_range.start_timestamp).format('MMMM'):dayjs(item.window_range.start_timestamp).format('MMMM')
+                    else if (dayjs(item.window_range.start_timestamp).format('YYYY') == dayjs().format('YYYY')) {
+                        date = global.language == 'en' ? dayjs(item.window_range.start_timestamp).format('MMMM') : dayjs(item.window_range.start_timestamp).format('MMMM')
                     }
                     else {
                         date = global.language == 'en' ? dayjs(item.window_range.start_timestamp).format('MMMM YYYY') : dayjs(item.window_range.start_timestamp).format('YYYY年M月')
@@ -356,8 +342,6 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         if (props.fast_type) {
             params.fast_type = props.fast_type
         }
-        console.log(props.type, health.mode)
-        debugger
         setPage(index)
         setLoading(true)
         records(params).then(res => {
@@ -742,7 +726,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
             list.length > 0 && <View style={{ minHeight: rpxToPx(464), backgroundColor: '#fff', paddingTop: rpxToPx(60) }}>
                 {
                     list.map((item, index) => {
-                        if (itemLayouts.length >= index + 1) {
+                        if (itemLayouts.length >= index + 1 && pageTop > 0) {
                             // if (Math.abs(itemLayouts[index] - pageTop) > 2500) {
                             //     return <View style={{ height: itemHeights[index] }} id={`history-${index}`} key={index}>
                             //         {
@@ -764,7 +748,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                     flexDirection: 'row'
                                 }} id={`history-${index}`}>
                                     <TimelineDate timestamp={item.window_range.start_timestamp}
-                                        pre_timestamp={index>0 ? list[index - 1].window_range.start_timestamp : null}
+                                        pre_timestamp={index > 0 ? list[index - 1].window_range.start_timestamp : null}
                                     />
                                     <View style={{
                                         display: 'flex', flexDirection: 'column', flex: 1,
@@ -773,7 +757,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                                     </View>
                                 </View>
                             }
-                            
+
                         }
                         return <View id={`history-${index}`} key={index}>
                             {

+ 0 - 1
src/features/trackSomething/components/MetricHistory.scss

@@ -24,7 +24,6 @@
     margin-top: 16px;
     height: 32px;
     line-height: 32px;
-    opacity: 0.4;
 }
 
 .operate_item1{

+ 1 - 1
src/features/trackSomething/components/MetricHistory.tsx

@@ -171,7 +171,7 @@ export default function Component(props: { records: any[] }) {
                     {
                         showYear && <Text className="year g01" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>{TimeFormatter.getYearByDate(item.date)}</Text>
                     }
-                    <Text className="operate_day g03" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>{TimeFormatter.getMonthAndDayByDate(item.date)}</Text>
+                    <Text className="operate_day g02" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>{TimeFormatter.getMonthAndDayByDate(item.date)}</Text>
                     {
                         item.records.map((record, j) => {
                             return <View style={{ position: 'relative', zIndex: j == selIndex[1] ? 3 : 2 }} key={j}><RecordItem delete={() => deleteRecord(record)} onClick={(e) => {

+ 2 - 2
src/features/trackSomething/components/MetricItem.tsx

@@ -70,8 +70,8 @@ export default function Component(props: {
                 onClick={() => props.onClickDetail()}>{props.title}</Text>
             <View style={{ flex: 1 }} />
             {
-                props.showTag && <View className="metric_tag_bg">
-                    <Text className="metric_tag_text" style={{ color: props.themeColor }}>{props.tagName}</Text>
+                props.showTag && <View className="metric_tag_bg" style={{ backgroundColor: props.themeColor }}>
+                    <Text className="metric_tag_text" style={{ color: '#fff' }}>{props.tagName}</Text>
                 </View>
             }
 

+ 18 - 18
src/features/trackSomething/components/MetricModalAdd.tsx

@@ -28,32 +28,32 @@ export default function Component(props: { item: any, strTime: string, showPicke
     function trimTrailingZero(num) {
         // 先将数字转换为字符串
         let numStr = num.toString();
-      
+
         // 检查是否包含小数点
         if (numStr.indexOf('.') !== -1) {
-          // 获取小数部分
-          let decimalPart = numStr.split('.')[1];
-      
-          // 如果小数部分最后一位是 0,则去掉
-          if (decimalPart.endsWith('0')) {
-            numStr = numStr.slice(0, numStr.lastIndexOf('.'));
-          }
+            // 获取小数部分
+            let decimalPart = numStr.split('.')[1];
+
+            // 如果小数部分最后一位是 0,则去掉
+            if (decimalPart.endsWith('0')) {
+                numStr = numStr.slice(0, numStr.lastIndexOf('.'));
+            }
         }
-      
+
         // 返回处理后的数字
         return parseFloat(numStr);
-      }
+    }
 
     function addDetail() {
         return <View className='modal_content'>
             {
-                process.env.TARO_ENV == 'rn' && <View style={{position:'absolute',left:0,right:0,top:0,bottom:0}} onClick={()=>{
+                process.env.TARO_ENV == 'rn' && <View style={{ position: 'absolute', left: 0, right: 0, top: 0, bottom: 0 }} onClick={() => {
                     setSelUnit(-1)
                 }}></View>
             }
-            <Text className='modal_title' style={{ color: (metricItem as any).theme_color }} onClick={()=>{
-                    setSelUnit(-1)
-                }} suppressHighlighting>{(metricItem as any).name ? (metricItem as any).name : ''}</Text>
+            <Text className='modal_title' style={{ color: (metricItem as any).theme_color }} onClick={() => {
+                setSelUnit(-1)
+            }} suppressHighlighting>{(metricItem as any).name ? (metricItem as any).name : ''}</Text>
             <View style={{ position: 'relative' }}>
                 {
                     (metricItem as any).schemas.map((item, index) => {
@@ -78,8 +78,8 @@ export default function Component(props: { item: any, strTime: string, showPicke
                                 }} pointerEvents="none">{item.name}</Text>
                             }
                             {
-                                unit_options && unit_options.length > 1 && <View style={{ position: 'absolute', right: 20, zIndex: 1000000, top: (metricItem as any).schemas.length == 1 ? -rpxToPx(80)-10 : -rpxToPx(5)-10 }}>
-                                    <Text style={{ color: (metricItem as any).theme_color, opacity: 0.2, fontSize: 12,paddingTop:10,paddingBottom:10 }} onClick={(e) => {
+                                false && unit_options && unit_options.length > 1 && <View style={{ position: 'absolute', right: 20, zIndex: 1000000, top: (metricItem as any).schemas.length == 1 ? -rpxToPx(80) - 10 : -rpxToPx(5) - 10 }}>
+                                    <Text style={{ color: (metricItem as any).theme_color, opacity: 0.2, fontSize: 12, paddingTop: 10, paddingBottom: 10 }} onClick={(e) => {
                                         if (process.env.TARO_ENV == 'weapp') {
                                             e.stopPropagation()
                                         }
@@ -112,7 +112,7 @@ export default function Component(props: { item: any, strTime: string, showPicke
                                                             const pre_unit = dt.schemas[index].chosen_unit
                                                             const current_unit = obj.unit
 
-                                                            if (pre_unit == current_unit){
+                                                            if (pre_unit == current_unit) {
                                                                 setChangeIndex(-1)
                                                                 return
                                                             }
@@ -206,7 +206,7 @@ export default function Component(props: { item: any, strTime: string, showPicke
                 }
             </View>
             <View className="change_time_bg" >
-                <View className=" time_bg" style={{backgroundColor:'#9999991A'}} onClick={() => { props.showPicker(metricItem) }}>
+                <View className=" time_bg" style={{ backgroundColor: '#9999991A' }} onClick={() => { props.showPicker(metricItem) }}>
                     <Text className="time g02" >{props.strTime}</Text>
                 </View>
 

+ 6 - 0
src/pages/account/Album.tsx

@@ -50,6 +50,12 @@ export default function Album() {
         }
     }, [medias])
 
+    useEffect(()=>{
+        return ()=>{
+            myScrollTop = 0
+        }
+    },[])
+
     function more() {
         if (loading) return;
         if (total == medias.length) return;

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

@@ -1,3 +1,7 @@
+page{
+    background-color: #ffffff;
+}
+
 .photo_wall{
     height: 108px;
     background-color: #fff;

+ 67 - 145
src/pages/account/Journal.tsx

@@ -37,6 +37,8 @@ export default function Journal() {
     const [isPulling, setIsPulling] = useState(false)
     const [itemLayouts, setItemLayouts] = useState<any>([])
     const [itemHeights, setItemHeights] = useState<any>([])
+
+    const [yearStats, setYearStats] = useState<any>([])
     const [showDate, setShowDate] = useState(false)
     const [date, setDate] = useState('')
     const [loaded, setLoaded] = useState(false)
@@ -63,22 +65,22 @@ 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(() => {
 
-    // }, [])
+    useEffect(()=>{
+        return ()=>{
+            myScrollTop = 0
+        }
+    },[])
+
 
     useEffect(() => {
         getJounalsData(1)
     }, [window])
 
-    useEffect(() => {
-        console.log('last show status', showDate)
-    }, [showDate])
-
     useEffect(() => {
         if (journals.length > 0) {
             setTimeout(() => {
+                // console.log('journals length', journals.length)
                 measureItemLayouts()
             }, 500)
         }
@@ -122,9 +124,10 @@ export default function Journal() {
             // });
             setLoading(false)
             if (index == 1) {
-
-
-                setTotal((res as any).total)
+                if ((res as any).extra)
+                    setYearStats((res as any).extra.stat_by_year)
+                if ((res as any).total)
+                    setTotal((res as any).total)
                 setJournals(list)
                 setIsPulling(false)
             }
@@ -139,9 +142,9 @@ export default function Journal() {
     function measureItemLayouts() {
         const query = Taro.createSelectorQuery()
         journals.forEach((item, index) => {
-            if (index >= itemLayouts.length) {
-                query.select(`#history-${index}`).boundingClientRect()
-            }
+            // if (index >= itemLayouts.length) {
+            query.select(`#history-${index}`).boundingClientRect()
+            // }
 
         });
         query.exec((res) => {
@@ -154,8 +157,10 @@ export default function Journal() {
                     heights[index] = rect.height
                 }
             });
-            setItemLayouts([...itemLayouts, ...layouts])
-            setItemHeights([...itemHeights, ...heights])
+            setItemHeights(heights)
+            setItemLayouts(layouts)
+            // setItemLayouts([...itemLayouts, ...layouts])
+            // setItemHeights([...itemHeights, ...heights])
         })
     }
 
@@ -173,7 +178,7 @@ export default function Journal() {
             journals.forEach((item, index) => {
                 if (top >= itemLayouts[index] - 50) {
                     i = index
-                    dt = global.language == 'en' ? dayjs(item.timestamp).format('MMMM YYYY') : dayjs(item.timestamp).format('YYYY年M月')
+                    dt = global.language == 'en' ? dayjs(item.timestamp).format('YYYY') : dayjs(item.timestamp).format('YYYY年')
                 }
             })
 
@@ -189,7 +194,7 @@ export default function Journal() {
 
         }
 
-        if (showT) {
+        if (top >= 20) {
             Taro.setNavigationBarTitle({
                 title: pageTitle()
             })
@@ -200,6 +205,7 @@ export default function Journal() {
 
         }
         else {
+            setShowDate(false)
             Taro.setNavigationBarTitle({
                 title: ''
             })
@@ -220,79 +226,25 @@ export default function Journal() {
 
     }
 
-    function getTitle(item) {
-        if (item.title) {
-            return item.title;
-        }
-        if (item.moments) {
-            return item.moments[0].title
-        }
-        return ''
-    }
-
-    function journalItem(window, index) {
-        var array: any = [];
-        window.events.map(event => {
-            event.moments && event.moments.map(moment => {
-                if (moment.media && moment.media.length > 0) {
-                    moment.media.map(media => {
-                        array.push(media.url)
-                    })
-                }
-            })
-        })
-        return <View style={{ display: 'flex', flexDirection: 'row', marginBottom: rpxToPx(12), overflow: 'hidden', flexShrink: 0 }} key={index}>
-            {
-                array.length > 0 && <JournalCover imgs={array} />
-            }
-            <View style={{
-                display: 'flex',
-                flexDirection: 'column',
-                // flex: 1,
-                overflow: 'hidden',
-                backgroundColor: array.length == 0 ? '#fafafa' : 'transparent',
-                paddingLeft: array.length == 0 ? rpxToPx(20) : 0,
-                paddingRight: array.length == 0 ? rpxToPx(20) : 0,
-                paddingTop: array.length == 0 ? rpxToPx(12) : 0,
-                paddingBottom: array.length == 0 ? rpxToPx(12) : 0,
-                marginRight: rpxToPx(40),
-                flexShrink: 0
-            }}>
-                {
-
-                    window.events.map((item2, index2) => {
-                        if (item2.moments && item2.moments[0].type == 'PIC') return <View key={index2 * 1000} />
-                        return <TimeTitleDesc
-                            key={index2 * 1000}
-                            className="line1"
-                            style={{ width: array.length > 0 ? rpxToPx(350) : rpxToPx(512) }}
-                            timeObj={item2.time}
-                            time={dayjs(item2.time.timestamp).format('HH:mm')}
-                            title={getTitle(item2)}
-                            desc={item2.moments && item2.moments.length > 0 ? item2.moments[0].description : ''}
-                        />
-                    })
-                }
-
-
-
-            </View>
-        </View>
+    function yearCount(str) {
+        var year = str.substring(0, 4)
+        var array = yearStats.filter(item => item.year == year)
+        if (array.length > 0) return array[0].total
+        return '0'
     }
 
     function historyYear(index) {
         var showDate = false;
         var dateStr2: any = ''
-        if (index == 0) {
-            var currentDate = global.language == 'en' ? dayjs(journals[index].timestamp).format('YYYY') : dayjs(journals[index].timestamp).format('YYYY年')
+        if (index == -1) {
             var now = global.language == 'en' ? dayjs().format('YYYY') : dayjs().format('YYYY年')
-
-            if (currentDate != now) {
-                showDate = true
-                dateStr2 = currentDate
-            }
-
-
+            showDate = true
+            dateStr2 = now
+        }
+        else if (index == 0) {
+            var currentDate = global.language == 'en' ? dayjs(journals[index].timestamp).format('YYYY') : dayjs(journals[index].timestamp).format('YYYY年')
+            showDate = true
+            dateStr2 = currentDate
         }
         else {
             var currentDate = global.language == 'en' ? dayjs(journals[index].timestamp).format('YYYY') : dayjs(journals[index].timestamp).format('YYYY年')
@@ -303,7 +255,19 @@ export default function Journal() {
             }
         }
         if (showDate) {
-            return <View className="history_year_month h42 bold" style={{ marginBottom: rpxToPx(60) }}>{dateStr2}</View>
+            return <View style={{
+                display: 'flex', flexDirection: 'row', justifyContent: 'space-between',
+                position: 'relative',
+                marginLeft: rpxToPx(40),
+                marginRight: rpxToPx(40),
+                paddingTop: rpxToPx(44),
+                paddingBottom: rpxToPx(20),
+                marginBottom: rpxToPx(60)
+            }}>
+                <View className="h50 bold">{dateStr2}</View>
+                <View className="h30 g03" style={{ marginTop: rpxToPx(20) }}>{yearCount(dateStr2)}</View>
+                <View className="border_footer_line" />
+            </View>
         }
         return <View />
     }
@@ -441,59 +405,8 @@ export default function Journal() {
 
     if (!loaded) return <View />
 
-    // return <recycle-view
-    //     batch={true}
-    //     id="recycleId"
-    //     enableBackToTop
-    //     refresherEnabled
-    //     upperThreshold={70}
-    //     lowerThreshold={80}
-    //     refresherBackground={MainColorType.g05}
-    //     onRefresherRefresh={() => {
-    //         setIsPulling(true)
-    //         getJounalsData(1)
-    //     }}
-    //     refresherTriggered={isPulling}
-    //     onScroll={onScroll}
-    //     onScrollToLower={() => {
-    //         more()
-    //     }}
-    // >
-    //     <View>
-    //         <NewHeader type={NewHeaderType.left} title={pageTitle()} />
-    //         {
-    //             markDoneTip()
-    //         }
-    //     </View>
-
-    //     {
-    //         journals.map((item, index) => {
-    //             return <recycle-item key={index}><View key={index}>
-    //                 {
-    //                     historyYear(index)
-    //                 }
-    //                 <View className="history_item2" id={`history-${index}`} onClick={() => {
-    //                     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>
-    //                     </View>
-    //                     <View style={{ display: 'flex', flexDirection: 'column', flex: 1, width: rpxToPx(552), }}>
-    //                         {
-    //                             journalCell(item, index)
-    //                         }
-    //                     </View>
-    //                 </View></View>
-    //             </recycle-item>
-    //         })
-    //     }
-    //     <View>长列表后面的内容</View>
-    // </recycle-view>
-
     function itemData(index, item) {
-        if (itemLayouts.length >= index + 1) {
+        if (itemLayouts.length >= index + 1 && pageTop > 0) {
             if (Math.abs(itemLayouts[index] - pageTop) > 3000) {
                 return <View style={{ height: itemHeights[index] }} id={`history-${index}`}>
                     {/* {index} */}
@@ -540,24 +453,33 @@ export default function Journal() {
         </View>
     }
 
+    // console.log(journals.length, itemLayouts, pageTop)
 
-    return <StickyDateList onRefresherRefresh={() => {
-        setIsPulling(true)
-        getJounalsData(1)
-    }} isPulling={isPulling}
+
+    return <StickyDateList 
+    // onRefresherRefresh={() => {
+    //     setIsPulling(true)
+    //     getJounalsData(1)
+    // }} isPulling={isPulling}
         onScroll={onScroll}
         showDate={showDate}
         date={date}
         loadMore={() => {
             more()
         }}
-    ><View style={{ display: 'flex', flexDirection: 'column', minHeight: rpxToPx(464), backgroundColor: '#f5f5f5' }}>
+    ><View style={{ display: 'flex', flexDirection: 'column', minHeight: '101vh', backgroundColor: '#ffffff' }}>
 
-            <NewHeader type={NewHeaderType.left} title={pageYear()} whiteBg />
+            {/* {
+                journals.length>0 && historyYear(0)
+            } */}
+            {/* <NewHeader type={NewHeaderType.left} title={pageYear()} whiteBg /> */}
+            {
+                loaded && journals.length == 0 && historyYear(-1)
+            }
             {
                 markDoneTip()
             }
-            <View style={{ minHeight: '100vh', backgroundColor: '#fff', paddingTop: rpxToPx(60) }}>
+            <View style={{ backgroundColor: '#fff' }}>
                 {
                     journals.map((item, index) => {
 
@@ -577,6 +499,6 @@ export default function Journal() {
                     loaded && journals.length == 0 && <NoRecord />
                 }
             </View>
-            <ListFooter noMore={(journals.length > 0) && (total == journals.length)} loading={loading} />
+            <ListFooter noMore={(journals.length > 0) && (total == journals.length)} loading={loading && !((journals.length > 0) && (total == journals.length))} />
         </View></StickyDateList>
 }

+ 23 - 0
src/pages/account/JournalDetail.scss

@@ -45,4 +45,27 @@ body{
     flex-wrap: wrap;
     margin-top: 12px;
     // margin-bottom: 16px;
+}
+
+.share_btn_bg {
+    position: relative;
+    width: 80px;
+    height: 40px;
+}
+
+.share_icon_bg {
+    width: 80px;
+    height: 40px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.share_btn {
+    position: absolute;
+    opacity: 0;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
 }

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

@@ -1,4 +1,4 @@
-import { View, Image, Text } from "@tarojs/components";
+import { View, Image, Text, Button } from "@tarojs/components";
 import { useLoad, useRouter, useShareAppMessage } from "@tarojs/taro";
 import { useEffect, useState } from "react";
 import { useSelector } from "react-redux";
@@ -17,6 +17,7 @@ import formatMilliseconds from "@/utils/format_time";
 import SingleImage from "@/_health/components/single_img";
 import { journalDetail } from "@/services/health";
 import { useTranslation } from "react-i18next";
+import { IconShare } from "@/components/basic/Icons";
 
 let useRoute;
 let useNavigation;
@@ -29,7 +30,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 [shareUser, setShareUser] = useState<any>(null)
     const [imgs, setImgs] = useState<any>([])
     const [events, setEvents] = useState<any>([])
     const [loaded, setLoaded] = useState(false)
@@ -48,16 +49,25 @@ export default function JournalDetail() {
         router = useRouter()
     }
     const [data, setData] = useState<any>()
-    const [date,setDate] = useState<any>(router.params?router.params.date:0)
+    const [date, setDate] = useState<any>(router.params ? router.params.date : 0)
     // const [detail, setDetail] = useState(JSON.parse(router.params.detail))
 
     useEffect(() => {
-        if (date || router.params.window){
-            var params:any = {
+        Taro.getImageInfo({
+            src: './share_01.jpg',
+            success(result) {
+                debugger
+            },
+            fail(res) {
+                debugger
+            },
+        })
+        if (date || router.params.window) {
+            var params: any = {
                 window: router.params.window
             }
-            if (router.params.uid){
-                params.share_user_id=router.params.uid
+            if (router.params.uid) {
+                params.share_user_id = router.params.uid
             }
             journalDetail(date, params).then(res => {
                 if ((res as any).windows.length > 0 &&
@@ -66,23 +76,33 @@ export default function JournalDetail() {
                 ) {
                     setTitle((res as any).windows[0].events[0].time.timestamp)
                 }
-                if ((res as any).share_user){
+                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) => {
+            var title = t('health.share_my_journal')
+            if (router.params.window == 'EAT') {
+                title = t('health.share_my_food_journal')
+            }
+            else if (router.params.window == 'ACTIVE') {
+                title = t('health.share_my_activity_journal')
+            }
+            debugger
             return {
-                title: t('feature.track_time_duration.common.share_title'),
-                path: `pages/account/JournalDetail?date=${date}&uid=${user.id}&window=${router.params.window}`
+                title: title,
+                path: `pages/account/JournalDetail?date=${date}&uid=${user.id}&window=${router.params.window}`,
+                imageUrl: 'https://background-pictures.oss-cn-beijing.aliyuncs.com/windows/eat2.jpg'
+                // imageUrl:'/src/assets/_health/share_01.jpg'
             }
         })
     }
@@ -252,9 +272,9 @@ export default function JournalDetail() {
 
     return <View style={{ backgroundColor: '#fff' }}>
         <View className="journal_detail">
-            <Image className="header_avatar" src={shareUser?shareUser.avatar:user.avatar} mode="aspectFill" />
+            <Image className="header_avatar" src={shareUser ? shareUser.avatar : user.avatar} mode="aspectFill" />
             <View className="jounal_content">
-                <Text className="journal_nickname">{shareUser?shareUser.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) => {
@@ -288,11 +308,20 @@ export default function JournalDetail() {
                         />
                     })
                 }
-                <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.publish.timestamp).format('MMM D HH:mm') :
-                        dayjs(data.publish.timestamp).format('M月D日 HH:mm')
-                })}</Text>
+                <View style={{display:'flex',flexDirection:'row',justifyContent:'space-between',alignItems:'center',marginTop: rpxToPx(17),}}>
+                    <Text className="h24" style={{ color: MainColorType.g02,  lineHeight: rpxToPx(60) + 'px' }}>{t(data.publish.edited ? 'health.journal_updated' : 'health.journal_created', {
+                        date_time: global.language == 'en' ?
+                            dayjs(data.publish.timestamp).format('MMM D HH:mm') :
+                            dayjs(data.publish.timestamp).format('M月D日 HH:mm')
+                    })}</Text>
+                    <View className="share_btn_bg">
+
+                        <View className="share_icon_bg">
+                            <IconShare color={MainColorType.link + 'cc'} width={rpxToPx(32)} />
+                        </View>
+                        <Button className="share_btn" openType="share">1</Button>
+                    </View>
+                </View>
                 {/* <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>
 

+ 6 - 0
src/pages/account/Journal_副本.tsx

@@ -69,6 +69,12 @@ export default function Journal() {
         getJounalsData(1)
     }, [window])
 
+    useEffect(()=>{
+        return ()=>{
+            myScrollTop = 0
+        }
+    },[])
+
     useEffect(() => {
         console.log('last show status', showDate)
     }, [showDate])

+ 2 - 1
src/pages/account/PhotoWall.tsx

@@ -9,6 +9,7 @@ import Layout from "@/components/layout/layout";
 import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
 import NoRecord from "@/_health/components/no_record";
 import { useTranslation } from "react-i18next";
+import { rpxToPx } from "@/utils/tools";
 
 let useRoute;
 let useNavigation;
@@ -121,7 +122,7 @@ export default function PhotoWall() {
 
     function detail() {
         return <View style={{ display: 'flex', flexDirection: 'column' }}>
-            <View className="photo_wall2">
+            <View className="photo_wall2" style={{marginBottom:rpxToPx(60)}}>
                 {
                     list.map((item, index) => {
                         return <Image key={index}

BIN
src/pages/account/share_01.jpg


+ 2 - 1
src/pages/clock/Clock.tsx

@@ -274,7 +274,8 @@ export default function Clock() {
         <ClockNew onScroll={onScroll}>
             {
                 showCalendar && <Streak testInfo={null}
-                    top={scrollTop}
+                    // top={scrollTop}
+                    top={navigationBarHeight}
                     dismiss={() => {
                         setShowCalendar(false)
                     }}

+ 13 - 11
src/pages/clock/ClockNew.tsx

@@ -58,7 +58,7 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
 
     };
 
-    global.tapDone = ()=>{
+    global.tapDone = () => {
         setReminderAdd(true)
     }
 
@@ -77,12 +77,12 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
         Taro.getStorage({
             key: 'lastRefresh',
             success: function (res) {
-                if (res.data){
+                if (res.data) {
                     var oldTimestamp = parseInt(res.data)
                     var timestamp = new Date().getTime()
-                    for (var i=0;i<healthRef.current.refreshs.length;i++){
+                    for (var i = 0; i < healthRef.current.refreshs.length; i++) {
                         var item = healthRef.current.refreshs[i]
-                        if (timestamp>item && item>oldTimestamp){
+                        if (timestamp > item && item > oldTimestamp) {
                             global.refreshHistory()
                             console.log('强制刷新')
                             return
@@ -90,17 +90,17 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
                     }
                     console.log('暂不需要强制刷新')
                 }
-                
+
             },
             fail(res) {
-                console.log('load failed',res)
+                console.log('load failed', res)
                 global.refreshHistory()
             },
             complete: function () {
-                
+
             }
         })
-        
+
     }
 
     function checkTimeZone() {
@@ -266,7 +266,7 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
 
         const showAlert1 = await getStorage('148alert') || false;
         Taro.setStorage({ key: '148alert', data: true })
-        if (!showAlert1 && !health.finish_setup){
+        if (!showAlert1 && !health.finish_setup) {
             jumpPage('/_health/pages/guide_begin')
         }
 
@@ -338,7 +338,7 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
             }}
             onScroll={e => {
                 props.onScroll(e)
-                if (showDate && e.detail.scrollTop > 100){
+                if (showDate && e.detail.scrollTop > 100) {
                     dispatch(setTitle(t('health.recents')))
                 }
                 else if (e.detail.scrollTop > 100) {
@@ -370,7 +370,9 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
                     </View>
                 }
                 <MainSwiper count={count} pageChanged={pageChanged} typeChanged={typeChanged} />
-                <MainConsole type={type} />
+                {
+                    process.env.TARO_ENV=='weapp' && <MainConsole type={type} />
+                }
 
                 <MainHistory ref={historyRef2} updateDate={(e) => {
                     setShowDate(e.show)

+ 3 - 3
src/pages/discover/discover.tsx

@@ -97,7 +97,7 @@ export default function Discover() {
                     jumpPage('/_health/pages/fast_sleep')
                 }}
                 showLine={health.mode == 'FAST'}
-                icon={<Image className="active_icon" src={require('@assets/_health/fast.png')} />}
+                icon={<Image className="active_icon" src={require('@assets/_health/fast_sleep.png')} />}
                 title={t('health.fast_with_sleep')}
                 desc={<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
                     {
@@ -121,7 +121,7 @@ export default function Discover() {
         <View>
             <View className="discover_space" />
             <IconTitleCell
-                icon={<IconActive width={rpxToPx(32)} color={MainColorType.active} />}
+                icon={<Image style={{ width: rpxToPx(32), height: rpxToPx(32) }} src={require('@assets/_health/measurements.png')} />}
                 title={t('health.metric')}
                 onClick={() => {
                     if (!user.isLogin) {
@@ -155,7 +155,7 @@ export default function Discover() {
                     }
                     jumpPage('/_health/pages/long_fast')
                 }}
-                icon={<Image className="active_icon" src={require('@assets/_health/fast.png')} />}
+                icon={<Image className="active_icon" src={require('@assets/_health/long_fast.png')} />}
                 title={t('health.long_fast')}
                 desc={
                     longFastStatus()

+ 2 - 1
src/pages/workout/Workout.tsx

@@ -16,7 +16,8 @@ export default function Page() {
     useShareAppMessage((e) => {
       return {
         title: t('feature.workout.share_title'),
-        path: 'pages/workout/Workout'
+        path: 'pages/workout/Workout',
+        // imageUrl:'/src/assets/_health/share_01.jpg'
       }
     })
   }

+ 9 - 1
src/utils/time_format.ts

@@ -859,6 +859,13 @@ export class TimeFormatter {
     return false
   }
 
+  static isTomorrowday = (timestamp: number) => {
+    if (dayjs().format('YYYY-MM-DD') == dayjs(timestamp - 24 * 3600 * 1000).format('YYYY-MM-DD')) {
+      return true
+    }
+    return false
+  }
+
   static dayTagText = (begin: number, end: number) => {
     const date1 = dayjs(begin);
     const date2 = dayjs(end);
@@ -872,6 +879,7 @@ export class TimeFormatter {
     return ''
   }
 
+  //判断当天时间戳是否在本周
   static isTimestampInThisWeek = (timestamp) => {
     const date = new Date(timestamp);
 
@@ -890,7 +898,7 @@ export class TimeFormatter {
 
     // 判断时间戳是否在本周范围内
     return date >= startOfWeek && date <= endOfWeek;
-}
+  }
 
 }