Leon 2 éve
szülő
commit
1fccbe6935

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

@@ -63,7 +63,7 @@ export default function Buttons(props: {
             <View className={mainClass} style={{ ...props.btnStyle, opacity: props.lowLight ? 0.4 : 1 }} onClick={onClick}>
                 {
                     props.showLoading && <View style={{ marginBottom: 2, marginRight: 5 }}>
-                        <AtActivityIndicator size={32} color={props.lightLoading?'#999':'#000'} />
+                        <AtActivityIndicator size={32} color={props.btnStyle.color} />
                     </View>
                 }
                 <Text

+ 24 - 22
src/context/locales/en.js

@@ -1,10 +1,27 @@
 export default {
-    languageList:{
-        switch_language:'Switch Language',
-        zh:'Chinese',
-        en:'English'
+    tabbar:{
+        clock:'Circadian Clock',
+        metric:'Metric',
+        activity:'Activity',
+        nutrition:'Nutrition',
+        more:'More'
     },
     page:{
+        clock:{
+            title:'Circadian Clock',
+            schedule:{
+                title:'Schedule',
+            }
+        },
+        metric:{
+            title:'Metric',
+        },
+        activity:{
+            title:'Activity',
+        },
+        more:{
+            title:'More'
+        },
         choose_language:{
             title:'',
             sub_title:'',
@@ -32,26 +49,11 @@ export default {
             title:'',
             btn_done:''
         },
-        clock:{
-            schedule:{
-                title:'Schedule',
-            }
-        },
-        activity:{
-            title:'Activity',
-        },
-        metric:{
-            title:'Metric',
-        }
+        
+        
     },
     feature:{
-        tabbar:{
-            clock:'Clock',
-            metric:'Metric',
-            activity:'Activity',
-            nutrition:'Nutrition',
-            profile:'Profile'
-        },
+        
         auth:{
             create_account:{
                 title:'Create Account',

+ 132 - 66
src/context/locales/zh.js

@@ -1,85 +1,151 @@
 export default {
-    languageList:{
-        switch_language:'切换语言',
-        zh:'中文',
-        en:'英文'
+    tabbar: {
+        clock: '生物钟',
+        metric: '指标',
+        activity: '运动',
+        nutrition: '营养',
+        more: '更多'
     },
-    page:{
-        choose_language:{
-            title:'',
-            sub_title:'',
-            btn_confirm:''
+    page: {
+        clock: {
+            title: '生物钟',
         },
-        choose_auth:{
-            app_name:'',
-            btn_create_account:'',
-            btn_login:'登录',
-            btn_wechat:'微信登录'
+        activity: {
+            title: '运动',
         },
-        auth:{
-            agreement:'已阅读并同意《用户协议》和《隐私政策》',
+        metric: {
+            title: '指标',
         },
-        choose_scenario:{
-            title:'选择场景',
-            sub_title:'场景时钟将在首页展示',
-            btn_next:'下一步',
-            btn_more:'了解更多',
-            fast:'断食',
-            sleep:'睡眠',
-            fast_sleep:'断食睡眠',
+        more: {
+            title: '更多'
         },
-        clock:{
-            schedule:{
-                title:'日程',
-            }
+        choose_scenario: {
+            title: '选择生物钟',
+            sub_title: '场景时钟将在首页展示',
+            btn_next: '下一步',
+            btn_more: '了解更多',
+            fast: '断食',
+            sleep: '睡眠',
+            fast_sleep: '断食睡眠',
+        },
+        set_schedule: {
+            fast_title: '断食日程',
+            sleep_title: '睡眠日程',
+            fast_subtitle: '',
+            sleep_subtitle: ''
+        },
+        choose_language: {
+            title: '',
+            sub_title: '',
+            btn_confirm: ''
+        },
+        choose_auth: {
+            app_name: '',
+            btn_create_account: '',
+            btn_login: '登录',
+            btn_wechat: '微信登录'
         },
-        activity:{
-            title:'运动',
+        auth: {
+            agreement: '已阅读并同意《用户协议》和《隐私政策》',
         },
-        metric:{
-            title:'指标',
+        records_history: {
+            time_title: '断食睡眠记录',
+            metric_title: '{{title}}记录',
+            activity_title: '{{title}}记录'
+        },
+        setting: {
+            title: '设置',
+        },
+        user_profile: {
+            title: '用户信息'
         }
 
+
+
     },
-    feature:{
-        tabbar:{
-            clock:'时钟',
-            metric:'指标',
-            activity:'运动',
-            nutrition:'营养',
-            profile:'我'
+    feature: {
+        common: {
+            picker_cancel_btn: '取消',
+            picker_confirm_btn: '确定'
         },
-        auth:{
-            create_account:{
-                title:'注册账号',
-                sub_title:'创建用户名',
-                input_username_placeholder:'用户名',
-                input_email_placeholder:'邮箱',
-                footer_desc:'已有账号?',
-                footer_login:'去登录',
-                btn_next:'下一步'
+        auth: {
+            create_account: {
+                title: '注册账号',
+                sub_title: '创建用户名',
+                input_username_placeholder: '用户名',
+                input_email_placeholder: '邮箱',
+                footer_desc: '已有账号?',
+                footer_login: '去登录',
+                btn_next: '下一步'
             },
-            login:{
-                input_account_placeholder:'用户名或邮箱',
-                input_password_placeholder:'密码',
-                footer_desc:'还没有账号?',
-                footer_sign_up:'去注册'
+            login: {
+                input_account_placeholder: '用户名或邮箱',
+                input_password_placeholder: '密码',
+                footer_desc: '还没有账号?',
+                footer_sign_up: '去注册'
             },
-            create_password:{
-                title:'创建密码',
-                sub_title:'输入并确认密码',
-                input_password_placeholder:'密码',
-                input_password_confirm_placeholder:'确认密码',
-                btn_next:'下一步'
+            create_password: {
+                title: '创建密码',
+                sub_title: '输入并确认密码',
+                input_password_placeholder: '密码',
+                input_password_confirm_placeholder: '确认密码',
+                btn_next: '下一步'
             }
         },
-        track_time_duration:{
-            action_sheet:{
-                change_schedule:'调整日程',
-                switch_scenario:'切换场景',
-                give_up:'放弃终止',
-                end_fast:'结束断食',
-                cancel:'取消'
+        track_time_duration: {
+            status_indicator: {
+
+            },
+            console: {
+                fast_start: '开始断食',
+                fast_end: '结束断食',
+                sleep_start: '开始睡眠',
+                sleep_end: '结束睡眠',
+                countup: '已进行',             //indicator
+                countdown_not_due: '距结束',
+                timeout: '已超时',
+                fast_duration: '断食时长',    //时长picker titlte
+                sleep_duration: '睡眠时长',
+                real_fast_start_dt: '断食开始时间', //时间picker title
+                real_fast_end_dt: '断食结束时间',
+                real_sleep_start_dt: '睡眠开始时间',
+                real_sleep_end_dt: '睡眠结束时间',
+            },
+            schedule: {
+                unfollow_title: '日程提醒',
+                follow_tip: '开启后,将显示今天的日程。',
+                timeout_tip: '完成当前记录,恢复今天的日程。',
+                action_sheet_adjust_schedule: '调整日程', //点击弹出action_sheet的item
+                duration_goals_by_stage: '查看断食阶段目标',  //底部文字按钮 waite for start
+                current_stage: '查看当前断食阶段'              //底部文字按钮 onging
+            },
+            record_fast_sleep: {
+                header: {
+                    latest_record: '最近记录',
+                    btn_show_all: '显示全部'
+                },
+                item: {
+                    fast: '断食',
+                    sleep: '睡眠'
+                }
+            },
+
+            action_sheet: {
+                change_schedule: '调整日程',
+                switch_scenario: '切换场景',
+                give_up: '放弃终止',
+                end_fast: '结束断食',
+                cancel: '取消'
+            },
+            dial: {
+                start_time: '开始时间',
+                end_time: '结束时间',
+                duration: '时长',
+                schedule_start_time: '日程开始时间',
+                schedule_end_time: '日程结束时间',
+                schedule_duration: '日程时长',
+                btn_next: '下一步',
+                btn_done: '完成'
             }
         }
     }

+ 8 - 8
src/custom-tab-bar/index.tsx

@@ -46,20 +46,20 @@ export default function TabBar() {
     return (
         <View className='tabbar'>
             <View className={selIndex == 0 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(0)}>
-                {/* <Text>{t('feature.tabbar.clock')}</Text> */}
-                <Text>时钟</Text>
+                <Text>{t('tabbar.clock')}</Text>
+                {/* <Text>时钟</Text> */}
             </View>
             <View className={selIndex == 1 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(1)}>
-                <Text>指标</Text>
-                {/* <Text>{t('feature.tabbar.metric')}</Text> */}
+                {/* <Text>指标</Text> */}
+                <Text>{t('tabbar.metric')}</Text>
             </View>
             <View className={selIndex == 2 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(2)}>
-                <Text>运动</Text>
-                {/* <Text>{t('feature.tabbar.activity')}</Text> */}
+                {/* <Text>运动</Text> */}
+                <Text>{t('tabbar.activity')}</Text>
             </View>
             <View className={selIndex == 3 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(3)}>
-                {/* <Text>{t('feature.tabbar.profile')}</Text> */}
-                <Text>我</Text>
+                <Text>{t('tabbar.more')}</Text>
+                {/* <Text>我</Text> */}
             </View>
         </View>
     )

+ 41 - 23
src/features/trackTimeDuration/components/ChooseScenario.tsx

@@ -5,7 +5,7 @@ import Rings from '@components/view/Rings';
 import Rings2, { BgRing, RingCommon, TargetRing } from './Rings';
 import Footer from '@/components/layout/Footer';
 import SingleSelect from '../../../components/input/SingleSelect';
-import { ComponentStatus, TextType } from "@utils/types";
+import { ComponentStatus, NaviBarTitleShowType, TemplateType, TextType } from "@utils/types";
 import { useTranslation } from 'react-i18next'
 
 import './ChooseScenario.scss'
@@ -16,6 +16,7 @@ import { useDispatch, useSelector } from "react-redux";
 import { setScenario, setScenarioName, setStep } from "@/store/scenario";
 import { getPlans } from "@/services/trackTimeDuration";
 import { ChooseScenarioBtn } from "@/features/common/SpecBtns";
+import Layout from "@/components/layout/layout";
 
 
 export default function Component() {
@@ -25,16 +26,16 @@ export default function Component() {
     const [selIndex, setSelIndex] = useState(-1)
     const [scenarios, setScenarios] = useState<any[]>([])
     const selScenario = useSelector((state: any) => state.scenario);
-    const [count,setCount] = useState(0)
+    const [count, setCount] = useState(0)
 
-    useDidShow(()=>{
-        setCount(count+1)
+    useDidShow(() => {
+        setCount(count + 1)
     })
 
     useReady(() => {
         if (selScenario) {
             if (selScenario.name == 'FAST_SLEEP') {
-                dispatch(setStep(isFastFirst?'fast':'sleep'))
+                dispatch(setStep(isFastFirst ? 'fast' : 'sleep'))
                 setSelIndex(2)
             }
             else if (selScenario.name == 'SLEEP') {
@@ -46,14 +47,14 @@ export default function Component() {
                 setSelIndex(0)
             }
         }
-        Taro.getStorage({key:'scenarios'}).then(res=>{
-            if (res){
+        Taro.getStorage({ key: 'scenarios' }).then(res => {
+            if (res) {
                 setScenarios(JSON.parse(res.data as any))
             }
         })
         getPlans().then(res => {
             const data = res as { scenarios: any[] };
-            Taro.setStorage({key:'scenarios', data:JSON.stringify(data.scenarios as any)})
+            Taro.setStorage({ key: 'scenarios', data: JSON.stringify(data.scenarios as any) })
             setScenarios(data.scenarios)
         })
     })
@@ -84,7 +85,7 @@ export default function Component() {
                 break;
         }
         return <View>
-            <ChooseScenarioBtn title='Next' onClick={next} background={background}/>
+            <ChooseScenarioBtn title='Next' onClick={next} background={background} />
             {/* <Buttons title='Next' onClick={next} btnStyle={{ ...style, width: 320 }} /> */}
         </View>
     }
@@ -139,13 +140,13 @@ export default function Component() {
     function getScheduleTarget(isFast: boolean) {
         for (var i = 0; i < scenarios.length; i++) {
             if (isFast && scenarios[i].name == 'FAST') {
-                if (global.schedule_fast){
+                if (global.schedule_fast) {
                     return global.schedule_fast
                 }
                 return scenarios[i].schedule.fast
             }
             else if (!isFast && scenarios[i].name == 'SLEEP') {
-                if (global.schedule_sleep){
+                if (global.schedule_sleep) {
                     return global.schedule_sleep
                 }
                 return scenarios[i].schedule.sleep
@@ -233,22 +234,39 @@ export default function Component() {
             dispatch(setStep('sleep'))
         }
         else {
-            dispatch(setStep(isFastFirst?'fast':'sleep'))
+            dispatch(setStep(isFastFirst ? 'fast' : 'sleep'))
         }
         // dispatch(setScenarioName(scenarios[index].scenario) as any)
     }
 
-    return <View className="container">
-        <Texts text={t('page.choose_scenario.title')} type={TextType.primary}></Texts>
-        <Texts text={t('page.choose_scenario.sub_title')} type={TextType.secondary}></Texts>
-        <View style={{ height: 20 }} />
-        {
-            scenarios.length>0&&<View style={{ position: 'relative', zIndex: 1 }}>
-                <SingleSelect items={items()} itemSelect={handleItemSelect} selIndex={selIndex} />
-            </View>
-        }
+    return <Layout title={t('page.choose_scenario.title')}
+        titleShowStyle={NaviBarTitleShowType.scrollToShow} type={TemplateType.flex}>
+        <View className="container">
+            {/* <Texts text={t('page.choose_scenario.title')} type={TextType.primary}></Texts> */}
+            <Texts text={t('page.choose_scenario.sub_title')} type={TextType.secondary}></Texts>
+            <View style={{ height: 20 }} />
+            {
+                scenarios.length > 0 && <View style={{ position: 'relative', zIndex: 1 }}>
+                    <SingleSelect items={items()} itemSelect={handleItemSelect} selIndex={selIndex} />
+                </View>
+            }
+
+
+            <Footer children={footerContent()} />
+        </View>
+    </Layout>
+
+    // return <View className="container">
+    //     <Texts text={t('page.choose_scenario.title')} type={TextType.primary}></Texts>
+    //     <Texts text={t('page.choose_scenario.sub_title')} type={TextType.secondary}></Texts>
+    //     <View style={{ height: 20 }} />
+    //     {
+    //         scenarios.length>0&&<View style={{ position: 'relative', zIndex: 1 }}>
+    //             <SingleSelect items={items()} itemSelect={handleItemSelect} selIndex={selIndex} />
+    //         </View>
+    //     }
 
 
-        <Footer children={footerContent()} />
-    </View>;
+    //     <Footer children={footerContent()} />
+    // </View>;
 }

+ 1 - 1
src/features/trackTimeDuration/components/Console.tsx

@@ -456,7 +456,7 @@ export default function Component(props: { isNextStep?: boolean }) {
                     (time.status == 'WAIT_FOR_START') && <Stepper child={
                         <Text className="stepper_text" style={{ color: '#00FFFF', opacity: textAlpha(time) }} onClick={showDurationPicker}>{durationFormate()}</Text>
                     } minus={minus} plus={plus}
-                    themeColor={isFast?'#AAFF00':'#00FFFF'} disableMinus={disableMinus()} disablePlus={disablePlus()} />
+                    themeColor={'#00FFFF'} disableMinus={disableMinus()} disablePlus={disablePlus()} />
                 }
                 {
                     time.status == 'ONGOING1' && <View>

+ 56 - 43
src/features/trackTimeDuration/components/SetSchedule.tsx

@@ -14,9 +14,13 @@ import Modal from "@/components/layout/Modal";
 import Dial from './Dial';
 import TimePicker from "@/features/common/TimePicker";
 import { SetScheduleBtn } from "@/features/common/SpecBtns";
+import Layout from "@/components/layout/layout";
+import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
+import { useTranslation } from "react-i18next";
 
 export default function Component() {
   const isFastFirst = true;
+  const { t } = useTranslation()
   const dispatch = useDispatch();
   const canvasRef = useRef(null);
   const [scenario] = useState(useSelector((state: any) => state.scenario))
@@ -74,10 +78,10 @@ export default function Component() {
     setMinutes(durationTime(scheduleObj.start_time, scheduleObj.end_time)[1])
 
 
-    var title = scenario.step == 'fast' ? 'Fast schedule' : 'Sleep schedule'
-    Taro.setNavigationBarTitle({
-      title: title
-    })
+    // var title = scenario.step == 'fast' ? 'Fast schedule' : 'Sleep schedule'
+    // Taro.setNavigationBarTitle({
+    //   title: title
+    // })
   })
 
   function start() {
@@ -268,50 +272,59 @@ export default function Component() {
     return <TimePicker time={chooseStart ? startTime : endTime} confirm={chooseStart ? onStartTimeChange : onEndTimeChange} cancel={() => { setIsTimeOpen(false) }} />
   }
 
-  return <View >
-    {/* <Text>场景名称{scenario.name}</Text> */}
-
-    <View className="box">
-      <View className="header">
-        <View className="item1" style={{ opacity: operateType == 1 || operateType == 3 ? 1 : 0.4 }} onClick={() => {
-          setChooseStart(true)
-          setIsTimeOpen(true)
-        }}>
-          <Text className="item_title">{scenario.step == 'fast' ? 'Fast starts' : 'Sleep starts'}</Text>
-          <Text className="item_text">{startTime}</Text>
+  function detail() {
+    return <View >
+      {/* <Text>场景名称{scenario.name}</Text> */}
+
+      <View className="box">
+        <View className="header">
+          <View className="item1" style={{ opacity: operateType == 1 || operateType == 3 ? 1 : 0.4 }} onClick={() => {
+            setChooseStart(true)
+            setIsTimeOpen(true)
+          }}>
+            <Text className="item_title">{scenario.step == 'fast' ? 'Fast starts' : 'Sleep starts'}</Text>
+            <Text className="item_text">{startTime}</Text>
+          </View>
+          <View className="item1" style={{ opacity: operateType == 2 || operateType == 3 ? 1 : 0.4 }} onClick={() => {
+            setChooseStart(false)
+            setIsTimeOpen(true)
+          }}>
+            <Text className="item_title">{scenario.step == 'fast' ? 'Fast ends' : 'Sleep ends'}</Text>
+            <Text className="item_text">{endTime}</Text>
+          </View>
+
         </View>
-        <View className="item1" style={{ opacity: operateType == 2 || operateType == 3 ? 1 : 0.4 }} onClick={() => {
-          setChooseStart(false)
-          setIsTimeOpen(true)
-        }}>
-          <Text className="item_title">{scenario.step == 'fast' ? 'Fast ends' : 'Sleep ends'}</Text>
-          <Text className="item_text">{endTime}</Text>
+        <View style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
+          <Dial ref={canvasRef} />
         </View>
-
+        <Text className="duration" style={{ opacity: operateType == 1 || operateType == 2 ? 1 : 0.4 }} onClick={() => { setIsOpen(true) }}>{hours > 0 ? hours + ' hours ' : ''}{minutes > 0 ? minutes + ' minutes' : ''}</Text>
       </View>
-      <View style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
-        <Dial ref={canvasRef} />
-      </View>
-      <Text className="duration" style={{ opacity: operateType == 1 || operateType == 2 ? 1 : 0.4 }} onClick={() => { setIsOpen(true) }}>{hours > 0 ? hours + ' hours ' : ''}{minutes > 0 ? minutes + ' minutes' : ''}</Text>
+
+      <Footer>
+        <SetScheduleBtn title={scenario.step == 'fast' ? 'Set fast schedule' : 'Set sleep schedule'}
+          lowLight={operateType != 0}
+          isFast={scenario.step == 'fast'}
+          onClick={() => start()} />
+      </Footer>
+      {
+        isOpen && <Modal children={layoutContent()} dismiss={() => setIsOpen(false)} confirm={() => {
+          setIsOpen(false)
+          durationChange(pickerRef.current.getConfirmData())
+        }} />
+      }
+      {
+        isTimeOpen && <Modal children={timeContent()} dismiss={() => setIsTimeOpen(false)} confirm={() => {
+          setIsTimeOpen(false)
+        }} />
+      }
+
     </View>
+  }
 
-    <Footer>
-      <SetScheduleBtn title={scenario.step == 'fast' ? 'Set fast schedule' : 'Set sleep schedule'}
-        lowLight={operateType != 0}
-        isFast={scenario.step == 'fast'}
-        onClick={() => start()} />
-    </Footer>
+  return <Layout title={scenario.step == 'fast' ? t('page.set_schedule.fast_title') : t('page.set_schedule.sleep_title')}
+    titleShowStyle={NaviBarTitleShowType.scrollToShow} type={TemplateType.flex}>
     {
-      isOpen && <Modal children={layoutContent()} dismiss={() => setIsOpen(false)} confirm={() => {
-        setIsOpen(false)
-        durationChange(pickerRef.current.getConfirmData())
-      }} />
+      detail()
     }
-    {
-      isTimeOpen && <Modal children={timeContent()} dismiss={() => setIsTimeOpen(false)} confirm={() => {
-        setIsTimeOpen(false)
-      }} />
-    }
-
-  </View>;
+  </Layout>;
 }

+ 1 - 1
src/features/trackTimeDuration/components/TitleView.tsx

@@ -47,7 +47,7 @@ export default function Component(props:{children:any}) {
 
     return <View className='title_view'>
         <View className='title_bg'>
-            <Text className='title'>时钟</Text>
+            <Text className='title'>{t('page.clock.title')}</Text>
             {
                 time.status == 'WAIT_FOR_START' && <Image onClick={more} src={require('@/assets/images/add.png')} className='icon' />
             }

+ 8 - 0
src/pages/account/Profile.config.ts

@@ -0,0 +1,8 @@
+export default definePageConfig({
+    usingComponents:{
+      // 'ec-canvas': '../../lib/ec-canvas/ec-canvas',
+      // 'demo':'../../components/demo'
+    },
+    // "disableScroll": true
+    "navigationBarTitleText": ""
+  })

+ 46 - 34
src/pages/account/Profile.tsx

@@ -6,10 +6,13 @@ import Taro, { useDidShow } from "@tarojs/taro";
 import { useDispatch, useSelector } from "react-redux";
 import './Profile.scss'
 import Box from "@/components/layout/Box";
-import { BoxType } from "@/utils/types";
+import { BoxType, NaviBarTitleShowType, TemplateType } from "@/utils/types";
+import Layout from "@/components/layout/layout";
+import { useTranslation } from "react-i18next";
 
 export default function Page() {
     const dispatch = useDispatch();
+    const { t } = useTranslation()
     const user = useSelector((state: any) => state.user);
 
     function tapLogin() {
@@ -66,42 +69,51 @@ export default function Page() {
         })
     }
 
-    return <View className="container">
-        <View style={{ height: 20 }} />
-        <Box type={BoxType.outline}>
-            <View className="profile_card" onClick={tapProfile}>
-                <View className="avatar" style={{ opacity: user.isLogin ? 1 : 0.4 }}>
-                    {
-                        user.isLogin ? <Image src={user.avatar} className="avatar" /> : <Image src={require('@/assets/images/user.png')} className="avatar_placeholder" />
-                    }
+    function detail() {
+        return <View className="container">
+            <View style={{ height: 20 }} />
+            <Box type={BoxType.outline}>
+                <View className="profile_card" onClick={tapProfile}>
+                    <View className="avatar" style={{ opacity: user.isLogin ? 1 : 0.4 }}>
+                        {
+                            user.isLogin ? <Image src={user.avatar} className="avatar" /> : <Image src={require('@/assets/images/user.png')} className="avatar_placeholder" />
+                        }
+                    </View>
+                    <Text className="nickname">{user.isLogin ? user.nickname : '未登录'}</Text>
+                    <Text className="username">{user.isLogin ? '用户名未设置' : ''}</Text>
                 </View>
-                <Text className="nickname">{user.isLogin ? user.nickname : '未登录'}</Text>
-                <Text className="username">{user.isLogin ? '用户名未设置' : ''}</Text>
-            </View>
-        </Box>
+            </Box>
 
-        <Box type={BoxType.outline}>
-            <View className="balance" onClick={tapBalance}>
-                <Text className="title">逆龄石</Text>
-                <Text className="desc">{'会员体系升级中,期间指标记录限时免逆龄石记录\n敬请期待'}</Text>
-            </View>
-        </Box>
-        {user.isLogin && <Box type={BoxType.outline}>
-            <View onClick={goSetting}>
-                <Text className="title">设置</Text>
-            </View>
-        </Box>
-        }
-        {
-            user.isLogin && user.test_user && <Text>用户名:{user.nickname}</Text>
-        }
-        {
-            user.isLogin && user.test_user && <Text>id:{user.id}</Text>
-        }
+            <Box type={BoxType.outline}>
+                <View className="balance" onClick={tapBalance}>
+                    <Text className="title">逆龄石</Text>
+                    <Text className="desc">{'会员体系升级中,期间指标记录限时免逆龄石记录\n敬请期待'}</Text>
+                </View>
+            </Box>
+            {user.isLogin && <Box type={BoxType.outline}>
+                <View onClick={goSetting}>
+                    <Text className="title">设置</Text>
+                </View>
+            </Box>
+            }
+            {
+                user.isLogin && user.test_user && <Text>用户名:{user.nickname}</Text>
+            }
+            {
+                user.isLogin && user.test_user && <Text>id:{user.id}</Text>
+            }
+
+            {
+                user.isLogin && user.test_user && <Buttons title='重置session' onClick={reset} btnStyle={{ width: 289, marginBottom: 30 }} />
+            }
 
+        </View>
+    }
+
+    return <Layout title={t('page.more.title')}
+        titleShowStyle={NaviBarTitleShowType.scrollToShow} type={TemplateType.flex}>
         {
-            user.isLogin && user.test_user && <Buttons title='重置session' onClick={reset} btnStyle={{ width: 289, marginBottom: 30 }} />
+            detail()
         }
-
-    </View>
+    </Layout>;
 }

+ 7 - 0
src/pages/account/ProfileSetting.config.ts

@@ -0,0 +1,7 @@
+export default definePageConfig({
+    usingComponents: {
+        // 'ec-canvas': '../../lib/ec-canvas/ec-canvas',
+        // 'demo':'../../components/demo'
+    },
+    "navigationBarTitleText": ""
+})

+ 12 - 2
src/pages/account/ProfileSetting.tsx

@@ -1,15 +1,25 @@
 import Buttons from "@/components/basic/Buttons";
 import { clear, logout } from "@/services/user";
-import { View, Text, Image,Button } from "@tarojs/components";
+import { View, Text, Image, Button } from "@tarojs/components";
 import { useDispatch, useSelector } from "react-redux";
 import './ProfileSetting.scss'
 import Box from "@/components/layout/Box";
 import Taro from "@tarojs/taro";
+import { useEffect } from "react";
+import { useTranslation } from "react-i18next";
 
 export default function Page() {
     const dispatch = useDispatch();
     const user = useSelector((state: any) => state.user);
-    function editNickname(){
+    const { t } = useTranslation()
+
+    useEffect(() => {
+        Taro.setNavigationBarTitle({
+            title: t('page.user_profile.title')
+        })
+    }, [])
+
+    function editNickname() {
         Taro.navigateTo({
             url: '/pages/account/EditPage'
         })

+ 7 - 0
src/pages/account/Setting.config.ts

@@ -0,0 +1,7 @@
+export default definePageConfig({
+    usingComponents: {
+        // 'ec-canvas': '../../lib/ec-canvas/ec-canvas',
+        // 'demo':'../../components/demo'
+    },
+    "navigationBarTitleText": ""
+})

+ 8 - 0
src/pages/account/Setting.tsx

@@ -2,11 +2,19 @@ import Buttons from "@/components/basic/Buttons";
 import { clear, logout } from "@/services/user";
 import { View, Text, Button } from "@tarojs/components";
 import Taro from "@tarojs/taro";
+import { useEffect } from "react";
+import { useTranslation } from "react-i18next";
 import { useDispatch, useSelector } from "react-redux";
 
 export default function Page() {
     const dispatch = useDispatch();
+    const {t} = useTranslation()
     const user = useSelector((state: any) => state.user);
+    useEffect(()=>{
+        Taro.setNavigationBarTitle({
+            title:t('page.setting.title')
+        })
+    },[])
     function logoutF() {
         Taro.showModal({
             title: '退出登录',

+ 0 - 0
src/pages/account/Settings.tsx


+ 7 - 0
src/pages/clock/ChooseScenario.config.ts

@@ -0,0 +1,7 @@
+export default definePageConfig({
+    usingComponents: {
+        // 'ec-canvas': '../../lib/ec-canvas/ec-canvas',
+        // 'demo':'../../components/demo'
+    },
+    "navigationBarTitleText": ""
+})

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

@@ -33,10 +33,12 @@ import { showModal } from '@/store/modal'
 import { ConsoleType, changeConsoleStatus } from '@/store/console'
 import TitleView from '@/features/trackTimeDuration/components/TitleView'
 import StatusIndicator from '@/features/trackTimeDuration/components/StatusIndicator'
+import { useTranslation } from 'react-i18next'
 // import TabBar from '../../components/Tabbar';
 
 export default function IndexPage() {
   const dispatch = useDispatch();
+  const { t } = useTranslation()
   const [checkData, setCheckData] = useState(null)
   const user = useSelector((state: any) => state.user);
   const time = useSelector((state: any) => state.time);
@@ -230,7 +232,6 @@ export default function IndexPage() {
       }
       else {
         if (global.consoleType == 'going') {
-
           setShowSingleFastEnd(true)
           setTimeout(() => {
             setShowSingleFastEnd(false)
@@ -244,7 +245,6 @@ export default function IndexPage() {
           }, 2000)
         }
         else {
-          // console.log('bbb')
         }
       }
       // if ((res as any).current_record.status == 'ONGOING1') {
@@ -313,7 +313,7 @@ export default function IndexPage() {
     </TitleView>
   }
   return (
-    <Layout type={TemplateType.customHeader} header={headerView()} title='时钟' titleShowStyle={NaviBarTitleShowType.scrollToShow}>
+    <Layout type={TemplateType.customHeader} header={headerView()} title={t('page.clock.title')} titleShowStyle={NaviBarTitleShowType.scrollToShow}>
       <View style={{ flex: 1, flexDirection: 'column', display: 'flex', backgroundColor: '#000', color: '#fff' }}>
         {
           needShowAddTip && <Tooltip title="添加到我的小程序" closeTip={() => { setNeedShowAddTip(false) }} />

+ 2 - 1
src/pages/clock/SetSchedule.config.ts

@@ -3,6 +3,7 @@ export default definePageConfig({
       // 'ec-canvas': '../../lib/ec-canvas/ec-canvas',
       // 'demo':'../../components/demo'
     },
-    "disableScroll": true
+    // "disableScroll": true
+    "navigationBarTitleText": ""
   })
   

+ 18 - 3
src/pages/common/RecordsHistory.tsx

@@ -13,6 +13,7 @@ import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
 import { useSelector } from "react-redux";
 import RecordFastSleep from "@/features/trackTimeDuration/components/RecordFastSleep";
 import './RecordsHistory.scss'
+import { useTranslation } from "react-i18next";
 
 export default function Page() {
     const router = useRouter();
@@ -28,8 +29,9 @@ export default function Page() {
     const [modalDetail, setModalDetail] = useState<any>({})
     const [total, setTotal] = useState(0)
     const [isLoading, setIsLoading] = useState(false)
-    const [loaded,setLoaded] = useState(false)
+    const [loaded, setLoaded] = useState(false)
     const user = useSelector((state: any) => state.user);
+    const { t } = useTranslation()
 
 
     global.showModal = (isShow: boolean, detail: any) => {
@@ -100,7 +102,7 @@ export default function Page() {
                 page: page,
                 limit: pageSize,
                 // completed: true,
-                part_completed:true
+                part_completed: true
             }).then(res => {
                 Taro.stopPullDownRefresh()
                 setTriggered(false)
@@ -228,9 +230,22 @@ export default function Page() {
         }
     }
 
+    function getTitle() {
+        if (router.params.type == 'time') {
+            return t('page.records_history.time_title')
+        }
+        else if (router.params.type == 'metric') {
+            return t('page.records_history.metric_title', {title:router.params.title})
+        }
+        else {
+            return t('page.records_history.activity_title', {title:router.params.title})
+        }
+    }
+
     return <View style={{ position: 'relative' }}>
         <Layout children={showErrorPage ? <NoData refresh={() => { refresh() }} /> : detail()}
-            title={router.params.title}
+            // title={router.params.title}
+            title={getTitle()}
             type={TemplateType.flex}
             refresh={() => { refresh() }}
             triggered={triggered}