Leon 2 years ago
parent
commit
e7ca24e740

+ 2 - 2
ios/hola.xcodeproj/project.pbxproj

@@ -550,7 +550,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 12;
+				CURRENT_PROJECT_VERSION = 13;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -583,7 +583,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 12;
+				CURRENT_PROJECT_VERSION = 13;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (

+ 4 - 0
ios/hola/Info.plist

@@ -75,8 +75,12 @@
 	<key>UISupportedInterfaceOrientations</key>
 	<array>
 		<string>UIInterfaceOrientationPortrait</string>
+	</array>
+	<key>UISupportedInterfaceOrientations~ipad</key>
+	<array>
 		<string>UIInterfaceOrientationLandscapeLeft</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
+		<string>UIInterfaceOrientationPortrait</string>
 	</array>
 	<key>UIUserInterfaceStyle</key>
 	<string>Light</string>

File diff suppressed because it is too large
+ 0 - 0
ios/main.jsbundle


+ 21 - 16
src/context/locales/en.js

@@ -12,7 +12,7 @@ export default {
     },
     page: {
         clock: {
-            title: 'Biological Clock',
+            title: 'Cricadian Clock',
         },
         activity: {
             title: 'Activity',
@@ -33,14 +33,14 @@ export default {
             debug_mode: 'Debug Mode'
         },
         choose_scenario: {
-            title: 'Choose Biological Clock',
+            title: 'Choose Cricadian Clock',
             title_size: 25,
             sub_title: 'Fasting and sleep constitute the biological clock',
             btn_next: 'Next',
             btn_more: 'Learn More',
         },
         set_schedule: {
-            fast_title: 'Fasting Schedule',
+            fast_title: 'Fast Schedule',
             sleep_title: 'Sleep Schedule',
             fast_subtitle: 'Set time and duration goals',
             sleep_subtitle: 'Set time and duration goals',
@@ -56,7 +56,7 @@ export default {
             btn_login: 'Log In',
             btn_wechat: 'WeChat Log In',
             btn_signup: 'Sign Up',
-            slogan: 'Healthy Biological Clock'
+            slogan: 'Healthy Cricadian Clock'
         },
         auth: {
             agreement: 'I have read and agreed to the User Agreement and Privacy Policy',
@@ -160,10 +160,14 @@ export default {
         track_time_duration: {
             common: {
                 share_title: 'My Fasting Sleep Diary',
-                start_fast: 'Start Fast',
-                end_fast: 'End Fast',
-                start_sleep: 'Start Sleep',
-                end_sleep: 'End Sleep'
+                start_fast: 'Start fasting',//正常态
+                started_fasting:'Started fasting',//完成时
+                end_fast: 'End fasting',
+                ended_fasting: 'Ended fasting',
+                start_sleep: 'Start sleeping',
+                started_sleeping: 'Started sleeping',
+                end_sleep: 'End sleeping',
+                ended_sleeping: 'Ended sleeping'
             },
             change_tz_alert: {
                 title: 'Detected New Time Zone',
@@ -198,10 +202,10 @@ export default {
 
             },
             console: {
-                fast_start: 'Start Fast',
-                fast_end: 'End Fast',
-                sleep_start: 'Start Sleep',
-                sleep_end: 'End Sleep',
+                fast_start: 'Start fasting',
+                fast_end: 'End fasting',
+                sleep_start: 'Start sleeping',
+                sleep_end: 'End sleeping',
                 total_duration: 'Total Duration',
                 countup: 'In Progress',
                 countdown_not_due: 'Time Remaining',
@@ -226,11 +230,11 @@ export default {
             },
             record_fast_sleep: {
                 header: {
-                    latest_record: 'Latest Completed',
+                    latest_record: 'Recent',
                     btn_show_all: 'View More'
                 },
                 item: {
-                    fast: 'Fasting',
+                    fast: 'Fast',
                     sleep: 'Sleep'
                 },
                 timeline: 'Timeline',
@@ -259,7 +263,7 @@ export default {
             choose_scenario: {
                 list: {
                     item1: {
-                        name: 'Fasting',
+                        name: 'Fast',
                         desc: '',
                         note: ''
                     },
@@ -269,7 +273,7 @@ export default {
                         note: ''
                     },
                     item3: {
-                        name: 'Fasting and Sleep',
+                        name: 'Fast and Sleep',
                         desc: '',
                         note: ''
                     },
@@ -355,6 +359,7 @@ export default {
                 login_can_check: 'Record after Logging In',
                 check_unlock_data: 'Record to Unlock Trends',
                 choose_metric: 'Choose Metric',
+                choose_metric_desc:'Select metrics based on your needs.',
                 order: 'Adjust Order'
 
             },

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

@@ -43,6 +43,16 @@ export default {
             sleep_title: '睡眠日程',
             fast_subtitle: '设定时间和时长目标',
             sleep_subtitle: '设定时间和时长目标',
+            fast_target:'断食目标',
+            fast_target_desc:'计划每日断食16小时45分钟, 其余7小时15分钟进食。',
+            fast_schedule:'断食日程',
+            fast_schedule_desc:'计划每日18:00开始断食, 次日10:00结束断食。',
+            sleep_target:'睡眠目标',
+            sleep_target_desc:'计划每日断食16小时45分钟, 其余7小时15分钟进食。',
+            sleep_schedule:'睡眠日程',
+            sleep_schedule_desc:'计划每日18:00开始断食, 次日10:00结束断食。',
+            next_day:'次日'
+
         },
         choose_language: {
             title: '',
@@ -164,10 +174,14 @@ export default {
         track_time_duration: {
             common: {
                 share_title:'我的断食睡眠日记',
-                start_fast: '开始断食',
+                start_fast: '开始断食',//正常态
+                started_fasting:'开始断食',//完成时
                 end_fast: '结束断食',
+                ended_fasting: '结束断食',
                 start_sleep: '开始睡眠',
-                end_sleep: '结束睡眠'
+                started_sleeping: '开始睡眠',
+                end_sleep: '结束睡眠',
+                ended_sleeping: '结束睡眠'
             },
             change_tz_alert:{
                 title:'检测到新时区',
@@ -359,6 +373,7 @@ export default {
                 login_can_check: '登录后可记录',
                 check_unlock_data: '记录解锁趋势',
                 choose_metric: '选择指标项',
+                choose_metric_desc:'按需选择自己常用的指标',
                 order: '调整排序'
 
             },

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

@@ -146,7 +146,7 @@ export default function Component(props: {
     return <View className='modal_content'>
         <View className='modal_title_view'>
             <Text className='modal_title1'>{props.isWorkout ? t('feature.workout.choose_workout') : t('feature.track_something.metric.choose_metric')}</Text>
-            <Text className='modal_subtitle'>{props.isWorkout?t('feature.workout.choose_workout_desc'):'按需选择自己常用的指标'}</Text>
+            <Text className='modal_subtitle'>{props.isWorkout ? t('feature.workout.choose_workout_desc') : t('feature.track_something.metric.choose_metric_desc')}</Text>
         </View>
         <ScrollView className='modal_detail' scrollY>
             <View>
@@ -164,7 +164,7 @@ export default function Component(props: {
                                         <Text className='modal_item_text' style={{ color: color, marginLeft: 10 }}>{obj.name}</Text>
                                         <View style={{ flex: 1 }} />
                                         {
-                                            user.test_user && <Text style={{color:'#fff'}}>{obj.is_following ? codeIndex(obj.code) : ''}</Text>
+                                            user.test_user && <Text style={{ color: '#fff' }}>{obj.is_following ? codeIndex(obj.code) : ''}</Text>
                                         }
                                         {
                                             user.test_user && <Text style={{ color: 'green' }}>{obj.is_following ? codeNewIndex(obj.code) : ''}</Text>
@@ -183,11 +183,11 @@ export default function Component(props: {
         </ScrollView>
         <View className='modal_operate'>
             <View className='modal_btn' style={{ backgroundColor: color + alpha }} onClick={cancel}>
-                <Text className='modal_cancel_text' style={{ color: color }}>{t('feature.common.picker_cancel_btn')}</Text>
+                <Text className='modal_cancel_text' style={{ color: color, fontWeight: 'bold' }}>{t('feature.common.picker_cancel_btn')}</Text>
             </View>
             <View className='btn_space' />
             <View className='modal_btn' style={{ backgroundColor: color }} onClick={confirm}>
-                <Text className='modal_confirm_text' style={{ color: '#000' }}>下一步</Text>
+                <Text className='modal_confirm_text' style={{ color: '#000', fontWeight: 'bold' }}>{t('feature.common.btn_next')}</Text>
             </View>
 
 

+ 0 - 129
src/features/trackSomething/components/MetricModalChoose_backup.tsx

@@ -1,129 +0,0 @@
-import { View, Text, ScrollView } from '@tarojs/components'
-import './MetricModalChoose.scss'
-import { alphaToHex } from '@/utils/tools'
-import { useTranslation } from 'react-i18next'
-import { useEffect, useState } from 'react'
-import { IconRadio, IconRadioCheck } from '@/components/basic/Icons'
-import Taro from '@tarojs/taro'
-
-export default function Component(props: { themeColor: string, cancel: Function, confirm: Function, array: any, limit: any, orders: any }) {
-    const color = props.themeColor ? props.themeColor : '#ff0000'
-    const [list, setList] = useState(props.array)
-    const [orderList, setOrderList] = useState(props.orders)
-    const min = props.limit.min
-    const max = props.limit.max
-    const { t } = useTranslation()
-    var alpha = alphaToHex(0.4)
-
-    useEffect(()=>{
-        setList(props.array)
-        setOrderList(props.orders)
-    },[props.array,props.orders])
-
-    function cancel() {
-        props.cancel()
-    }
-
-    function confirm() {
-        props.confirm(orderList)
-    }
-
-    function tapItem(obj) {
-        var check = !obj.is_following
-
-        if (check){
-            if (max == orderList.length) {
-                Taro.showToast({
-                    icon: 'none',
-                    title: t('feature.common.toast.max_value'),
-                })
-                return
-            }
-        }
-        else {
-            if (min==orderList.length){
-                Taro.showToast({
-                    icon: 'none',
-                    title: t('feature.common.toast.min_value'),
-                })
-                return
-            }
-        }
-        if (check) {
-            orderList.push({
-                name: obj.name,
-                code: obj.code
-            })
-        }
-        else {
-            for (var i = 0; i < orderList.length; i++) {
-                if (orderList[i].code == obj.code) {
-                    orderList.splice(i, 1)
-                }
-            }
-        }
-        for (var i = 0; i < list.length; i++) {
-            for (var j = 0; j < list[i].items.length; j++) {
-                var temp = list[i].items[j]
-                if (obj.code == temp.code) {
-                    temp.is_following = check
-                }
-            }
-        }
-
-        setList(JSON.parse(JSON.stringify(list)))
-        setOrderList(JSON.parse(JSON.stringify(orderList)))
-    }
-
-    function codeIndex(code){
-        for (var i=0;i<orderList.length;i++){
-            if (orderList[i].code == code){
-                return i+1;
-            }
-        }
-        return ''
-    }
-
-
-    return <View className='modal_content'>
-        <View className='modal_title_view'>
-            <Text className='modal_title1'>{t('feature.track_something.metric.choose_metric')}</Text>
-            <Text className='modal_subtitle'>按需选择自己常用的指标</Text>
-        </View>
-        <ScrollView className='modal_detail' scrollY>
-            <View>
-                {
-                    list.map((item, index) => {
-                        return <View className='modal_group' key={index}>
-                            <Text className='modal_group_title'>{item.name}</Text>
-                            {
-                                item.items.map((obj, i) => {
-                                    return <View className='modal_item' onClick={() => tapItem(obj)}>
-                                        {
-                                            obj.is_following ? <IconRadioCheck width={16} color='#fff' /> : <IconRadio width={16} color='#fff' />
-                                        }
-
-                                        <Text className='modal_item_text' style={{ color: color, marginLeft: 10 }}>{obj.name}</Text>
-                                        <View style={{flex:1}}/>
-                                        <Text>{obj.is_following?'序号:'+codeIndex(obj.code):''}</Text>
-                                    </View>
-                                })
-                            }
-                        </View>
-                    })
-                }
-            </View>
-        </ScrollView>
-        <View className='modal_operate'>
-            <View className='modal_btn' style={{ backgroundColor: color + alpha }} onClick={cancel}>
-                <Text className='modal_cancel_text' style={{ color: color }}>{t('feature.common.picker_cancel_btn')}</Text>
-            </View>
-            <View className='btn_space' />
-            <View className='modal_btn' style={{ backgroundColor: color }} onClick={confirm}>
-                <Text className='modal_confirm_text' style={{ color: '#000' }}>下一步</Text>
-            </View>
-
-
-        </View>
-    </View>
-}

+ 18 - 10
src/features/trackTimeDuration/components/TimelineFastSleep.tsx

@@ -10,7 +10,7 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
     function formateTime(obj: any, isEnd: boolean) {
         if (isEnd) {
             if (obj.real_end_time) {
-                if (obj.real_end_time_zone){
+                if (obj.real_end_time_zone) {
                     var newTimestamp = TimeFormatter.transferTimestamp(obj.real_end_time, obj.real_end_time_zone)
                     return TimeFormatter.timelineFormatTime(newTimestamp)
                 }
@@ -22,7 +22,7 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
         }
         else {
             if (obj.real_start_time) {
-                if (obj.real_end_time_zone){
+                if (obj.real_end_time_zone) {
                     var newTimestamp = TimeFormatter.transferTimestamp(obj.real_start_time, obj.real_start_time_zone)
                     return TimeFormatter.timelineFormatTime(newTimestamp)
                 }
@@ -90,12 +90,14 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
     if (props.data.fast) {
         var timeZone = ''
         if (props.data.fast.real_start_time_zone) {
-            timeZone = ' '+props.data.fast.real_start_time_zone
+            timeZone = ' ' + props.data.fast.real_start_time_zone
         }
         timelineItems.push(
             {
                 status: getStatus(true, true, props.data),
-                title: t('feature.track_time_duration.common.start_fast'),
+                title: getStatus(true, true, props.data) == 'padding' ?
+                    t('feature.track_time_duration.common.start_fast') :
+                    t('feature.track_time_duration.common.started_fasting'),
                 content: formateTime(props.data.fast, false) + timeZone,
                 date: showDate(props.data.fast, false) ? formateDate(props.data.fast, false) : '',
                 color: global.fastColor ? global.fastColor : ColorType.fast
@@ -105,12 +107,14 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
     if (props.data.sleep) {
         var timeZone = ''
         if (props.data.sleep.real_start_time_zone) {
-            timeZone = ' '+props.data.sleep.real_start_time_zone
+            timeZone = ' ' + props.data.sleep.real_start_time_zone
         }
         timelineItems.push(
             {
                 status: getStatus(false, true, props.data),
-                title: t('feature.track_time_duration.common.start_sleep'),
+                title: getStatus(false, true, props.data) == 'padding' ?
+                t('feature.track_time_duration.common.start_sleep'):
+                t('feature.track_time_duration.common.started_sleeping'),
                 content: formateTime(props.data.sleep, false) + timeZone,
                 date: showDate(props.data.sleep, false) ? formateDate(props.data.sleep, false) : '',
                 color: global.sleepColor ? global.sleepColor : ColorType.sleep
@@ -120,12 +124,14 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
     if (props.data.sleep) {
         var timeZone = ''
         if (props.data.sleep.real_end_time_zone) {
-            timeZone = ' '+props.data.sleep.real_end_time_zone
+            timeZone = ' ' + props.data.sleep.real_end_time_zone
         }
         timelineItems.push(
             {
                 status: getStatus(false, false, props.data),
-                title: t('feature.track_time_duration.common.end_sleep'),
+                title: getStatus(false, false, props.data) == 'padding' ?
+                t('feature.track_time_duration.common.end_sleep'):
+                t('feature.track_time_duration.common.ended_sleeping'),
                 content: formateTime(props.data.sleep, true) + timeZone,
                 date: showDate(props.data.sleep, true) ? formateDate(props.data.sleep, true) : '',
                 color: global.sleepColor ? global.sleepColor : ColorType.sleep
@@ -135,12 +141,14 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
     if (props.data.fast) {
         var timeZone = ''
         if (props.data.fast.real_end_time_zone) {
-            timeZone = ' '+props.data.fast.real_end_time_zone
+            timeZone = ' ' + props.data.fast.real_end_time_zone
         }
         timelineItems.push(
             {
                 status: getStatus(true, false, props.data),
-                title: t('feature.track_time_duration.common.end_fast'),
+                title: getStatus(true, false, props.data) == 'padding' ?
+                t('feature.track_time_duration.common.end_fast'):
+                t('feature.track_time_duration.common.ended_fasting'),
                 content: formateTime(props.data.fast, true) + timeZone,
                 date: showDate(props.data.fast, true) ? formateDate(props.data.fast, true) : '',
                 color: global.fastColor ? global.fastColor : ColorType.fast

Some files were not shown because too many files changed in this diff