Ver Fonte

themecolor

Leon há 2 anos atrás
pai
commit
91b34afa96

+ 2 - 2
src/components/basic/Buttons.scss

@@ -41,7 +41,7 @@
 //     border: 0;
 // }
 
-
+@import '@/utils/common.scss';
 
 .texted {
     // background: linear-gradient(to right, red, blue);
@@ -52,7 +52,7 @@
 }
 
 .mixed {
-    background: linear-gradient(90deg, #AAFF00 0%, #00FFFF 100%);
+    background: linear-gradient(90deg, $fastColor 0%, #00FFFF 100%);
     -webkit-background-clip: text;
     background-clip: text;
     color: transparent;

+ 3 - 1
src/components/input/SingleSelect.scss

@@ -1,3 +1,5 @@
+@import '@/utils/common.scss';
+
 .item{
     margin: 0 46px  40px 46px;
     background-color: #1C1C1C;
@@ -12,5 +14,5 @@
 }
 
 .item_select{
-    border: solid 4px #AAFF00;
+    border: solid 4px $fastColor;
 }

+ 3 - 1
src/components/layout/Header.scss

@@ -1,3 +1,5 @@
+@import '@/utils/common.scss';
+
 .header{
     display: flex;
     flex-direction: row;
@@ -16,7 +18,7 @@
 }
 
 .header_action{
-    color: #AAFF00;
+    color: $fastColor;
     font-size: 32px;
     line-height: 32px;
     font-weight: 400;

+ 7 - 5
src/context/locales/zh.js

@@ -113,8 +113,8 @@ export default {
                 countup: '已进行',             //indicator
                 countdown_not_due: '距结束',
                 timeout: '已超时',
-                fast_duration: '断食时长',    //时长picker title
-                sleep_duration: '睡眠时长',
+                fast_duration: '断食目标时长',    //时长picker title
+                sleep_duration: '睡眠目标时长',
                 real_fast_start_dt: '断食开始时间', //时间picker title
                 real_fast_end_dt: '断食结束时间',
                 real_sleep_start_dt: '睡眠开始时间',
@@ -141,9 +141,7 @@ export default {
 
             action_sheet: {
                 change_schedule: '调整日程',
-                switch_scenario: '切换场景',
-                give_up: '放弃终止',
-                end_fast: '结束断食',
+                switch_scenario: '选择生物钟',
                 cancel: '取消'
             },
             dial: {
@@ -179,6 +177,10 @@ export default {
                 }
 
             }
+        },
+        track_something:{
+            btn_record:'记录',
+            picker_datetime:'记录时间'
         }
     }
 }

+ 4 - 0
src/context/themes/color.tsx

@@ -0,0 +1,4 @@
+export enum ColorType {
+    fast = '',
+    sleep = ''
+}

+ 0 - 0
src/context/themes/placeholder


+ 7 - 2
src/features/trackSomething/components/Metric.tsx

@@ -308,7 +308,7 @@ export default function Component(props: any) {
                             value={value}
                             unit={unit}
                             desc={desc}
-                            btnText={'记录'}
+                            btnText={t('feature.track_something.btn_record')}
                             isDisabled={false}
                             showDetail={showDetail}
                             themeColor={item.theme_color}
@@ -395,7 +395,12 @@ export default function Component(props: any) {
                     chooseTime((picker as any).getConfirmData());
                     setIsTimePickerOpen(false);
                 }}>
-                <LimitPickers ref={limitPickerRef} isRealTime={true} time={time} limit={limit} limitDay={180} onCancel={() => { setIsTimePickerOpen(false) }} onChange={(e) => {
+                <LimitPickers ref={limitPickerRef} 
+                isRealTime={true} time={time} limit={limit} 
+                title={t('feature.track_something.picker_datetime')}
+                themeColor={(metricItem as any).theme_color}
+                limitDay={180} onCancel={() => { setIsTimePickerOpen(false) }}
+                 onChange={(e) => {
                     chooseTime(e)
                     //  pickerConfirm(e)
                     //  hidePicker()

+ 11 - 5
src/features/trackTimeDuration/components/SetSchedule.scss

@@ -29,11 +29,10 @@
 .item_title{
     font-size: 32px;
     line-height: 32px;
-    color: #fff;
 }
 
 .subtitle{
-    color: #fff;
+
     opacity: 0.4;
     font-size: 36px;
     margin-bottom: 20px;
@@ -43,7 +42,6 @@
     margin-top: 10px;
     font-size: 48px;
     line-height: 48px;
-    color: #fff;
     font-weight: bold;
 }
 
@@ -70,13 +68,21 @@
 .duration_title{
     font-size: 32px;
     line-height: 32px;
-    color: #fff;
 }
 
-.duration{
+.duration_value{
     font-size: 48px;
     line-height: 48px;
     margin-top: 10px;
     text-align: center;
     font-weight: bold;
+}
+
+.schedule_text_value{
+    color: #fff;
+}
+
+.schedule_text_key{
+    color: #fff;
+    opacity: 0.6;
 }

+ 9 - 7
src/features/trackTimeDuration/components/SetSchedule.tsx

@@ -300,6 +300,8 @@ export default function Component() {
       cancel={() => { setIsTimeOpen(false) }} />
   }
 
+  console.log(scenario)
+
   function detail() {
     return <View >
       <Text className="subtitle">{t('page.set_schedule.fast_subtitle')}</Text>
@@ -310,16 +312,16 @@ export default function Component() {
             setChooseStart(true)
             setIsTimeOpen(true)
           }}>
-            <Text className="item_title">{t('feature.track_time_duration.dial.start_time')}</Text>
-            <Text className="item_text">{startTime}</Text>
+            <Text className="item_title schedule_text_key">{t('feature.track_time_duration.dial.start_time')}</Text>
+            <Text className="item_text schedule_text_value">{startTime}</Text>
           </View>
           <View style={{ width: 23 }} />
           <View className="item1" style={{ opacity: operateType == 2 || operateType == 3 ? 1 : 0.4, backgroundColor: isDebugMode ? 'pink' : 'transparent' }} onClick={() => {
             setChooseStart(false)
             setIsTimeOpen(true)
           }}>
-            <Text className="item_title">{t('feature.track_time_duration.dial.end_time')}</Text>
-            <Text className="item_text">{endTime}</Text>
+            <Text className="item_title schedule_text_key">{t('feature.track_time_duration.dial.end_time')}</Text>
+            <Text className="item_text schedule_text_value">{endTime}</Text>
           </View>
 
         </View>
@@ -327,14 +329,14 @@ export default function Component() {
           <Dial ref={canvasRef} />
         </View>
         <View className="duration_bg" style={{ opacity: operateType == 1 || operateType == 2 ? 1 : 0.4, backgroundColor: isDebugMode ? 'pink' : 'transparent' }} onClick={() => { setIsOpen(true) }}>
-          <Text className="duration_title">{t('feature.track_time_duration.dial.duration')}</Text>
-          <Text className="duration"  >{hours > 0 ? hours + '小时' : ''}{minutes > 0 ? minutes + '分钟' : ''}</Text>
+          <Text className="duration_title schedule_text_key">{t('feature.track_time_duration.dial.duration')}</Text>
+          <Text className="duration_value schedule_text_value"  >{hours > 0 ? hours + '小时' : ''}{minutes > 0 ? minutes + '分钟' : ''}</Text>
         </View>
 
       </View>
 
       <Footer>
-        <SetScheduleBtn title={scenario.step == 'fast' ? t('feature.common.btn_set_and_next') : t('feature.common.btn_set_and_done')}
+        <SetScheduleBtn title={(scenario.step == 'fast' && scenario.name == 'FAST_SLEEP') ? t('feature.common.btn_set_and_next') : t('feature.common.btn_set_and_done')}
           lowLight={operateType != 0}
           isFast={scenario.step == 'fast'}
           onClick={() => start()} />

+ 2 - 1
src/features/trackTimeDuration/components/Stage.scss

@@ -1,3 +1,4 @@
+@import '@/utils/common.scss';
 .stage {
     display: flex;
     flex-direction: column;
@@ -32,7 +33,7 @@
 
 .stage_step_border_ing{
     border-right-style: solid;
-    border-right-color: #AAFF00;
+    border-right-color: $fastColor;
     border-right-width: 2px;
 }
 

+ 18 - 9
src/features/trackTimeDuration/components/StatusIndicator.tsx

@@ -32,7 +32,7 @@ export default function Component() {
         return strName
     }
 
-    
+
 
     function sleepAlpha() {
         return time.status == 'ONGOING3' ? 0.4 : 1
@@ -69,14 +69,23 @@ export default function Component() {
         return strName
     }
 
+    if (!time.scenario){
+        return <View />
+    }
+
     return <View className='subcontent'>
-        <View className='scenario'>
-            <View className='point' style={{ backgroundColor: '#AAFF00' }} />
-            <Text className='name'>{getFastName()}</Text>
-        </View>
-        <View className='scenario' style={{ opacity: sleepAlpha() }}>
-            <View className='point' style={{ backgroundColor: '#00FFFF' }} />
-            <Text className='name'>{getSleepName()}</Text>
-        </View>
+        {
+            time.scenario != 'SLEEP' && <View className='scenario'>
+                <View className='point' style={{ backgroundColor: '#AAFF00' }} />
+                <Text className='name'>{getFastName()}</Text>
+            </View>
+        }
+        {
+            time.scenario != 'FAST' && <View className='scenario' style={{ opacity: sleepAlpha() }}>
+                <View className='point' style={{ backgroundColor: '#00FFFF' }} />
+                <Text className='name'>{getSleepName()}</Text>
+            </View>
+        }
+
     </View>
 }

+ 7 - 5
src/features/trackTimeDuration/components/TitleView.tsx

@@ -15,11 +15,13 @@ export default function Component(props:{children:any}) {
 
     function more() {
         Taro.showActionSheet({
-            itemList: [t('feature.track_time_duration.action_sheet.change_schedule'), t('feature.track_time_duration.action_sheet.switch_scenario')]
-        })
-            .then(res => {
+            itemList: [
+                t('feature.track_time_duration.action_sheet.switch_scenario'),
+                t('feature.track_time_duration.action_sheet.change_schedule')
+            ]
+        }).then(res => {
                 switch (res.tapIndex) {
-                    case 0:
+                    case 1:
                         if (time.scenario == 'FAST_SLEEP') {
                             dispatch(setStep(isFastFirst ? 'fast' : 'sleep'))
                         }
@@ -33,7 +35,7 @@ export default function Component(props:{children:any}) {
                             url: '/pages/clock/SetSchedule'
                         })
                         break;
-                    case 1:
+                    case 0:
                         Taro.navigateTo({
                             url: '/pages/clock/ChooseScenario'
                         })

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

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