leon 1 vuosi sitten
vanhempi
commit
6399549720

+ 3 - 1
src/_health/base/new_durationpicker.tsx

@@ -15,6 +15,8 @@ export default function NewDurationPicker(props: { value?: any, onChange?: any,
     const [items, setItems] = useState<any>([[0]])
     const [values, setValues] = useState<any>([0])
     const [loaded, setLoaded] = useState(false)
+
+    console.log('picker value',props.value)
     useEffect(() => {
         switch (props.type) {
             case DurationPickerType.normal:
@@ -93,7 +95,7 @@ export default function NewDurationPicker(props: { value?: any, onChange?: any,
         var days: string[] = []
 
         for (let i = min; i <= max; i++) {
-            days.push(i + TimeFormatter.getDaysUnit(i))
+            days.push(i + TimeFormatter.getDaysUnit(i,true))
         }
 
         var hours: string[] = []

+ 9 - 2
src/_health/components/choose_date_time.tsx

@@ -93,7 +93,7 @@ export default function ChooseDateTime(props: {
         if (TimeFormatter.isTomorrowday(props.targetTimestamp!)){
             return TimeFormatter.getTomorrowUnit()+' '
         }
-        return global.languange=='en'?dayjs(props.targetTimestamp).format('MMM D'):dayjs(props.targetTimestamp).format('MMMD日')
+        return global.language=='en'?dayjs(props.targetTimestamp).format('MMM D '):dayjs(props.targetTimestamp).format('MMMD日')
 
     }
 
@@ -127,7 +127,14 @@ export default function ChooseDateTime(props: {
             }
             {/* <View className="h34" style={{color:props.color}}>{dateTitle()} {timeTitle()}</View> */}
             {
-                !props.title ? <View className="h44" style={{ color: props.color }}>{dateTitle()} {timeTitle()}</View> :
+                !props.title ? <View className="h44" style={{ color: props.color }}
+                onClick={() => {
+                    // setChooseDate(false)
+                    if (props.choose) {
+                        props.choose()
+                    }
+                }}
+                >{dateTitle()} {timeTitle()}</View> :
                     <View style={{
                         borderColor: props.showError ? 'red' : (props.expand && !chooseDate) ? props.color : 'transparent',
                         borderWidth: rpxToPx(2),

+ 9 - 6
src/_health/components/console_cell.scss

@@ -21,15 +21,18 @@
 .timeline_desc {
     font-size: 24px;
     line-height: 34px;
+    // width: 400px;
+    height: 34px;
+    overflow: hidden;
     // width: 500px;
-    flex: 1;
+    // flex: 1;
     // color: #B2B2B2;
     // white-space: nowrap;
-    // display: -webkit-box;
-    // -webkit-box-orient: vertical;
-    // overflow: hidden;
-    // -webkit-line-clamp: 1; // 限制为一行
-    // text-overflow: ellipsis; // 超出部分显示省略号
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    -webkit-line-clamp: 1; // 限制为一行
+    text-overflow: ellipsis; // 超出部分显示省略号
     white-space: nowrap;
     /* 不换行 */
     overflow: hidden;

+ 0 - 13
src/_health/components/fast_sleep_console.scss

@@ -31,19 +31,6 @@
   
 }
 
-.timeline_desc {
-    font-size: 24px;
-    line-height: 34px;
-    width: 500px;
-    // color: #B2B2B2;
-    white-space: nowrap;
-    display: -webkit-box;
-    -webkit-box-orient: vertical;
-    overflow: hidden;
-    -webkit-line-clamp: 1; // 限制为一行
-    text-overflow: ellipsis; // 超出部分显示省略号
-}
-
 .timeline_thirdspace {
     height: 12px;
     margin-top: 5px;

+ 4 - 1
src/_health/components/no_record.tsx

@@ -2,11 +2,14 @@ import { View, Image } from "@tarojs/components";
 import './no_record.scss'
 import { rpxToPx } from "@/utils/tools";
 import { MainColorType } from "@/context/themes/color";
+import { useTranslation } from "react-i18next";
 
 export default function NoRecord() {
+    const {t} = useTranslation()
+
     return <View className="no_more_bg">
         {/* <Image style={{width:rpxToPx(160),height:rpxToPx(160)}} src={require('@assets/_health/null.png')}/> */}
         <View style={{ height: rpxToPx(188) }} />
-        <View className="h30 bold g03">暂无数据</View>
+        <View className="h30 bold g03">{t('health.no_data')}</View>
     </View>
 }

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

@@ -120,7 +120,7 @@ export default function FastSleep() {
             <View className="page_container">
                 <NewHeader type={health.fast_with_sleep.status != 'OG2_MISALIGNED' ? NewHeaderType.left_subtitle : NewHeaderType.left}
                     title={t('health.fast_with_sleep')}
-                    subtitle={health.fast_with_sleep.status != 'OG2_MISALIGNED' ? 'Tune Into Your Circadian Rhythm ' : ''}
+                    subtitle={health.fast_with_sleep.status != 'OG2_MISALIGNED' ? t('health.fast_sleep_subtitle') : ''}
                 />
                 {
                     health.fast_with_sleep.status != 'OG2_MISALIGNED' && <Swiper indicatorColor='#59595933'

+ 32 - 9
src/_health/pages/log_time.tsx

@@ -143,14 +143,33 @@ export default function LogTime() {
     }
 
     function getLongDuration() {
-        var day = Math.floor(longDuration / 24)
-        var hour = longDuration % 24
-        var str = ''
-        if (day > 0)
-            str = day + '天'
-        if (hour > 0)
-            str += hour + '小时'
+        // var day = Math.floor(longDuration / 24)
+        // var hour = longDuration % 24
+        // var str = ''
+        // if (day > 0)
+        //     str = day + '天'
+        // if (hour > 0)
+        //     str += hour + '小时'
+        // return str
+
+        var days = Math.floor(longDuration / 24)
+        var hours = longDuration % 24
+
+        var str = `${days} 天`
+        if (global.language == 'en') {
+            str = days == 1 ? `${days} day` : `${days} days`
+        }
+        if (hours > 0) {
+            if (global.language == 'en') {
+                str = hours == 1 ? `${str} ${hours} hr` : `${str} ${hours} hrs`
+            }
+            else {
+                str = `${str} ${hours} 小时`
+            }
+
+        }
         return str
+
     }
 
     function initDatas(res = data) {
@@ -992,7 +1011,7 @@ export default function LogTime() {
                 return <Card>
                     <View style={{ position: 'relative' }}>
                         <View className="card_header" style={{ justifyContent: 'space-between' }}>
-                            <View className="h34" style={{ marginLeft: rpxToPx(12) }}>LongFast Goal</View>
+                            <View className="h34" style={{ marginLeft: rpxToPx(12) }}>{t('health.goal')}</View>
                             <NewButton
                                 type={expandIndex == -1 ? NewButtonType.alpha : NewButtonType.gray}
                                 color={isFast ? MainColorType.fast : MainColorType.sleep}
@@ -1001,6 +1020,9 @@ export default function LogTime() {
                                 fontNormal
                                 onClick={() => { setExpandIndex(-1) }}
                             />
+                            {
+                                expandIndex == -1 && <View className="border_footer_line" style={{ left: rpxToPx(40),right:rpxToPx(40) }}/>
+                            }
                             {/* </View> */}
                         </View>
                         {
@@ -1026,7 +1048,8 @@ export default function LogTime() {
                 return <Card>
                     <View style={{ position: 'relative' }}>
                         <View className="card_header" style={{ justifyContent: 'space-between' }}>
-                            <View className="h34" style={{ marginLeft: rpxToPx(12) }}>{isFast ? 'Fast Goal' : 'Sleep Goal'}</View>
+                        <View className="h34" style={{ marginLeft: rpxToPx(12) }}>{t('health.goal')}</View>
+                            {/* <View className="h34" style={{ marginLeft: rpxToPx(12) }}>{isFast ? 'Fast Goal' : 'Sleep Goal'}</View> */}
                             {/* <View style={{
                             borderColor: expandIndex == -1 ? isFast ? MainColorType.fast : MainColorType.sleep : 'transparent',
                             borderWidth: rpxToPx(2),

+ 63 - 38
src/_health/pages/long_fast.tsx

@@ -63,6 +63,11 @@ export default function LongFast() {
         }
     }, [])
 
+    useEffect(() => {
+        if (health.long_fast && health.long_fast.extra && health.long_fast.extra.long_fast_goal)
+            setDuration(health.long_fast.extra.long_fast_goal / 60)
+    }, [health.long_fast])
+
     useEffect(() => {
         pauseTime = editDuration
     }, [editDuration])
@@ -93,7 +98,7 @@ export default function LongFast() {
     function tapLog() {
         var item = long_fast.timeline[0]
         const { event_id, schedule_id } = item
-        jumpPage(`/_health/pages/timeline_detail?event_id=${event_id}&schedule_id=${schedule_id}`)
+        jumpPage(`/_health/pages/timeline_detail?event_id=${event_id}&schedule_id=${schedule_id}&fast_type=LF&autoPost=1`)
         // jumpPage(`/_health/pages/add_moment?moment=${JSON.stringify(item)}&title=${item.title}&schedule_id=${item.schedule_id}&event_id=${item.event_id}`)
     }
 
@@ -104,11 +109,7 @@ export default function LongFast() {
     }
 
     function tapMore() {
-        var listItems = ['编辑目标', t('health.delete_log')]
-        if (long_fast.status == 'OG') {
-            listItems.push('结束断食')
-            // listItems.push(t('health.edit_fast_goal'))
-        }
+        var listItems = [t('health.edit_goal'), t('health.delete_log')]
         showActionSheet({
             title: t('health.more_actions'),
             showActionSheetWithOptions: showActionSheetWithOptions,
@@ -120,11 +121,11 @@ export default function LongFast() {
                         break
                     case 1:
                         showAlert({
-                            title: '确定要放弃本次断食吗?',
-                            content: '放弃后断食不会本记录',
+                            title: t('health.del_title'),
+                            content: '',
                             showCancel: true,
-                            cancelText: '取消',
-                            confirmText: '确定',
+                            cancelText: t('health.del_cancel'),
+                            confirmText: t('health.del_confirm'),
                             confirm: () => {
                                 del()
                             }
@@ -139,7 +140,7 @@ export default function LongFast() {
     }
 
     function del() {
-        delRecord({ids:[health.long_fast.window_id]}).then(res => {
+        delRecord({ ids: [health.long_fast.window_id] }).then(res => {
             global.refreshWindow()
         })
     }
@@ -166,7 +167,7 @@ export default function LongFast() {
         params.requestId = enterTime
 
 
-        clockTimes('',params).then(res => {
+        clockTimes('', params).then(res => {
             if ((res as any).warn_code == 'SAVE_AS_IF') {
                 showAlert({
                     title: 'Saving as Intermittent Fasting',
@@ -198,6 +199,12 @@ export default function LongFast() {
 
     function goal() {
         var hours = long_fast.extra.long_fast_goal / 60
+        if (global.language == 'en') {
+            if (hours == 1) {
+                return hours + ' hr'
+            }
+            return hours + ' hrs'
+        }
         return hours + '小时'
         // var days = Math.floor(hours / 24)
         // var left = hours % 24
@@ -214,9 +221,19 @@ export default function LongFast() {
     function getDurationStr() {
         var days = Math.floor(duration / 24)
         var hours = duration % 24
+
         var str = `${days} 天`
+        if (global.language == 'en') {
+            str = days == 1 ? `${days} day` : `${days} days`
+        }
         if (hours > 0) {
-            str = `${str} ${hours} 小时`
+            if (global.language == 'en') {
+                str = hours == 1 ? `${str} ${hours} hr` : `${str} ${hours} hrs`
+            }
+            else {
+                str = `${str} ${hours} 小时`
+            }
+
         }
         return str
     }
@@ -228,7 +245,14 @@ export default function LongFast() {
                 marginTop: rpxToPx(22), display: 'flex',
                 flexDirection: 'row', alignItems: 'center',
                 justifyContent: 'center',
-            }}>
+
+            }}
+                onClick={() => {
+                    var item = long_fast.timeline[0]
+                    const { event_id, schedule_id } = item
+                    jumpPage(`/_health/pages/timeline_detail?event_id=${event_id}&schedule_id=${schedule_id}&fast_type=LF`)
+                }}
+            >
                 {
                     moment.media && moment.media.length > 0 && <Image
                         src={moment.media[0].url}
@@ -278,7 +302,7 @@ export default function LongFast() {
     ><View className="page_container">
             <NewHeader type={NewHeaderType.left_subtitle}
                 title={t('health.long_fast')}
-                subtitle="Prolonged Fasting beyond 24 hours"
+                subtitle={t('health.long_fast_subtitle')}
             />
             <Card>
                 <View className="long_fast_card">
@@ -291,8 +315,8 @@ export default function LongFast() {
                         top: rpxToPx(20),
                     }}>
                         <StatusIndicator type={StatusType.normal}//type={status == 'WFS' ? StatusType.normal : StatusType.ing}
-                            color={ MainColorType.fast}
-                            text={long_fast.status == 'WFS' ?t('health.longfast_wait'):t('health.in_progress')}
+                            color={MainColorType.fast}
+                            text={long_fast.status == 'WFS' ? t('health.longfast_wait') : t('health.in_progress')}
                             fontColor={MainColorType.g01}
                             fontSize={rpxToPx(20)}
                         >
@@ -301,7 +325,7 @@ export default function LongFast() {
                     </View>
                     <View style={{ height: rpxToPx(96) }} />
                     <View className="h50 bold" style={{ color: MainColorType.fast }}>{timeText()}</View>
-                    <View className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(12) }}>Goal {goal()}</View>
+                    <View className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(12) }}>{goal()}</View>
                     <View style={{ height: rpxToPx(44) }} />
                     {
                         long_fast.status == 'WFS' ? <NewButton
@@ -309,7 +333,7 @@ export default function LongFast() {
                             width={rpxToPx(538)}
                             height={rpxToPx(96)}
                             color={getThemeColor('FAST')}
-                            title="Start fast"
+                            title={t('health.start_fast')}
                             onClick={() => {
                                 tapStart()
                                 // 
@@ -320,7 +344,7 @@ export default function LongFast() {
                                 width={rpxToPx(538)}
                                 height={rpxToPx(96)}
                                 color={getThemeColor('FAST')}
-                                title="How are you feeling?"
+                                title={t('health.add_note')}
                                 onClick={() => {
                                     tapLog()
                                 }}
@@ -334,21 +358,22 @@ export default function LongFast() {
             </Card>
 
             <View className="long_fast_footer" style={{ backgroundColor: 'transparent', marginBottom: -rpxToPx(35) }}>
-                <View style={{ width: rpxToPx(316), height: rpxToPx(128), display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
-                    {
-                        long_fast.status == 'OG' ? <NewButton
-                            type={NewButtonType.link}
-                            title={'End longfast'}
-                            onClick={tapEnd}
-                        >
-                        </NewButton> : <NewButton
-                            type={NewButtonType.link}
-                            title={'See Guidelines'}
-                            onClick={() => { }}
-                        >
-                        </NewButton>
-                    }
-                </View>
+                {
+                    long_fast.status == 'OG' && <View style={{ width: rpxToPx(316), height: rpxToPx(128), display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
+                        {
+                            long_fast.status == 'OG' ? <NewButton
+                                type={NewButtonType.link}
+                                title={t('health.end_fast')}
+                                onClick={tapEnd}
+                            >
+                            </NewButton> : <NewButton
+                                type={NewButtonType.link}
+                                title={'See Guidelines'}
+                                onClick={() => { }}
+                            >
+                            </NewButton>
+                        }
+                    </View>}
                 {
                     long_fast.status == 'OG' && <NewButton
                         btnStyle={{
@@ -375,7 +400,7 @@ export default function LongFast() {
 
             {
                 editDuration && <NewModal
-                    title='长断食时长'
+                    title={t('health.edit_goal')}
                     dismiss={() => {
                         setEditDuration(false)
                     }}
@@ -386,7 +411,7 @@ export default function LongFast() {
                             global.refreshWindow()
                         })
                     }}
-                    themeColor={getThemeColor(health.mode)}>
+                    themeColor={getThemeColor('FAST')}>
                     {/* <View style={{ flexDirection: 'column', display: 'flex', alignItems: 'center', marginBottom: 20 }}>
                         <NewDurationPicker type={DurationPickerType.long}
                             color={MainColorType.fast}
@@ -395,7 +420,7 @@ export default function LongFast() {
                     </View> */}
                     <Card>
                         <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
-                            <View className="picker_title" style={{ color: MainColorType.fast, width: rpxToPx(618) }}>
+                            <View className="picker_title h44" style={{ color: MainColorType.fast, width: rpxToPx(618) }}>
                                 {getDurationStr()}
                                 <View className="border_footer_line" />
                             </View>

+ 61 - 34
src/_health/pages/move.tsx

@@ -115,7 +115,7 @@ export default function Move() {
     useDidShow(() => {
         checkAuth()
         getMovesCurrent()
-        getMovesHistory(1)
+        // getMovesHistory(1)
     })
 
     global.updateMove = () => {
@@ -180,7 +180,7 @@ export default function Move() {
         myScrollTop = top
         if (e.detail.scrollTop > 70) {
             Taro.setNavigationBarTitle({
-                title:'Move Every Hour'
+                title:t('health.move_every_hour')
             })
         }
         else {
@@ -195,9 +195,24 @@ export default function Move() {
             list.forEach((item, index) => {
                 if (top >= itemLayouts[index] - 50) {
                     i = index
-                    var currentDate = (list[index].date + '').substring(0, 6)
+                    // var currentDate = (list[index].date + '').substring(0, 6)
+
+                    // date = currentDate.substring(0, 4) + '年' + currentDate.substring(4, 6) + '月'
+                    var currentDate = list[index].date + ''
+                    var date1 = currentDate.substring(0, 4) + '-' + currentDate.substring(4, 6) + '-'+ currentDate.substring(6, 8)
+                    var timestamp = new Date(date1).getTime()
+
+                    if (TimeFormatter.isTimestampInThisWeek(timestamp)) {
+                        date = t('health.this_week')
+                    }
+                    else if (dayjs(timestamp).format('YYYY') == dayjs().format('YYYY')) {
+                        date = global.language == 'en' ? dayjs(timestamp).format('MMMM') : dayjs(timestamp).format('MMMM')
+                    }
+                    else {
+                        date = global.language == 'en' ? dayjs(timestamp).format('YYYY') : dayjs(timestamp).format('YYYY年')
+                    }
+
 
-                    date = currentDate.substring(0, 4) + '年' + currentDate.substring(4, 6) + '月'
                 }
             })
 
@@ -440,7 +455,7 @@ export default function Move() {
                 {
                     item.is_extra && <Text style={{ color: getThemeColor('SLEEP') }}>is Extra</Text>
                 }
-                <Text className="h24 bold"><Text className="h34 bold">{item.real_steps}</Text> / {item.target_steps} steps</Text>
+                <Text className="h24 bold"><Text className="h34 bold">{item.real_steps}</Text> / {item.target_steps} {t('health.steps')}</Text>
                 <View style={{
                     height: rpxToPx(18), flexShrink: 0,
 
@@ -448,7 +463,7 @@ export default function Move() {
             </View>
 
             {
-                item.status == 'MISSED' && <Text className="missed">Missed</Text>
+                item.status == 'MISSED' && <Text className="missed">{t('health.missed')}</Text>
             }
             {
                 item.status == 'SEDENTARY' && <IconSit width={rpxToPx(44)} color={MainColorType.g02} />
@@ -466,7 +481,8 @@ export default function Move() {
 
         return <View className="summary">
             <View className="summary_header">
-                <Text className="h34 bold">Last {hours.length} Hour{hours.length == 1 ? '' : 's'}</Text>
+                {/* <Text className="h34 bold">Last {hours.length} Hour{hours.length == 1 ? '' : 's'}</Text> */}
+                <Text className="h34 bold">{t('health.past_few_hour')}</Text>
                 <View className="border_footer_line" />
             </View>
             {
@@ -490,7 +506,7 @@ export default function Move() {
                                     }}
                                     type={NewButtonType.link}
                                     fontSize={rpxToPx(24)}
-                                    title={moreActive ? '收起' : `展开剩余${hours.length - 3}条`}
+                                    title={moreActive ? t('health.show_less') : t('health.show_all',{count:hours.length})}
                                     btnStyle={{ minWidth: rpxToPx(170) }}
                                 />
                             </View>
@@ -501,7 +517,7 @@ export default function Move() {
             }
             {
                 hours.length == 0 && <View className="no_current">
-                    <Text>No Active Hours Yet.</Text>
+                    <Text>{t('health.no_active_hour')}</Text>
                     <View className="border_footer_line" />
                 </View>
             }
@@ -625,7 +641,7 @@ export default function Move() {
             <StatusIndicator
                 type={StatusType.normal}
                 color={selItem.type == 'SLEEP' ? getThemeColor('SLEEP') : getThemeColor('ACTIVE')}
-                text={`${selItem.type == 'SLEEP' ? 'SLEEP HOUR ' : 'WAKING HOUR '}${selItem.index}`}
+                text={`${selItem.type == 'SLEEP' ? t('health.sleeping_hour') : t('health.waking_hour')}${selItem.index}`}
             // fontSize={}
             // fontColor={}
             />
@@ -642,22 +658,24 @@ export default function Move() {
             tHour = data.hours[0].hour
         }
         if (hour > tHour) {
-            return `Check in begins at ${getDuration().substring(0, 2)}:50 tomorrow`
+            return global.language == 'en'?t('health.check_begin_at',{time:getDuration().substring(0, 2)+':50 tomorrow'}):
+            t('health.check_begin_at',{time:'明天'+getDuration().substring(0, 2)+':50'})
+            // return `Check in begins at ${getDuration().substring(0, 2)}:50 tomorrow`
         }
-        return `Check in begins at ${getDuration().substring(0, 2)}:50`
+        return t('health.check_begin_at',{time:getDuration().substring(0, 2)+':50'})
     }
 
     function consolePanel() {
 
-        if (!allowRun) {
-            return <View className="move_console move_console_auth">
-                <Text className="console_duration" style={{ color: '#000', fontSize: rpxToPx(34) }}>你还没有开启步数授权</Text>
-                <Text className="console_open_tip">体验Move More需要您开启微信运动授权,点击下方按钮进行授权</Text>
-                <View className="console_checkbtn"
-                    onClick={tapLog}
-                    style={{ color: '#fff', backgroundColor: getThemeColor('ACTIVE') }}>去授权</View>
-            </View>
-        }
+        // if (!allowRun) {
+        //     return <View className="move_console move_console_auth">
+        //         <Text className="console_duration" style={{ color: '#000', fontSize: rpxToPx(34) }}>你还没有开启步数授权</Text>
+        //         <Text className="console_open_tip">体验Move More需要您开启微信运动授权,点击下方按钮进行授权</Text>
+        //         <View className="console_checkbtn"
+        //             onClick={tapLog}
+        //             style={{ color: '#fff', backgroundColor: getThemeColor('ACTIVE') }}>去授权</View>
+        //     </View>
+        // }
 
         return <View className="move_console">
             <View style={{ flex: 1 }} />
@@ -715,7 +733,15 @@ export default function Move() {
     }
 
     function toolBtnText() {
-        return `Upcoming (${data.hours.length - hours.length > 0 ? data.hours.length - hours.length : ''})`
+        var str = ''
+        if (data.hours.length - hours.length ==1){
+            str = t('health.upcoming')
+        }
+        else {
+            str = t('health.upcomings')
+        }
+
+        return `${str} (${data.hours.length - hours.length > 0 ? data.hours.length - hours.length : '0'})`
     }
 
     function showMore() {
@@ -753,10 +779,10 @@ export default function Move() {
         return <View className="move_summary">
 
             <View className="summary_header">
-                <Text className="h34 bold">Summary</Text>
+                <Text className="h34 bold">{t('health.summary')}</Text>
                 <View style={{ flex: 1 }} />
                 {
-                    data.last_updated && <Text style={{ color: '#b2b2b2', fontSize: 10, fontWeight: 'normal' }}>最近更新于 {dayjs(data.last_updated).format('HH:mm')}</Text>
+                    data.last_updated && <Text style={{ color: '#b2b2b2', fontSize: 10, fontWeight: 'normal' }}>{t('health.last_updated')} {dayjs(data.last_updated).format('HH:mm')}</Text>
                 }
 
                 <View className="border_footer_line" />
@@ -764,30 +790,30 @@ export default function Move() {
             <View className="summary_content">
                 <View className="summary_footer">
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Hours Sedentary</Text>
+                        <Text className="light_desc">{t('health.sedentary_hours')}</Text>
                         <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.sedentary_hours}</Text> / {data.stat.waking_hours}</Text>
                     </View>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Hours Active</Text>
+                        <Text className="light_desc">{t('health.active_hours')}</Text>
                         <Text style={{ color: getThemeColor('ACTIVE'), fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.active_hours}</Text> / {data.stat.waking_hours}</Text>
                     </View>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Hours Missed</Text>
+                        <Text className="light_desc">{t('health.missed_hours')}</Text>
                         <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.missed_hours}</Text> / {data.stat.waking_hours}</Text>
                     </View>
                 </View>
                 <View className="summary_footer" style={{ marginTop: rpxToPx(48) }}>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Total Steps</Text>
+                        <Text className="light_desc">{t('health.step')}</Text>
                         <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_steps}</Text> / {data.stat.target_steps}</Text>
                     </View>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Total Calories</Text>
-                        <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_calories}</Text> / {data.stat.target_calories}</Text>
+                        <Text className="light_desc">{t('health.calories')}</Text>
+                        <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_calories}</Text> / {data.stat.target_calories}{t('health.kcal')}</Text>
                     </View>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Total Distance</Text>
-                        <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_distance}</Text> / {data.stat.target_distance}</Text>
+                        <Text className="light_desc">{t('health.distance')}</Text>
+                        <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_distance}</Text> / {data.stat.target_distance}{t('health.km')}</Text>
                     </View>
                 </View>
             </View>
@@ -857,7 +883,7 @@ export default function Move() {
         loadMore={more}>
 
         <View style={{ display: 'flex', flexDirection: 'column' }}>
-            <NewHeader type={NewHeaderType.left} title="Move Every Hour" />
+            <NewHeader type={NewHeaderType.left} title={t('health.move_every_hour')} />
             {
                 consolePanel()
             }
@@ -886,7 +912,8 @@ export default function Move() {
                                 </View>
                                 <View className="history_item_detail_bg">
                                     <IconActive width={rpxToPx(32)} color={MainColorType.active} />
-                                    <Text style={{ fontSize: rpxToPx(26), marginLeft: rpxToPx(16) }}> Hours Active {item.active_hours} · Total Steps {item.stat.real_steps}</Text>
+                                    <Text style={{ fontSize: rpxToPx(26), marginLeft: rpxToPx(16) }}> {item.description}</Text>
+                                    {/* <Text style={{ fontSize: rpxToPx(26), marginLeft: rpxToPx(16) }}> Hours Active {item.active_hours} · Total Steps {item.stat.real_steps}</Text> */}
                                 </View>
                                 {/* <View className="border_footer_line" /> */}
                             </View>

+ 35 - 19
src/_health/pages/move_detail.tsx

@@ -11,6 +11,7 @@ import NewButton, { NewButtonType } from "../base/new_button";
 import { MainColorType } from "@/context/themes/color";
 import ListFooter from "../components/list_footer";
 import { IconActive, IconSit } from "@/components/basic/Icons";
+import { useTranslation } from "react-i18next";
 
 let useRoute;
 let useNavigation;
@@ -36,6 +37,7 @@ export default function MoveDetail() {
     const [loaded, setLoaded] = useState(false)
     const [data, setData] = useState<any>(null)
     const [moreActive, setMoreActive] = useState(false)
+    const { t } = useTranslation()
 
     useEffect(() => {
         getActiveMoveDetail(router.params.id).then(res => {
@@ -48,41 +50,41 @@ export default function MoveDetail() {
         return <View className="move_summary">
 
             <View className="summary_header">
-                <Text className="h34 bold">Summary</Text>
+                <Text className="h34 bold">{t('health.summary')}</Text>
                 <View style={{ flex: 1 }} />
-                {
-                    data.last_updated && <Text style={{ color: '#b2b2b2', fontSize: 10, fontWeight: 'normal' }}>最近更新于 {dayjs(data.last_updated).format('HH:mm')}</Text>
-                }
+                {/* {
+                    data.last_updated && <Text style={{ color: '#b2b2b2', fontSize: 10, fontWeight: 'normal' }}>{t('health.last_updated')} {dayjs(data.last_updated).format('MM-DD HH:mm')}</Text>
+                } */}
 
                 <View className="border_footer_line" />
             </View>
             <View className="summary_content">
                 <View className="summary_footer">
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Hours Sedentary</Text>
+                        <Text className="light_desc">{t('health.sedentary_hours')}</Text>
                         <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.sedentary_hours}</Text> / {data.stat.waking_hours}</Text>
                     </View>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Hours Active</Text>
+                        <Text className="light_desc">{t('health.active_hours')}</Text>
                         <Text style={{ color: getThemeColor('ACTIVE'), fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.active_hours}</Text> / {data.stat.waking_hours}</Text>
                     </View>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Hours Missed</Text>
+                        <Text className="light_desc">{t('health.missed_hours')}</Text>
                         <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.missed_hours}</Text> / {data.stat.waking_hours}</Text>
                     </View>
                 </View>
                 <View className="summary_footer" style={{ marginTop: rpxToPx(48) }}>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Total Steps</Text>
+                        <Text className="light_desc">{t('health.step')}</Text>
                         <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_steps}</Text> / {data.stat.target_steps}</Text>
                     </View>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Total Calories</Text>
-                        <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_calories}</Text> / {data.stat.target_calories}</Text>
+                        <Text className="light_desc">{t('health.calories')}</Text>
+                        <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_calories}</Text> / {data.stat.target_calories}{t('health.kcal')}</Text>
                     </View>
                     <View className="summary_footer_item">
-                        <Text className="light_desc">Total Distance</Text>
-                        <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_distance}</Text> / {data.stat.target_distance}</Text>
+                        <Text className="light_desc">{t('health.distance')}</Text>
+                        <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_distance}</Text> / {data.stat.target_distance}{t('health.km')}</Text>
                     </View>
                 </View>
             </View>
@@ -95,7 +97,7 @@ export default function MoveDetail() {
         const hours = data.hours
         return <View className="summary">
             <View className="summary_header">
-                <Text className="h34 bold">Hourly</Text>
+                <Text className="h34 bold">{t('health.hourly')}</Text>
                 <View className="border_footer_line" />
             </View>
             <View className="summary_content2">
@@ -127,7 +129,7 @@ export default function MoveDetail() {
                 {
                     item.is_extra && <Text style={{ color: getThemeColor('SLEEP') }}>is Extra</Text>
                 }
-                <Text className="h24 bold"><Text className="h34 bold">{item.real_steps}</Text> / {item.target_steps} steps</Text>
+                <Text className="h24 bold"><Text className="h34 bold">{item.real_steps}</Text> / {item.target_steps} {t('health.steps')}</Text>
                 <View style={{
                     height: rpxToPx(18), flexShrink: 0,
 
@@ -135,13 +137,13 @@ export default function MoveDetail() {
             </View>
 
             {
-                item.status == 'MISSED' && <Text className="missed">Missed</Text>
+                item.status == 'MISSED' && <Text className="missed">{t('health.missed')}</Text>
             }
             {
-                item.status == 'SEDENTARY' && <IconSit width={rpxToPx(44)} color={MainColorType.g02}/>
+                item.status == 'SEDENTARY' && <IconSit width={rpxToPx(44)} color={MainColorType.g02} />
             }
             {
-                item.status == 'ACTIVE' && <IconActive width={rpxToPx(44)} color={MainColorType.active}/>
+                item.status == 'ACTIVE' && <IconActive width={rpxToPx(44)} color={MainColorType.active} />
             }
             <View className="border_footer_line" />
         </View>
@@ -149,9 +151,23 @@ export default function MoveDetail() {
 
     if (!loaded) return <View />
 
-    const date = data.start_date + ''
+
+
+    function headerTitle() {
+        const date = data.start_date + ''
+        var strDate = date.substring(0, 4) + '-' + date.substring(4, 6) + '-' + date.substring(6, 8)
+        if (global.language == 'en'){
+            return dayjs(new Date(strDate).getTime()).format('MMMM D, YYYY')
+        }
+        else {
+            return dayjs(new Date(strDate).getTime()).format('YYYY年MMMD日')
+        }
+
+        // return date.substring(0, 4) + '年' + date.substring(4, 6) + '月' + date.substring(6, 8) + '日'
+    }
+
     return <View>
-        <NewHeader type={NewHeaderType.left} title={date.substring(0, 4) + '年' + date.substring(4, 6) + '月' + date.substring(6, 8) + '日'} />
+        <NewHeader type={NewHeaderType.left} title={headerTitle()} />
         {
             summary()
         }

+ 31 - 28
src/_health/pages/move_schedule.tsx

@@ -14,6 +14,7 @@ import ConsoleCell from "../components/console_cell";
 import Layout from "@/components/layout/layout";
 import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
 import Card from "../components/card";
+import { useTranslation } from "react-i18next";
 
 let useRoute;
 let useNavigation;
@@ -45,6 +46,7 @@ export default function MoveSchedule() {
     const [hours, setHours] = useState<any>([])
     const [loaded, setLoaded] = useState(false)
     const [count, setCount] = useState(1)
+    const {t} = useTranslation()
 
 
     useEffect(() => {
@@ -138,7 +140,7 @@ export default function MoveSchedule() {
 
 
         return <View style={{ display: 'flex', flexDirection: 'column' }}>
-            <NewHeader type={NewHeaderType.left} title="Upcoming Check Ins" />
+            <NewHeader type={NewHeaderType.left} title={t('health.upcomings')} />
             {
                 hours.length == 0 && <View style={{ display: 'flex', flex: 1, flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(110) }}>
                     <Image src={require('@assets/_health/sleep2.png')} style={{ width: rpxToPx(64), height: rpxToPx(64) }} />
@@ -161,8 +163,8 @@ export default function MoveSchedule() {
                                 moveCell
                                 status={<StatusIndicator type={StatusType.normal}
                                     color={MainColorType.active}
-                                    text={'WAKING HOUR ' + (index + 1)} />}
-                                title={`Check in at ${open}:50`}
+                                    text={t('health.waking_hour') + (index + 1)} />}
+                                title={t('health.check_begin_at',{time:open+':50'})}
                                 description={`${parseInt(start) < new Date().getHours() ? '' : ''}${start}:00-${end}:00`}
                                 subDesc={<Text className="schedule_item_time">  {firstTime(index)}</Text>}
                                 right={<View style={{
@@ -171,31 +173,32 @@ export default function MoveSchedule() {
                                     alignItems: 'center'
                                 }}>
                                     {
-                                        item.reminder ? <IconNotification color={MainColorType.g03} width={rpxToPx(28)} /> : <IconNotificationOff color={MainColorType.g03} width={rpxToPx(28)} />
+                                        // item.reminder ? <IconNotification color={MainColorType.g03} width={rpxToPx(28)} /> : <IconNotificationOff color={MainColorType.g03} width={rpxToPx(28)} />
                                     }
                                     <View style={{ width: rpxToPx(12) }} />
-                                    <Switch checked={item.reminder} color={getThemeColor('ACTIVE')} onChange={e => {
-                                        console.log(item)
-
-                                        createSchedule({
-                                            schedules: [{
-                                                id: item.schedule_id,
-                                                reminder: e.detail.value
-                                            }],
-                                        }).then(res => {
-                                            getData()
-                                            if (global.refreshWindow) {
-                                                global.refreshWindow()
-                                            }
-                                            if (global.refreshSchedules) {
-                                                global.refreshSchedules()
-                                            }
-                                            if (global.updateMove) {
-                                                global.updateMove()
-                                            }
-                                        })
-                                    }} />
-                                    <View style={{marginRight:-rpxToPx(14)}}/>
+                                    {
+                                        !global.hideRingIcon && <Switch checked={item.reminder} color={getThemeColor('ACTIVE')} onChange={e => {
+                                            console.log(item)
+
+                                            createSchedule({
+                                                schedules: [{
+                                                    id: item.schedule_id,
+                                                    reminder: e.detail.value
+                                                }],
+                                            }).then(res => {
+                                                getData()
+                                                if (global.refreshWindow) {
+                                                    global.refreshWindow()
+                                                }
+                                                if (global.refreshSchedules) {
+                                                    global.refreshSchedules()
+                                                }
+                                                if (global.updateMove) {
+                                                    global.updateMove()
+                                                }
+                                            })
+                                        }} />}
+                                    <View style={{ marginRight: -rpxToPx(14) }} />
                                 </View>}
                                 disable={true}
                                 onClick={() => { }}
@@ -211,7 +214,7 @@ export default function MoveSchedule() {
 
             <Text className="no_more" style={{ color: '#5C7099' }} onClick={() => {
                 jumpPage('./move_setting_reminder')
-            }}>Full schedules</Text>
+            }}>{t('health.see_full_check')}</Text>
         </View>
     }
 
@@ -220,7 +223,7 @@ export default function MoveSchedule() {
         header={null}
         secondPage={true}
         titleColor={'#fff'}
-        title={'Upcoming Check Ins'}
+        title={t('health.upcomings')}
         type={TemplateType.customHeader}
         titleShowStyle={NaviBarTitleShowType.scrollToShow} />
 }

+ 30 - 27
src/_health/pages/move_setting_reminder.tsx

@@ -14,12 +14,14 @@ import Layout from "@/components/layout/layout";
 import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
 import Card from "../components/card";
 import ConsoleCell from "../components/console_cell";
+import { useTranslation } from "react-i18next";
 
 export default function MoveSettingReminder() {
     const [selIndex, setSelIndex] = useState(-1)
     const [hours, setHours] = useState('')
     const [total, setTotal] = useState('')
     const [detail, setDetail] = useState<any>(null)
+    const {t} = useTranslation()
 
     useEffect(() => {
         getData()
@@ -38,7 +40,7 @@ export default function MoveSettingReminder() {
 
     function detailContent() {
         return <View>
-            <NewHeader type={NewHeaderType.left} title="Full Check In Schedule" />
+            <NewHeader type={NewHeaderType.left} title={t('health.full_check_in_schedule')} />
             <Card>
                 <View style={{ display: 'flex', flexDirection: 'column', width: rpxToPx(700) }}>
                     {
@@ -47,8 +49,8 @@ export default function MoveSettingReminder() {
                                 moveCell
                                 status={<StatusIndicator type={StatusType.normal}
                                     color={MainColorType.active}
-                                    text={'WAKING HOUR ' + (index + 1)} />}
-                                title={`Check in at ${item.reminder_time}`}
+                                    text={t('health.waking_hour') + (index + 1)} />}
+                                title={t('health.check_begin_at',{time:item.reminder_time})}
                                 description={`${item.title}`}
                                 subDesc={<Text className="schedule_item_time"></Text>}
                                 right={<View style={{
@@ -56,32 +58,33 @@ export default function MoveSettingReminder() {
                                     flexDirection: 'row',
                                     alignItems: 'center'
                                 }}>
-                                    {
+                                    {/* {
                                         item.reminder ? <IconNotification color={MainColorType.g03} width={rpxToPx(28)} /> : <IconNotificationOff color={MainColorType.g03} width={rpxToPx(28)} />
-                                    }
+                                    } */}
                                     <View style={{ width: rpxToPx(12) }} />
-                                    <Switch checked={item.reminder} color={getThemeColor('ACTIVE')} onChange={e => {
-                                        console.log(item)
+                                    {
+                                        !global.hideRingIcon && <Switch checked={item.reminder} color={getThemeColor('ACTIVE')} onChange={e => {
+                                            console.log(item)
 
-                                        createSchedule({
-                                            schedules: [{
-                                                id: item.id,
-                                                reminder: e.detail.value
-                                            }],
-                                        }).then(res => {
-                                            getData()
-                                            if (global.refreshWindow) {
-                                                global.refreshWindow()
-                                            }
-                                            if (global.refreshSchedules) {
-                                                global.refreshSchedules()
-                                            }
-                                            if (global.updateMove) {
-                                                global.updateMove()
-                                            }
-                                        })
-                                    }} />
-                                    <View style={{marginRight:-rpxToPx(14)}}/>
+                                            createSchedule({
+                                                schedules: [{
+                                                    id: item.id,
+                                                    reminder: e.detail.value
+                                                }],
+                                            }).then(res => {
+                                                getData()
+                                                if (global.refreshWindow) {
+                                                    global.refreshWindow()
+                                                }
+                                                if (global.refreshSchedules) {
+                                                    global.refreshSchedules()
+                                                }
+                                                if (global.updateMove) {
+                                                    global.updateMove()
+                                                }
+                                            })
+                                        }} />}
+                                    <View style={{ marginRight: -rpxToPx(14) }} />
                                 </View>}
                                 disable={true}
                                 onClick={() => { }}
@@ -148,7 +151,7 @@ export default function MoveSettingReminder() {
         header={null}
         secondPage={true}
         titleColor={'#fff'}
-        title={'Full Check In Schedule'}
+        title={t('health.full_check_in_schedule')}
         type={TemplateType.customHeader}
         titleShowStyle={NaviBarTitleShowType.scrollToShow} />
 }

+ 12 - 17
src/_health/pages/post_result.tsx

@@ -2,7 +2,7 @@ import { View, Image, Text, Switch, Button } from "@tarojs/components";
 import Taro, { useRouter, useShareAppMessage } from "@tarojs/taro";
 import './post_result.scss'
 import { getThemeColor } from "@/features/health/hooks/health_hooks";
-import { rpxToPx } from "@/utils/tools";
+import { rpxToPx, vibrate } from "@/utils/tools";
 import NewButton, { NewButtonType } from "../base/new_button";
 import { IconActive, IconCheck, IconNotification, IconNotificationOff, IconSit } from "@/components/basic/Icons";
 import { MainColorType } from "@/context/themes/color";
@@ -102,7 +102,7 @@ export default function PostResult() {
 
             return {
                 title: title,
-                path: `/_health/pages/timeline_detail?fast_type=${fast_type}&type=${type}&window_id=${window_id}&event_id=${event_id}&uid=${user.id}&isfastsleep=${op_page == 'FAST_WITH_SLEEP'?1:0}&disable_edit=1&enter_type=share`,
+                path: `/_health/pages/timeline_detail?fast_type=${fast_type}&type=${type}&window_id=${window_id}&event_id=${event_id}&uid=${user.id}&isfastsleep=${op_page == 'FAST_WITH_SLEEP' ? 1 : 0}&disable_edit=1&enter_type=share`,
                 imageUrl: imageUrl
             }
         })
@@ -203,14 +203,6 @@ export default function PostResult() {
     }
 
     function headerDesc() {
-        if (data.scenario == 'MOVE') {
-            if (data.extra.move_status == 'SEDENTARY') {
-                return 'Sedentary Hour'
-            }
-            else {
-                return 'Active Hour'
-            }
-        }
         return data.description
     }
 
@@ -243,15 +235,18 @@ export default function PostResult() {
                         type={NewButtonType.link}
                         title={nextTitle()}
                         onClick={() => {
-                            setShowSetting(true)
+                            global.hideRingIcon?vibrate():setShowSetting(true)
                         }}
                     >
-                        <View style={{ marginRight: rpxToPx(8) }}>
-                            {
-                                data.next.reminder ? <IconNotification color={MainColorType.link} width={rpxToPx(26)} /> :
-                                    <IconNotificationOff color={MainColorType.link} width={rpxToPx(26)} />
-                            }
-                        </View>
+                        {
+                            !global.hideRingIcon && <View style={{ marginRight: rpxToPx(8) }}>
+                                {
+                                    data.next.reminder ? <IconNotification color={MainColorType.link} width={rpxToPx(26)} /> :
+                                        <IconNotificationOff color={MainColorType.link} width={rpxToPx(26)} />
+                                }
+                            </View>
+                        }
+
 
                     </NewButton>
                 </View>

+ 9 - 4
src/_health/pages/timeline_detail.tsx

@@ -79,7 +79,7 @@ export default function TimelineDetail() {
         router = useRouter()
     }
 
-    const { schedule_id, event_id, window_id, isfastsleep, fast_type, disable_edit, uid } = router.params
+    const { schedule_id, event_id, window_id, isfastsleep, fast_type, disable_edit, uid,autoPost } = router.params
 
 
     if (process.env.TARO_ENV == 'weapp') {
@@ -173,6 +173,11 @@ export default function TimelineDetail() {
         })
 
         getDatas()
+
+
+        if (!window_id && ((health.mode != 'ACTIVE' && health.mode != 'EAT') || fast_type == 'LF') && autoPost=='1'){
+            setShowPop(true)
+        }
     }, [])
 
     useEffect(() => {
@@ -787,7 +792,7 @@ export default function TimelineDetail() {
         <Text style={{ opacity: 0 }}>{count}</Text>
         <ListFooter />
         {
-            !window_id && health.mode != 'ACTIVE' && health.mode != 'EAT' && <View className="add_note"><NewButton type={NewButtonType.link} title="写个笔记" onClick={() => {
+            !window_id && ((health.mode != 'ACTIVE' && health.mode != 'EAT') || fast_type == 'LF') && <View className="add_note"><NewButton type={NewButtonType.link} title={t('health.add_note')} onClick={() => {
                 timestamp = new Date().getTime()
                 setShowPop(true)
 
@@ -825,7 +830,7 @@ export default function TimelineDetail() {
                 </NewButton>
                 <View onClick={() => setShowTimePicker(true)} style={{ height: rpxToPx(88), marginTop: rpxToPx(120), width: rpxToPx(80), color: MainColorType.link }}>{time}
                 </View>
-                <Textarea className="myTextarea" placeholder="What's on your mind?" style={{ flex: 1, color: '#fff', caretColor: getThemeColor(detail.window) }} focus value={desc} onInput={(e) => {
+                <Textarea className="myTextarea" placeholder={t('health.how_feeling')} style={{ flex: 1, color: '#fff', caretColor: getThemeColor(detail.window) }} focus value={desc} onInput={(e) => {
                     setDesc(e.detail.value)
                 }} />
                 <View className="toolbar2">
@@ -848,7 +853,7 @@ export default function TimelineDetail() {
 
 
                     <View style={{ flex: 1 }} />
-                    <View className="btn" style={{ backgroundColor: btnDisable ? '#b2b2b2' : getThemeColor(detail.window) }} onClick={tapPost}>发布</View>
+                    <View className="btn" style={{ backgroundColor: btnDisable ? '#b2b2b2' : getThemeColor(detail.window) }} onClick={tapPost}>{t('health.post')}</View>
                 </View>
 
                 <View style={{ height: bottom, flexShrink: 0 }} />

+ 9 - 3
src/app.tsx

@@ -36,6 +36,8 @@ const App: React.FC<PropsWithChildren> = ({ children }) => {
 
   // const dispatch = useDispatch();
 
+  global.hideRingIcon = true
+
   Taro.setStorage({ key: 'showedDisqualifiedAlert', data: false })
 
 
@@ -79,17 +81,21 @@ const App: React.FC<PropsWithChildren> = ({ children }) => {
     if (value) {
       // Do something with return value
 
-      if (value == 'wechat'){
+      if (value == 'wechat') {
         const isZh = Taro.getAppBaseInfo().language == 'zh_CN'
         global.language = isZh ? 'zh' : 'en'
       }
       else {
         global.language = value
       }
-      
 
 
-      
+
+
+    }
+    else {
+      const isZh = Taro.getAppBaseInfo().language == 'zh_CN'
+      global.language = isZh ? 'zh' : 'en'
     }
     loadWXCache()
     global.isDebug = Taro.getStorageSync('isDebug')

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

@@ -1010,7 +1010,7 @@ export default {
         journal_created: 'Journal created on {{date_time}}',
         journal_updated: 'Journal updated on {{date_time}}',
 
-        metric: 'Metrics',
+        metric: 'Body Metrics',
         photos: 'Photos',
         schedules: 'Schedule',
         streaks: 'Streaks',
@@ -1089,7 +1089,50 @@ export default {
         choose_photo:'Choose from Photos',
         camera:'Camera',
         delete:'Delete',
-        photos:'Photos'
-
+        photos:'Photos',
+
+        upcoming:'Upcoming',
+        upcomings:'Upcomings',
+        no_data:'No Data',
+
+        summary:'Summary',
+        sedentary_hours:'Sedentary Hours',
+        active_hours:'Active Hours',
+        missed_hours:'Missed Hours',
+        step:'Total Steps',
+        calories:'Total Calories',
+        distance:'Total Distance',
+        last_updated: 'Last updated',
+        // upcoming_check_ins:'Upcoming Check-Ins',
+        full_check_in_schedule:'Full Check-In Schedule',
+        waking_hour:'WAKING HOUR ',
+        sleeping_hour:'SLEEPING HOUR ',
+        no_active_hour:'No Active Hours Yet.',
+        see_full_check:'See Full Check-In Schedule',
+
+        check_begin_at:'Check-in begins at {{time}}',
+        kcal:' kcal',
+        km:' km',
+        steps:'steps',
+        missed:'Missed',
+        hourly:'Hourly',
+        past_few_hour:'Past Few Hours',
+
+        show_all:'Show All ({{count}})',
+        show_less:'Show Less',
+        move_every_hour:'Move Every Hour',
+        long_fast_subtitle:'Prolonged Fasting Beyond 24 Hours',
+        fast_sleep_subtitle:'Tune Into Your Circadian Rhythm',
+
+        start_fast:'Start Fast',
+        end_fast:'End Fast',
+
+        goal:'Goal',
+        how_feeling:'How are you feeling?',
+        edit_goal:'Edit Goal',
+
+        add_note:'Add Note',
+
+        post:'Post',
     }
 }

+ 6 - 3
src/context/locales/index.ts

@@ -9,7 +9,7 @@ function getLanguageSetting() {
   if (process.env.TARO_ENV == 'weapp') {
     var key = Taro.getStorageSync('language')
     if (key) {
-      if (key == 'wechat'){
+      if (key == 'wechat') {
         const isZh = Taro.getAppBaseInfo().language == 'zh_CN'
         // global.language = isZh ? 'zh' : 'en'
         initLocale(isZh ? 'zh' : 'en')
@@ -17,10 +17,13 @@ function getLanguageSetting() {
       else {
         initLocale(key)
       }
-      
+
     }
     else {
-      initLocale('zh')
+      const isZh = Taro.getAppBaseInfo().language == 'zh_CN'
+      // global.language = isZh ? 'zh' : 'en'
+      initLocale(isZh ? 'zh' : 'en')
+      // initLocale('zh')
     }
   }
   else {

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

@@ -1012,7 +1012,7 @@ export default {
         journal_created: '日记创建于 {{date_time}}',
         journal_updated: '日记更新于 {{date_time}}',
 
-        metric: '指标',
+        metric: '身体指标',
         photos: '照片',
         schedules: '日程',
         streaks: '连续天数',
@@ -1093,5 +1093,47 @@ export default {
         camera:'拍摄',
         delete:'删除',
         photos:'相册',
+
+        upcoming:'即将到来',
+        upcomings:'即将到来',
+        no_data:'暂无数据',
+
+        summary:'摘要',
+        sedentary_hours:'久坐小时数',
+        active_hours:'活跃小时数',
+        missed_hours:'错过小时数',
+        step:'总步数',
+        calories:'总热量消耗',
+        distance:'总距离',
+        last_updated: '最近更新于',
+        // upcoming_check_ins:'接下来的打卡',
+        full_check_in_schedule:'完整打卡日程',
+        waking_hour:'清醒小时',
+        sleeping_hour:'睡眠小时',
+        no_active_hour:'暂无活跃小时',
+        see_full_check:'查看完整打卡日程',
+
+        check_begin_at:'打卡于 {{time}} 开始',
+        kcal:' 千卡',
+        km:' 公里',
+        steps:'步',
+        missed:'错过',
+        hourly:'每小时',
+        past_few_hour:'过去几个小时',
+
+        show_all:'全部打卡 ({{count}})',
+        show_less:'收起',
+        move_every_hour:'每小时走一走',
+        long_fast_subtitle:'24小时及更长时间的断食(辟谷)',
+        fast_sleep_subtitle:'调整你的生物钟',
+        start_fast:'开始断食',
+        end_fast:'结束断食',
+        goal:'目标',
+        how_feeling:'感觉如何?',
+        edit_goal:'编辑目标',
+
+        add_note:'添加笔记',
+
+        post:'发布',
     }
 }

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

@@ -32,25 +32,6 @@
 
 }
 
-.timeline_desc {
-  font-size: 24px;
-  line-height: 34px;
-  // width: 500px;
-  flex:1;
-  // white-space: nowrap;
-  // display: -webkit-box;
-  // -webkit-box-orient: vertical;
-  // overflow: hidden;
-  // -webkit-line-clamp: 1; // 限制为一行
-  // text-overflow: ellipsis; // 超出部分显示省略号
-  white-space: nowrap;
-  /* 不换行 */
-  overflow: hidden;
-  /* 隐藏超出部分 */
-  text-overflow: ellipsis;
-  /* 显示省略号 */
-}
-
 .timeline_thirdspace {
   height: 12px;
   margin-top: 5px;

+ 11 - 7
src/pages/account/Setting.tsx

@@ -74,7 +74,7 @@ export default function Page() {
             }
         }
         else {
-            setLanguageType('中文')
+            setLanguageType('微信系统语言')
         }
     }
 
@@ -176,12 +176,7 @@ export default function Page() {
             alertText: '更改语言',
             itemList: ['中文', 'English', '微信系统语言'],
             success: function (res) {
-                if (res != -1) {
-                    global.refreshWindow()
-                    if (global.refreshHistory) {
-                        global.refreshHistory()
-                    }
-                }
+                
                 switch (res) {
                     case 0:
                         global.language = 'zh'
@@ -204,6 +199,15 @@ export default function Page() {
                         setLanguageType('微信系统语言')
                         break;
                 }
+                if (res != -1) {
+                    Taro.reLaunch({
+                        url:'/pages/clock/Clock'
+                    })
+                    // global.refreshWindow()
+                    // if (global.refreshHistory) {
+                    //     global.refreshHistory()
+                    // }
+                }
             }
         })
         // if (global.language == 'en') {

+ 10 - 6
src/pages/clock/ClockNew.tsx

@@ -67,9 +67,9 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
             checkTimeZone()
         }
 
-        setTimeout(() => {
+        // setTimeout(() => {
             checkVersionUpdate();
-        }, 1000)
+        // }, 1000)
     })
 
     function refreshData() {
@@ -158,9 +158,10 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
             })
         }, 1000)
 
-        setTimeout(() => {
-            checkVersionUpdate();
-        }, 1500)
+        // setTimeout(() => {
+        //     checkVersionUpdate();
+        // }, 1500)
+        checkVersionUpdate();
 
 
     }, [])
@@ -258,15 +259,18 @@ export default function ClockNew(props: { children: any, onScroll: any }) {
     }
 
     async function checkVersionUpdate() {
+        console.log('9527')
         if (!user.isLogin) {
             return
         }
-        // return
+        console.log('9528')
 
 
         const showAlert1 = await getStorage('148alert') || false;
         Taro.setStorage({ key: '148alert', data: true })
 
+        console.log('9529',showAlert1,health.finish_setup)
+
 
         if (!showAlert1 && !health.finish_setup) {
             showAlert({

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

@@ -61,7 +61,7 @@ export default function Discover() {
 
     function longFastStatus() {
         const { status } = health.long_fast
-        return <View className="h26" style={{ color: MainColorType.g02 }}>{status == 'OG' ? 'In progress' : ''}</View>
+        return <View className="h26" style={{ color: MainColorType.g02 }}>{status == 'OG' ? t('health.in_progress') : ''}</View>
     }
 
 

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

@@ -3,7 +3,7 @@ const online = process.env.TARO_ENV == 'weapp' ? false : false;
 import { WX_VERSION as _WX_VERSION, APP_VERSION as _APP_VERSION, ANDROID_VERSION as _ANDROID_VERSION } from "../../../config/env";
 
 // export const baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
-export const baseUrl = online ? process.env.TARO_ENV == 'rn' ? 'https://api.app.fast.liveplus.fun' : 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';//'https://api.pre.fast.liveplus.fun'//'https://api.fast.dev.liveplus.fun';
+export const baseUrl = online ? process.env.TARO_ENV == 'rn' ? 'https://api.app.fast.liveplus.fun' : 'https://api.fast.liveplus.fun' : 'https://api.pre.fast.liveplus.fun'//'https://api.fast.dev.liveplus.fun';//'https://api.fast.dev.liveplus.fun';
 
 export const APP_VERSION = _APP_VERSION
 export const WX_VERSION = _WX_VERSION