Leon 1 rok temu
rodzic
commit
0563f31091
43 zmienionych plików z 320 dodań i 160 usunięć
  1. 1 1
      src/_health/components/fast_sleep_console.tsx
  2. 4 0
      src/_health/components/list_footer.scss
  3. 5 2
      src/_health/components/list_footer.tsx
  4. 101 25
      src/_health/pages/add_moment.tsx
  5. 2 1
      src/_health/pages/log_time.tsx
  6. 3 1
      src/_health/pages/schedules.tsx
  7. 1 0
      src/_health/pages/streak_weekly.tsx
  8. 1 0
      src/_health/pages/timeline_detail.scss
  9. 48 7
      src/_health/pages/timeline_detail.tsx
  10. BIN
      src/assets/_health/no_more.png
  11. BIN
      src/assets/images/add.png
  12. BIN
      src/assets/images/add2.png
  13. BIN
      src/assets/images/pointer.png
  14. BIN
      src/assets/images/scale_center2.png
  15. 2 1
      src/components/basic/Buttons.tsx
  16. 9 2
      src/components/input/SlidngScale.scss
  17. 17 17
      src/components/input/SlidngScale.tsx
  18. 2 0
      src/context/locales/en.js
  19. 2 1
      src/context/locales/zh.js
  20. 6 2
      src/features/health/HistoryItem.tsx
  21. 9 8
      src/features/health/MainConsole.tsx
  22. 13 1
      src/features/health/MainHistory.tsx
  23. 5 1
      src/features/health/calendar.scss
  24. 5 4
      src/features/health/calendar.tsx
  25. 1 1
      src/features/trackSomething/components/Metric.tsx
  26. 5 7
      src/features/trackSomething/components/MetricHistory.scss
  27. 3 3
      src/features/trackSomething/components/MetricHistory.tsx
  28. 0 2
      src/features/trackSomething/components/MetricModalAdd.scss
  29. 6 8
      src/features/trackSomething/components/MetricModalAdd.tsx
  30. 2 3
      src/features/trackSomething/components/MetricModalChoose.scss
  31. 3 3
      src/features/trackSomething/components/MetricModalChoose.tsx
  32. 4 7
      src/features/trackTimeDuration/components/WeekCalendar.scss
  33. 12 12
      src/features/trackTimeDuration/components/WeekCalendar.tsx
  34. 0 2
      src/features/trackTimeDuration/components/WeekCalendarItem.scss
  35. 21 21
      src/features/trackTimeDuration/components/WeekCalendarItem.tsx
  36. 3 1
      src/pages/account/Album.tsx
  37. 3 1
      src/pages/account/Journal.tsx
  38. 1 1
      src/pages/clock/Clock.tsx
  39. 2 2
      src/pages/clock/Clock2.scss
  40. 0 8
      src/pages/clock/ClockNew.tsx
  41. 1 0
      src/pages/common/RecordsHistory.config.ts
  42. 6 4
      src/pages/common/RecordsHistory.tsx
  43. 11 0
      src/services/health.tsx

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

@@ -315,7 +315,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                     return <NewButton
                         color={item.timeline.target.timestamp >= new Date().getTime() ? MainColorType.g02 : getThemeColor(item.mode)}
                         type={item.timeline.target.timestamp >= new Date().getTime() ? NewButtonType.alpha2 : NewButtonType.alpha}
-                        title={'Log'}
+                        title={t('health.log')}
                         width={rpxToPx(128)}
                         height={rpxToPx(72)}
                         bold={true}

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

@@ -3,6 +3,10 @@
     height: 128px;
     flex-shrink: 0;
     margin-bottom: 10px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 750px;
 }
 .no_more {
     display: flex;

+ 5 - 2
src/_health/components/list_footer.tsx

@@ -1,10 +1,13 @@
-import { View,Text } from "@tarojs/components";
+import { View,Text,Image } from "@tarojs/components";
 import './list_footer.scss'
 
 export default function ListFooter(props:{noMore?:boolean}){
     return <View className="list_footer">
-        {
+        {/* {
             props.noMore&&<Text className="no_more g02">没有更多了</Text>
+        } */}
+        {
+            props.noMore&& <Image src={require('@assets/_health/no_more.png')} style={{width:68,height:4}}/>
         }
     </View>
 }

+ 101 - 25
src/_health/pages/add_moment.tsx

@@ -11,7 +11,7 @@ import Modal from "@/components/layout/Modal.weapp";
 import dayjs from "dayjs";
 import TimePicker from "@/features/common/TimePicker";
 import { MainColorType } from "@/context/themes/color";
-import { createMoment, getLabelsEvent } from "@/services/health";
+import { createMoment, getLabelsEvent, updateMoment } from "@/services/health";
 import { useDispatch, useSelector } from "react-redux";
 import { getThemeColor } from "@/features/health/hooks/health_hooks";
 import { setShowActionTip } from "@/store/health";
@@ -87,26 +87,42 @@ export default function AddMoment() {
                 // setShowTitlePicker(true)
             }
         })
+
+
+        if (router.params.edit) {
+            var detail = JSON.parse(router.params.detail)
+            setTitle(detail.title)
+            var moment = detail.moments[0]
+            setDesc(moment.description)
+            var timeObj = moment.time
+            setTime(dayjs(timeObj.timestamp).format('HH:mm'))
+            setSelDate(dayjs(timeObj.timestamp).format('YYYY-MM-DD'))
+            if (moment.media.length > 0) {
+                setImgUrl(moment.media[0].url)
+            }
+            debugger
+        }
     }, [])
 
-    useLoad(()=>{
-        Taro.enableAlertBeforeUnload({
-            message:'hhh',
-            success(res) {
-                
-            },
-            fail(res) {
-                
-            },
-            complete(res) {
-                
-            },
-        })
+    useLoad(() => {
+        if (!router.params.edit)
+            Taro.enableAlertBeforeUnload({
+                message: 'hhh',
+                success(res) {
+
+                },
+                fail(res) {
+
+                },
+                complete(res) {
+
+                },
+            })
     })
 
-    useUnload(()=>{
+    useUnload(() => {
         Taro.disableAlertBeforeUnload({
-            
+
         })
     })
 
@@ -140,7 +156,7 @@ export default function AddMoment() {
             count: 1,
             sizeType: ['compressed'],
             mediaType: ['image'],
-            sourceType: [isCamera?'camera':'album'],
+            sourceType: [isCamera ? 'camera' : 'album'],
             success: function (res) {
                 chooseSuccess(res, true)
                 checkAuthorized()
@@ -151,11 +167,15 @@ export default function AddMoment() {
     }
 
     function save() {
-        if (desc.length == 0 && imgUrl.length == 0) {
-            Taro.showToast({
-                icon: 'none',
-                title: '请输入描述或添加图片'
-            })
+        // if (desc.length == 0 && imgUrl.length == 0) {
+        //     Taro.showToast({
+        //         icon: 'none',
+        //         title: '请输入描述或添加图片'
+        //     })
+        //     return
+        // }
+        if (router.params.edit) {
+            edit()
             return
         }
         // var date = new Date(timestamp)
@@ -229,6 +249,61 @@ export default function AddMoment() {
         })
     }
 
+    function edit() {
+        var date = new Date(selDate + ' ' + time + ':00')
+
+        var params: any = {
+            schedule_id: schedule_id,
+            title: title,
+            description: desc,
+            start: {
+                date: dayjs(date.getTime()).format('YYYYMMDD'),
+                timestamp: date.getTime()
+            }
+        }
+
+
+        if (imgUrl.length > 0) {
+            params.media = [{
+                url: imgUrl,
+                type: imgUrl.indexOf('mp4') != -1 ? 'video' : 'image',
+                source: 'album'
+            }]
+        }
+        if (event_id && event_id != 'undefined') {
+            params.event_id = event_id
+        }
+
+        if (is_temp) {
+            params.event = health.mode == 'EAT' ? 'EAT_CUSTOM' : 'ACTIVE_CUSTOM'
+        }
+        // if (moment.target && moment.target.duration) {
+        //     params.duration = durationT//moment.target.duration
+        // }
+
+        if (durationT) {
+            params.duration = durationT * 60 * 1000
+        }
+
+
+        params.extra = {
+            set_time: global.set_time ? global.set_time : new Date().getTime(),
+            confirm_time: new Date().getTime()
+        }
+        updateMoment(params, router.params.id).then(res => {
+            if (process.env.TARO_ENV == 'weapp') {
+                Taro.navigateBack();
+                // Taro.redirectTo({
+                //     url: '/_health/pages/post_result?data=' + JSON.stringify(res)
+                // })
+            }
+
+            global.refreshWindow()
+            global.refreshHistory()
+            global.refreshMoment()
+        })
+    }
+
     async function chooseSuccess(res, isAlbum) {
         var params = {
             event: 'add_a_picture',
@@ -412,20 +487,21 @@ export default function AddMoment() {
 
             <Textarea placeholder="简单描述(选填)" className="textarea"
                 placeholder-style="color:#B2B2B2"
+                value={desc}
                 onInput={e => {
                     setDesc(e.detail.value)
                 }} />
 
             <View className="form">
                 {
-                    imgUrl.length > 0 && <View className="cover" ><NewButton type={NewButtonType.img} onClick={()=>addImage(false)}><Image src={imgUrl} mode="aspectFill" className="cover" onClick={addImage} /></NewButton></View>
+                    imgUrl.length > 0 && <View className="cover" ><NewButton type={NewButtonType.img} onClick={() => addImage(false)}><Image src={imgUrl} mode="aspectFill" className="cover" onClick={addImage} /></NewButton></View>
                 }
                 {
                     imgUrl.length == 0 && <View style={{ display: 'flex', flexDirection: 'row' }}>
-                        <View className="cover" ><NewButton type={NewButtonType.img} onClick={()=>addImage(false)}><View className="cover" >
+                        <View className="cover" ><NewButton type={NewButtonType.img} onClick={() => addImage(false)}><View className="cover" >
                             <Image src={require('@assets/_health/album.png')} style={{ width: 40, height: 40 }} />
                         </View></NewButton></View>
-                        <View className="cover" style={{marginLeft:rpxToPx(40)}}><NewButton type={NewButtonType.img} onClick={()=>addImage(true)}><View className="cover" >
+                        <View className="cover" style={{ marginLeft: rpxToPx(40) }}><NewButton type={NewButtonType.img} onClick={() => addImage(true)}><View className="cover" >
                             <Image src={require('@assets/_health/camera.png')} style={{ width: 40, height: 40 }} />
                         </View></NewButton></View>
                     </View>

+ 2 - 1
src/_health/pages/log_time.tsx

@@ -20,6 +20,7 @@ import NewDatePicker, { NewDatePickerType } from "../base/new_date_picker";
 import ChooseDateTime from "../components/choose_date_time";
 import { TimeFormatter } from "@/utils/time_format";
 import StatusIndicator, { StatusType } from "../base/status_indicator";
+import { t } from "i18next";
 
 let useRoute;
 let useNavigation;
@@ -798,7 +799,7 @@ export default function LogTime() {
             <NewButton
                 color={footerBtnColor()}
                 type={NewButtonType.fill}
-                title={'Log'}
+                title={t('health.log')}
                 width={rpxToPx(646)}
                 height={rpxToPx(96)}
                 disable={errors.length > 0}

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

@@ -21,6 +21,7 @@ import { AtSwipeAction } from "taro-ui"
 import ScheduleItem from "../components/schedule_item";
 import { useTranslation } from "react-i18next";
 import NewHeader, { NewHeaderType } from "../components/new_header";
+import ListFooter from "../components/list_footer";
 
 let useRoute;
 let useNavigation;
@@ -508,7 +509,8 @@ export default function Schedules() {
             }
 
 
-            <View style={{ height: 300, flexShrink: 0 }} />
+            {/* <View style={{ height: 100, flexShrink: 0 }} /> */}
+            <ListFooter />
 
             <View style={{ flex: 1 }} />
             {

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

@@ -6,6 +6,7 @@ import { rpxToPx } from "@/utils/tools";
 import { View, Text } from "@tarojs/components";
 import { useState } from "react";
 import { useTranslation } from "react-i18next";
+import '../../pages/clock/Clock2.scss'
 
 let GradientText
 if (process.env.TARO_ENV == 'rn') {

+ 1 - 0
src/_health/pages/timeline_detail.scss

@@ -5,6 +5,7 @@
     padding-bottom: 20px;
     display: flex;
     flex-direction: row;
+    box-sizing: border-box;
 }
 
 .detail_header_header{

+ 48 - 7
src/_health/pages/timeline_detail.tsx

@@ -20,6 +20,9 @@ import TimeTitleDesc from "../components/time_title_desc";
 import CoverList from "../components/cover_list";
 import ListFooter from "../components/list_footer";
 import showAlert from "@/components/basic/Alert";
+import showActionSheet from "@/components/basic/ActionSheet";
+import { useTranslation } from "react-i18next";
+import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 
 let timestamp = 0;
 let useRoute;
@@ -30,6 +33,7 @@ if (process.env.TARO_ENV == 'rn') {
     useNavigation = require("@react-navigation/native").useNavigation
 }
 export default function TimelineDetail() {
+    let showActionSheetWithOptions;
     const health = useSelector((state: any) => state.health);
     const user = useSelector((state: any) => state.user);
     const [list, setList] = useState<any>([])
@@ -45,6 +49,8 @@ export default function TimelineDetail() {
     const [time, setTime] = useState(dayjs().format('HH:mm'))
     const [selTime, setSelTime] = useState(dayjs().format('HH:mm'))
     const [selDate, setSelDate] = useState(dayjs().format('YYYY-MM-DD'))
+
+    const { t } = useTranslation()
     let router
     let navigation;
     if (useNavigation) {
@@ -84,6 +90,10 @@ export default function TimelineDetail() {
         }
     }, [desc, imgUrl])
 
+    global.refreshMoment = ()=>{
+        getDatas()
+    }
+
     function getDatas() {
         getEvents(event_id).then(res => {
             setLoaded(true)
@@ -236,13 +246,20 @@ export default function TimelineDetail() {
         return array;
     }
 
-    function tapMore() {
+    function edit() {
+        if (list.length == 0) return
+        var id = list[0].id
+        jumpPage(`./add_moment?edit=1&event_id=${event_id}&id=${id}&detail=${JSON.stringify(detail)}`)
+        // jumpPage('./add_moment?edit=1&event_id='+id+'&detail='+JSON.stringify(detail))
+    }
+
+    function del() {
         showAlert({
-            title:'删除',
-            content:'确认删除此记录吗?',
-            showCancel:true,
-            confirm:()=>{
-                delEvents(event_id).then(res=>{
+            title: '删除',
+            content: '确认删除此记录吗?',
+            showCancel: true,
+            confirm: () => {
+                delEvents(event_id).then(res => {
                     Taro.navigateBack()
                     global.refreshWindow()
                     // global.refreshHistory()
@@ -251,9 +268,33 @@ export default function TimelineDetail() {
         })
     }
 
+    function tapMore() {
+        var list: any = []
+        if (health.mode != 'ACTIVE' && health.mode != 'EAT') {
+            list = ['删除']
+        }
+        else {
+            list = ['编辑', '删除']
+        }
+        showActionSheet({
+            showActionSheetWithOptions: showActionSheetWithOptions,
+            title: t('health.more_actions'),
+            itemList: list,
+            success: (res) => {
+                if (res == 0 && (health.mode == 'ACTIVE' || health.mode == 'EAT')) {
+                    edit()
+                }
+                else {
+                    del()
+                }
+            }
+        })
+
+    }
+
     if (!loaded) return <View />
 
-    return <View style={{ display: 'flex', flex: 1 }}>
+    return <View style={{ display: 'flex', flex: 1, flexDirection: 'column' }}>
         <View className="detail_header">
             <Image className="detail_header_header"
                 src={user.avatar}

BIN
src/assets/_health/no_more.png


BIN
src/assets/images/add.png


BIN
src/assets/images/add2.png


BIN
src/assets/images/pointer.png


BIN
src/assets/images/scale_center2.png


+ 2 - 1
src/components/basic/Buttons.tsx

@@ -104,7 +104,8 @@ export default function Buttons(props: {
             <Text
                 // onClick={onClick}
                 style={{
-                    color: props.btnStyle.color,
+                    // color: props.btnStyle.color,
+                    color:'#fff',
                     fontSize: props.btnStyle.fontSize,
                     fontWeight: 'bold',
                     marginBottom: 2

+ 9 - 2
src/components/input/SlidngScale.scss

@@ -139,7 +139,7 @@
     top: 0;
     height: 120px;
     width: 375px;
-    background: linear-gradient(90deg, #1C1C1C 1%, rgba(28, 28, 28, 0) 100%);
+    background: linear-gradient(90deg, #ffffff 1%, rgba(255, 255, 255, 0) 100%);
     z-index: 100;
 }
 
@@ -150,7 +150,7 @@
     top: 0;
     height: 120px;
     width: 375px;
-    background: linear-gradient(90deg, rgba(28, 28, 28, 0) 1%, #1C1C1C 100%);
+    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 1%, #ffffff 100%);
     z-index: 100;
 }
 
@@ -171,6 +171,13 @@
 
 /* #endif */
 
+// .center_line {
+//     width: 24px;
+//     height: 30px;
+//     position: absolute;
+//     left: 363px;
+//     top: -12px;
+// }
 .center_line {
     width: 24px;
     height: 30px;

+ 17 - 17
src/components/input/SlidngScale.tsx

@@ -216,7 +216,7 @@ export default function Component(props: {
     if (isFT_IN) {
         for (var i = 0; i < 12; i++) {
             var obj = list[i];
-            svgLine += `<line x1="${i * 12 + 1}" y1="0" x2="${i * 12 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="${props.themeColor}"  stroke-width="2"/>`
+            svgLine += `<line x1="${i * 12 + 1}" y1="0" x2="${i * 12 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="#999999"  stroke-width="2"/>`
 
         }
     }
@@ -224,7 +224,7 @@ export default function Component(props: {
         for (var i = 0; i < 10; i++) {
             var obj = list[i];
             if (obj)
-                svgLine += `<line x1="${i * 10 + 1}" y1="0" x2="${i * 10 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="${props.themeColor}"  stroke-width="2"/>`
+                svgLine += `<line x1="${i * 10 + 1}" y1="0" x2="${i * 10 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="#999999"  stroke-width="2"/>`
 
         }
     }
@@ -233,7 +233,7 @@ export default function Component(props: {
         var obj = list[i];
         if (obj.showBig) {
             //字体设置参考 https://segmentfault.com/a/1190000006110417
-            svgNumber += `<text x="${i * (isFT_IN ? 12 : 10) + 1 + 30}" y="${rpxToPx(2 + 36)}" text-anchor="middle" fill="white"  font-size="${rpxToPx(36)}">${isFT_IN ? parseInt('' + obj.value / 12) : obj.value}</text>`
+            svgNumber += `<text x="${i * (isFT_IN ? 12 : 10) + 1 + 30}" y="${rpxToPx(2 + 36)}" text-anchor="middle" fill="#999999"  font-size="${rpxToPx(36)}">${isFT_IN ? parseInt('' + obj.value / 12) : obj.value}</text>`
         }
     }
     svgLine += `</svg>`
@@ -250,14 +250,14 @@ export default function Component(props: {
     if (isFT_IN) {
         for (var i = 0; i < 12; i++) {
             var obj = list[i];
-            svgLine2 += `<line x1="${i * 12 + 1}" y1="0" x2="${i * 12 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="${props.themeColor}"  stroke-width="2"/>`
+            svgLine2 += `<line x1="${i * 12 + 1}" y1="0" x2="${i * 12 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="#999999"  stroke-width="2"/>`
         }
     }
     else {
         for (var i = 0; i < 10; i++) {
             var obj = list[i];
             if (obj)
-                svgLine2 += `<line x1="${i * 10 + 1}" y1="0" x2="${i * 10 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="${props.themeColor}"  stroke-width="2"/>`
+                svgLine2 += `<line x1="${i * 10 + 1}" y1="0" x2="${i * 10 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="#999999"  stroke-width="2"/>`
         }
     }
 
@@ -268,29 +268,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={{ 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">{parseInt(current / 12 + '')}</Text>)
+                    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 && <Text className="unit" style={{ marginRight: 2 }}>ft</Text>}
                 {
-                    current % 12 > 0 && (process.env.TARO_ENV == 'weapp' ? <Text className="number" style={{ 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">{current % 12}</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 && <Text className="unit">in</Text>
+                    current % 12 > 0 && <Text className="unit" style={{color:props.themeColor}}>in</Text>
                 }
             </View>
         }
         {
             !isFT_IN && <View className="number_bg" style={{ opacity: enableText ? 1 : 0.4 }}>
                 {
-                    process.env.TARO_ENV == 'weapp' ? <Text className="number" style={{ fontFamily: "PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;" }}>{current}</Text> :
-                        <Text className="number">{current}</Text>
+                    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>
                 }
 
-                <Text className="unit">{props.unit}</Text>
+                <Text className="unit" style={{color:props.themeColor}}>{props.unit}</Text>
             </View>
         }
 
@@ -309,7 +309,7 @@ export default function Component(props: {
                     zIndex: 100,
                     pointerEvents: 'none'
                 }}
-                    colors={['#1C1C1C', 'rgba(28, 28, 28, 0)']}
+                    colors={['#ffffff', 'rgba(255, 255, 255, 0)']}
                     start={{ x: 0, y: 0 }}
                     end={{ x: 1, y: 0 }} pointerEvents="none" />
             }
@@ -323,11 +323,11 @@ export default function Component(props: {
                     zIndex: 100,
                     pointerEvents: 'none'
                 }}
-                    colors={['#1C1C1C', 'rgba(28, 28, 28, 0)']}
+                    colors={['#ffffff', 'rgba(255, 255, 255, 0)']}
                     start={{ x: 1, y: 0 }}
                     end={{ x: 0, y: 0 }} pointerEvents="none" />
             }
-            <View className="top_line" style={{ backgroundColor: props.themeColor }} />
+            <View className="top_line" style={{ backgroundColor: '#999999' }} />
             <ScrollView
                 style={{ zIndex: 0, position: 'relative', marginTop: -60 }} ref={scrollViewRef}
                 showsHorizontalScrollIndicator={false}
@@ -375,7 +375,7 @@ export default function Component(props: {
 
 
 
-            <Image className="center_line" src={require('@assets/images/scale_center.png')} />
+            <Image className="center_line" src={require('@assets/images/scale_center2.png')} />
             {/* <View className="center_line" /> */}
         </View>
 

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

@@ -940,5 +940,7 @@ export default {
         ok:'OK',
 
         logging:'logging',
+
+        log:'Log',
     }
 }

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

@@ -939,6 +939,7 @@ export default {
 
         ok:'我知道了',
 
-        logging:'记录中'
+        logging:'记录中',
+        log:'记录'
     }
 }

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

@@ -25,7 +25,8 @@ export default function HistoryItem(props: {
     isArchived?: boolean,
     refresh?: Function,
     mode: string,
-    fast_type?: string
+    fast_type?: string,
+    hideLine?:boolean
 }) {
     const health = useSelector((state: any) => state.health);
     let showActionSheetWithOptions;
@@ -286,6 +287,9 @@ export default function HistoryItem(props: {
             </View>
         </View>
 
-        <View className="border_footer_line" />
+        {
+            !props.hideLine && <View className="border_footer_line" />
+        }
+        
     </View>
 }

+ 9 - 8
src/features/health/MainConsole.tsx

@@ -146,14 +146,15 @@ export default function MainConsole(props: { type: WindowType }) {
     }
 
     function operateTitle(item) {
-        switch (item.action) {
-            case 'START':
-            case 'END':
-                return '打卡'
-            case 'MARK_DONE':
-                return 'Action'
-        }
-        return '记录'
+        return t('health.log')
+        // switch (item.action) {
+        //     case 'START':
+        //     case 'END':
+        //         return '打卡'
+        //     case 'MARK_DONE':
+        //         return 'Action'
+        // }
+        // return '记录'
     }
 
     function itemTitle(item: any) {

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

@@ -17,6 +17,7 @@ import NoRecord from "@/_health/components/no_record";
 import ListFooter from "@/_health/components/list_footer";
 
 let lastMode = ''
+let myScrollTop = 0
 export default forwardRef((props: { type?: string, fast_type?: string, updateDate?: any, refreshSuccess?: any }, ref) => {
     const [itemLayouts, setItemLayouts] = useState<any>([])
     const [list, setList] = useState<any>([])
@@ -78,7 +79,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
             var layouts: any = []
             res.forEach((rect, index) => {
                 if (rect) {
-                    layouts[index] = rect.top
+                    layouts[index] = rect.top + myScrollTop
                 }
             });
             setItemLayouts(layouts)
@@ -87,6 +88,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
 
     function onScroll(e) {
         var top = e.detail.scrollTop
+        myScrollTop = top
         if (itemLayouts.length > 0) {
             var i = -1
             var date = ''
@@ -199,6 +201,15 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         return <View />
     }
 
+    function hideLine(index) {
+        var currentDate = dayjs(list[index].window_range.start_timestamp).format('YYYY年M月D日')
+        if (list.length > index + 1) {
+            var nextDate = dayjs(list[index+1].window_range.start_timestamp).format('YYYY年M月D日')
+            if (currentDate == nextDate) return true
+        }
+        return false
+    }
+
     if (!loaded || health.mode == 'DAY' || health.mode == 'NIGHT')
         return <View />
 
@@ -265,6 +276,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                         index={index}
                         mode={props.type ?? health.mode}
                         fast_type={props.fast_type}
+                        hideLine={hideLine(index)}
                         onClick={() => {
                             jumpPage('/_health/pages/moment_detail')
                         }} />

+ 5 - 1
src/features/health/calendar.scss

@@ -74,6 +74,7 @@
     background-color: #26B7FF1A;
     border-top-left-radius: 30px;
     border-bottom-left-radius: 30px;
+    width: 94px;
 }
 
 .right_calendar_item {
@@ -87,6 +88,7 @@
     background-color: #26B7FF1A;
     border-top-right-radius: 30px;
     border-bottom-right-radius: 30px;
+    width: 94px;
 }
 
 .full_calendar_item {
@@ -99,6 +101,7 @@
     flex-shrink: 0;
     background-color: #26B7FF1A;
     border-radius: 30px;
+    width: 94px;
 }
 
 .today1 {
@@ -171,6 +174,7 @@
     justify-content: center;
     flex-shrink: 0;
     background-color: #26B7FF1A;
+    width: 94px;
 }
 
 .calendar_item {
@@ -180,7 +184,7 @@
     align-items: center;
     justify-content: center;
     flex-shrink: 0;
-
+    width: 94px;
 }
 
 .left_day {

+ 5 - 4
src/features/health/calendar.tsx

@@ -40,7 +40,8 @@ export default function Calendar(props: { year: number, month: number, mode: str
         const firstDayOfWeek = firstDay.getDay();
         const spaceCount = firstDayOfWeek > indexBeginWeek ? firstDayOfWeek - indexBeginWeek : firstDayOfWeek - indexBeginWeek + 7
         setSpaces(new Array(spaceCount).fill(''))
-
+        if (spaceCount==7)
+            setSpaces([])
 
 
 
@@ -262,13 +263,13 @@ export default function Calendar(props: { year: number, month: number, mode: str
                 <View className="calendar_main3">
                     {
                         spaces.map((item, i) => {
-                            return <View className="calendar_item" style={{ width: rpxToPx(94) }} key={i * 10} />
+                            return <View className="calendar_item" key={i * 10} />
                         })
                     }
                     {
                         days.map((item, index) => {
                             if (item.isToday && item.right) {
-                                return <View key={index} className="calendar_item" style={{ width: rpxToPx(94), position: 'relative' }}>
+                                return <View key={index} className="calendar_item" style={{  position: 'relative' }}>
                                     <View className="full_right_today" style={{ backgroundColor: getThemeColor(props.mode) + '33' }} />
                                     <View className="fullToday">
                                         <View className="today3" />
@@ -276,7 +277,7 @@ export default function Calendar(props: { year: number, month: number, mode: str
                                     <Text >{item.day}</Text>
                                 </View>
                             }
-                            return <View className={itemClass(item)} style={{ width: rpxToPx(94), backgroundColor: bgColor(item), position: 'relative' }} key={index}>
+                            return <View className={itemClass(item)} style={{  backgroundColor: bgColor(item), position: 'relative' }} key={index}>
                                 {
                                     !item.full && item.isToday && <View className="today2" />
                                 }

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

@@ -287,7 +287,7 @@ export default function Component(props: any) {
                 }
                 {
                     user.isLogin && list.length > 0 && <View className="add_more" onClick={chooseMore}>
-                        <Image style={{ width: rpxToPx(48), height: rpxToPx(48) }} src={require('@assets/images/add2.png')} />
+                        <Image style={{ width: rpxToPx(72), height: rpxToPx(72) }} src={require('@assets/images/add2.png')} />
                         <Text className="add_more_text" style={{color:props.theme_color}}>{t('feature.workout.add_more')}</Text>
                     </View>
                 }

+ 5 - 7
src/features/trackSomething/components/MetricHistory.scss

@@ -7,7 +7,6 @@
     line-height: 80px;
     opacity: 0.8;
     font-size: 48px;
-    color: #fff;
     font-weight: 500;
 }
 
@@ -25,7 +24,6 @@
     margin-top: 16px;
     height: 32px;
     line-height: 32px;
-    color: #fff;
     opacity: 0.4;
 }
 
@@ -36,7 +34,7 @@
     display: flex;
     flex-direction: row;
     align-items: center;
-    background-color: #1C1C1C;
+    background-color: #fff;
     border-radius: $boxBorderRadius;
     padding-left: 40px;
     padding-right: 40px;
@@ -56,17 +54,17 @@
 .status_text{
     font-size: 30px;
     font-weight: 500;
-    color: #fff;
+    color: #000;
 }
 .value{
     font-size: 48px;
     // margin-left: 24px;
-    color: #fff;
+    color: #000;
     font-weight: 500;
 }
 
 .unit{
-    color: #fff;
+    color: #000;
     margin-top: 8px;
     font-size: 32px;
     font-weight: 500;
@@ -74,7 +72,7 @@
 
 .time{
     font-size: 28px;
-    color: rgba($color: #ffffff, $alpha: 0.5);
+    color: rgba($color: #000, $alpha: 0.5);
     font-weight: 400;
 }
 

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

@@ -169,9 +169,9 @@ export default function Component(props: { records: any[] }) {
                 lastYearStr = TimeFormatter.getYearByDate(item.date)
                 return <View style={{ display: 'flex', flexDirection: 'column', paddingBottom: index < list.length - 1 ? 0 : 80, zIndex: index == selIndex[0] ? 1 : 0 }}>
                     {
-                        showYear && <Text className="year" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>{TimeFormatter.getYearByDate(item.date)}</Text>
+                        showYear && <Text className="year g01" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>{TimeFormatter.getYearByDate(item.date)}</Text>
                     }
-                    <Text className="operate_day" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>{TimeFormatter.getMonthAndDayByDate(item.date)}</Text>
+                    <Text className="operate_day g03" 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) => {
@@ -213,7 +213,7 @@ export default function Component(props: { records: any[] }) {
                                     <View style={{ display: 'flex', flexDirection: 'column', zIndex: 100, position: 'absolute', alignItems: 'center', top: rpxToPx(125), left: 30 }}>
                                         <Image src={require('@assets/images/pointer.png')} style={{ width: 32, height: 12, marginBottom: -2 }} />
                                         <View style={{
-                                            backgroundColor: '#505050',
+                                            backgroundColor: '#000',
                                             width: 82,
                                             borderRadius: 12,
                                             boxSizing: 'border-box',

+ 0 - 2
src/features/trackSomething/components/MetricModalAdd.scss

@@ -14,7 +14,5 @@
 
 .time{
     height: 60px;
-    color: #fff;
-    opacity: 0.4;
     line-height: 60px;
 }

+ 6 - 8
src/features/trackSomething/components/MetricModalAdd.tsx

@@ -79,7 +79,7 @@ export default function Component(props: { item: any, strTime: string, showPicke
                             }
                             {
                                 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: '#fff', opacity: 0.2, fontSize: 12,paddingTop:10,paddingBottom:10 }} onClick={(e) => {
+                                    <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()
                                         }
@@ -89,7 +89,7 @@ export default function Component(props: { item: any, strTime: string, showPicke
                                         selUnit == index && <View style={{ display: 'flex', flexDirection: 'column', position: 'absolute', alignItems: 'center', top: 25, right: -10 }}>
                                             <Image src={require('@assets/images/pointer.png')} style={{ width: 32, height: 12, marginBottom: -2 }} />
                                             <View style={{
-                                                backgroundColor: '#505050',
+                                                backgroundColor: '#000',
                                                 width: 82,
                                                 borderRadius: 12,
                                                 boxSizing: 'border-box',
@@ -157,7 +157,7 @@ export default function Component(props: { item: any, strTime: string, showPicke
                                                         }}>
                                                             <View style={{ width: 12 }} />
                                                             <Image style={{ width: 12, height: 9, marginRight: 7, opacity: chosen_unit == obj.unit ? 1 : 0 }} src={require('@assets/images/check_white.png')} />
-                                                            <Text style={{ color: '#fff', fontSize: 12 }}>{obj.special == 'FT_IN' ? 'ft in' : obj.unit}</Text>
+                                                            <Text style={{ color: (metricItem as any).theme_color, fontSize: 12 }}>{obj.special == 'FT_IN' ? 'ft in' : obj.unit}</Text>
                                                         </View>
                                                     })
                                                 }
@@ -193,10 +193,8 @@ export default function Component(props: { item: any, strTime: string, showPicke
                                     special={obj.special ?? null}
                                     themeColor={(metricItem as any).theme_color}
                                     changed={(e) => {
-                                        debugger
                                         item.tempValue = e;
                                         item.tempUnit = obj.unit ? obj.unit : item.default_unit
-                                        debugger
                                     }}
                                     updateStatus={(isEnable) => {
                                         setEnable(isEnable)
@@ -208,8 +206,8 @@ export default function Component(props: { item: any, strTime: string, showPicke
                 }
             </View>
             <View className="change_time_bg" >
-                <View className="gray1 time_bg" onClick={() => { props.showPicker(metricItem) }}>
-                    <Text className="time" >{props.strTime}</Text>
+                <View className=" time_bg" style={{backgroundColor:'#9999991A'}} onClick={() => { props.showPicker(metricItem) }}>
+                    <Text className="time g02" >{props.strTime}</Text>
                 </View>
 
             </View>
@@ -225,7 +223,7 @@ export default function Component(props: { item: any, strTime: string, showPicke
                         props.confirm(metricItem)
                     }
                 }}>
-                    <Text className='modal_confirm_text' style={{ color: '#000', fontWeight: 'bold' }}>{
+                    <Text className='modal_confirm_text' style={{ color: '#fff', fontWeight: 'bold' }}>{
                         t('feature.common.picker_confirm_btn')
                     }</Text>
                 </View>

+ 2 - 3
src/features/trackSomething/components/MetricModalChoose.scss

@@ -12,12 +12,11 @@
     font-size: 40px;
     line-height: 40px;
     font-weight: bold;
-    color: #fff;
+    color: #000;
 }
 
 .modal_subtitle{
     margin-top: 16px;
-    color: #fff;
     opacity: 0.4;
     font-size: 28px;
     line-height: 28px;
@@ -50,7 +49,7 @@
     font-size: 36px;
     line-height: 48px;
     font-weight: bold;
-    color: #fff;
+    color: #000;
     opacity: 0.8;
 }
 

+ 3 - 3
src/features/trackSomething/components/MetricModalChoose.tsx

@@ -146,7 +146,7 @@ export default function Component(props: {
     return <View className='modal_content'>
         <View className='modal_title_view'>
             <Text className='modal_title1'>{props.isWorkout ? t('feature.workout.choose_workout') : t('feature.track_something.metric.choose_metric')}</Text>
-            <Text className='modal_subtitle'>{props.isWorkout ? t('feature.workout.choose_workout_desc') : t('feature.track_something.metric.choose_metric_desc')}</Text>
+            <Text className='modal_subtitle g01'>{props.isWorkout ? t('feature.workout.choose_workout_desc') : t('feature.track_something.metric.choose_metric_desc')}</Text>
         </View>
         <ScrollView className='modal_detail' scrollY>
             <View>
@@ -158,7 +158,7 @@ export default function Component(props: {
                                 item.items.map((obj, i) => {
                                     return <View className='modal_item' onClick={() => tapItem(obj)}>
                                         {
-                                            obj.is_following ? <IconRadioCheck width={16} color='#fff' /> : <IconRadio width={16} color='#fff' />
+                                            obj.is_following ? <IconRadioCheck width={16} color='#d9d9d9' /> : <IconRadio width={16} color='#d9d9d9' />
                                         }
 
                                         <Text className='modal_item_text' style={{ color: color, marginLeft: 10, marginRight: 10 }}>{obj.name}</Text>
@@ -192,7 +192,7 @@ export default function Component(props: {
             </View>
             <View className='btn_space' />
             <View className='modal_btn' style={{ backgroundColor: color }} onClick={confirm}>
-                <Text className='modal_confirm_text' style={{ color: '#000', fontWeight: 'bold' }}>{t('feature.common.btn_next')}</Text>
+                <Text className='modal_confirm_text' style={{ color: '#fff', fontWeight: 'bold' }}>{t('feature.common.btn_next')}</Text>
             </View>
 
 

+ 4 - 7
src/features/trackTimeDuration/components/WeekCalendar.scss

@@ -15,7 +15,6 @@
 .calendar_summary_title {
     font-size: 32px;
     line-height: 32px;
-    color: #fff;
     opacity: 0.6;
 }
 
@@ -31,7 +30,6 @@
     font-size: 22px;
     line-height: 24px;
     margin-left: 8px;
-    color: #fff;
     opacity: 0.6;
     letter-spacing: -0.5;
 }
@@ -56,7 +54,7 @@
 .chart_bg {
     width: 750px;
     height: 520px;
-    background-color: #212121;
+    background-color: #fff;
     display: flex;
     flex-direction: row;
     position: relative;
@@ -80,7 +78,7 @@
     top: 60px;
     bottom: 60px;
     border-radius: 0;
-    background: linear-gradient(180deg, #1C1C1C, #000000, #1C1C1C);
+    background: linear-gradient(180deg, #fff, #d9d9d9, #fff);
 }
 
 .chart_content_bg2 {
@@ -90,7 +88,7 @@
     top: 60px;
     bottom: 60px;
     border-radius: 0;
-    background: linear-gradient(180deg, #000000, #1C1C1C, #000000);
+    background: linear-gradient(180deg, #d9d9d9, #fff, #d9d9d9);
 }
 
 /* #endif */
@@ -130,9 +128,8 @@
 .chart_times_txt {
     font-size: 16px;
     line-height: 16px;
-    color: #fff;
-    opacity: 0.4;
     position: absolute;
+    opacity: 0.4;
 }
 
 .calendar-arrow-bg {

+ 12 - 12
src/features/trackTimeDuration/components/WeekCalendar.tsx

@@ -290,7 +290,7 @@ const WeekCalendar = memo((props: { isFastSleep: boolean }) => {
                         </View>
                 }
                 <View className="calendar_summary_item">
-                    <Text className="calendar_summary_title">{props.isFastSleep ? t('feature.track_time_duration.weekly.fast_average') : t('feature.track_time_duration.weekly.eat_average')}</Text>
+                    <Text className="calendar_summary_title g01">{props.isFastSleep ? t('feature.track_time_duration.weekly.fast_average') : t('feature.track_time_duration.weekly.eat_average')}</Text>
                     <Text className="calendar_summary_value" style={{ color: props.isFastSleep ? ColorType.fast : ColorType.food }}>{!summary || (props.isFastSleep ? summary.fast.avg == 0 : summary.eat.avg == 0) ? t('feature.track_time_duration.record_fast_sleep.none') : TimeFormatter.calculateTimeDifference(new Date().getTime(), new Date().getTime() + (props.isFastSleep ? summary.fast.avg : summary.eat.avg))}</Text>
                 </View>
             </View>
@@ -314,7 +314,7 @@ const WeekCalendar = memo((props: { isFastSleep: boolean }) => {
         </View>
         <View style={{ display: 'flex', flexDirection: 'row', marginBottom: rpxToPx(16), alignItems: 'center' }}>
             <View className="calendar_this_week" >{getWeekIndex()}</View>
-            <Text className="calendar_summary_desc">{getWeekDuration()}</Text>
+            <Text className="calendar_summary_desc g01">{getWeekDuration()}</Text>
 
         </View>
 
@@ -367,18 +367,18 @@ const WeekCalendar = memo((props: { isFastSleep: boolean }) => {
                 </View>
                 {
                     props.isFastSleep ? <View className="chart_times" style={{ marginTop: parseInt(rpxToPx(60) + ''), marginBottom: parseInt(rpxToPx(60) + '') }}>
-                        <Text className="chart_times_txt" style={{ left: 0, top: 0 }}>12:00</Text>
-                        <Text className="chart_times_txt" style={{ left: 0, top: parseInt(rpxToPx(100 - 7) + '') }}>18:00</Text>
-                        <Text className="chart_times_txt" style={{ left: 0, top: parseInt(rpxToPx(200 - 5) + '') }}>24:00</Text>
-                        <Text className="chart_times_txt" style={{ left: 0, top: parseInt(rpxToPx(300 - 5) + '') }}>06:00</Text>
-                        <Text className="chart_times_txt" style={{ left: 0, bottom: 0 }}>12:00</Text>
+                        <Text className="chart_times_txt g01" style={{ left: 0, top: 0 }}>12:00</Text>
+                        <Text className="chart_times_txt g01" style={{ left: 0, top: parseInt(rpxToPx(100 - 7) + '') }}>18:00</Text>
+                        <Text className="chart_times_txt g01" style={{ left: 0, top: parseInt(rpxToPx(200 - 5) + '') }}>24:00</Text>
+                        <Text className="chart_times_txt g01" style={{ left: 0, top: parseInt(rpxToPx(300 - 5) + '') }}>06:00</Text>
+                        <Text className="chart_times_txt g01" style={{ left: 0, bottom: 0 }}>12:00</Text>
                     </View> :
                         <View className="chart_times" style={{ marginTop: parseInt(rpxToPx(60) + ''), marginBottom: parseInt(rpxToPx(60) + '') }}>
-                            <Text className="chart_times_txt" style={{ left: 0, top: 0 }}>00:00</Text>
-                            <Text className="chart_times_txt" style={{ left: 0, top: parseInt(rpxToPx(100 - 7) + '') }}>06:00</Text>
-                            <Text className="chart_times_txt" style={{ left: 0, top: parseInt(rpxToPx(200 - 5) + '') }}>12:00</Text>
-                            <Text className="chart_times_txt" style={{ left: 0, top: parseInt(rpxToPx(300 - 5) + '') }}>18:00</Text>
-                            <Text className="chart_times_txt" style={{ left: 0, bottom: 0 }}>24:00</Text>
+                            <Text className="chart_times_txt g01" style={{ left: 0, top: 0 }}>00:00</Text>
+                            <Text className="chart_times_txt g01" style={{ left: 0, top: parseInt(rpxToPx(100 - 7) + '') }}>06:00</Text>
+                            <Text className="chart_times_txt g01" style={{ left: 0, top: parseInt(rpxToPx(200 - 5) + '') }}>12:00</Text>
+                            <Text className="chart_times_txt g01" style={{ left: 0, top: parseInt(rpxToPx(300 - 5) + '') }}>18:00</Text>
+                            <Text className="chart_times_txt g01" style={{ left: 0, bottom: 0 }}>24:00</Text>
                         </View>
                 }
 

+ 0 - 2
src/features/trackTimeDuration/components/WeekCalendarItem.scss

@@ -38,8 +38,6 @@
 .chart_week_text {
     font-size: 20px;
     line-height: 20px;
-    color: #fff;
-    opacity: 0.4;
     position: absolute;
     // width: 94px;
     // margin-left: 0px;

+ 21 - 21
src/features/trackTimeDuration/components/WeekCalendarItem.tsx

@@ -190,22 +190,22 @@ export default function WeekCalendarItem(props: { data: any, isCurrentWeek: bool
         <View style={{ height: parseInt(rpxToPx(60) + '') }}>
             {
                 props.isFastSleep ? <View className="chart_top_week">
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(0) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 0 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(0)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 1) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 1 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(1)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 2) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 2 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(2)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 3) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 3 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(3)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 4) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 4 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(4)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 5) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 5 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(5)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 6) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 6 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(6)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(0) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 0 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(0)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 1) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 1 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(1)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 2) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 2 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(2)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 3) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 3 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(3)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 4) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 4 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(4)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 5) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 5 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(5)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 6) + ''), opacity: props.isCurrentWeek && isTop() && weekIndex() == 6 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(6)}</Text>
                 </View> :
                     <View className="chart_top_week">
-                        <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(0) + ''), opacity: props.isCurrentWeek  && weekIndex() == 6 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(0)}</Text>
-                        <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 1) + ''), opacity: props.isCurrentWeek  && weekIndex() == 0 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(1)}</Text>
-                        <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 2) + ''), opacity: props.isCurrentWeek  && weekIndex() == 1 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(2)}</Text>
-                        <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 3) + ''), opacity: props.isCurrentWeek  && weekIndex() == 2 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(3)}</Text>
-                        <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 4) + ''), opacity: props.isCurrentWeek  && weekIndex() == 3 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(4)}</Text>
-                        <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 5) + ''), opacity: props.isCurrentWeek  && weekIndex() == 4 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(5)}</Text>
-                        <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 6) + ''), opacity: props.isCurrentWeek  && weekIndex() == 5 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(6)}</Text>
+                        <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(0) + ''), opacity: props.isCurrentWeek  && weekIndex() == 6 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(0)}</Text>
+                        <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 1) + ''), opacity: props.isCurrentWeek  && weekIndex() == 0 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(1)}</Text>
+                        <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 2) + ''), opacity: props.isCurrentWeek  && weekIndex() == 1 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(2)}</Text>
+                        <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 3) + ''), opacity: props.isCurrentWeek  && weekIndex() == 2 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(3)}</Text>
+                        <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 4) + ''), opacity: props.isCurrentWeek  && weekIndex() == 3 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(4)}</Text>
+                        <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 5) + ''), opacity: props.isCurrentWeek  && weekIndex() == 4 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(5)}</Text>
+                        <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 6) + ''), opacity: props.isCurrentWeek  && weekIndex() == 5 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(6)}</Text>
                     </View>
             }
 
@@ -273,13 +273,13 @@ export default function WeekCalendarItem(props: { data: any, isCurrentWeek: bool
         {
             props.isFastSleep && <View style={{ height: parseInt(rpxToPx(60) + '') }}>
                 <View className="chart_bottom_week">
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(0) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 0 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(1)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 1) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 1 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(2)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 2) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 2 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(3)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 3) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 3 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(4)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 4) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 4 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(5)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 5) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 5 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(6)}</Text>
-                    <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 6) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == -1 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(0)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(0) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 0 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(1)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 1) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 1 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(2)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 2) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 2 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(3)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 3) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 3 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(4)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 4) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 4 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(5)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 5) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == 5 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(6)}</Text>
+                    <Text className="chart_week_text g01" style={{ left: parseInt(rpxToPx(94 * 6) + ''), opacity: props.isCurrentWeek && !isTop() && weekIndex() == -1 ? 1 : 0.4 }}>{TimeFormatter.getDayOfWeek(0)}</Text>
                 </View>
             </View>
         }

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

@@ -15,6 +15,7 @@ import StickyDateList from "@/_health/components/sticky_date_list";
 import ListFooter from "@/_health/components/list_footer";
 import CoverList from "@/_health/components/cover_list";
 
+let myScrollTop = 0
 export default function Album() {
 
     const [medias, setMedias] = useState<any>([])
@@ -110,7 +111,7 @@ export default function Album() {
             var layouts: any = []
             res.forEach((rect, index) => {
                 if (rect) {
-                    layouts[index] = rect.top
+                    layouts[index] = rect.top+myScrollTop
                 }
             });
             setItemLayouts(layouts)
@@ -119,6 +120,7 @@ export default function Album() {
 
     function onScroll(e) {
         var top = e.detail.scrollTop
+        myScrollTop = top
         if (itemLayouts.length > 0) {
             var i = -1
             var date = ''

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

@@ -13,6 +13,7 @@ import { MainColorType } from "@/context/themes/color";
 import ListFooter from "@/_health/components/list_footer";
 import TimeTitleDesc from "@/_health/components/time_title_desc";
 
+let myScrollTop = 0
 export default function Journal() {
     const [journals, setJournals] = useState<any>([])
     const [isPulling, setIsPulling] = useState(false)
@@ -93,7 +94,7 @@ export default function Journal() {
             var layouts: any = []
             res.forEach((rect, index) => {
                 if (rect) {
-                    layouts[index] = rect.top
+                    layouts[index] = rect.top+myScrollTop
                 }
             });
             setItemLayouts(layouts)
@@ -102,6 +103,7 @@ export default function Journal() {
 
     function onScroll(e) {
         var top = e.detail.scrollTop
+        myScrollTop = top
         if (itemLayouts.length > 0) {
             var i = -1
             var date = ''

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

@@ -261,7 +261,7 @@ export default function Clock() {
                 confirm={() => { }}>
                 <View style={{ display: 'flex', flexDirection: 'column' }}>
                     <View style={{ height: navigationBarHeight }} />
-                    <Calendar year={2024} month={10} mode={health.mode}/>
+                    <Calendar year={2024} month={new Date().getMonth()+1} mode={health.mode}/>
                 </View>
             </Streak>
         }

+ 2 - 2
src/pages/clock/Clock2.scss

@@ -81,8 +81,8 @@
 
 .index_section_title {
     // background-color: red;
-    color: #fff;
-    opacity: 0.6;
+    color: #000;
+    // opacity: 0.6;
     font-size: 48px;
     font-weight: bold;
 }

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

@@ -1,9 +1,6 @@
 import { View, ScrollView, Swiper, SwiperItem, Image } from "@tarojs/components";
 import './Clock.scss'
 import { useEffect, useRef, useState } from "react";
-import MainDayNightCard from "@/features/health/MainDayNightCard";
-import MainFastEatCard from "@/features/health/MainFastEatCard";
-import MainSleepActiveCard from "@/features/health/MainSleepActiveCard";
 import TabBar from "@/components/navigation/TabBar";
 import { compareVersion, rpxToPx } from "@/utils/tools";
 import MainSwiper from "@/features/health/MainSwiper";
@@ -14,9 +11,6 @@ import { getArchived, windows } from "@/services/health";
 import { useDispatch, useSelector } from "react-redux";
 import health, { setEatArchived, setFastWithSleep, setFinishSetup, setLongFast, setRefreshs, setTitle, setWindows } from "@/store/health";
 import dayjs from "dayjs";
-import Modal from "@/components/layout/Modal.weapp";
-import Streak from "@/features/health/Streak";
-import Calendar from "@/features/health/calendar";
 import { MainColorType } from "@/context/themes/color";
 import NewButton, { NewButtonType } from "@/_health/base/new_button";
 import { getThemeColor } from "@/features/health/hooks/health_hooks";
@@ -35,8 +29,6 @@ export default function ClockNew() {
     const user = useSelector((state: any) => state.user);
     const health = useSelector((state: any) => state.health);
     const [type, setType] = useState(WindowType.day)
-    const [showCalendar, setShowCalendar] = useState(false)
-    const [showSection, setShowSection] = useState(false)
     const [needShowAddTip, setNeedShowAddTip] = useState(false)
     const [reminderAdd,setReminderAdd] = useState(true)
     const [showDate, setShowDate] = useState(false)

+ 1 - 0
src/pages/common/RecordsHistory.config.ts

@@ -2,5 +2,6 @@ export default definePageConfig({
     "disableScroll": false,
     "navigationBarTitleText":"",
     "enablePullDownRefresh":true,
+    "navigationBarBackgroundColor":"#f5f5f5"
     // "enablePageMeta":true
 })

+ 6 - 4
src/pages/common/RecordsHistory.tsx

@@ -19,6 +19,7 @@ import { clearWorkoutRecords, workoutRecords } from "@/services/workout";
 import WorkoutHistory from "@/features/workout/WorkoutHistory";
 import showAlert from "@/components/basic/Alert";
 import { rpxToPx } from "@/utils/tools";
+import NoRecord from "@/_health/components/no_record";
 
 let useRoute;
 let useNavigation;
@@ -379,7 +380,7 @@ export default function Page() {
         if (router.params.type == 'time') {
             return <View>
                 {
-                    process.env.TARO_ENV == 'weapp' && user.test_user && <Text style={{ color: '#fff', position: 'absolute', right: 50, top: 0 }} onClick={() => global.clearHistory()}>删除全部</Text>
+                    process.env.TARO_ENV == 'weapp' && user.test_user && <Text style={{ color: '#000', position: 'absolute', right: 50, top: 0 }} onClick={() => global.clearHistory()}>删除全部</Text>
                 }
                 {
                     filters()
@@ -437,9 +438,10 @@ export default function Page() {
             titleShowStyle={NaviBarTitleShowType.scrollToShow}
         />
         {
-            loaded && records.length == 0 && <View className="no_records_bg">
-                <Text className="no_records">{t('feature.common.no_data.no_record')}</Text>
-            </View>
+            loaded && records.length == 0 && <NoRecord />
+            // <View className="no_records_bg">
+            //     <Text className="no_records">{t('feature.common.no_data.no_record')}</Text>
+            // </View>
         }
 
         {

+ 11 - 0
src/services/health.tsx

@@ -181,6 +181,17 @@ export const createMoment = (params) => {
     })
 }
 
+export const updateMoment = (params,id) => {
+    return new Promise((resolve) => {
+        request({
+            url: API_HEALTH_MOMENT+'/'+id, method: 'PUT', data: { ...params }
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        })
+    })
+}
+
 export const updateEventDuration = (id, duration) => {
     return new Promise((resolve) => {
         request({