Leon 1 jaar geleden
bovenliggende
commit
7294aa1b44

+ 0 - 2
src/_health/base/new_date_time_picker.tsx

@@ -39,11 +39,9 @@ export default function NewDateTimePicker(props: {
             else if (TimeFormatter.isTimestampInThisWeek(date.getTime())){
                 string = dt.format('dddd')
             }
-            debugger
             result.push(string)
             date.setDate(date.getDate() + 1)
         }
-        debugger
         return result
     }
 

+ 15 - 11
src/_record/pages/log_record.scss

@@ -12,15 +12,15 @@
     // flex-wrap: wrap;
     width: 750px;
     box-sizing: border-box;
-    padding-left: 40px;
+    padding-left: 26px;
     margin-top: 64px;
 }
 
 .operate_item {
     margin-right: 32px;
-    margin-bottom: 26px;
-    width: 670px;
-    height: 156px;
+    margin-bottom: 12px;
+    width: 698px;
+    height: 168px;
     display: flex;
     flex-direction: row;
     align-items: center;
@@ -30,14 +30,16 @@
     box-sizing: border-box;
 }
 
-.first_letter{
-    margin-left:30px;
+.first_letter {
+    margin-left: 50px;
     margin-right: 40px;
     background-color: rgba($color: #fff, $alpha: 0.5);
-    width:108px;
-    height:108px;
+    color: rgba($color: #000, $alpha: 0.75);
+    font-weight: bold;
+    width: 108px;
+    height: 108px;
     border-radius: 54px;
-    display:flex;
+    display: flex;
     align-items: center;
     justify-content: center;
 }
@@ -63,7 +65,7 @@
     background-color: #fff;
 }
 
-.input_content_placeholder{
+.input_content_placeholder {
     text-align: center;
 }
 
@@ -219,6 +221,7 @@
     right: 0;
     top: 0;
 }
+
 /* #endif */
 
 /* #ifdef rn */
@@ -241,6 +244,7 @@
     right: 0;
     top: 0;
 }
+
 /* #endif */
 
 
@@ -303,7 +307,7 @@
     flex-direction: column;
 }
 
-.share_btn1{
+.share_btn1 {
     display: flex;
     flex-direction: row;
     align-items: center;

+ 8 - 6
src/_record/pages/log_record.tsx

@@ -1,4 +1,4 @@
-import { View, Image, PageMeta, NavigationBar, Input, Textarea, ScrollView, Snapshot, PickerView, PickerViewColumn,Text } from "@tarojs/components";
+import { View, Image, PageMeta, NavigationBar, Input, Textarea, ScrollView, Snapshot, PickerView, PickerViewColumn, Text } from "@tarojs/components";
 import './log_record.scss'
 import { useEffect, useState } from "react";
 import Taro, { useRouter, useShareAppMessage } from "@tarojs/taro";
@@ -680,7 +680,9 @@ export default function LogRecord({ route }) {
                                 setStep(1)
                             }}><View className="first_letter h36">
                                 <Image src={BASE_IMG_URL + 'edit.svg'} style={{ width: rpxToPx(36), height: rpxToPx(36) }} />
-                            </View>{t('health.custom')}</View>
+                            </View>{t('health.custom')}
+                            <View style={{ flex: 1 }} />
+                            <IconAdd color={MainColorType.g02} width={rpxToPx(36)} /></View>
                     </View>
                 </View>
                 {/* </Snapshot> */}
@@ -773,8 +775,8 @@ export default function LogRecord({ route }) {
                                 setDesc(e.detail.value)
                             }} />
                         <View className="form2">
-                            
-                            
+
+
                             {
                                 pics.map((item, index) => {
                                     return <View className="cover1" key={index}>
@@ -839,9 +841,9 @@ export default function LogRecord({ route }) {
 
 
                 </View>
-                <View style={{width:300}}>
+                <View style={{ width: 300 }}>
                 </View>
-                
+
             </ScrollView>
         }
         {

+ 36 - 19
src/_record/pages/time_record.tsx

@@ -22,6 +22,7 @@ import { useTranslation } from "react-i18next";
 import FollowInfo from "@/_moment/components/follow_info";
 
 import MomentDetailShare from "@/pages/moment/moment_detail_share";
+import { BASE_IMG_URL } from "@/services/http/api";
 
 
 let timer
@@ -65,6 +66,7 @@ export default function TimeRecord() {
     const [postError, setPostError] = useState('')
 
     const [pickerTitle, setPickerTitle] = useState('')
+    const [themeColor, setThemeColor] = useState(MainColorType.orange)
 
     const { t } = useTranslation()
 
@@ -138,12 +140,13 @@ export default function TimeRecord() {
 
 
     useEffect(() => {
-        const { events } = record
-        events.map((item) => {
+        const { list } = record
+        list.map((item) => {
             if (item.scenario == scenario) {
-                setInfo(item)
-                setStatus(item.status)
+                setInfo(item.event)
+                setStatus(item.event.status)
                 setLoaded(true)
+                setThemeColor(item.theme_color)
             }
         })
         downloadFile()
@@ -159,10 +162,23 @@ export default function TimeRecord() {
 
     function downloadFile() {
         Taro.downloadFile({
-            url: 'https://background-pictures.oss-cn-beijing.aliyuncs.com/inapp/checkmark.png',
+            url: BASE_IMG_URL + 'cp_check_f.png',
             success: (res) => {
                 if (res.statusCode === 200) {
-                    global.checkImg = res.tempFilePath
+                    global.checkFastImg = res.tempFilePath
+
+                } else {
+                }
+            },
+            fail: (err) => {
+            }
+        });
+
+        Taro.downloadFile({
+            url: BASE_IMG_URL + 'cp_check_s.png',
+            success: (res) => {
+                if (res.statusCode === 200) {
+                    global.checkSleepImg = res.tempFilePath
 
                 } else {
                 }
@@ -345,7 +361,7 @@ export default function TimeRecord() {
             return {
                 value: '',
                 footer: '',
-                color: MainColorType.orange,
+                color: themeColor,
                 result: TimeFormatter.formateDurationBySeconds(info.time.end_timestamp / 1000 - info.time.start_timestamp / 1000),
             }
         }
@@ -356,7 +372,7 @@ export default function TimeRecord() {
             return {
                 target: str,
                 goal: t('health.adjust_goal'),
-                color: MainColorType.orange
+                color: themeColor
             }
         }
         var percent = 100 * (new Date().getTime() - info.time.start_timestamp) / info.time.duration
@@ -416,7 +432,7 @@ export default function TimeRecord() {
                     </View>
 
                 </View>
-                <View className="share_card2" style={{ background: MainColorType.orange, marginTop: rpxToPx(26) + navigationBarHeight }}>
+                <View className="share_card2" style={{ background: themeColor, marginTop: rpxToPx(26) + navigationBarHeight }}>
                     {/* {
                         shareUrl.length > 0 ? <Image src={shareUrl} style={{ width: rpxToPx(900), height: rpxToPx(720) }} /> :
                             <View style={{ width: rpxToPx(900), height: rpxToPx(720), backgroundColor: MainColorType.g02 }} />
@@ -430,13 +446,14 @@ export default function TimeRecord() {
                             width: rpxToPx(88)
                         }}
                         real={{
-                            color: MainColorType.orange,
+                            color: themeColor,
                             width: rpxToPx(16),
                             start: getStartArc(info.time.start_timestamp),
                             duration: getDurationArc(info.time.start_timestamp, info.time.end_timestamp)
                         }}
                         extra={ringExtra()}
-                        shareBg={[MainColorType.orange]}
+                        shareBg={[themeColor]}
+                        checkImgUrl={scenario == 'FAST' ? global.checkFastImg : global.checkSleepImg}
                         isCompleted
                         shareCover={
                             url => {
@@ -622,7 +639,7 @@ export default function TimeRecord() {
                             duration: status == 'WFS' ? getDurationArc(new Date().getTime(), new Date().getTime() + info.time.duration) : getDurationArc(info.time.start_timestamp, info.time.start_timestamp + info.time.duration)
                         }}
                         real={status == 'WFS' ? null : {
-                            color: MainColorType.orange,
+                            color: themeColor,
                             width: rpxToPx(88),
                             start: getStartArc(info.time.start_timestamp),
                             duration: getDurationArc(info.time.start_timestamp, new Date().getTime())
@@ -630,7 +647,7 @@ export default function TimeRecord() {
                         extra={ringExtra()}
                     />
                 </View>
-               
+
                 {
                     status == 'OG' && <View className="operate_content" style={{ marginTop: -rpxToPx(20) }}>
                         <NewButton type={NewButtonType.custom} onClick={() => {
@@ -640,7 +657,7 @@ export default function TimeRecord() {
                                 <View className={showHighlight ? 'card_highlight start_card_show' : ''} />
                                 <View className="black_50 h24">{scenario == 'FAST' ? t('health.started') : t('health.bedtime1')}</View>
                                 <View className="h44 bold" style={{ marginTop: rpxToPx(8), marginBottom: rpxToPx(8) }}>{TimeFormatter.abbrTimestampFormat(info.time.start_timestamp)}</View>
-                                <View className="h30 bold" style={{ color: MainColorType.orange }}>{scenario == 'FAST' ? t('health.adjust_start') : t('health.adjust_bedtime')}</View>
+                                <View className="h30 bold" style={{ color: themeColor }}>{scenario == 'FAST' ? t('health.adjust_start') : t('health.adjust_bedtime')}</View>
                             </View>
                         </NewButton>
                         <NewButton type={NewButtonType.custom} onClick={() => {
@@ -649,7 +666,7 @@ export default function TimeRecord() {
                             <View className="operate_item">
                                 <View className="black_50 h24">{t('health.time_goal', { time: TimeFormatter.formateDurationBySeconds(info.time.duration / 1000) })}</View>
                                 <View className="h44 bold" style={{ marginTop: rpxToPx(8), marginBottom: rpxToPx(8) }}>{TimeFormatter.abbrTimestampFormat(info.time.target_end_timestamp)}</View>
-                                <View className="h30 bold" style={{ color: MainColorType.orange }}>{t('health.adjust_goal')}</View>
+                                <View className="h30 bold" style={{ color: themeColor }}>{t('health.adjust_goal')}</View>
                             </View>
                         </NewButton>
                     </View>
@@ -660,7 +677,7 @@ export default function TimeRecord() {
                         title={scenario == 'FAST' ? record.actions.FAST_START : record.actions.SLEEP_BEDTIME}
                         width={rpxToPx(490)}
                         height={rpxToPx(108)}
-                        color={MainColorType.orange}
+                        color={themeColor}
                         onClick={start}
                     />
                 }
@@ -671,7 +688,7 @@ export default function TimeRecord() {
                         title={scenario == 'FAST' ? record.actions.FAST_END : record.actions.SLEEP_WAKE_UP}
                         width={rpxToPx(490)}
                         height={rpxToPx(108)}
-                        color={MainColorType.orange}
+                        color={themeColor}
                         onClick={end}
                     />
                         {/* <NewButton
@@ -775,7 +792,7 @@ export default function TimeRecord() {
                                     duration: status == 'WFS' ? getDurationArc(new Date().getTime(), new Date().getTime() + info.time.duration) : getDurationArc(info.time.start_timestamp, info.time.start_timestamp + info.time.duration)
                                 }}
                                 real={status == 'WFS' ? null : {
-                                    color: MainColorType.orange,
+                                    color: themeColor,
                                     width: rpxToPx(88),
                                     start: getStartArc(info.time.start_timestamp),
                                     duration: getDurationArc(info.time.start_timestamp, new Date().getTime())
@@ -906,6 +923,6 @@ export default function TimeRecord() {
         <MomentDetailShare
             user={user}
             canvas_id="time_record"
-            btnColor={MainColorType.orange} />
+            btnColor={themeColor} />
     </View>
 }

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

@@ -981,7 +981,6 @@ export default {
         fasting_with_sleep: 'Fasting with Sleep',
         long_fast: 'Long Fast',
         move_more: 'Move More',
-        move_every_hour: 'Move Every Hour',
 
         log_extra_meal: 'Log Extra Meal',
         log_extra_activity: 'Log Extra Activity',
@@ -1126,7 +1125,7 @@ export default {
 
         show_all: 'Show All ({{count}})',
         show_less: 'Show Less',
-        move_every_hour: 'Move Every Hour',
+        move_every_hour: 'Hourly Steps',
         long_fast_subtitle: 'Prolonged Fasting Beyond 24 Hours',
         fast_sleep_subtitle: 'Tune Into Your Circadian Rhythm',
 

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

@@ -982,7 +982,6 @@ export default {
         fasting_with_sleep: '断食与睡眠',
         long_fast: '长断食',
         move_more: '走一走',
-        move_every_hour: '每小时走一走',
 
         log_extra_meal: '记录额外一餐',
         log_extra_activity: '记录额外活动',
@@ -1129,7 +1128,7 @@ export default {
 
         show_all: '全部打卡 ({{count}})',
         show_less: '收起',
-        move_every_hour: '每小时走一走',
+        move_every_hour: '每小时步数',
         long_fast_subtitle: '24小时及更长时间的断食(辟谷)',
         fast_sleep_subtitle: '调整你的生物钟',
         start_fast: '开始断食',

+ 4 - 0
src/pages/clock/Clock.tsx

@@ -56,6 +56,10 @@ export default function Clock() {
     }
 
     useEffect(() => {
+        Taro.setNavigationBarColor({
+            backgroundColor:'#ffffff',
+            frontColor:'#ffffff'
+        })
         if (navigation) {
             navigation.setOptions({
                 headerTitle: '',

+ 35 - 2
src/pages/clock/ClockIndex.tsx

@@ -11,7 +11,7 @@ import dayjs from "dayjs";
 import 'dayjs/locale/zh-cn';
 import 'dayjs/locale/en';
 
-import { setActions, setEvents, setTimeData } from "@/store/record";
+import { setActions, setEvents, setSceanrioList, setTimeData } from "@/store/record";
 import { TimeFormatter } from "@/utils/time_format";
 import { getInfo } from "@/services/user";
 import Taro from "@tarojs/taro";
@@ -97,6 +97,38 @@ export default function ClockIndex() {
         durationPickerRef.current = showDurationPicker
     }, [showDatePicker, showDurationPicker, showEndDatePicker])
 
+    useEffect(()=>{
+        downloadFile()
+    },[])
+
+    function downloadFile() {
+        Taro.downloadFile({
+            url: BASE_IMG_URL+'cp_check_f.png',
+            success: (res) => {
+                if (res.statusCode === 200) {
+                    global.checkFastImg = res.tempFilePath
+
+                } else {
+                }
+            },
+            fail: (err) => {
+            }
+        });
+
+        Taro.downloadFile({
+            url: BASE_IMG_URL+'cp_check_s.png',
+            success: (res) => {
+                if (res.statusCode === 200) {
+                    global.checkSleepImg = res.tempFilePath
+
+                } else {
+                }
+            },
+            fail: (err) => {
+            }
+        });
+    }
+
     function getHomeData() {
         getWindows()
         homeInfo().then(res => {
@@ -106,6 +138,7 @@ export default function ClockIndex() {
 
             dispatch(setEvents((res as any).events))
             dispatch(setActions((res as any).actions))
+            dispatch(setSceanrioList((res as any).scenarios))
             if ((res as any).scenarios) {
                 setScenarios((res as any).scenarios)
                 var active_scenario = (res as any).active_scenario
@@ -346,7 +379,7 @@ export default function ClockIndex() {
     }
 
     function swiperHeight() {
-        return screenHeight - navigationBarHeight - rpxToPx(94) - rpxToPx(112) - bottomSafeAreaHeight + 4
+        return screenHeight - navigationBarHeight - rpxToPx(108) - rpxToPx(112) - bottomSafeAreaHeight + 4
     }
 
     if (!loaded) return <View />

+ 19 - 11
src/pages/clock/components/index_tab.scss

@@ -1,9 +1,11 @@
 .index_tabbar {
     width: 750px;
-    height: 94px;
+    height: 84px;
     display: flex;
     flex-direction: row;
     align-items: center;
+    margin-top: 12px;
+    margin-bottom: 12px;
 }
 
 .index_tabbar_item {
@@ -11,36 +13,42 @@
     flex-direction: column;
     align-items: center;
     position: relative;
-    justify-content: center;
-    height: 94px;
+    // justify-content: center;
+    height: 84px;
+    padding: 0 44px;
 }
 
 .tab_item_nor {
+    margin-top: 20px;
     font-size: 36px;
+    line-height: 44px;
     font-weight: bold;
-    color: rgba($color: #000000, $alpha: 0.4);
-    padding: 0 48px;
+    color: rgba($color: #000000, $alpha: 0.75);
+    
 }
 
 .tab_item_sel {
+    margin-top: 20px;
     font-size: 36px;
+    line-height: 44px;
     font-weight: bold;
     color: #000;
-    padding: 0 48px;
 }
 
 .tab_item_line{
-    width: 36px;
     height: 6px;
     background-color: transparent;
     border-radius: 3px;
-    margin-top: 12px;
+    margin-top: 14px;
 }
 
 .tab_item_line_sel{
-    width: 36px;
+    width: 61.8%;
+    display: flex;
+    // padding: 0 48px;
     height: 6px;
     background-color: #000;
-    border-radius: 3px;
-    margin-top: 12px;
+    border-radius: 4px;
+    margin-top: 14px;
+    overflow: hidden;
 }

+ 169 - 17
src/pages/clock/components/log_publish.tsx

@@ -1,4 +1,4 @@
-import { Textarea, View, Image, Input } from "@tarojs/components";
+import { Textarea, View, Image, Input, ScrollView } from "@tarojs/components";
 import './log_publish.scss'
 import { rpxToPx } from "@/utils/tools";
 import { useEffect, useState } from "react";
@@ -13,9 +13,10 @@ import { MainColorType } from "@/context/themes/color";
 import dayjs from "dayjs";
 import { addEvents } from "@/services/health";
 import { TimeFormatter } from "@/utils/time_format";
-import { BASE_IMG_URL } from "@/services/http/api";
+import { BASE_IMG_URL, baseUrl } from "@/services/http/api";
 import LogTags from "./log_tags";
 import PickerCard from "@/_record/components/picker_card";
+import showActionSheet from "@/components/basic/ActionSheet";
 
 let useRoute;
 let useNavigation;
@@ -51,19 +52,160 @@ export default function LogPublish(props: { onClose: any, scenario: string, tag?
     const [step, setStep] = useState(props.addTag ? 1 : 2)
     const [inputFocus, setInputFocus] = useState(false)
     const [showTimePicker, setShowTimePicker] = useState(false)
+    const [addEnter, setAddEnter] = useState(props.addTag ?? false)
 
     const { t } = useTranslation()
 
     useEffect(() => {
         if (step == 1) {
+
             setTimeout(() => {
                 setInputFocus(true)
             }, 300)
         }
+        else {
+            setAddEnter(false)
+        }
     }, [step])
 
-    function tapPic() {
+    function addImage(isCamera) {
+        var source: any = isCamera ? ['camera'] : ['album']
+        Taro.chooseImage({
+            count: 9 - pics.length,
+            sizeType: ['compressed'],
+            // mediaType: ['image'],
+            sourceType: source,
+            success: async function (res) {
+                const results = await Promise.all(res.tempFiles.map(getImageInfo));
+
+
+                chooseSuccess(results, true)
+                // checkAuthorized()
+            },
+            fail: function (res) {
+            }
+        })
+    }
+
+    async function chooseSuccess(res, isAlbum) {
+        // const filePaths = res.map(file => file.path
+        //     // process.env.TARO_ENV === 'rn' || isFilePath ? file.path : file.tempFilePath
+        // )
+        Taro.showLoading({
+            title: t('health.uploading')
+        })
 
+        try {
+            const uploadedUrls = await Promise.all(res.map(path => uploadFile2(path, isAlbum ? 'album' : 'camera')))
+            setPics([...pics, ...uploadedUrls])
+            Taro.hideLoading()
+        } catch (error) {
+            console.error('Error uploading files:', error)
+            Taro.hideLoading()
+        }
+    }
+
+    function uploadFile2(obj: any, source: string): Promise<string> {
+        return new Promise((resolve, reject) => {
+            var path = obj.path
+            const dot = path.lastIndexOf('.')
+            const fileExt = dot > 0 ? path.substring(dot) : ''
+            Taro.request({
+                method: 'GET',
+                timeout: 30000,
+                url: `${baseUrl}/api/thirdparty/aliyun/oss-form-upload`,
+                header: {
+                    'Authorization': 'bearer ' + global.token
+                },
+                data: {
+                    type: 'FOOD_JOURNAL',
+                    file_ext: fileExt
+                },
+                success: (rsp) => {
+                    if (rsp.statusCode !== 200) {
+                        reject(new Error(t('health.networkError')))
+                        return
+                    }
+                    Taro.uploadFile({
+                        timeout: 30000,
+                        url: rsp.data.upload_url,
+                        filePath: path,
+                        name: 'file',
+                        formData: rsp.data.fields,
+                        success: () => {
+                            var temp = JSON.parse(JSON.stringify(obj))
+                            temp.url = rsp.data.view_url
+                            // resolve(rsp.data.view_url)
+                            resolve(temp)
+                        },
+                        fail: (error) => {
+
+                            reject(error)
+                        }
+                    })
+                },
+                fail: reject
+            })
+        })
+    }
+
+
+    const getImageInfo = (src) => {
+        const { tempFilePath, path } = src
+        return new Promise((resolve) => {
+            Taro.getImageInfo({
+                src: tempFilePath ? tempFilePath : path,
+                success: (result) => resolve({
+                    height: result.height,
+                    width: result.width,
+                    orientation: result.orientation,
+                    path: result.path,
+                    type: result.type
+                }),
+                fail: (error) => resolve({
+                    height: 1024,
+                    width: 1024,
+                    orientation: 'up',
+                    path: tempFilePath,
+                    type: 'unknown'
+                }),
+            });
+        });
+    };
+
+    function tapPic() {
+        var list = process.env.TARO_ENV == 'weapp' ? [t('health.add_photos'), t('health.camera2'), t('health.import_chat')] :
+            [t('health.add_photos'), t('health.camera2')]
+        showActionSheet({
+            title: '',
+            // showActionSheetWithOptions: showActionSheetWithOptions,
+            itemList: list,
+            success: function (res) {
+                switch (res) {
+                    case 0:
+                        addImage(false)
+                        break;
+                    case 1:
+                        addImage(true)
+                        break;
+                    case 2:
+                        Taro.chooseMessageFile({
+                            count: 9 - pics.length,
+                            type: 'image',
+                            success: async function (res) {
+                                const results = await Promise.all(res.tempFiles.map(getImageInfo));
+                                chooseSuccess(results, true)
+                            },
+                            fail(res) {
+                            },
+                        })
+                        break;
+                    case 3:
+                        // setImgUrl('')
+                        break;
+                }
+            }
+        })
     }
 
     function save() {
@@ -322,19 +464,21 @@ export default function LogPublish(props: { onClose: any, scenario: string, tag?
     }
 
     function tagsContent() {
-        return <View style={{ display: 'flex', alignItems: 'center', flexDirection: 'column', marginTop: rpxToPx(26) }}>
-            <Image src={BASE_IMG_URL + 'tag.svg'} style={{ width: rpxToPx(96), height: rpxToPx(96), marginBottom: rpxToPx(24) }} />
-            <View className="h50 bold" style={{ textAlign: 'center', width: rpxToPx(600), }}>{t('health.add_a_tag')}</View>
-            <LogTags tags={props.tags} scenario={props.scenario} showPublish={(scenario, item, addTag) => {
-                // props.showPublish(scenario, item, tags)
-                if (addTag) {
-                    setStep(1)
-                    return
-                }
-                setTitle(item.title)
-                setStep(2)
-            }} />
-        </View>
+        return <ScrollView scrollY style={{height:screenHeight-navigationBarHeight}}>
+            <View style={{ display: 'flex', alignItems: 'center', flexDirection: 'column', marginTop: rpxToPx(26) }}>
+                <Image src={BASE_IMG_URL + 'tag.svg'} style={{ width: rpxToPx(96), height: rpxToPx(96), marginBottom: rpxToPx(24) }} />
+                <View className="h50 bold" style={{ textAlign: 'center', width: rpxToPx(600), }}>{t('health.add_a_tag')}</View>
+                <LogTags tags={props.tags} scenario={props.scenario} showPublish={(scenario, item, addTag) => {
+                    // props.showPublish(scenario, item, tags)
+                    if (addTag) {
+                        setStep(1)
+                        return
+                    }
+                    setTitle(item.title)
+                    setStep(2)
+                }} />
+            </View>
+        </ScrollView>
     }
 
     function addTagContent() {
@@ -355,6 +499,10 @@ export default function LogPublish(props: { onClose: any, scenario: string, tag?
                     <View className="form_cancel">
                         <NewButton btnStyle={{ flex: 1 }} type={NewButtonType.img}
                             onClick={() => {
+                                if (addEnter) {
+                                    props.onClose()
+                                    return
+                                }
                                 setStep(0)
                             }}
                         >
@@ -364,6 +512,7 @@ export default function LogPublish(props: { onClose: any, scenario: string, tag?
                     <View className="form_cancel">
                         <NewButton btnStyle={{ flex: 1 }} type={NewButtonType.img}
                             onClick={() => {
+
                                 if (!title || title.length == 0) return
                                 // setChooseTitle(title)
                                 // setPostCount(1)
@@ -405,7 +554,10 @@ export default function LogPublish(props: { onClose: any, scenario: string, tag?
                     top: 22 - rpxToPx(32)
                 }}
                     onClick={() => {
-
+                        if (addEnter) {
+                            props.onClose()
+                            return
+                        }
                         // if (showResult) {
                         //     process.env.TARO_ENV == 'weapp' ? Taro.navigateBack() : navigation.goBack()
                         //     return

+ 9 - 6
src/pages/clock/components/log_tags.scss

@@ -4,15 +4,16 @@
     // flex-wrap: wrap;
     width: 750px;
     box-sizing: border-box;
-    padding-left: 40px;
-    margin-top: 26px;
+    padding-left: 26px;
+    margin-top: 12px;
 }
 
 .tag_operate_item {
     margin-right: 32px;
-    margin-bottom: 26px;
-    width: 670px;
-    height: 156px;
+    margin-bottom: 12px;
+    width: 698px;
+    // height: 156px;
+    height: 168px;
     display: flex;
     flex-direction: row;
     align-items: center;
@@ -23,9 +24,11 @@
 }
 
 .tag_first_letter {
-    margin-left: 30px;
+    margin-left: 50px;
     margin-right: 40px;
     background-color: rgba($color: #fff, $alpha: 0.5);
+    color: rgba($color: #000, $alpha: 0.75);
+    font-weight: bold;
     width: 108px;
     height: 108px;
     border-radius: 54px;

+ 7 - 5
src/pages/clock/components/log_tags.tsx

@@ -9,7 +9,7 @@ import { useTranslation } from "react-i18next";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import { useSelector } from "react-redux";
 
-export default function LogTags(props: { tags: any, scenario: any, showPublish: any }) {
+export default function LogTags(props: { tags: any, scenario: any, showPublish: any, showMove?: boolean }) {
     const user = useSelector((state: any) => state.user);
     const { t } = useTranslation()
     return <View className="tag_operate_bg">
@@ -52,10 +52,12 @@ export default function LogTags(props: { tags: any, scenario: any, showPublish:
                 // setStep(1)
             }}><View className="tag_first_letter h36">
                 <Image src={BASE_IMG_URL + 'edit.svg'} style={{ width: rpxToPx(36), height: rpxToPx(36) }} />
-            </View>{t('health.custom')}</View>
+            </View>{t('health.custom')}
+            <View style={{ flex: 1 }} />
+            <IconAdd color={MainColorType.g02} width={rpxToPx(36)} /></View>
         {
-            props.scenario == 'ACTIVITY' && <View className="tag_operate_item h34"
-                style={{ backgroundColor: MainColorType.white_25, marginBottom: rpxToPx(100), marginTop: -rpxToPx(74) }}
+            props.showMove && props.scenario == 'ACTIVITY' && <View className="tag_operate_item h34"
+                style={{ backgroundColor: MainColorType.white_25, marginBottom: rpxToPx(100), marginTop: -rpxToPx(88) }}
                 onClick={() => {
                     if (!user.isLogin) {
                         jumpPage('/_account/pages/ChooseAuth', 'ChooseAuth')
@@ -64,7 +66,7 @@ export default function LogTags(props: { tags: any, scenario: any, showPublish:
                     jumpPage('/_health/pages/move')
                 }}><View className="tag_first_letter h36">
                     <Image src={BASE_IMG_URL + 'walk.svg'} style={{ width: rpxToPx(36), height: rpxToPx(36) }} />
-                </View>{global.language == 'en' ? 'Move' : '步数'}
+                </View>{global.language == 'en' ? 'Steps' : '步数'}
                 <View style={{ flex: 1 }} />
                 <IconArrow color={MainColorType.g02} width={rpxToPx(36)} />
             </View>

+ 6 - 2
src/pages/clock/components/record_log.tsx

@@ -46,6 +46,7 @@ export default function RecordLog(props: {
     edit?: any,
     check_in?: any,
     tags: any,
+    
 
 }) {
     const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
@@ -219,6 +220,7 @@ export default function RecordLog(props: {
 
     function tapPic() {
         //, t('health.delete')
+        console.log('aaaaa')
         var list = process.env.TARO_ENV == 'weapp' ? [t('health.add_photos'), t('health.camera2'), t('health.import_chat')] :
             [t('health.add_photos'), t('health.camera2')]
         showActionSheet({
@@ -576,7 +578,7 @@ export default function RecordLog(props: {
                     (scenario, item, addTag) => {
                         props.showPublish(scenario, item, tags, addTag)
                     }
-                } />
+                } showMove/>
             }
             {
                 step == 1 && <View className="cardShowAni" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(300) }}>
@@ -706,7 +708,9 @@ export default function RecordLog(props: {
                             {
                                 pics.length < 9 && <NewButton
                                     type={NewButtonType.custom}
-                                    onClick={tapPic}>
+                                    onClick={()=>{
+                                        tapPic()
+                                    }}>
                                     <View className="cover1" style={{}}><IconCamera color="#000" width={rpxToPx(48)} /></View>
                                 </NewButton>
                             }

+ 17 - 49
src/pages/clock/components/record_time.tsx

@@ -148,9 +148,6 @@ export default function RecordTime(props: {
         }
     }, [status, showDatePicker, showEndDatePicker, showDurationPicker])
 
-    useEffect(() => {
-        downloadFile()
-    }, [])
 
 
     useEffect(() => {
@@ -164,33 +161,7 @@ export default function RecordTime(props: {
         setCount(props.count)
     }, [props.count])
 
-    function downloadFile() {
-        Taro.downloadFile({
-            url: BASE_IMG_URL+'cp_check_f.png',
-            success: (res) => {
-                if (res.statusCode === 200) {
-                    global.checkFastImg = res.tempFilePath
 
-                } else {
-                }
-            },
-            fail: (err) => {
-            }
-        });
-
-        Taro.downloadFile({
-            url: BASE_IMG_URL+'cp_check_s.png',
-            success: (res) => {
-                if (res.statusCode === 200) {
-                    global.checkSleepImg = res.tempFilePath
-
-                } else {
-                }
-            },
-            fail: (err) => {
-            }
-        });
-    }
 
     function tapClock() {
         // if (status == 'WFS')
@@ -637,7 +608,7 @@ export default function RecordTime(props: {
     function render() {
 
         return <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
-            <View style={{ height: rpxToPx(26) }} />
+            <View style={{ height: rpxToPx(12) }} />
             <View className="progress_card">
                 <View onClick={() => {
                     if (!user.isLogin) {
@@ -731,19 +702,17 @@ export default function RecordTime(props: {
                         {/* <View onClick={more}>More</View> */}
                     </View>
                 }
-                {
+                {/* {
                     status == 'OG' && <View className="share_icon">
                         <ShareBtn>
                             <Image onClick={() => {
-                                // setShareUrl('')
-                                // setShowShare(true)
                             }} src={require('@assets/_health/wechat.png')} style={{
                                 width: rpxToPx(72),
                                 height: rpxToPx(72)
                             }} />
                         </ShareBtn>
                     </View>
-                }
+                } */}
 
 
             </View>
@@ -890,22 +859,21 @@ export default function RecordTime(props: {
             {
                 status == 'DONE' ? doneComponent() : render()
             }
-            {
-                scenario == 'FAST' && <NewButton type={NewButtonType.custom} onClick={() => {
-                    if (!user.isLogin) {
-                        jumpPage('/_account/pages/ChooseAuth', 'ChooseAuth')
-                        return
-                    }
-                    jumpPage('/_health/pages/fast_sleep')
-                }}>
-                    <View className="time_record_card">
-                        {global.language == 'en' ? 'Fast & Sleep' : '断食与睡眠'}
-                        <View className="timer_record_card_arrow">
-                            <IconArrow width={rpxToPx(34)} color={MainColorType.black_25} />
-                        </View>
+            <NewButton type={NewButtonType.custom} onClick={() => {
+                if (!user.isLogin) {
+                    jumpPage('/_account/pages/ChooseAuth', 'ChooseAuth')
+                    return
+                }
+                jumpPage('/_health/pages/fast_sleep')
+            }}>
+                <View className="time_record_card">
+                    {global.language == 'en' ? 'Fast & Sleep' : '断食与睡眠'}
+                    <View className="timer_record_card_arrow">
+                        <IconArrow width={rpxToPx(34)} color={MainColorType.black_25} />
                     </View>
-                </NewButton>
-            }
+                </View>
+            </NewButton>
+
             <NewButton type={NewButtonType.custom} onClick={() => {
                 if (!user.isLogin) {
                     jumpPage('/_account/pages/ChooseAuth', 'ChooseAuth')

+ 3 - 4
src/pages/clock/components/record_time_result.tsx

@@ -56,10 +56,9 @@ export default function RecordTimeResult(props: { onClose: any, scenario: string
             }
             Taro.eventCenter.trigger('refreshClockIndex')
             Taro.eventCenter.trigger('refreshMoments', '')
-            setInfo((res as any).data)
-            // setShowDatePicker(false)
-            // setShowDurationPicker(false)
-            // setShowEndDatePicker(false)
+            var dt = (res as any).data
+            dt.theme_color = info.theme_color
+            setInfo(dt)
             props.hidePicker()
             setCount((count) => count + 1)
             setPosting(false)

+ 7 - 2
src/store/record.tsx

@@ -6,12 +6,14 @@ interface RecordState {
     time: any,
     events: any,
     actions: any,
+    list: any,
 }
 
 const initialState: RecordState = {
     time: null,
     events: null,
-    actions: null
+    actions: null,
+    list: []
 }
 
 const recordSlice = createSlice({
@@ -28,9 +30,12 @@ const recordSlice = createSlice({
         setActions(state, action) {
             state.actions = action.payload
         },
+        setSceanrioList(state, action) {
+            state.list = action.payload
+        },
 
     }
 });
 
 export default recordSlice.reducer;
-export const { setTimeData, setEvents, setActions } = recordSlice.actions;
+export const { setTimeData, setEvents, setActions, setSceanrioList } = recordSlice.actions;