leon пре 1 година
родитељ
комит
0603458a85

+ 17 - 11
src/_health/base/new_durationpicker.tsx

@@ -16,7 +16,7 @@ export default function NewDurationPicker(props: { value?: any, onChange?: any,
     const [values, setValues] = useState<any>([0])
     const [loaded, setLoaded] = useState(false)
 
-    console.log('picker value',props.value)
+    console.log('picker value', props.value)
     useEffect(() => {
         switch (props.type) {
             case DurationPickerType.normal:
@@ -40,13 +40,19 @@ export default function NewDurationPicker(props: { value?: any, onChange?: any,
                         var minute = count % 60;
                         var str = ''
                         if (hour > 0) {
-                            str = hour + '小时'
+                            // 
+                            if (global.language == 'en') {
+                                str = hour + (hour==1?' hr ':' hrs ')
+                            }
+                            else {
+                                str = hour + '小时'
+                            }
                         }
                         if (minute > 0) {
-                            str += minute + '分钟'
+                            str += minute + (global.language == 'en'?' mins':'分钟')
                         }
                         if (hour == 0 && minute == 0) {
-                            str = '0分钟'
+                            str = global.language == 'en'?'0 mins':'0分钟'
                         }
                         array.push(str)
                     }
@@ -95,7 +101,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,true))
+            days.push(i + TimeFormatter.getDaysUnit(i, true))
         }
 
         var hours: string[] = []
@@ -106,11 +112,11 @@ export default function NewDurationPicker(props: { value?: any, onChange?: any,
     }
 
     function longValues() {
-        if (props.value){
-            var day = Math.floor(props.value/24)
-            var hour = props.value%24
-            return [day-1,hour]
-            
+        if (props.value) {
+            var day = Math.floor(props.value / 24)
+            var hour = props.value % 24
+            return [day - 1, hour]
+
 
         }
         return [0, 0]
@@ -125,7 +131,7 @@ export default function NewDurationPicker(props: { value?: any, onChange?: any,
                     props.onChange(list[0] * 3600 * 1000 + list[1] * 5 * 60 * 1000)
                     break
                 case DurationPickerType.long:
-                    props.onChange(list[0]*24+list[1]+24)
+                    props.onChange(list[0] * 24 + list[1] + 24)
                     break
                 case DurationPickerType.moment:
                 default:

+ 11 - 4
src/_health/components/fast_sleep_console.tsx

@@ -80,16 +80,23 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
     }
 
     function goDetail(index) {
+        const {status} = props.data
         if (index == 0 && props.data.fast.status == 'OG') {
             const { event_id, schedule_id } = props.data.fast.timeline[0]
             jumpPage(`/_health/pages/timeline_detail?event_id=${event_id}&schedule_id=${schedule_id}`)
             return
         }
-        else if (index == 1 && (props.data.sleep.status == 'OG' || props.data.status == 'OG3')) {
+        else if (index == 1 && (props.data.sleep.status == 'OG' || status == 'OG3')) {
             const { event_id, schedule_id } = props.data.sleep.timeline[0]
             jumpPage(`/_health/pages/timeline_detail?event_id=${event_id}&schedule_id=${schedule_id}`)
             return
         }
+        else if (index == 2 && status == 'OG3'){
+            const { event_id, schedule_id } = props.data.sleep.timeline[0]
+            const {window_id} = props.data.sleep
+            jumpPage(`/_health/pages/timeline_detail?type=recent&isfastsleep=0&window_id=${window_id}&event_id=${event_id}&schedule_id=${schedule_id}`)
+            return
+        }
         vibrate()
 
     }
@@ -291,7 +298,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
         }
 
         function rightView() {
-            if (index == 2 && status == 'OG3') return null
+            if (index == 2 && status == 'OG3') return <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
             if (isError) {
                 return <View style={{
                     borderColor: MainColorType.error,
@@ -301,7 +308,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                 }}>
                     <NewButton
                         type={NewButtonType.gray}
-                        title='Correct'
+                        title={t('health.correct')}
                         // fontSize={rpxToPx(34)}
                         width={rpxToPx(128)}
                         height={rpxToPx(72)}
@@ -402,7 +409,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
                 <View className="error_icon_bg">
                     <Image src={require('@assets/_health/tip_error.png')} style={{ width: rpxToPx(26), height: rpxToPx(26) }} />
                 </View>
-                <Text className="h24" style={{ lineHeight: rpxToPx(36) + 'px' }}>Logged times are not in their proper order</Text>
+                <Text className="h24" style={{ lineHeight: rpxToPx(36) + 'px' }}>{t('health.log_time_correct')}</Text>
             </View>
         }
         {

+ 3 - 3
src/_health/components/fast_sleep_popup.tsx

@@ -65,7 +65,7 @@ export default function FastSleepPopup(props: { close: any, data: any,top?:numbe
         else if (status == 'OG2_NO1') {
             return ('')
         }
-        return <View className="line_height_48 h30 bold" style={{ color: MainColorType.fast }}>{TimeFormatter.calculateTimeDifference(fast.real.start_timestamp, sleep.real.start_timestamp,false,true)}</View>
+        return <View className="line_height_48 h30 bold" style={{ color: MainColorType.fast,flexShrink:0 }}>{TimeFormatter.calculateTimeDifference(fast.real.start_timestamp, sleep.real.start_timestamp,false,true)}</View>
     }
 
     function step2() {
@@ -81,9 +81,9 @@ export default function FastSleepPopup(props: { close: any, data: any,top?:numbe
             return <View className="time_count h30 bold" style={{ backgroundColor: MainColorType.sleep }}>{TimeFormatter.countdown(sleep.real.start_timestamp)}</View>
         }
         else if (status == 'OG3') {
-            return <View className="h30 bold" style={{ color: MainColorType.sleep }}>{TimeFormatter.calculateTimeDifference(sleep.real.start_timestamp, sleep.real.end_timestamp,false,true)}</View>
+            return <View className="line_height_48 h30 bold" style={{ color: MainColorType.sleep,flexShrink:0 }}>{TimeFormatter.calculateTimeDifference(sleep.real.start_timestamp, sleep.real.end_timestamp,false,true)}</View>
         }
-        return <View className="h30 bold" style={{ color: MainColorType.sleep }}>{TimeFormatter.calculateTimeDifference(sleep.target.start_timestamp, sleep.target.end_timestamp,false,true)}</View>
+        return <View className="line_height_48 h30 bold" style={{ color: MainColorType.sleep,flexShrink:0 }}>{TimeFormatter.calculateTimeDifference(sleep.target.start_timestamp, sleep.target.end_timestamp,false,true)}</View>
     }
 
     function step3() {

+ 25 - 7
src/_health/components/post_moment_time.tsx

@@ -35,20 +35,38 @@ export default function PostMomentTime(props: {
     const [showMore, setShowMore] = useState(false)
     const [time, setTime] = useState(props.time)
     const [minutes, setMinutes] = useState(30)
-    const {t} = useTranslation()
+    const { t } = useTranslation()
 
     function durationTime() {
         var hour = Math.floor(minutes / 60)
         var minute = minutes % 60
         var str = ''
         if (hour > 0) {
-            str = hour + '小时'
+            if (global.language == 'en') {
+                str = hour + (hour == 1 ? ' hr ' : ' hrs ')
+            }
+            else {
+                str = hour + '小时'
+            }
+
         }
         if (minute > 0) {
-            str += minute + '分钟'
+            if (global.language == 'en') {
+                str += minute + ' mins'
+            }
+            else {
+                str += minute + '分钟'
+            }
+
         }
         if (hour == 0 && minute == 0) {
-            str = '0分钟'
+            if (global.language == 'en') {
+                str = '0 mins'
+            }
+            else {
+                str = '0分钟'
+            }
+
         }
         return str
     }
@@ -133,7 +151,7 @@ export default function PostMomentTime(props: {
                     color={iFast ? MainColorType.fast : MainColorType.sleep}
     */
     return <NewModal
-        title={props.title??'开始时间'}
+        title={props.title ?? '开始时间'}
         dismiss={props.dismiss}
         confirm={() => {
             var date = new Date(selDate + ' ' + time + ':00')
@@ -171,7 +189,7 @@ export default function PostMomentTime(props: {
 
                 // footerTitle={scheduleTime()}
                 enterTimestamp={global.set_time}
-                targetTimestamp={props.moment && props.moment.target?props.moment.target.timestamp:new Date().getTime()}
+                targetTimestamp={props.moment && props.moment.target ? props.moment.target.timestamp : new Date().getTime()}
 
                 // tapFooter={() => {
                 //     if (time == dayjs(props.moment.target.timestamp).format('HH:mm')) {
@@ -258,7 +276,7 @@ export default function PostMomentTime(props: {
                     <NewButton
                         onClick={() => setShowMore(true)}
                         type={NewButtonType.link}
-                        title='Show More'
+                        title={global.language == 'en' ? 'Show More' : '查看更多'}
                     />
             }
 

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

@@ -489,7 +489,7 @@ export default function AddMoment() {
             <View style={{ height: rpxToPx(40), flexShrink: 0 }} />
 
 
-            <Textarea placeholder="简单描述(选填)" className="textarea g01"
+            <Textarea placeholder={t('health.add_text')} className="textarea g01"
                 placeholder-style="color:#B2B2B2"
                 value={desc}
                 onInput={e => {

+ 23 - 24
src/_health/pages/guide_active.tsx

@@ -148,7 +148,6 @@ export default function GuideActive() {
     }
 
     function items() {
-        console.log(labels.length)
         var items = list.filter(item => item.window == 'ACTIVE')
         if (items.length == 0) {
             if (labels.length == 0) return <View />
@@ -279,28 +278,28 @@ export default function GuideActive() {
                         gray={isDisable(obj)}
                         days={obj.plus_days != 0 ? obj.plus_days : null}
                         hideReminderIcon={true}
-                        onDelete={() => {
-                            const scenario = getScenario(health.windows, 'ACTIVE')
-                            if (scenario.access.min >= items.length) {
-                                showAlert({
-                                    title: '删除',
-                                    content: '最少保留' + items.length + '个',
-                                    showCancel: true,
-                                    confirm: () => {
-                                    }
-                                })
-                                return
-                            }
-                            var array = JSON.parse(JSON.stringify(list))
-                            for (var j = 0; j < array.length; j++) {
-                                if (array[j].id == obj.id) {
-                                    array.splice(j, 1)
-                                }
-                            }
-                            setList(array)
-                            check(array)
-                            global.refreshWindow()
-                        }}
+                        // onDelete={() => {
+                        //     const scenario = getScenario(health.windows, 'ACTIVE')
+                        //     if (scenario.access.min >= items.length) {
+                        //         showAlert({
+                        //             title: '删除',
+                        //             content: '最少保留' + items.length + '个',
+                        //             showCancel: true,
+                        //             confirm: () => {
+                        //             }
+                        //         })
+                        //         return
+                        //     }
+                        //     var array = JSON.parse(JSON.stringify(list))
+                        //     for (var j = 0; j < array.length; j++) {
+                        //         if (array[j].id == obj.id) {
+                        //             array.splice(j, 1)
+                        //         }
+                        //     }
+                        //     setList(array)
+                        //     check(array)
+                        //     global.refreshWindow()
+                        // }}
                         onChange={(time) => {
                             var array = JSON.parse(JSON.stringify(list))
                             array.map(item => {
@@ -372,7 +371,7 @@ export default function GuideActive() {
         <View className="main_footer">
             <NewButton
                 type={NewButtonType.fill}
-                title="下一步"
+                title={t('health.next')}
                 disable={errors.length > 0}
                 color={MainColorType.active}
                 width={rpxToPx(646)}

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

@@ -359,7 +359,7 @@ export default function GuideEat() {
 
             <NewButton
                 type={NewButtonType.fill}
-                title="下一步"
+                title={t('health.next')}
                 disable={errors.length > 0}
                 color={MainColorType.eat}
                 width={rpxToPx(646)}

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

@@ -201,7 +201,7 @@ export default function GuideFast() {
         <View className="main_footer">
             <NewButton
                 type={NewButtonType.fill}
-                title="下一步"
+                title={t('health.next')}
                 disable={errors.length > 0}
                 color={MainColorType.fast}
                 width={rpxToPx(646)}

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

@@ -139,7 +139,7 @@ export default function GuideFull() {
         <View className="main_footer">
             <NewButton
                 type={NewButtonType.fill}
-                title="完成"
+                title={t('health.done')}
                 color={MainColorType.fast}
                 width={rpxToPx(646)}
                 height={rpxToPx(96)}

+ 11 - 2
src/_health/pages/guide_sleep.tsx

@@ -202,10 +202,19 @@ export default function GuideSleep() {
 
         // 格式化返回结果
         if (hours > 0 && minutes > 0) {
+            if (global.language == 'en'){
+                return `${hours} ${hours==1?'hr':'hrs'} ${minutes} ${minutes==1?'min':'mins'}`;
+            }
             return `${hours}小时${minutes}分钟`;
         } else if (hours > 0) {
+            if (global.language == 'en'){
+                return `${hours} ${hours==1?'hr':'hrs'}`;
+            }
             return `${hours}小时`;
         } else {
+            if (global.language == 'en'){
+                return `${minutes} ${minutes==1?'min':'mins'}`;
+            }
             return `${minutes}分钟`;
         }
     }
@@ -262,13 +271,13 @@ export default function GuideSleep() {
         <View className="main_footer">
             <NewButton
                 type={NewButtonType.link}
-                title="了解更多"
+                title={t('health.learn_more')}
                 onClick={more}
             />
             <View style={{ height: rpxToPx(60) }} />
             <NewButton
                 type={NewButtonType.fill}
-                title="下一步"
+                title={t('health.next')}
                 disable={errors.length > 0}
                 color={MainColorType.sleep}
                 width={rpxToPx(646)}

+ 87 - 43
src/_health/pages/log_time.tsx

@@ -183,26 +183,53 @@ export default function LogTime() {
 
             if (isFast) {
                 timeline = isStart ? fast.timeline[0] : fast.timeline[1]
+                var fastScenario = getScenario(health.windows, 'FAST')
+                if (!isFastWithSleep) {
+
+                    timeline = isStart ? fastScenario.timeline[0] : fastScenario.timeline[1]
+                }
                 Taro.setNavigationBarTitle({
                     title: isStart ? fast.timeline[0].title : fast.timeline[1].title
                 });
 
                 //特殊处理单场景下,结束,超过24小时,picker设置为target_end_time
-                if (!isStart && new Date().getTime() - fast.timeline[0].target.timestamp >= 24 * 3600 * 1000) {
-                    time = dayjs(fast.timeline[1].target.timestamp).format('HH:mm')
-                    date = dayjs(fast.timeline[1].target.timestamp).format('YYYY-MM-DD')
+                if (isFastWithSleep) {
+                    if (!isStart && new Date().getTime() - fast.timeline[0].target.timestamp >= 24 * 3600 * 1000) {
+                        time = dayjs(fast.timeline[1].target.timestamp).format('HH:mm')
+                        date = dayjs(fast.timeline[1].target.timestamp).format('YYYY-MM-DD')
+                    }
+                }
+                else {
+                    if (!isStart && new Date().getTime() - fastScenario.timeline[0].target.timestamp >= 24 * 3600 * 1000) {
+                        time = dayjs(fastScenario.timeline[1].target.timestamp).format('HH:mm')
+                        date = dayjs(fastScenario.timeline[1].target.timestamp).format('YYYY-MM-DD')
+                    }
                 }
+
             }
             else {
                 timeline = isStart ? sleep.timeline[0] : sleep.timeline[1]
+                var fastScenario = getScenario(health.windows, 'SLEEP')
+                if (!isFastWithSleep) {
+
+                    timeline = isStart ? fastScenario.timeline[0] : fastScenario.timeline[1]
+                }
                 Taro.setNavigationBarTitle({
                     title: isStart ? sleep.timeline[0].title : sleep.timeline[1].title
                 });
 
                 //特殊处理单场景下,结束,超过24小时,picker设置为target_end_time
-                if (!isStart && new Date().getTime() - sleep.timeline[0].target.timestamp >= 24 * 3600 * 1000) {
-                    time = dayjs(sleep.timeline[1].target.timestamp).format('HH:mm')
-                    date = dayjs(sleep.timeline[1].target.timestamp).format('YYYY-MM-DD')
+                if (isFastWithSleep) {
+                    if (!isStart && new Date().getTime() - sleep.timeline[0].target.timestamp >= 24 * 3600 * 1000) {
+                        time = dayjs(sleep.timeline[1].target.timestamp).format('HH:mm')
+                        date = dayjs(sleep.timeline[1].target.timestamp).format('YYYY-MM-DD')
+                    }
+                }
+                else {
+                    if (!isStart && new Date().getTime() - fastScenario.timeline[0].target.timestamp >= 24 * 3600 * 1000) {
+                        time = dayjs(fastScenario.timeline[1].target.timestamp).format('HH:mm')
+                        date = dayjs(fastScenario.timeline[1].target.timestamp).format('YYYY-MM-DD')
+                    }
                 }
             }
             if (router.params.longfast) {
@@ -212,7 +239,8 @@ export default function LogTime() {
             }
 
 
-
+            var time = dayjs().format('HH:mm')
+            var date = dayjs().format('YYYY-MM-DD')
 
             list.push({
                 event_id: timeline.event_id,
@@ -224,6 +252,7 @@ export default function LogTime() {
                     confirm_time: enterTime
                 }
             })
+            debugger
             setExpandIndex(0)
         }
         else {
@@ -253,6 +282,7 @@ export default function LogTime() {
                         title: i == 1 ? sleep.timeline[0].title : sleep.timeline[1].title
                     });
                 }
+                debugger
                 list.push({
                     event_id: timeline.event_id,
                     schedule_id: timeline.schedule_id,
@@ -284,31 +314,32 @@ export default function LogTime() {
             sleepEndTime = fastEndTime - fastEndtoWakeDuration//(fast.target.end_timestamp-sleep.target.end_timestamp)
             sleepStartTime = sleepEndTime - sleep.target.duration
 
-            var isConflict = false;
-            if (fast.real && fast.real.start_timestamp && fast.real.start_timestamp > fastStartTime) {
-                isConflict = true;
-            }
-            else if (sleep.real && sleep.real.start_timestamp && sleep.real.start_timestamp > sleepStartTime) {
-                isConflict = true;
-            }
-            else if (sleep.real && sleep.real.end_timestamp && sleep.real.end_timestamp > sleepEndTime) {
-                isConflict = true;
-            }
+            var isConflict = true
+            // var isConflict = false;
+            // if (fast.real && fast.real.start_timestamp && fast.real.start_timestamp < fastStartTime) {
+            //     isConflict = true;
+            // }
+            // else if (sleep.real && sleep.real.start_timestamp && sleep.real.start_timestamp > sleepStartTime) {
+            //     isConflict = true;
+            // }
+            // else if (sleep.real && sleep.real.end_timestamp && sleep.real.end_timestamp > sleepEndTime) {
+            //     isConflict = true;
+            // }
 
-            if (!isConflict) {
-                list[0].date = dayjs(fastStartTime).format('YYYY-MM-DD')
-                list[0].time = dayjs(fastStartTime).format('HH:mm')
+            // if (!isConflict) {
+            //     list[0].date = dayjs(fastStartTime).format('YYYY-MM-DD')
+            //     list[0].time = dayjs(fastStartTime).format('HH:mm')
 
-                list[1].date = dayjs(sleepStartTime).format('YYYY-MM-DD')
-                list[1].time = dayjs(sleepStartTime).format('HH:mm')
+            //     list[1].date = dayjs(sleepStartTime).format('YYYY-MM-DD')
+            //     list[1].time = dayjs(sleepStartTime).format('HH:mm')
 
-                if (list.length > 2) {
-                    list[2].date = dayjs(sleepEndTime).format('YYYY-MM-DD')
-                    list[2].time = dayjs(sleepEndTime).format('HH:mm')
+            //     if (list.length > 2) {
+            //         list[2].date = dayjs(sleepEndTime).format('YYYY-MM-DD')
+            //         list[2].time = dayjs(sleepEndTime).format('HH:mm')
 
-                }
+            //     }
 
-            }
+            // }
 
             if (fast.real && fast.real.start_timestamp) {
                 list[0].date = dayjs(fast.real.start_timestamp).format('YYYY-MM-DD')
@@ -333,6 +364,7 @@ export default function LogTime() {
             list[0].time = ''
             list[0].date = ''
         }
+        debugger
         setArray(list)
 
         setLoaded(true)
@@ -627,15 +659,19 @@ export default function LogTime() {
                     setRequestId(new Date().getTime())
                     console.log(new Date().getTime())
                     showAlert({
-                        title: 'Saving as Long Fast',
-                        content: 'Fasting that lasts more than 24 hours will be saved as Long Fast. ',
+                        title: t('health.save_as_lf_title'),
+                        content: t('health.save_as_lf_desc'),
                         showCancel: true,
-                        cancelText: '取消',
-                        confirmText: '保存',
+                        cancelText: t('health.cancel'),
+                        confirmText: t('health.save'),
                         cancel: () => {
                         },
                         confirm: () => {
                             tapCommit(false, false, (res as any).warn_code)
+                            // Taro.showToast({
+                            //     title: t('health.save_as_lf_toast'),
+                            //     icon: 'success'
+                            // })
                         }
                     })
                     return
@@ -643,15 +679,19 @@ export default function LogTime() {
                 if ((res as any).warn_code == 'SAVE_AS_IF') {
                     setRequestId(new Date().getTime())
                     showAlert({
-                        title: 'Saving as Intermittent Fasting',
-                        content: 'Fasting that lasts fewer than 24 hours will be saved as Intermittent Fasting.',
+                        title: t('health.save_as_if_title'),
+                        content: t('health.save_as_if_desc'),
                         showCancel: true,
-                        cancelText: '取消',
-                        confirmText: '保存',
+                        cancelText: t('health.cancel'),
+                        confirmText: t('health.save'),
                         cancel: () => {
                         },
                         confirm: () => {
                             tapCommit(false, false, (res as any).warn_code)
+                            // Taro.showToast({
+                            //     title: t('health.save_as_if_toast'),
+                            //     icon: 'success'
+                            // })
                         }
                     })
                     return
@@ -747,7 +787,13 @@ export default function LogTime() {
         }
         var time2 = timestamp + duration
         if (router.params.longfast) {
-            return 'Expect to end fast at ' + dayjs(time2).format('MM-DD HH:mm')
+            if (TimeFormatter.isToday(time2)) {
+                return t('health.end_fast_date_time', { date: global.language == 'en' ? 'today' : '今天', time: dayjs(time2).format('HH:mm') })
+            }
+            else if (TimeFormatter.isTomorrowday(time2)) {
+                return t('health.end_fast_date_time', { date: global.language == 'en' ? 'tomorrow' : '明天', time: dayjs(time2).format('HH:mm') })
+            }
+            return t('health.end_fast_date_time', { date: global.language == 'en' ? dayjs(time2).format('on MMM D') : dayjs(time2).format('MMMD日'), time: dayjs(time2).format('HH:mm') })//'Expect to end fast at ' + dayjs(time2).format('MM-DD HH:mm')
         }
         var strTime = TimeFormatter.dayjsFormat(time2, false)
         if (isFast) {
@@ -768,6 +814,7 @@ export default function LogTime() {
         var time = array[index].time
         var min = enterTime
         var max = new Date().getTime()
+        debugger
         if (iFast) {
             var timeline = index == 0 ? fast.timeline[0] : fast.timeline[1]
             if (!isFastWithSleep) {
@@ -902,9 +949,6 @@ export default function LogTime() {
             showLine={showLine}
             targetTimestamp={timeline.target.timestamp}
             enterTimestamp={enterTime}
-            // footerTitle=""
-            // footerTitle={changeTimeText(timeline.target.timestamp,data, time)}
-            // tapFooter={() => tapChangeTime(schedule_time, time, index)}
             color={iFast ? MainColorType.fast : MainColorType.sleep}
             minTimestamp={min}
             maxTimestamp={max}
@@ -1099,7 +1143,7 @@ export default function LogTime() {
 
     if (!loaded) return <View />
 
-    return <View className="page_container">
+    return <View className="page_container" style={{minHeight:'101vh'}}>
         <View style={{ height: rpxToPx(36) }} />
         <Card>
             <View style={{ display: 'flex', flexDirection: 'column' }}>
@@ -1118,7 +1162,7 @@ export default function LogTime() {
                         <View className="error_icon_bg" style={{ backgroundColor: MainColorType.success }}>
                             <Image src={require('@assets/_health/tip_check.png')} style={{ width: rpxToPx(26), height: rpxToPx(26) }} />
                         </View>
-                        <Text className="h24" style={{ lineHeight: rpxToPx(36) + 'px' }}>成功提示</Text>
+                        <Text className="h24" style={{ lineHeight: rpxToPx(36) + 'px' }}>{t('health.auto_save')}</Text>
                     </View>
                 }
                 {
@@ -1132,7 +1176,7 @@ export default function LogTime() {
 
         </Card>
         <View style={{ height: rpxToPx(36) }} />
-        {
+        {/* {
             isSingle && isStart && !showGoal && <View style={{ height: rpxToPx(72), marginTop: rpxToPx(18) }}>
                 <NewButton
                     type={NewButtonType.link}
@@ -1142,7 +1186,7 @@ export default function LogTime() {
                     }}
                 />
             </View>
-        }
+        } */}
         {
             goalCard()
         }

+ 13 - 9
src/_health/pages/long_fast.tsx

@@ -76,11 +76,11 @@ export default function LongFast() {
         const fast = getScenario(health.windows, 'FAST')
         if (fast.status == 'OG') {
             showAlert({
-                title: '断食进行中',
-                content: '当前有一个正在进行的间歇性断食记录,要转换为长断食吗?',
+                title: t('health.if_progress_title'),
+                content: t('health.if_progress_desc'),
                 showCancel: true,
-                cancelText: '取消',
-                confirmText: '转换',
+                cancelText: t('health.cancel'),
+                confirmText: t('health.switch'),
                 confirm: () => {
                     // 
                     updateFast({ fast_type: 'LF' }).then(res => {
@@ -170,15 +170,19 @@ export default function LongFast() {
         clockTimes('', params).then(res => {
             if ((res as any).warn_code == 'SAVE_AS_IF') {
                 showAlert({
-                    title: 'Saving as Intermittent Fasting',
-                    content: 'Fasting that lasts fewer than 24 hours will be saved as Intermittent Fasting.',
+                    title: t('health.save_as_if_title'),
+                    content: t('health.save_as_if_desc'),
                     showCancel: true,
-                    cancelText: '取消',
-                    confirmText: '保存',
+                    cancelText: t('health.cancel'),
+                    confirmText: t('health.save'),
                     cancel: () => {
                     },
                     confirm: () => {
                         save((res as any).warn_code)
+                        // Taro.showToast({
+                        //     title:t('health.save_as_if_toast'),
+                        //     icon:'success'
+                        // })
                     }
                 })
                 return
@@ -299,7 +303,7 @@ export default function LongFast() {
                 (historyRef.current as any).more()
             }
         }}
-    ><View className="page_container">
+    ><View className="page_container" style={{minHeight:'101vh'}}>
             <NewHeader type={NewHeaderType.left_subtitle}
                 title={t('health.long_fast')}
                 subtitle={t('health.long_fast_subtitle')}

+ 49 - 25
src/_health/pages/move.tsx

@@ -12,7 +12,7 @@ import { getActiveMoves, getActiveMovesCurrent, uploadActiveMoves } from "@/serv
 import dayjs from "dayjs";
 import { TimeFormatter } from "@/utils/time_format";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
-import { rpxToPx } from "@/utils/tools";
+import { rpxToPx, vibrate } from "@/utils/tools";
 import { IconActive, IconMore, IconSit } from "@/components/basic/Icons";
 import NewHeader, { NewHeaderType } from "../components/new_header";
 import NewButton, { NewButtonType } from "../base/new_button";
@@ -26,6 +26,7 @@ let timer
 let myScrollTop = 0
 export default function Move() {
     const health = useSelector((state: any) => state.health);
+    const user = useSelector((state: any) => state.user);
     const [allowRun, setAllowRun] = useState(false)
     const [loaded, setLoaded] = useState(false)
     const [loadAuth, setLoadAuth] = useState(false)
@@ -38,7 +39,7 @@ export default function Move() {
     const [moreActive, setMoreActive] = useState(false)
     const [hours, setHours] = useState<any>([])
     const [startDate, setStarteDate] = useState('')
-    const [btnDisable,setBtnDisable] = useState(false)
+    const [btnDisable, setBtnDisable] = useState(false)
 
     const [isPulling, setIsPulling] = useState(false)
     const [itemLayouts, setItemLayouts] = useState<any>([])
@@ -180,12 +181,12 @@ export default function Move() {
         myScrollTop = top
         if (e.detail.scrollTop > 70) {
             Taro.setNavigationBarTitle({
-                title:t('health.move_every_hour')
+                title: t('health.move_every_hour')
             })
         }
         else {
             Taro.setNavigationBarTitle({
-                title:''
+                title: ''
             })
         }
 
@@ -199,7 +200,7 @@ export default function Move() {
 
                     // 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 date1 = currentDate.substring(0, 4) + '-' + currentDate.substring(4, 6) + '-' + currentDate.substring(6, 8)
                     var timestamp = new Date(date1).getTime()
 
                     if (TimeFormatter.isTimestampInThisWeek(timestamp)) {
@@ -306,7 +307,7 @@ export default function Move() {
                 getMovesCurrent()
                 getMovesHistory(1)
                 setBtnDisable(false)
-            }).catch(e=>{
+            }).catch(e => {
                 setBtnDisable(false)
             })
         }).catch(_ => {
@@ -332,7 +333,7 @@ export default function Move() {
                 }).then(res => {
                     if ((res as any).error_code == 'WX_STEP_PARSE_FAIL') {
                         Taro.showToast({
-                            title: '获取失败',
+                            title: global.language == 'en' ? 'Get Failed' : '获取失败',
                             icon: 'none'
                         })
                         return
@@ -506,7 +507,7 @@ export default function Move() {
                                     }}
                                     type={NewButtonType.link}
                                     fontSize={rpxToPx(24)}
-                                    title={moreActive ? t('health.show_less') : t('health.show_all',{count:hours.length})}
+                                    title={moreActive ? t('health.show_less') : t('health.show_all', { count: hours.length })}
                                     btnStyle={{ minWidth: rpxToPx(170) }}
                                 />
                             </View>
@@ -580,12 +581,12 @@ export default function Move() {
                 const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
                 const seconds = String(totalSeconds % 60).padStart(2, '0');
 
-                return <Text className="console_footer" style={{ color: getThemeColor('ACTIVE') }}>Ending soon {minutes}:{seconds}</Text>
+                return <Text className="console_footer" style={{ color: getThemeColor('ACTIVE') }}>{t('health.end_soon', { time: minutes + ':' + seconds })} </Text>
             }
 
             const pre = new Date().getTime()
             const next = new Date().getTime() + 3600 * 1000
-            return <Text className="console_footer">Check In available {dayjs(pre).format('HH:50')}-{dayjs(next).format('HH:10')}</Text>
+            return <Text className="console_footer">{t('health.check_in_available', { time: dayjs(pre).format('HH:50') + '-' + dayjs(next).format('HH:10') })}</Text>
         }
 
         const minute = new Date().getMinutes()
@@ -606,7 +607,7 @@ export default function Move() {
             const seconds = String(totalSeconds % 60).padStart(2, '0');
 
             // return `${hours}:${minutes}:${seconds}`;
-            return <Text className="console_footer">Opening soon {minutes}:{seconds}</Text>
+            return <Text className="console_footer">{t('health.open_soon', { time: minutes + ':' + seconds })}</Text>
         }
 
         let time = new Date()
@@ -621,7 +622,7 @@ export default function Move() {
         // const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
         const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
         const seconds = String(totalSeconds % 60).padStart(2, '0');
-        return <Text className="console_footer">Opening soon {minutes}:{seconds}</Text>
+        return <Text className="console_footer">{t('health.open_soon', { time: minutes + ':' + seconds })}</Text>
     }
 
     function hourIndex() {
@@ -651,18 +652,26 @@ export default function Move() {
 
     }
 
-    function becomeTime() {
+    function becomeTime(isSleep: boolean) {
         var hour = new Date().getHours()
         var tHour = parseInt(getDuration().substring(0, 2))
         if (isExtra()) {
             tHour = data.hours[0].hour
         }
+        if (isSleep) {
+            if (hour > tHour) {
+                return global.language == 'en' ? t('health.check_reopen', { time: 'tomorrow at ' + data.hours[0].hour + ':50' }) :
+                    t('health.check_reopen', { time: '明天' + data.hours[0].hour + ':50' })
+                // return `Check in begins at ${getDuration().substring(0, 2)}:50 tomorrow`
+            }
+            return t('health.check_reopen', { time: data.hours[0].hour + ':50' })
+        }
         if (hour > tHour) {
-            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 global.language == 'en' ? t('health.check_begin_at', { time: 'tomorrow at ' + getDuration().substring(0, 2) + ':50' }) :
+                t('health.check_begin_at', { time: '明天' + getDuration().substring(0, 2) + ':50' })
             // return `Check in begins at ${getDuration().substring(0, 2)}:50 tomorrow`
         }
-        return t('health.check_begin_at',{time:getDuration().substring(0, 2)+':50'})
+        return t('health.check_begin_at', { time: getDuration().substring(0, 2) + ':50' })
     }
 
     function consolePanel() {
@@ -689,37 +698,52 @@ export default function Move() {
                 color: isExtra() ? getThemeColor('SLEEP') : getThemeColor('ACTIVE'),
                 lineHeight: isExtra() ? rpxToPx(60) + 'px' : rpxToPx(42) + 'px'
             }}>{
-                    isExtra() ? 'Sleep well.' : getStatus() == 'open' ? `Think you've hit ${getCurrentTarget()} steps this hour?` : `Hit ${getCurrentTarget()} steps within the hour`
+                    isExtra() ? t('health.sleep_well') : getStatus() == 'open' ? t('health.think_goal_title', { steps: getCurrentTarget() }) : t('health.hit_steps', { steps: getCurrentTarget() })
                 }</Text>
             <View style={{ height: rpxToPx(48), }} />
 
             {
                 isExtra() ? <NewButton type={NewButtonType.gray}
+                    onClick={() => {
+                        if (user.test_user) {
+                            tapLog()
+                        }
+                        else {
+                            vibrate()
+                        }
+                    }}
                     width={rpxToPx(502)}
                     height={rpxToPx(96)}
                     fontSize={rpxToPx(26)}
                     bold
                     // disable
-                    title={becomeTime()}
+                    title={becomeTime(true)}
                 /> : getStatus() == 'open' ?
                     <NewButton type={NewButtonType.fill}
                         onClick={tapLog}
                         width={rpxToPx(502)}
                         height={rpxToPx(96)}
                         fontSize={rpxToPx(26)}
-                        title="I Think So!"
+                        title={t('health.think_so')}
                         bold
                         color={getThemeColor('ACTIVE')}
                     />
                     :
                     <NewButton type={NewButtonType.gray}
-                        onClick={tapLog}
+                        onClick={() => {
+                            if (user.test_user) {
+                                tapLog()
+                            }
+                            else {
+                                vibrate()
+                            }
+                        }}
                         width={rpxToPx(502)}
                         height={rpxToPx(96)}
                         fontSize={rpxToPx(26)}
                         bold
                         // disable
-                        title={becomeTime()}
+                        title={becomeTime(false)}
                     />
                 // <View className="console_checkbtn" onClick={tapLog}>{becomeTime()}</View>
             }
@@ -734,7 +758,7 @@ export default function Move() {
 
     function toolBtnText() {
         var str = ''
-        if (data.hours.length - hours.length ==1){
+        if (data.hours.length - hours.length == 1) {
             str = t('health.upcoming')
         }
         else {
@@ -907,8 +931,8 @@ export default function Move() {
                             return <View key={index} id={`history-${index}`} className="history_item" onClick={() => goDetail(item)}>
                                 {/* <Text className="history_item_date">{(item.date + '').substring(6, 8)}</Text> */}
                                 <View className="cell_date" >
-                                    <View className="h42 bold" style={{ lineHeight: rpxToPx(60) + 'px' }}>{historyDate(item,index)}</View>
-                                    <View className="h24 bold" style={{ marginLeft: rpxToPx(6), marginTop: rpxToPx(13), lineHeight: rpxToPx(47) + 'px' }}>{historyMonth(item,index)}</View>
+                                    <View className="h42 bold" style={{ lineHeight: rpxToPx(60) + 'px' }}>{historyDate(item, index)}</View>
+                                    <View className="h24 bold" style={{ marginLeft: rpxToPx(6), marginTop: rpxToPx(13), lineHeight: rpxToPx(47) + 'px' }}>{historyMonth(item, index)}</View>
                                 </View>
                                 <View className="history_item_detail_bg">
                                     <IconActive width={rpxToPx(32)} color={MainColorType.active} />
@@ -921,7 +945,7 @@ export default function Move() {
                     }
                 </View>
             }
-            <View style={{backgroundColor:'#fff',height:rpxToPx(40),flexShrink:0}}/>
+            <View style={{ backgroundColor: '#fff', height: rpxToPx(40), flexShrink: 0 }} />
             <ListFooter noMore={(list.length > 0) && (total == list.length)} />
 
 

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

@@ -105,6 +105,7 @@ export default function MoveSchedule() {
     }
 
     function firstTime(index) {
+        return ''
         var firstIndex = -1;
         var selHour = -1;
         for (var i = 0; i < hours.length; i++) {

+ 7 - 5
src/_health/pages/move_setting_time.tsx

@@ -12,12 +12,14 @@ 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";
 
 export default function MoveSettingTime() {
     const [selIndex, setSelIndex] = useState(-1)
     const [hours, setHours] = useState('')
     const [total, setTotal] = useState('')
     const [detail, setDetail] = useState<any>(null)
+    const {t} = useTranslation()
 
     useEffect(() => {
         getDatas()
@@ -39,8 +41,8 @@ export default function MoveSettingTime() {
         return <View>
             <NewHeader
                 type={NewHeaderType.left_subtitle}
-                title="每小时步数目标"
-                subtitle={`平均 ${hours} 步,全天 ${total} 步`}
+                title={t('health.hour_step_goal')}
+                subtitle={t('health.avg_total_steps',{avg:hours,total:total})}//{`平均 ${hours} 步,全天 ${total} 步`}
             />
             <Card>
                 <View style={{ display: 'flex', flexDirection: 'column', width: rpxToPx(700) }}>
@@ -50,13 +52,13 @@ export default function MoveSettingTime() {
                                 moveCell
                                 status={<StatusIndicator
                                     type={StatusType.normal}
-                                    text={'WALKING HOUR ' + (index + 1)}
+                                    text={t('health.waking_hour')+' ' + (index + 1)}
                                     color={MainColorType.active}
                                 />
                                 }
                                 right={selIndex != index ? <Text className="h26" style={{ color: MainColorType.link }} onClick={() => {
                                     setSelIndex(index)
-                                }}>更改目标</Text> : null}
+                                }}>{t('health.change_goal')}</Text> : null}
                                 disable={true}
                                 showLine={true}
                                 fullLine={false}
@@ -109,7 +111,7 @@ export default function MoveSettingTime() {
         header={null}
         secondPage={true}
         titleColor={'#fff'}
-        title={'每小时步数目标'}
+        title={t('health.hour_step_goal')}
         type={TemplateType.customHeader}
         titleShowStyle={NaviBarTitleShowType.scrollToShow} />
 }

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

@@ -19,6 +19,7 @@ import NewHeader, { NewHeaderType } from "../components/new_header";
 import Card from "../components/card";
 import Layout from "@/components/layout/layout";
 import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
+import { useTranslation } from "react-i18next";
 
 let useRoute;
 let useNavigation;
@@ -51,6 +52,7 @@ export default function SchedulesEdit() {
     const [selItem, setSelItem] = useState<any>(null)
     const [editIndex, setEditIndex] = useState({ row: -1, index: -1 })
     const [delIds, setDelIds] = useState<any>([])
+    const {t} = useTranslation()
 
     useEffect(() => {
         schedules()
@@ -339,7 +341,7 @@ export default function SchedulesEdit() {
             <View className="main_footer">
                 <NewButton
                     type={NewButtonType.fill}
-                    title="完成"
+                    title={t('health.done')}
                     color={getThemeColor(health.mode)}
                     width={rpxToPx(670)}
                     height={rpxToPx(96)}

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

@@ -609,11 +609,11 @@ export default function TimelineDetail() {
         {
             !showEmpty && <View className="detail_header">
                 <Image className="detail_header_header"
-                    src={shareUser ? shareUser.avatar : user.avatar}
+                    src={shareUser ? shareUser.avatar : detail.share_user?detail.share_user.avatar:user.avatar}
                     mode="aspectFill"
                 />
                 <View className="detail_header_content">
-                    <Text className="detail_nickname">{shareUser ? shareUser.nickname : user.nickname}</Text>
+                    <Text className="detail_nickname">{shareUser ? shareUser.nickname :detail.share_user?detail.share_user.nickname: user.nickname}</Text>
                     {
                         (!window_id || window_id == 'undefined') && (detail.scenario != 'MEAL' && detail.scenario != 'ACTIVITY') &&
                         <TimeTitleDesc

+ 139 - 105
src/context/locales/en.js

@@ -937,10 +937,10 @@ export default {
         change_location: 'Change Location',
         clear_location: 'Clear Location',
         delete_current_record: 'Delete Current Record',
-        delete_log:'Delete Log',
+        delete_log: 'Delete Log',
         edit_fast_goal: 'Edit Fast Goal',
         change_step_goal: 'Change Step Goal',
-        log_more:'Log More',
+        log_more: 'Log More',
 
         create_my_active: 'Create My Activities',
 
@@ -1052,121 +1052,155 @@ export default {
         // my_sleep_period:'My Sleep Schedule {{time}}',
         // my_activity_period:'My Activity Schedule {{time}}',
         // my_eating_period:'My Eating Schedule {{time}}',
-        my_period:'From {{start}} to {{end}}',
+        my_period: 'From {{start}} to {{end}}',
 
         // fasting_progress:'Fasting Log in Progress',
         // sleep_progress:'Sleep Log in Progress',
         // meal_progress:'Meal Log in Progress',
         // activity_progress:'Activity Log in Progress',
-        log_progress:'Log in Progress',
-
-        my_activity:'My Activity',
-        my_meal:'My Meal',
-        schedule_time:'Scheduled Time',
-        choose_enter_activity_name:'Enter or Choose Activity Name',
-        chose_enter_time_desc:'Enter or Choose Time Description',
-        choose_enter_meal_label:'Enter or Choose Meal Label',
-        fix_time:'At Fixed Time Every Day',
-        see_full_schedule:'See Full Schedule',
-        edit_name:'Edit Names',
-        edit_order:'Edit Orders',
-        back_no_save:'Exit without Saving',
-
-        verion_tip:'You are upgraded to the latest version',
-        verion_done:'Finish Setup',
-        del_title:'Confirm Delete',
-        del_confirm:'Delete',
-        del_cancel:'Cancel',
-        meal_label:'Meal Label',
-        activity_title:'Activity Title',
-
-        done:'Done',
-        share_moment:'Share Moment',
-        no_content:'No Content',
-
-        add_my_first_activity:'Add My First Activity',
-
-        choose_photo:'Choose from Photos',
-        camera:'Camera',
-        delete:'Delete',
-        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',
+        log_progress: 'Log in Progress',
+
+        my_activity: 'My Activity',
+        my_meal: 'My Meal',
+        schedule_time: 'Scheduled Time',
+        choose_enter_activity_name: 'Enter or Choose Activity Name',
+        chose_enter_time_desc: 'Enter or Choose Time Description',
+        choose_enter_meal_label: 'Enter or Choose Meal Label',
+        fix_time: 'At Fixed Time Every Day',
+        see_full_schedule: 'See Full Schedule',
+        edit_name: 'Edit Names',
+        edit_order: 'Edit Orders',
+        back_no_save: 'Exit without Saving',
+
+        verion_tip: 'You are upgraded to the latest version',
+        verion_done: 'Finish Setup',
+        del_title: 'Confirm Delete',
+        del_confirm: 'Delete',
+        del_cancel: 'Cancel',
+        meal_label: 'Meal Label',
+        activity_title: 'Activity Title',
+
+        done: 'Done',
+        share_moment: 'Share Moment',
+        no_content: 'No Content',
+
+        add_my_first_activity: 'Add My First Activity',
+
+        choose_photo: 'Choose from Photos',
+        camera: 'Camera',
+        delete: 'Delete',
+        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',
-        done:'Done',
-        next:'Next',
-        log_time_title:'Start Time',
-        note_time:'Time',
-        future_time_limit:'Future time cannot be selected',
-
-        choose_member:'Choose Membership',
-        edit:'Edit',
-        cancel:'Cancel',
-        log_out:'Log Out',
-        log_out_title:'Confirm Log Out',
+        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 {{time}}',
+        check_reopen:'Check-In reopens {{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',
+        done: 'Done',
+        next: 'Next',
+        log_time_title: 'Start Time',
+        note_time: 'Time',
+        future_time_limit: 'Future time cannot be selected',
+
+        choose_member: 'Choose Membership',
+        edit: 'Edit',
+        cancel: 'Cancel',
+        log_out: 'Log Out',
+        log_out_title: 'Confirm Log Out',
         auto_save: 'Auto-saved',
 
-        resolve_conflict:'Please resolve conflict first',
-        tip_choose_meal:'Enter or choose a meal label',
-        tip_choose_activity:'Enter or choose an activity title',
-        tip_choose_desc:'Enter or choose a time description',
+        resolve_conflict: 'Please resolve conflict first',
+        tip_choose_meal: 'Enter or choose a meal label',
+        tip_choose_activity: 'Enter or choose an activity title',
+        tip_choose_desc: 'Enter or choose a time description',
 
-        become_member_title:'Become a Member',
-        become_member_desc:'Members can add more than {{count}} {{type}} to their schedule.',
-        member_activity:'activities',
-        member_meal:'meals',
-        not_now:'Not Now',
-        choose_plan:'Enroll',
+        become_member_title: 'Become a Member',
+        become_member_desc: 'Members can add more than {{count}} {{type}} to their schedule.',
+        member_activity: 'activities',
+        member_meal: 'meals',
+        not_now: 'Not Now',
+        choose_plan: 'Enroll',
 
-        keep_at_least:'Keep at least {{number}} {{type}}',
-        no_vip_title:'Become a Member',
-        no_vip_desc:'You can add unlimited meals or activities to your daily schedule',
+        keep_at_least: 'Keep at least {{number}} {{type}}',
+        no_vip_title: 'Become a Member',
+        no_vip_desc: 'Add unlimited meals or activities to your daily schedule',
 
-        long_fast_alert_title:'Long Fast in Progress',
-        long_fast_alert_desc:'During the long fasting period, Fast with Sleep is temporarily unavailable, but you can still log your sleep under the \'Sleep\' tab.',
+        long_fast_alert_title: 'Long Fast in Progress',
+        long_fast_alert_desc: 'During Long Fast, Fast with Sleep is temporarily unavailable, but you can still log your sleep under \'Sleep\' tab.',
         got_it: 'Got it',
-        loading:'Loading...',
-
+        loading: 'Loading...',
+        learn_more: 'Learn More',
+        add_text: 'Add Text',
+        end_fast_date_time: 'End fast {{date}} {{time}}',
+        log_time_correct: 'Logged times are not in their proper order',
+        correct: 'Correct',
+        follow_wechat: 'Follow WeChat',
+        follow_system: 'Follow System',
+
+        switch: 'Switch',
+        save:'Save',
+        lf_progress_title: 'Long Fast in Progress',
+        lf_progress_desc: 'Do you want to switch it to Intermittent Fasting?',
+        if_progress_title: 'Intermittent Fasting in Progress',
+        if_progress_desc: 'Do you want to switch it to Long Fast?',
+
+        save_as_if_title:'Saving as Intermittent Fasting',
+        save_as_if_desc:'Fasting that lasts less than 24 hours will be saved as Intermittent Fasting',
+        save_as_if_toast:'Saved to \'Fast/Recents\'',
+        save_as_lf_title:'Saving as Long Fast',
+        save_as_lf_desc:'Fasting that lasts 24 hours or more will be saved as Long Fast',
+        save_as_lf_toast:'Saved to \'Long Fast/Recents\'',
+
+        sleep_well:'Sleep Well.',
+        think_goal_title:'Think you\'ve hit {{steps}} steps this hour?',
+        think_so:'I Think So!',
+        end_soon:'Ending soon {{time}}',
+        open_soon:'Opening soon {{time}}',
+        check_in_available:'Check In available {{time}}',
+        hit_steps:'Hit {{steps}} steps within the hour',
+
+        change_goal:'Change Goal',
+        hit_steps2:'Hit {{steps}} steps',
+        hour_step_goal:'Hourly Step Goal',
+        avg_total_steps:'Average {{avg}} steps, Total {{total}} steps',
     }
 }

+ 44 - 9
src/context/locales/zh.js

@@ -1113,7 +1113,8 @@ export default {
         no_active_hour: '暂无活跃小时',
         see_full_check: '查看完整打卡日程',
 
-        check_begin_at: '打卡于 {{time}} 开始',
+        check_begin_at: '打卡将于 {{time}} 开放',
+        check_reopen:'打卡将于{{time}}重新开放',
         kcal: ' 千卡',
         km: ' 公里',
         steps: '步',
@@ -1156,17 +1157,51 @@ export default {
 
         become_member_title: '成为会员',
         become_member_desc: '会员可以在日程中添加超过{{count}}个{{type}}',
-        member_activity:'活动',
-        member_meal:'餐次',
+        member_activity: '活动',
+        member_meal: '餐次',
         not_now: '暂不',
         choose_plan: '选择计划',
 
-        keep_at_least:'需保留至少{{number}}个{{type}}',
-        no_vip_title:'成为会员',
-        no_vip_desc:'您可在您每天的日程中,添加无限多个餐次或活动',
-        long_fast_alert_title:'长断食进行中',
-        long_fast_alert_desc:'长断食期间,“断食与睡眠”功能暂不可用。不过您仍可在“睡眠”窗口下记录您的睡眠。',
+        keep_at_least: '需保留至少{{number}}个{{type}}',
+        no_vip_title: '成为会员',
+        no_vip_desc: '在您每天的日程中,添加无限多个餐次或活动',
+        long_fast_alert_title: '长断食进行中',
+        long_fast_alert_desc: '长断食期间,“断食与睡眠”功能暂不可用。不过您仍可在“睡眠”窗口下记录您的睡眠。',
         got_it: '我知道了',
-        loading:'正在加载...',
+        loading: '正在加载...',
+        learn_more: '了解更多',
+        add_text: '添加正文',
+        end_fast_date_time: '{{date}}{{time}}结束断食',
+        log_time_correct: '记录的时间顺序不正确',
+        correct: '更正',
+        follow_wechat: '跟随微信',
+        follow_system: '跟随系统',
+
+        switch:'转换',
+        save:'保存',
+        lf_progress_title:'长断食进行中',
+        lf_progress_desc:'要将它转换为间歇性断食吗?',
+        if_progress_title:'间歇性断食进行中',
+        if_progress_desc:'要将它转换为长断食吗?',
+
+        save_as_if_title:'保存为间歇性断食',
+        save_as_if_desc:'持续时间不足24小时的断食将被归为间歇性断食',
+        save_as_if_toast:'已保存至“断食/最近”',
+        save_as_lf_title:'保存为长断食',
+        save_as_lf_desc:'持续24小时或更长时间的断食将被归为长断食',
+        save_as_lf_toast:'已保存至“长断食/最近”',
+
+        sleep_well:'睡个好觉',
+        think_goal_title:'本小时走够{{steps}}步了吗?',
+        think_so:'我想是的!',
+        end_soon:'打卡即将关闭 {{time}}',
+        open_soon:'打卡即将开放 {{time}}',
+        check_in_available:'打卡已开放 {{time}}',
+        hit_steps:'本小时走够{{steps}}步',
+
+        change_goal:'更改目标',
+        hit_steps2:'走够{{steps}}步',
+        hour_step_goal:'每小时步数目标',
+        avg_total_steps:'平均 {{avg}} 步,全天 {{total}} 步',
     }
 }

+ 13 - 35
src/features/health/MainConsole.tsx

@@ -69,7 +69,7 @@ export default function MainConsole(props: { type: WindowType }) {
 
 
     useEffect(() => {
-        if(user.isLogin){
+        if (user.isLogin) {
             refreshLabels()
         }
     }, [user.isLogin])
@@ -142,13 +142,19 @@ export default function MainConsole(props: { type: WindowType }) {
 
         if ((item.event == 'FAST_START' || item.event == 'FAST_END') && health.long_fast.status == 'OG') {
             showAlert({
-                title: '长断食进行中',
-                content: '当前有一个正在进行的长断食记录,要转换为间歇性断食吗?',
+                title: t('health.lf_progress_title'),
+                content: t('health.lf_progress_desc'),
                 showCancel: true,
-                cancelText: '取消',
-                confirmText: '确定',
+                cancelText: t('health.cancel'),
+                confirmText: t('health.switch'),
                 confirm: () => {
                     changeToIF();
+                },
+                cancel: () => {
+                    // Taro.showToast({
+                    //     title: '已保存到发现页“长断食”',
+                    //     icon: 'success'
+                    // })
                 }
             })
             return
@@ -162,7 +168,7 @@ export default function MainConsole(props: { type: WindowType }) {
                 {
 
 
-                    jumpPage(`/_health/pages/log_time?index=${health.mode == 'FAST' ? 0 : 1}&single=1&is_start=1&window=${health.mode}&op_page=${health.mode == 'FAST' ?'HOME_FAST':'HOME_SLEEP'}`)
+                    jumpPage(`/_health/pages/log_time?index=${health.mode == 'FAST' ? 0 : 1}&single=1&is_start=1&window=${health.mode}&op_page=${health.mode == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`)
                 }
                 return;
             case 'END':
@@ -170,7 +176,7 @@ export default function MainConsole(props: { type: WindowType }) {
 
                     var sceniaro = getScenario(health.windows, health.mode)
 
-                    jumpPage(`/_health/pages/log_time?type=home&index=${health.mode == 'FAST' ? 3 : 2}&single=${sceniaro.status == 'OG' ? 1 : 0}&is_start=0&window=${health.mode}&op_page=${health.mode == 'FAST' ?'HOME_FAST':'HOME_SLEEP'}`)
+                    jumpPage(`/_health/pages/log_time?type=home&index=${health.mode == 'FAST' ? 3 : 2}&single=${sceniaro.status == 'OG' ? 1 : 0}&is_start=0&window=${health.mode}&op_page=${health.mode == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`)
                 }
                 return;
             case 'MARK_DONE':
@@ -842,34 +848,6 @@ export default function MainConsole(props: { type: WindowType }) {
         return 'time_point'
     }
 
-    function fastWithSleepStatus() {
-        const { status } = health.fast_with_sleep
-        var str = ''
-        switch (status) {
-            case 'OG1':
-                str = t('health.fast_before_bed')
-                break;
-            case 'OG2_NO1':
-                str = t('health.fast_missing')
-                break;
-            case 'OG2':
-                str = t('health.fast_while_sleep')
-                break;
-            case 'OG2_MISALIGNED':
-                str = t('health.misaligned')
-                break;
-            case 'OG3':
-                str = t('health.fast_after_sleep')
-                break
-        }
-        return <View className="H26" style={{ color: MainColorType.g02 }}>{str}</View>
-    }
-
-    function longFastStatus() {
-        const { status } = health.long_fast
-        return <View className="h26" style={{ color: MainColorType.g02 }}>{status == 'OG' ? 'In progress' : ''}</View>
-    }
-
     function showMoreBtn() {
         if (health.mode == 'DAY' || health.mode == 'NIGHT') {
             if (!getScenario(health.windows, health.mode).extra.choose_location) {

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

@@ -34,6 +34,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
     const [loading, setLoading] = useState(false)
     const [showEatArchive, setShowEatArchive] = useState(true)
     const [showActiveArchive, setShowActiveArchive] = useState(true)
+    const [onlyMe,setOnlyMe] = useState(true)
 
     const [fastList, setFastList] = useState<any>([])
     const [eatList, setEatList] = useState<any>([])
@@ -59,6 +60,10 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         }
     }, [list])
 
+    useEffect(()=>{
+        refresh()
+    },[onlyMe])
+
     useEffect(()=>{
         return ()=>{
             myScrollTop = 0
@@ -342,6 +347,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
         if (props.fast_type) {
             params.fast_type = props.fast_type
         }
+        params.show_all_user = onlyMe?false:true
         setPage(index)
         setLoading(true)
         records(params).then(res => {
@@ -597,8 +603,14 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
     return <View style={{ width: rpxToPx(750), marginTop: rpxToPx(60) }}>
 
         {
-            (list.length >= 0 || health.mode == 'EAT') && <View className="new_header_bg">
+            <View className="new_header_bg" style={{position:'relative'}}>
                 <Text className="h50 bold">{t('health.recents')}</Text>
+                {
+                    user.test_user && <View style={{position:'absolute',right:30,top:20}} onClick={()=>{
+                        setOnlyMe(!onlyMe)
+
+                    }}>{onlyMe?'仅自己':'全部用户'}</View>
+                }
                 {
                     false && (health.mode == 'EAT' || health.mode == 'ACTIVE') && <View onClick={() => {
                         jumpPage('/pages/account/Journal?type=' + health.mode + `&show_tip=${showTipF() ? '1' : '0'}`)

+ 2 - 2
src/pages/account/Album.tsx

@@ -345,9 +345,9 @@ export default function Album() {
                         </View>
                     })
                 }
-                {
+                {/* {
                     medias.length > 0 && <View style={{ height: rpxToPx(40), flexShrink: 0, backgroundColor: '#fff' }} />
-                }
+                } */}
 
                 <ListFooter noMore={(medias.length > 0) && (total == medias.length)} loading={loading}/>
 

+ 4 - 4
src/pages/account/Setting.tsx

@@ -63,7 +63,7 @@ export default function Page() {
         if (lg.length > 0) {
             switch (lg) {
                 case 'wechat':
-                    setLanguageType('微信系统语言')
+                    setLanguageType(process.env.TARO_ENV=='weapp'?t('health.follow_wechat'):t('health.follow_system'))
                     break
                 case 'zh':
                     setLanguageType('中文')
@@ -74,7 +74,7 @@ export default function Page() {
             }
         }
         else {
-            setLanguageType('微信系统语言')
+            setLanguageType(process.env.TARO_ENV=='weapp'?t('health.follow_wechat'):t('health.follow_system'))
         }
     }
 
@@ -181,7 +181,7 @@ export default function Page() {
     function changeLanguage() {
         showActionSheet({
             // alertText: '更改语言',
-            itemList: ['中文', 'English', '微信系统语言'],
+            itemList: ['中文', 'English', process.env.TARO_ENV=='weapp'?t('health.follow_wechat'):t('health.follow_system')],
             success: function (res) {
                 
                 switch (res) {
@@ -203,7 +203,7 @@ export default function Page() {
                         global.language = isZh ? 'zh' : 'en'
                         Taro.setStorageSync('language', 'wechat')
                         i18n.changeLanguage(isZh ? 'zh' : 'en')
-                        setLanguageType('微信系统语言')
+                        setLanguageType(process.env.TARO_ENV=='weapp'?t('health.follow_wechat'):t('health.follow_system'))
                         break;
                 }
                 if (res != -1) {

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

@@ -41,19 +41,19 @@ export default function Discover() {
         var str = ''
         switch (status) {
             case 'OG1':
-                str = t('health.fast_before_bed')
+                str = t('health.stage1')
                 break;
             case 'OG2_NO1':
                 str = t('health.fast_missing')
                 break;
             case 'OG2':
-                str = t('health.fast_while_sleep')
+                str = t('health.stage2')
                 break;
             case 'OG2_MISALIGNED':
                 str = t('health.misaligned')
                 break;
             case 'OG3':
-                str = t('health.fast_after_sleep')
+                str = t('health.stage3')
                 break
         }
         return <View className="H26" style={{ color: MainColorType.g02 }}>{str}</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

+ 0 - 1
src/store/health.tsx

@@ -95,7 +95,6 @@ const healthSlice = createSlice({
             state.isCompleted = isCompleted
         },
         setSchedules(state, action) {
-            debugger
             state.schedules = action.payload
         },
         setFooter(state, action) {

+ 4 - 2
src/utils/ring_utils.ts

@@ -16,10 +16,12 @@ export const startDegree = (time: number) => {
     var hour = date.getHours();
     var minute = date.getMinutes();
     var second = date.getSeconds();
-    return (hour * 3600 + minute * 60 + second) / (24 * 3600) * 360;
+    var degree = (hour * 3600 + minute * 60 + second) / (24 * 3600) * 360;
+    return degree
 }
 
 export const durationProgress = (start_time: number, end_time: number) => {
     var duration = (end_time - start_time) / 1000;
-    return duration / (24 * 3600) * 100;
+    var progress = duration / (24 * 3600) * 100
+    return progress > 99.9 ? 99.9 : progress;
 }