Leon hai 1 ano
pai
achega
58f1dac44c

+ 7 - 0
config/index.ts

@@ -1,4 +1,6 @@
 import path from 'path';
+
+
 const config = {
   projectName: 'hola',
   date: '2023-10-5',
@@ -15,6 +17,11 @@ const config = {
   },
   copy: {
     patterns: [
+      {
+        from: `node_modules/tdesign-miniprogram-taro/miniprogram_dist/`,
+        to: `dist/miniprogram_npm/tdesign-miniprogram/`,
+        ignore: ['*.ts', '*.map', 'type.js']
+      },
     ],
     options: {
     }

+ 2 - 0
package.json

@@ -106,6 +106,8 @@
 		"react-native-webview": "~11.23.0",
 		"react-redux": "^8.1.3",
 		"taro-ui": "^3.1.1",
+		"tdesign-miniprogram": "^1.2.8",
+		"tdesign-miniprogram-taro": "^0.0.4",
 		"xstate": "^4.38.2"
 	},
 	"devDependencies": {

+ 2 - 1
src/app.config.ts

@@ -34,7 +34,8 @@ const appConfig = defineAppConfig({
     }
   ],
   usingComponents: {
-    'mysvg': './components/basic/svg'
+    'mysvg': './components/basic/svg',
+    // 't-popup':'tdesgin-miniprogram/popup/popup'
   },
   "requiredPrivateInfos": [
     "chooseLocation"

+ 2 - 0
src/app.scss

@@ -244,9 +244,11 @@ page {
     color: #fff;
     opacity: 0.2;
     margin-left: 86px;
+    margin-right: 46px;
     line-height: 32px;
     font-size: 24px;
     margin-top: 20px;
+    display: flex;
 }
 
 .cell_bg {

+ 2 - 1
src/app.tsx

@@ -22,7 +22,8 @@ if (process.env.TARO_ENV == 'rn') {
 
 
 const App: React.FC<PropsWithChildren> = ({ children }) => {
-  console.log(Intl.DateTimeFormat().resolvedOptions().timeZone)
+  // console.log(Intl.DateTimeFormat().resolvedOptions().timeZone)
+  console.log(Taro.getSystemInfoSync().platform)
   if (process.env.TARO_ENV=='rn'){
     // alert(Intl.DateTimeFormat().resolvedOptions().timeZone)
   }

+ 1 - 1
src/components/view/Timeline.tsx

@@ -33,7 +33,7 @@ export default function Component(props: { items: any[], title?: string, type?:
                                 <View style={{ flex: 1 }} />
                             </View>
                         </View>
-                        <View className="timeline-detail" style={{width:props.width?rpxToPx(props.width):rpxToPx(468)}}>{item.content}
+                        <View className="timeline-detail" style={{width:props.width?rpxToPx(props.width+16):rpxToPx(488)}}>{item.content}
                             {
                                 item.date && <View className="timeline-date">{item.date}</View>
                             }

+ 58 - 26
src/context/locales/en.js

@@ -23,11 +23,11 @@ export default {
         food: {
             title: 'Food',
         },
-        workout:{
-            title:'Workouts'
+        workout: {
+            title: 'Workouts'
         },
-        explore:{
-            title:'Explore'
+        explore: {
+            title: 'Explore'
         },
         more: {
             title: 'More',
@@ -79,7 +79,7 @@ export default {
             agreement: 'I have read and agreed to the User Agreement and Privacy Policy',
         },
         records_history: {
-            time_title: 'Fast and Sleep',
+            time_title: 'History',
             metric_title: '{{title}} Records',
             activity_title: '{{title}} Records',
             del_success: 'Deletion successful'
@@ -104,17 +104,20 @@ export default {
             wait_for_end: 'Awaiting end',
             not_started: 'Not started',
             not_completed: 'Not completed',
-            btn_pre:'Pre',
+            btn_pre: 'Pre',
             btn_next: 'Next',
             btn_done: 'Done',
             btn_set_and_next: 'Set and next',
             btn_set_and_done: 'Set and done',
-            drag_order:'Press and drag to change order',
-            maintain:'Item under maintenance',
-            multi_timezones:'Mult. time zones',
-            different_timezone:'Other time zone',
-            multi_tz_desc:'Multiple time zones were involved in these events.',
-            diff_tz_desc:'These events occured in {{location}} time which differs from your current time zone.',
+            drag_order: 'Press and drag to change order',
+            maintain: 'Item under maintenance',
+            multi_timezones: 'Mult. time zones',
+            different_timezone: 'Other time zone',
+            multi_tz_desc: 'Multiple time zones were involved in these events.',
+            diff_tz_desc: 'These events occured in {{location}} time which differs from your current time zone.',
+            become_pro: 'Become Pro',
+            overnight: 'Overnight',
+            day: 'Day',
             toast: {
                 min_value: 'Cannot go any lower',
                 max_value: 'Cannot go any higher',
@@ -192,7 +195,28 @@ export default {
                 started_sleeping: 'Started sleeping',
                 end_sleep: 'End sleeping',
                 ended_sleeping: 'Ended sleeping',
-                start_fasting_first:'Start fasting first.',
+                start_fasting_first: 'Start fasting first.',
+            },
+            third_ring: {
+                night_ring: 'Night ring',
+                day_ring: 'Day ring',
+                sunrise_today: 'Sunrise',
+                sunset_today: 'Sunset',
+                sunrise_tomorrow: 'Sunrise (tmrw)',
+
+                member_desc: 'Sunset and sunrise times are global average. For actual times at your location, join our Pro program.',
+                base_location_desc: 'Calculated based on your location.',
+                enter_location_desc: 'Sunset and sunrise times are global average. For actual times at your location, enter your location.',
+
+                location: 'Location',
+                enter: 'Enter',
+                unknown: 'Unknown',
+                latitude: 'Latitude',
+                longitude: 'Longitude',
+                coordinates: 'Coordinates',
+                timezone: 'Time zone',
+
+
             },
             change_tz_alert: {
                 title: 'New Time Zone Detected',
@@ -232,15 +256,17 @@ export default {
                 sleep_start: 'Start sleeping',
                 sleep_end: 'End sleeping',
                 total_duration: 'Total duration',
-                countup: 'In progress',
-                countdown_not_due: 'Time remaining',
-                timeout: 'Time expired',
+                countup: 'Elapsed',
+                countdown_not_due: 'Remaining',
+                timeout: 'Extended',
+                real_duration: 'Actual',
                 fast_duration: 'Fasting target duration',
                 sleep_duration: 'Sleep target duration',
                 real_fast_start_dt: 'Fast start time',
                 real_fast_end_dt: 'Fast end time',
                 real_sleep_start_dt: 'Sleep start time',
                 real_sleep_end_dt: 'Sleep end time',
+                target: 'Target'
             },
             schedule: {
                 section_title: 'Today',
@@ -250,32 +276,38 @@ export default {
                 duration_goals_by_stage: 'View fasting stage goals',
                 current_stage: 'View current fasting stage',
                 timeline: 'Schedule',
-                total_time:'Total time',
+                total_time: 'Duration',
                 stage: 'Stages',
 
             },
             record_fast_sleep: {
                 header: {
                     latest_record: 'Recent',
-                    btn_show_all: 'View more'
+                    btn_show_all: 'Show History'
                 },
                 item: {
                     fast: 'Fast',
                     sleep: 'Sleep'
                 },
-                timeline: 'Timeline',
+                timeline: 'Times',
                 stage: 'Stages',
-                pop_title: 'Detail'
+                pop_title: 'Detail',
+                history_title: 'History',
+                tab_all: 'All',
+                tab_fast_sleep: 'Fast with Sleep',
+                tab_fast: 'Fast',
+                tab_sleep: 'Sleep',
+                delete: 'Delete'
             },
 
             action_sheet: {
                 change_schedule: 'Adjust schedule',
                 switch_scenario: 'Select circadian clock',
-                set_new_goals:'Set New Goals',
-                set_fast_goal:'Set Fast Goal (for this time)',
-                set_sleep_goal:'Set Sleep Goal (for this time) ',
-                edit_fasting_goal:'Edit Fasting Goal',
-                edit_sleeping_goal:'Edit Sleeping Goal',
+                set_new_goals: 'Set New Goals',
+                set_fast_goal: 'Set Fast Goal (for this time)',
+                set_sleep_goal: 'Set Sleep Goal (for this time) ',
+                edit_fasting_goal: 'Edit Fasting Goal',
+                edit_sleeping_goal: 'Edit Sleeping Goal',
                 cancel: 'Cancel'
             },
             dial: {
@@ -395,7 +427,7 @@ export default {
                 choose_metric: 'Choose metric',
                 choose_metric_desc: 'Select metrics based on your needs.',
                 order: 'Adjust order',
-                composite:'Comp'
+                composite: 'Comp'
 
             },
             werun_auth: {

+ 93 - 60
src/context/locales/zh.js

@@ -23,11 +23,11 @@ export default {
         food: {
             title: '饮食',
         },
-        workout:{
-            title:'运动'
+        workout: {
+            title: '运动'
         },
-        explore:{
-            title:'发现'
+        explore: {
+            title: '发现'
         },
         more: {
             title: '更多',
@@ -49,16 +49,16 @@ export default {
             sleep_title: '睡眠日程',
             fast_subtitle: '设定时间和时长目标',
             sleep_subtitle: '设定时间和时长目标',
-            fast_target:'断食目标',
-            fast_target_desc:'计划每日断食{{target_time}}, 其余{{left_time}}进食。',
-            fast_schedule:'断食日程',
-            fast_schedule_desc:'计划每日{{start_time}}开始断食, {{the_next_day}}{{end_time}}结束断食。',
-            sleep_target:'睡眠目标',
-            sleep_target_desc:'计划每日睡眠{{target_time}}, 其余{{left_time}}清醒。',
-            sleep_schedule:'睡眠日程',
-            sleep_schedule_desc:'计划每日{{start_time}}开始睡眠, {{the_next_day}}{{end_time}}结束睡眠。',
-            next_day:'次日',
-            the_next_day:'次日'
+            fast_target: '断食目标',
+            fast_target_desc: '计划每日断食{{target_time}}, 其余{{left_time}}进食。',
+            fast_schedule: '断食日程',
+            fast_schedule_desc: '计划每日{{start_time}}开始断食, {{the_next_day}}{{end_time}}结束断食。',
+            sleep_target: '睡眠目标',
+            sleep_target_desc: '计划每日睡眠{{target_time}}, 其余{{left_time}}清醒。',
+            sleep_schedule: '睡眠日程',
+            sleep_schedule_desc: '计划每日{{start_time}}开始睡眠, {{the_next_day}}{{end_time}}结束睡眠。',
+            next_day: '次日',
+            the_next_day: '次日'
 
         },
         choose_language: {
@@ -78,7 +78,7 @@ export default {
             agreement: '已阅读并同意《用户协议》和《隐私政策》',
         },
         records_history: {
-            time_title: '断食和睡眠',
+            time_title: '历史记录',
             metric_title: '{{title}}记录',
             activity_title: '{{title}}记录',
             del_success: '删除成功'
@@ -107,16 +107,19 @@ export default {
             not_started: "未开始",
             not_completed: "未完成",
             btn_next: '下一步',
-            btn_pre:'上一步',
+            btn_pre: '上一步',
             btn_done: '完成',
             btn_set_and_next: "下一步",// "Set and Next"
             btn_set_and_done: "完成",// "Set and Done"
-            drag_order:'长按可拖动排序',
-            maintain:'项目维护中',
-            multi_timezones:'跨多时区',
-            different_timezone:'其他时区',
-            multi_tz_desc:'上述事件涉及到多个时区。',
-            diff_tz_desc:'上述事件发生在{{location}}时区, 与您当前所在的时区不同。',
+            drag_order: '长按可拖动排序',
+            maintain: '项目维护中',
+            multi_timezones: '跨多时区',
+            different_timezone: '其他时区',
+            multi_tz_desc: '上述事件涉及到多个时区。',
+            diff_tz_desc: '上述事件发生在{{location}}时区, 与您当前所在的时区不同。',
+            become_pro:'成为会员',
+            overnight: '夜间',
+            day: '白天',
             toast: {
                 min_value: '不能再小了',
                 max_value: '不能再大了',
@@ -187,29 +190,51 @@ export default {
         },
         track_time_duration: {
             common: {
-                share_title:'我的断食睡眠日记',
+                share_title: '我的断食睡眠日记',
                 start_fast: '开始断食',//正常态
-                started_fasting:'开始断食',//完成时
+                started_fasting: '开始断食',//完成时
                 end_fast: '结束断食',
                 ended_fasting: '结束断食',
                 start_sleep: '开始睡眠',
                 started_sleeping: '开始睡眠',
                 end_sleep: '结束睡眠',
                 ended_sleeping: '结束睡眠',
-                start_fasting_first:'开始断食后可设置',
+                start_fasting_first: '开始断食后可设置',
             },
-            change_tz_alert:{
-                title:'检测到新时区',
-                content:'已为您变更到 {{tz}}',
-                confirm:'我知道了'
+            third_ring: {
+                night_ring: '夜间',
+                day_ring: '白天',
+                sunrise_today: '日出',
+                sunset_today: '日落',
+                sunrise_tomorrow: '日出(明天)',
+
+                member_desc: "日出和日落时间为全球平均值。如需获取实际时间, 成为我们的 Pro 会员。",
+                enter_location_desc: "日出和日落时间为全球平均值。如需获取实际时间,请选择您的地点。",
+                base_location_desc: "根据您的地点计算。",
+
+                location: '地点',
+                enter: '选择',
+                unknown: '未知',
+                latitude: '经度',
+                longitude: '纬度',
+                coordinates: '经纬度',
+                timezone: '时区',
+
+
+            },
+            change_tz_alert: {
+                title: '检测到新时区',
+                content: '已为您变更到 {{tz}}',
+                confirm: '我知道了'
             },
             status_indicator: {
-                fast_wait_for_start:'断食',
-                fast_ongoing:'断食进行中',
-                sleep_wait_for_start:'睡眠',
-                sleep_ongoing:'睡眠进行中',
-                sleep_ongoing1:'睡眠待开始',
-                sleep_ongoing3:'睡眠已结束'
+                fast_wait_for_start: '断食',
+                fast_ongoing: '断食进行中',
+                sleep_wait_for_start: '睡眠',
+                sleep_ongoing: '睡眠进行中',
+                sleep_ongoing1: '睡眠待开始',
+                sleep_ongoing3: '睡眠已结束',
+
             },
             follow_wx_pub: {
                 //未关注状态
@@ -238,12 +263,14 @@ export default {
                 countup: '已进行',             //indicator
                 countdown_not_due: '距结束',
                 timeout: '已超时',
-                fast_duration: '断食目标时长',    //时长picker title
-                sleep_duration: '睡眠目标时长',
+                real_duration: '实际',
+                fast_duration: '设置断食目标时长',    //时长picker title
+                sleep_duration: '设置睡眠目标时长',
                 real_fast_start_dt: '断食开始时间', //时间picker title
                 real_fast_end_dt: '断食结束时间',
                 real_sleep_start_dt: '睡眠开始时间',
                 real_sleep_end_dt: '睡眠结束时间',
+                target: '目标'
             },
             schedule: {
                 section_title: '今天',
@@ -253,32 +280,38 @@ export default {
                 duration_goals_by_stage: '查看断食阶段目标',  //底部文字按钮 waite for start
                 current_stage: '查看当前断食阶段',              //底部文字按钮 onging
                 timeline: '日程',            //一级页面待开始进行中,segment index=0的值
-                total_time:'总时间',
+                total_time: '时长',
                 stage: '阶段',
 
             },
             record_fast_sleep: {
                 header: {
-                    latest_record: '最近完成',
-                    btn_show_all: '查看更多'
+                    latest_record: '最近',
+                    btn_show_all: '查看历史'
                 },
                 item: {
                     fast: '断食',
                     sleep: '睡眠'
                 },
-                timeline: '时间线',  //modal弹窗 segment index=0的值
+                timeline: '时间',  //modal弹窗 segment index=0的值
                 stage: '阶段',
-                pop_title: '详情'
+                pop_title: '详情',
+                history_title: '历史记录',
+                tab_all: '全部',
+                tab_fast_sleep: '断食与睡眠',
+                tab_fast: '断食',
+                tab_sleep: '睡眠',
+                delete: '删除'
             },
 
             action_sheet: {
                 change_schedule: '调整日程',
                 switch_scenario: '选择生物钟',
-                set_new_goals:'设置新目标',
-                set_fast_goal:'设置断食目标(本次)',
-                set_sleep_goal:'设置睡眠目标(本次)',
-                edit_fasting_goal:'编辑断食目标',
-                edit_sleeping_goal:'编辑睡眠目标',
+                set_new_goals: '设置新目标',
+                set_fast_goal: '设置断食目标(本次)',
+                set_sleep_goal: '设置睡眠目标(本次)',
+                edit_fasting_goal: '编辑断食目标',
+                edit_sleeping_goal: '编辑睡眠目标',
                 cancel: '取消'
             },
             dial: {
@@ -355,17 +388,17 @@ export default {
             slider_tip_post_meal_title: '饱足感',
             slider_tip_pre_meal_desc: '极度饥饿到不饿',
             slider_tip_post_meal_desc: '不饱到极度撑胀',
-            disable_switch_modal_title:'请先完成当前记录',
-            disable_switch_modal_btn:'我知道了'
+            disable_switch_modal_title: '请先完成当前记录',
+            disable_switch_modal_btn: '我知道了'
         },
-        workout:{
-            share_title:'我的运动日记',
-            finish_title:'{{name}}计时训练中',
-            finish_current:'请先结束训练',
-            add_more:'添加更多',
-            choose_workout:'选择运动项',
-            order:'调整排序',
-            choose_workout_desc:'选择健身训练中常练的动作\n或日常活动'
+        workout: {
+            share_title: '我的运动日记',
+            finish_title: '{{name}}计时训练中',
+            finish_current: '请先结束训练',
+            add_more: '添加更多',
+            choose_workout: '选择运动项',
+            order: '调整排序',
+            choose_workout_desc: '选择健身训练中常练的动作\n或日常活动'
         },
         track_something: {
             btn_record: '记录',
@@ -391,15 +424,15 @@ export default {
                 check: '打卡'
             },
             metric: {
-                share_title:'我的指标记录',
+                share_title: '我的指标记录',
                 no_record: '无记录',
                 un_login: '未登录',
                 login_can_check: '登录后可记录',
                 check_unlock_data: '记录解锁趋势',
                 choose_metric: '选择指标项',
-                choose_metric_desc:'按需选择自己常用的指标',
+                choose_metric_desc: '按需选择自己常用的指标',
                 order: '调整排序',
-                composite:'复合'
+                composite: '复合'
             },
             werun_auth: {
                 modal_open_setting_title: '提示',

+ 56 - 27
src/features/trackTimeDuration/components/ClockHeader.tsx

@@ -11,6 +11,7 @@ import { PageContainer, View } from "@tarojs/components";
 import PickerViews from "@/components/input/PickerViews";
 import Modal from "@/components/layout/Modal.weapp";
 import { ColorType } from "@/context/themes/color";
+import { updateRecord } from "@/services/trackTimeDuration";
 
 
 let GradientText
@@ -66,22 +67,23 @@ export default function ClockHeader(props: { homeData: any }) {
         var data = props.homeData.fast_sleep
         var status = data.current_record.status
         var itemList: any = []
-        if (status == 'WAIT_FOR_START') {
-            itemList.push(t('feature.track_time_duration.action_sheet.set_new_goals'))
-            itemList.push(t('feature.track_time_duration.action_sheet.set_fast_goal'))
-            itemList.push(t('feature.track_time_duration.action_sheet.set_sleep_goal'))
-        }
-        else if (status == 'ONGOING1') {
-            itemList.push(t('feature.track_time_duration.action_sheet.set_sleep_goal'))
-            itemList.push(t('feature.track_time_duration.action_sheet.edit_fasting_goal'))
-        }
-        else if (status == 'ONGOING2') {
-            itemList.push(t('feature.track_time_duration.action_sheet.edit_sleeping_goal'))
-            itemList.push(t('feature.track_time_duration.action_sheet.edit_fasting_goal'))
-        }
-        else if (status == 'ONGOING3') {
-            itemList.push(t('feature.track_time_duration.action_sheet.edit_fasting_goal'))
-        }
+        itemList.push(t('feature.track_time_duration.action_sheet.set_sleep_goal'))
+        // if (status == 'WAIT_FOR_START') {
+        //     itemList.push(t('feature.track_time_duration.action_sheet.set_new_goals'))
+        //     itemList.push(t('feature.track_time_duration.action_sheet.set_fast_goal'))
+        //     itemList.push(t('feature.track_time_duration.action_sheet.set_sleep_goal'))
+        // }
+        // else if (status == 'ONGOING1') {
+        //     itemList.push(t('feature.track_time_duration.action_sheet.set_sleep_goal'))
+        //     itemList.push(t('feature.track_time_duration.action_sheet.edit_fasting_goal'))
+        // }
+        // else if (status == 'ONGOING2') {
+        //     itemList.push(t('feature.track_time_duration.action_sheet.edit_sleeping_goal'))
+        //     itemList.push(t('feature.track_time_duration.action_sheet.edit_fasting_goal'))
+        // }
+        // else if (status == 'ONGOING3') {
+        //     itemList.push(t('feature.track_time_duration.action_sheet.edit_fasting_goal'))
+        // }
         Taro.showActionSheet({
             itemList: itemList
         }).then(res => {
@@ -94,18 +96,24 @@ export default function ClockHeader(props: { homeData: any }) {
                             dispatch(setScenario(data.scenario));
                             jumpPage('/pages/clock/SetSchedule', 'SetSchedule', navigation)
                         }
-                        else if (status == 'ONGOING1') {
-                            setIsFast(false)
-                            setShowDurationPicker(true)
-                        }
-                        else if (status == 'ONGOING2') {
-                            setIsFast(false)
-                            setShowEditPicker(true)
-                        }
-                        else if (status == 'ONGOING3') {
-                            setIsFast(true)
-                            setShowEditPicker(true)
+                        else {
+                            Taro.showToast({
+                                title: t('feature.common.toast.ongoing'),
+                                icon: 'none'
+                            })
                         }
+                        // else if (status == 'ONGOING1') {
+                        //     setIsFast(false)
+                        //     setShowDurationPicker(true)
+                        // }
+                        // else if (status == 'ONGOING2') {
+                        //     setIsFast(false)
+                        //     setShowEditPicker(true)
+                        // }
+                        // else if (status == 'ONGOING3') {
+                        //     setIsFast(true)
+                        //     setShowEditPicker(true)
+                        // }
                     }
                     break;
                 case 1:
@@ -179,7 +187,28 @@ export default function ClockHeader(props: { homeData: any }) {
             global.changeTargetDuration(count, isFast)
         }
         else {
+            var params: any = {}
+            if (isFast) {
+                params = {
+                    fast: {
+                        target_duration: count * 60 * 1000
+                    }
+                }
+            }
+            else {
+                params = {
+                    sleep: {
+                        target_duration: count * 60 * 1000
+                    }
+                }
+            }
+            updateRecord({
+                ...params
+            }, (currentRecord as any).id).then(res => {
+                global.indexPageRefresh()
+            }).catch(e => {
 
+            })
         }
         setShowDurationPicker(false)
         setShowEditPicker(false)

+ 32 - 16
src/features/trackTimeDuration/components/DayLight.tsx

@@ -9,6 +9,7 @@ import { clearLocation, getPerm, latestLocation, uploadPerm } from '@/services/u
 import { TimeFormatter } from '@/utils/time_format'
 import { ColorType } from '@/context/themes/color'
 import { rpxToPx } from '@/utils/tools'
+import { useTranslation } from 'react-i18next'
 export default function DayLight() {
     const [showRing, setShowRing] = useState(false)
     const [isTomorrow, setIsTomorrow] = useState(false)
@@ -20,6 +21,7 @@ export default function DayLight() {
     const [showLocatin, setShowLocation] = useState(true)
     const dayNight = useSelector((state: any) => state.dayNight);
     const user = useSelector((state: any) => state.user);
+    const {t} = useTranslation()
     const dispatch = useDispatch();
 
     useEffect(() => { getContent() }, [])
@@ -165,6 +167,20 @@ export default function DayLight() {
 
     }
 
+    function getLocation(){
+        if ((authInfo as any).address.city.length>0){
+            return (authInfo as any).address.city
+        }
+        if ((authInfo as any).address.province.length>0){
+            return (authInfo as any).address.province
+        }
+        if ((authInfo as any).address.country.length>0){
+            return (authInfo as any).address.country
+        }
+        return t('feature.track_time_duration.third_ring.unknown')
+
+    }
+
     function clearData() {
         Taro.showModal({
             title: '提示',
@@ -192,7 +208,7 @@ export default function DayLight() {
     return <View>
         <View className='cell_bg'>
             <View className='cell_full'>
-                <Text className="cell_title">Night ring</Text>
+                <Text className="cell_title">{t('feature.track_time_duration.third_ring.night_ring')}</Text>
                 <Switch checked={showRing}
                     color={ColorType.night}
                     onChange={(e) => {
@@ -213,7 +229,7 @@ export default function DayLight() {
             }
             {
                 showRing && <View className="cell_full">
-                    <Text className="cell_title">Sunset today</Text>
+                    <Text className="cell_title">{t('feature.track_time_duration.third_ring.sunset_today')}</Text>
                     <Text className="cell_value">{sunsetTime}</Text>
                 </View>
             }
@@ -222,16 +238,16 @@ export default function DayLight() {
             }
             {
                 showRing && <View className="cell_full">
-                    <Text className="cell_title">Sunrise tomororow</Text>
+                    <Text className="cell_title">{t('feature.track_time_duration.third_ring.sunrise_tomorrow')}</Text>
                     <Text className="cell_value">{sunriseTime}</Text>
                 </View>
             }
         </View>
         {
             showRing && <Text className='cell_footer' >{
-                !isMember ? 'Sunset and sunrise times are global average. For actual times at your location, join our Pro program.' :
-                    authInfo ? 'Calculated based on your location.' :
-                        'Sunset and sunrise times are global average. For actual times at your location, enter your location.'
+                !isMember ? t('feature.track_time_duration.third_ring.member_desc'):
+                    authInfo ? t('feature.track_time_duration.third_ring.base_location_desc'):
+                    t('feature.track_time_duration.third_ring.enter_location_desc')
             }</Text>
         }
 
@@ -245,18 +261,18 @@ export default function DayLight() {
                     isMember ? <View className="cell_bg">
                         {
                             showLocatin && <View className="cell_full" onClick={auth}>
-                                <Text className="cell_title">Location</Text>
-                                <Text className="cell_value">{authInfo ? (authInfo as any).address.city : 'Enter'}</Text>
+                                <Text className="cell_title">{t('feature.track_time_duration.third_ring.location')}</Text>
+                                <Text className="cell_value">{authInfo ? getLocation() : t('feature.track_time_duration.third_ring.enter')}</Text>
                                 <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
                             </View>
                         }
                         {
-                            showLocatin && <View className="cell_line" style={{ height: 1 }} />
+                            authInfo && showLocatin && <View className="cell_line" style={{ height: 1 }} />
                         }
 
                         {
                             authInfo && showLocatin && <View className="cell_full" >
-                                <Text className="cell_title">Latitude</Text>
+                                <Text className="cell_title">{t('feature.track_time_duration.third_ring.latitude')}</Text>
 
                                 <Text className="cell_value">{(authInfo as any).latitude}</Text>
 
@@ -264,22 +280,22 @@ export default function DayLight() {
                             </View>
                         }
                         {
-                            showLocatin && <View className="cell_line" style={{ height: 1 }} />
+                            authInfo && showLocatin && <View className="cell_line" style={{ height: 1 }} />
                         }
                         {
                             authInfo && showLocatin && <View className="cell_full">
-                                <Text className="cell_title" >Longitude</Text>
+                                <Text className="cell_title" >{t('feature.track_time_duration.third_ring.longitude')}</Text>
 
                                 <Text className="cell_value">{(authInfo as any).longitude}</Text>
 
                             </View>
                         }
                         {
-                            showLocatin && <View className="cell_line" style={{ height: 1 }} />
+                            authInfo && showLocatin && <View className="cell_line" style={{ height: 1 }} />
                         }
                         {
                             authInfo && showLocatin && <View className="cell_full">
-                                <Text className="cell_title">Time zone</Text>
+                                <Text className="cell_title">{t('feature.track_time_duration.third_ring.timezone')}</Text>
 
                                 <Text className="cell_value">{timezone}</Text>
 
@@ -289,7 +305,7 @@ export default function DayLight() {
 
                     </View> :
                         <View className='become_vip' onClick={buy}>
-                            <Text style={{ color: '#000' }}>Become Pro</Text>
+                            <Text style={{ color: '#000' }}>{t('feature.common.become_pro')}</Text>
                         </View>
                 }
 
@@ -304,7 +320,7 @@ export default function DayLight() {
                     }}>{showLocatin ? 'Hide my location' : 'Show my location'}</Text>
                 }
                 {
-                    authInfo && showLocatin && <Text className='cell_footer' onClick={clearData}>清除位置数据</Text>
+                    authInfo && showLocatin && user.test_user && <Text className='cell_footer' onClick={clearData}>清除位置数据</Text>
                 }
 
             </View>

+ 27 - 0
src/features/trackTimeDuration/components/DurationPicker.tsx

@@ -0,0 +1,27 @@
+import { View } from "@tarojs/components"
+import { useEffect, useState } from "react"
+import { durationIndex } from "../hooks/Console"
+import { useSelector } from "react-redux"
+
+export default function DurationPicker(props: { record: any }) {
+    const [showDurationPicker, setShowDurationPicker] = useState(false)
+    const [fastPickerValue, setFastPickerValue] = useState([0, 0])
+    const [sleepPickerValue, setSleepPickerValue] = useState([0, 0])
+    const [showEditPicker, setShowEditPicker] = useState(false)
+    const common = useSelector((state: any) => state.common);
+
+    useEffect(() => {
+        getStateDetail()
+    }, [props.record])
+
+    function getStateDetail() {
+        var current_record = props.record
+        if (current_record.fast)
+            setFastPickerValue(durationIndex(current_record.fast.target_start_time, current_record.fast.target_end_time, common))
+        if (current_record.sleep)
+            setSleepPickerValue(durationIndex(current_record.sleep.target_start_time, current_record.sleep.target_end_time, common))
+    }
+
+
+    return <View style={{ width: 0, height: 0, opacity: 0 }} />
+}

+ 23 - 2
src/features/trackTimeDuration/components/IndexConsole.scss

@@ -7,20 +7,29 @@
     background-color: $fastColor;
     margin-left: 46px;
     margin-right: 46px;
-    margin-bottom: 36px;
+    // margin-bottom: 36px;
     align-items: center;
     justify-content: center;
     display: flex;
     color: #000;
 }
 
+.btn_line {
+    height: 36px;
+    width: 1px;
+    background-color: #fff;
+    opacity: 0.4;
+    margin-left: 114px;
+    flex-shrink: 0;
+}
+
 .stage_btn {
     height: 84px;
     border-radius: 42px;
     position: relative;
     margin-left: 46px;
     margin-right: 46px;
-    margin-bottom: 36px;
+    // margin-bottom: 36px;
     align-items: center;
     justify-content: center;
     flex-direction: row;
@@ -49,4 +58,16 @@
 
 .btn_sleep {
     background-color: $sleepColor;
+}
+
+.expand {
+    color: #fff;
+    opacity: 0.4;
+    width: 100%;
+    text-align: center;
+    display: flex;
+    // margin-top: 36px;
+    margin-top: 20px;
+    align-items: center;
+    justify-content: center;
 }

+ 21 - 8
src/features/trackTimeDuration/components/IndexConsole.tsx

@@ -22,6 +22,7 @@ export default function IndexConsole(props: { record: any }) {
     const { t } = useTranslation()
     const [fastDuration, setFastDuration] = useState<number>(0);
     const [sleepDuration, setSleepDuration] = useState<number>(0);
+    const [expand, setExpand] = useState(true);
 
     // const [fastPickerValue, setFastPickerValue] = useState([0, 0])
     // const [sleepPickerValue, setSleepPickerValue] = useState([0, 0])
@@ -187,25 +188,26 @@ export default function IndexConsole(props: { record: any }) {
         {
             status == 'WAIT_FOR_START' ?
                 <View onClick={tapStartFast} className='console_btn'>
-                    <Text style={{fontWeight:'bold'}}>{t('feature.track_time_duration.common.start_fast')}</Text>
+                    <Text style={{ fontWeight: 'bold' }}>{t('feature.track_time_duration.common.start_fast')}</Text>
                 </View> :
                 <View onClick={() => { vibrate() }} className='stage_btn'>
                     <Text style={{ flex: 1 }}>睡前断食</Text>
                     {
                         status == 'ONGOING1' ?
                             <Text>{TimeFormatter.countdown(currentRecord.fast.real_start_time)}</Text> :
-                            <Text>{TimeFormatter.durationFormate(currentRecord.fast.real_start_time, currentRecord.sleep.real_start_time)}</Text>
+                            <Text>{TimeFormatter.countdown(currentRecord.fast.real_start_time, currentRecord.sleep.real_start_time)}</Text>
                     }
 
                 </View>
         }
+        <View className='btn_line' />
         {
             (status == 'WAIT_FOR_START' || status == 'ONGOING1') &&
             <View onClick={tapStartSleep} className={status == 'ONGOING1' ? 'console_btn btn_sleep' : 'console_btn btn_sleep btn_disable'}>
                 {
                     status != 'ONGOING1' && <Image className='lock' src={require('@assets/images/lock.png')} />
                 }
-                <Text style={{fontWeight:'bold'}}>{t('feature.track_time_duration.common.start_sleep')}</Text>
+                <Text style={{ fontWeight: 'bold' }}>{t('feature.track_time_duration.common.start_sleep')}</Text>
             </View>
         }
         {
@@ -214,19 +216,20 @@ export default function IndexConsole(props: { record: any }) {
                 <Text style={{ flex: 1 }}>睡眠期间断食</Text>
                 {
                     status == 'ONGOING2' ? <Text>{TimeFormatter.countdown(currentRecord.sleep.real_start_time)}</Text> :
-                        <Text>{TimeFormatter.durationFormate(currentRecord.sleep.real_start_time, currentRecord.sleep.real_end_time)}</Text>
+                        <Text>{TimeFormatter.countdown(currentRecord.sleep.real_start_time, currentRecord.sleep.real_end_time)}</Text>
                 }
 
 
             </View>
         }
+        {(expand || (status != 'WAIT_FOR_START' && status != 'ONGOING1')) && <View className='btn_line' />}
         {
-            (status == 'WAIT_FOR_START' || status == 'ONGOING1' || status == 'ONGOING2') &&
+            (expand || (status != 'WAIT_FOR_START' && status != 'ONGOING1')) && (status == 'WAIT_FOR_START' || status == 'ONGOING1' || status == 'ONGOING2') &&
             <View onClick={tapEndSleep} className={status == 'ONGOING2' ? 'console_btn btn_sleep' : 'console_btn btn_sleep btn_disable'}>
                 {
                     status != 'ONGOING2' && <Image className='lock' src={require('@assets/images/lock.png')} />
                 }
-                <Text style={{fontWeight:'bold'}}>{t('feature.track_time_duration.common.end_sleep')}</Text>
+                <Text style={{ fontWeight: 'bold' }}>{t('feature.track_time_duration.common.end_sleep')}</Text>
             </View>
         }
         {
@@ -236,14 +239,24 @@ export default function IndexConsole(props: { record: any }) {
                 <Text>{TimeFormatter.countdown(currentRecord.sleep.real_end_time)}</Text>
             </View>
         }
+        {(expand || (status != 'WAIT_FOR_START')) && <View className='btn_line' />}
         {
-            (status == 'WAIT_FOR_START' || status == 'ONGOING1' || status == 'ONGOING2' || status == 'ONGOING3') &&
+            (expand || status != 'WAIT_FOR_START') && (status == 'WAIT_FOR_START' || status == 'ONGOING1' || status == 'ONGOING2' || status == 'ONGOING3') &&
             <View onClick={tapEndFast} className={status == 'ONGOING3' ? 'console_btn' : 'console_btn btn_disable'}>
                 {
                     status == 'WAIT_FOR_START' && <Image className='lock' src={require('@assets/images/lock.png')} />
                 }
-                <Text style={{fontWeight:'bold'}}>{t('feature.track_time_duration.common.end_fast')}</Text>
+                <Text style={{ fontWeight: 'bold' }}>{t('feature.track_time_duration.common.end_fast')}</Text>
             </View>
         }
+        {
+            (status == 'WAIT_FOR_START' || status == 'ONGOING1') &&
+            <View>
+                {
+                    expand ? <Text className='expand' onClick={() => { setExpand(false) }}>收起</Text> : <Text className='expand' onClick={() => { setExpand(true) }}>展开</Text>
+                }
+            </View>
+        }
+
     </View>
 }

+ 76 - 46
src/features/trackTimeDuration/components/IndexItem.tsx

@@ -1,5 +1,5 @@
 import { View, Text, Image } from "@tarojs/components";
-import { dotIsOuterRange, getBgRing, getCommon, getDot, getReal, getSchedule, getTarget } from "../hooks/RingData";
+import { dotIsOuterRange, getBgRing, getCommon, getDot, getReal, getSchedule, getTarget, timeTotimestamp } from "../hooks/RingData";
 import { RealRing, CurrentDot } from "@/features/trackTimeDuration/components/Rings";
 import Rings from "./Rings";
 import './IndexItem.scss'
@@ -18,19 +18,26 @@ let useNavigation;
 if (process.env.TARO_ENV == 'rn') {
     useNavigation = require("@react-navigation/native").useNavigation
 }
-export default function Component(props: { type: string, data: any, time: any }) {
+
+let popTimer;
+let currentRecordTemp;
+export default function Component(props: { type: string, data: any, time: any, showStage?: boolean }) {
     const { t } = useTranslation()
-    const record = props.data.current_record;
+    const [record, setRecord] = useState(props.data.current_record);
     const user = useSelector((state: any) => state.user);
     const dayNight = useSelector((state: any) => state.dayNight);
     const [stageList, setStageList] = useState([true, false, false])
     const [isStageMode, setIsStageMode] = useState(false)
-    const [showDetailModal, setShowDetailModal] = useState(false)
     let navigation;
     if (useNavigation) {
         navigation = useNavigation()
     }
 
+    useEffect(() => {
+        setRecord(props.data.current_record)
+        currentRecordTemp = props.data.current_record
+    }, [props.data])
+
     useEffect(() => {
         if (props.type == 'FAST_SLEEP') {
             global.updateMixItem = (data) => {
@@ -70,7 +77,7 @@ export default function Component(props: { type: string, data: any, time: any })
             return <Rings common={common} bgRing={bgRing} currentDot={currentDot1} realRing={realRing1} targetRing={targetBigRing1} canvasId={props.type + props.time + 'big'} />
         }
         if (record.status == 'WAIT_FOR_START') {
-            var realRing1 = getSchedule(record, props.type != 'SLEEP', true)
+            var realRing1 = getSchedule(props.data.scenario, props.type != 'SLEEP', true, true)//getSchedule(record, props.type != 'SLEEP', true)
             var list: any = []
             if (props.type == 'FAST_SLEEP') {
                 realRing1.color = ColorType.fast + '66'
@@ -79,12 +86,14 @@ export default function Component(props: { type: string, data: any, time: any })
                     currentDot1.color = ColorType.ring
                 }
 
+                var detail = timeTotimestamp(props.data.scenario)
+
                 if (stageList[0]) {
 
                     const realRingBig: RealRing = {
                         color: global.fastColor ? global.fastColor : ColorType.fast,
-                        startArc: startArc(record.fast.target_start_time),
-                        durationArc: durationArc(record.fast.target_start_time, record.sleep.target_start_time)
+                        startArc: startArc(detail.fast.target_start_time),
+                        durationArc: durationArc(detail.fast.target_start_time, detail.sleep.target_start_time)
                     }
 
                     list.push(realRingBig)
@@ -92,8 +101,8 @@ export default function Component(props: { type: string, data: any, time: any })
                 if (stageList[1]) {
                     const realRingBig: RealRing = {
                         color: global.fastColor ? global.fastColor : ColorType.fast,
-                        startArc: startArc(record.sleep.target_start_time),
-                        durationArc: durationArc(record.sleep.target_start_time, record.sleep.target_end_time)
+                        startArc: startArc(detail.sleep.target_start_time),
+                        durationArc: durationArc(detail.sleep.target_start_time, detail.sleep.target_end_time)
                     }
 
                     list.push(realRingBig)
@@ -101,8 +110,8 @@ export default function Component(props: { type: string, data: any, time: any })
                 if (stageList[2]) {
                     const realRingBig: RealRing = {
                         color: global.fastColor ? global.fastColor : ColorType.fast,
-                        startArc: startArc(record.sleep.target_end_time),
-                        durationArc: durationArc(record.sleep.target_end_time, record.fast.target_end_time)
+                        startArc: startArc(detail.sleep.target_end_time),
+                        durationArc: durationArc(detail.sleep.target_end_time, detail.fast.target_end_time)
                     }
 
                     list.push(realRingBig)
@@ -135,7 +144,7 @@ export default function Component(props: { type: string, data: any, time: any })
                 return <Rings common={common} bgRing={bgRing} currentDot={currentDot} canvasId={props.type + props.time + 'small'} targetRing={targetBigRing1} realRing={realRing} />
             }
             else if (record.status == 'WAIT_FOR_START' || record.status == 'ONGOING1') {
-                realRing = getSchedule(record, false, true)
+                realRing = getSchedule(props.data.scenario, false, true, true)//getSchedule(record, false, true)
                 var currentDot = getDot(record, false)
                 if (dotIsOuterRange(true, record.sleep)) {
                     currentDot.color = ColorType.ring
@@ -226,7 +235,7 @@ export default function Component(props: { type: string, data: any, time: any })
                 </View>
             }
             {
-                props.type == 'FAST_SLEEP' && user.isLogin && global.showNightRing === true && <View style={{ display: 'flex', position: 'absolute', left: -14, top: -14, right: -14, bottom: -14 }}>
+                props.type == 'FAST_SLEEP' && !props.showStage && user.isLogin && global.showNightRing === true && <View style={{ display: 'flex', position: 'absolute', left: -14, top: -14, right: -14, bottom: -14 }}>
                     {
                         dayRing()
                     }
@@ -236,16 +245,6 @@ export default function Component(props: { type: string, data: any, time: any })
         </View>
     }
 
-    function getArrowText() {
-        if (record.status == 'WAIT_FOR_START') {
-            return '去开始'
-        }
-        if (record.status == 'ONGOING1' && props.type == 'SLEEP') {
-            return '去开始'
-        }
-        return '去结束'
-    }
-
     function getDuration(obj) {
         if (!obj) {
         }
@@ -296,10 +295,16 @@ export default function Component(props: { type: string, data: any, time: any })
             jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
             return
         }
-        setShowDetailModal(true)
-        // global.selectData = props.data
-        // global.scenario = props.type
-        // jumpPage('/pages/clock/Clock', 'Clock', navigation)
+        if (props.showStage) {
+            return
+        }
+        var node = schedules()
+        global.showIndexModal3(true, node, null);
+        popTimer = setInterval(() => {
+            var node = schedules()
+            global.showIndexModal3(true, node, null);
+        }, 1000)
+        global.popTimer = popTimer
     }
 
     function nightDuration() {
@@ -322,53 +327,78 @@ export default function Component(props: { type: string, data: any, time: any })
 
     function schedules() {
         var timestamp = new Date().getTime()//props.data.first_real_check_time
-
         return <View style={{ display: 'flex', flexDirection: 'column' }}>
-            <TimelineStage data={record} title={t('feature.track_time_duration.record_fast_sleep.pop_title')}
+            <TimelineStage data={currentRecordTemp} title={t('feature.track_time_duration.record_fast_sleep.pop_title')}
                 subTitle='今天' first_real_check_time={timestamp} />
         </View>
     }
 
-    return <View className="time_operate_item" onClick={goClock}>
+    function fastPicker() {
+        var node = schedules()
+        global.showIndexModal2(true, node, null);
+        popTimer = setInterval(() => {
+            var node = schedules()
+            global.showIndexModal2(true, node, null);
+        }, 1000)
+        global.popTimer = popTimer
+    }
+
+    function sleepPicker(e) {
+        if (record.status == 'ONGOING3') {
+            return;
+        }
+        if (record.status == 'WAIT_FOR_START') {
+            Taro.showToast({
+                title: t('feature.track_time_duration.common.start_fasting_first'),
+                icon: 'none'
+            })
+            return;
+        }
+        var node = schedules()
+        global.showIndexModal2(true, node, null);
+        popTimer = setInterval(() => {
+            var node = schedules()
+            global.showIndexModal2(true, node, null);
+        }, 1000)
+        global.popTimer = popTimer
+    }
+
+    return <View className="time_operate_item">
         <View className="fast_sleep_item">
             {
                 rings()
             }
             <View className="duration_bg">
                 {
-                    props.type == 'FAST_SLEEP' && user.isLogin && global.showNightRing === true &&
-                    <Text className="duration_title">夜间</Text>
+                    props.type == 'FAST_SLEEP' && !props.showStage && user.isLogin && global.showNightRing === true &&
+                    <Text className="duration_title">{t('feature.common.overnight')}</Text>
                 }
                 {
-                    props.type == 'FAST_SLEEP' && user.isLogin && global.showNightRing === true &&
+                    props.type == 'FAST_SLEEP' && !props.showStage && user.isLogin && global.showNightRing === true &&
                     <Text className="duration_value" style={{ color: ColorType.night }}>{nightDuration()}</Text>
                 }
                 {
-                    (props.type == 'FAST' || props.type == 'FAST_SLEEP') && <Text className="duration_title">{t('feature.track_time_duration.record_fast_sleep.item.fast')}</Text>
+                    (props.type == 'FAST' || props.type == 'FAST_SLEEP') && <Text className="duration_title" onClick={fastPicker}>{t('feature.track_time_duration.record_fast_sleep.item.fast')}</Text>
                 }
                 {
-                    (props.type == 'FAST' || props.type == 'FAST_SLEEP') && <Text className="duration_value" style={{ color: global.fastColor ? global.fastColor : ColorType.fast }}>{fastDuration()}</Text>
+                    (props.type == 'FAST' || props.type == 'FAST_SLEEP') && <Text className="duration_value" onClick={fastPicker} style={{ color: global.fastColor ? global.fastColor : ColorType.fast }}>{fastDuration()}</Text>
                 }
                 {
-                    (props.type == 'SLEEP' || props.type == 'FAST_SLEEP') && <Text className="duration_title">{t('feature.track_time_duration.record_fast_sleep.item.sleep')}</Text>
+                    (props.type == 'SLEEP' || props.type == 'FAST_SLEEP') && <Text className="duration_title" onClick={sleepPicker}>{t('feature.track_time_duration.record_fast_sleep.item.sleep')}</Text>
                 }
                 {
-                    (props.type == 'SLEEP' || props.type == 'FAST_SLEEP') && <Text className="duration_value" style={{ color: global.sleepColor ? global.sleepColor : ColorType.sleep }}>{sleepDuration()}</Text>
+                    (props.type == 'SLEEP' || props.type == 'FAST_SLEEP') && <Text className="duration_value" onClick={sleepPicker} style={{ color: global.sleepColor ? global.sleepColor : ColorType.sleep }}>{sleepDuration()}</Text>
                 }
             </View>
             {/* <Image className="arrow1" src={require('@/assets/images/arrow.png')} /> */}
-            {/* <View className="record_arrow_bg" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>
+            <View className="record_arrow_bg" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }} onClick={goClock}>
                 <View style={{ flex: 1 }} />
-                <Text className='recordTime'>{getArrowText()}</Text>
+                {/* <Text className='recordTime'>{getArrowText()}</Text> */}
                 <Image className="arrow2" src={require('@/assets/images/arrow3.png')} />
-            </View> */}
+            </View>
+
+            {/* <t-popup></t-popup> */}
 
         </View>
-        {
-            showDetailModal && <Modal children={schedules()}
-                modalType={ModalType.center}
-                dismiss={() => setShowDetailModal(false)}
-                confirm={() => { }} />
-        }
     </View>
 }

+ 18 - 13
src/features/trackTimeDuration/components/RecordFastSleep.tsx

@@ -73,11 +73,11 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number })
         // console.log(sqrt(-4).toString())
     }, [props.data])
 
-    useEffect(()=>{
-        if (common.recordSelID!=props.data.id){
+    useEffect(() => {
+        if (common.recordSelID != props.data.id) {
             setShowDel(false)
         }
-    },[common.recordSelID])
+    }, [common.recordSelID])
 
     function checkTimezone() {
         var split = new Date().toString().split(' ');
@@ -535,24 +535,29 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number })
 
     function touchStart(e) {
         startX = e.touches[0].clientX
-
+        startY = e.touches[0].clientY
     }
 
     function touchMove(e) {
         let x = startX
+        let y = startY
         let deltaX = e.touches[0].clientX - x
+        let deltaY = e.touches[0].clientY - y
 
 
-        if (deltaX < -60) {
-            setShowDel(true)
-            dispatch(setSelID(props.data.id))
-            global.selId = props.data.id
-        }
-        else if (deltaX > 60) {
-            setShowDel(false)
-            // global.selId = -1
+        if (Math.abs(deltaX) > Math.abs(deltaY)) {
+            if (deltaX < -60) {
+                setShowDel(true)
+                dispatch(setSelID(props.data.id))
+                global.selId = props.data.id
+            }
+            else if (deltaX > 60) {
+                setShowDel(false)
+                // global.selId = -1
+            }
         }
 
+
     }
 
     function touchEnd(e) {
@@ -570,7 +575,7 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number })
                 onClick={showDetail}
             >{recordDetail()}
             </RecordItem>
-            <View className={showDel ? 'btnDelete btnDeleteAni' : 'btnDelete'} onClick={del}>删除</View>
+            <View className={showDel ? 'btnDelete btnDeleteAni' : 'btnDelete'} onClick={del}>{t('feature.track_time_duration.record_fast_sleep.delete')}</View>
 
         </View>
         {

+ 25 - 39
src/features/trackTimeDuration/components/TimelineFastSleep.tsx

@@ -8,7 +8,7 @@ import { useEffect, useState } from "react";
 import { useSelector } from "react-redux";
 import './TimelineFastSleep.scss'
 
-export default function TimelineFastSleep(props: { data: any, title?: string, first_real_check_time?: number,multiTimeZone?: boolean, diffTimeZone?: boolean }) {
+export default function TimelineFastSleep(props: { data: any, title?: string, first_real_check_time?: number, multiTimeZone?: boolean, diffTimeZone?: boolean }) {
     const { t } = useTranslation()
     const [diffTimeZone, setDiffTimeZone] = useState(props.diffTimeZone)
     const [multTimeZone, setMulTimeZone] = useState(props.multiTimeZone)
@@ -69,51 +69,21 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
 
     }
 
-    function showDate(obj: any, isEnd: boolean) {
-        var dt = 0
-        if (isEnd) {
-            if (obj.real_end_time) {
-                dt = obj.real_end_time
-            }
-            else {
-                dt = obj.target_end_time
-            }
-        }
-        else {
-            if (obj.real_start_time) {
-                dt = obj.real_start_time
-            }
-            else {
-                dt = obj.target_start_time
-            }
-        }
-        // debugger
-        var dt2 = props.first_real_check_time ? props.first_real_check_time : 0
-        var date1 = new Date(dt)
-        var date2 = new Date(dt2)
-        if (date1.getFullYear() == date2.getFullYear() &&
-            date1.getMonth() == date2.getMonth() &&
-            date1.getDate() == date2.getDate()) {
-            return false
-        }
-        return true
-    }
-
     function formateDate(obj: any, isEnd: boolean) {
         if (isEnd) {
             if (obj.real_end_time) {
-                return TimeFormatter.dateDescription(obj.real_end_time)
+                return TimeFormatter.dateDescription(obj.real_end_time, true)
             }
             else {
-                return TimeFormatter.dateDescription(obj.target_end_time)
+                return TimeFormatter.dateDescription(obj.target_end_time, true)
             }
         }
         else {
             if (obj.real_start_time) {
-                return TimeFormatter.dateDescription(obj.real_start_time)
+                return TimeFormatter.dateDescription(obj.real_start_time, true)
             }
             else {
-                return TimeFormatter.dateDescription(obj.target_start_time)
+                return TimeFormatter.dateDescription(obj.target_start_time, true)
             }
         }
 
@@ -146,6 +116,7 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
         if (props.data.fast.real_start_time_zone) {
             timeZone = ' ' + props.data.fast.real_start_time_zone
         }
+        debugger
         timelineItems.push(
             {
                 status: getStatus(true, true, props.data),
@@ -166,7 +137,7 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
         }
         var status = getStatus(false, true, props.data)
         var strContent = props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.sleep, false) + scenario.schedule.sleep.start_time : formateDate(props.data.sleep, false) + formateTime(props.data.sleep, false)
-        var strDate = props.data.status == 'WAIT_FOR_START' ? getWaitForStartDate(scenario.schedule.sleep.start_time) : multTimeZone ? timeZone : ''
+        var strDate =  multTimeZone ? timeZone : ''
         // (diffTimeZone ? timeZone : showDate(props.data.sleep, false) ? formateDate(props.data.sleep, false) : '')
         timelineItems.push(
             {
@@ -187,7 +158,7 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
         }
         var status = getStatus(false, false, props.data)
         var strContent: string = props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.sleep, true) + scenario.schedule.sleep.end_time : formateDate(props.data.sleep, true) + formateTime(props.data.sleep, true)
-        var strDate = props.data.status == 'WAIT_FOR_START' ? getWaitForStartDate(scenario.schedule.sleep.end_time) : multTimeZone ? timeZone : ''
+        var strDate =  multTimeZone ? timeZone : ''
         // (diffTimeZone ? timeZone : showDate(props.data.sleep, true) ? formateDate(props.data.sleep, true) : '')
         timelineItems.push(
             {
@@ -213,13 +184,28 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
                     t('feature.track_time_duration.common.end_fast') :
                     t('feature.track_time_duration.common.ended_fasting'),
                 content: props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.fast, true) + scenario.schedule.fast.end_time : formateDate(props.data.fast, true) + formateTime(props.data.fast, true),
-                date: props.data.status == 'WAIT_FOR_START' ? getWaitForStartDate(scenario.schedule.fast.end_time) : multTimeZone ? timeZone : '',
+                date:  multTimeZone ? timeZone : '',
                 // (diffTimeZone ? timeZone : showDate(props.data.fast, true) ? formateDate(props.data.fast, true) : ''),
                 color: global.fastColor ? global.fastColor : ColorType.fast
             }
         )
     }
 
+    function getTZLocation() {
+        if (props.data.fast) {
+            if (props.data.fast.real_start_time_zone_id) {
+                return props.data.fast.real_start_time_zone_id
+            }
+            return props.data.fast.real_start_time_zone
+        }
+        else {
+            if (props.data.sleep.real_start_time_zone_id) {
+                return props.data.sleep.real_start_time_zone_id
+            }
+            return props.data.sleep.real_start_time_zone
+        }
+    }
+
     return <View style={{ display: 'flex', flexDirection: 'column' }}>
         <View style={{ display: 'flex', flexDirection: 'row' }}>
             <Timeline items={timelineItems} title={props.title} width={468} />
@@ -230,7 +216,7 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
             multTimeZone && <Text className="tz_note_desc">{t('feature.common.multi_tz_desc')}</Text>
         }
         {
-            diffTimeZone && <Text className="tz_note_desc">{t('feature.common.diff_tz_desc',{location:'Shanghai'})}</Text>
+            !multTimeZone && diffTimeZone && <Text className="tz_note_desc">{t('feature.common.diff_tz_desc', { location: getTZLocation() })}</Text>
         }
     </View>
 }

+ 0 - 2
src/features/trackTimeDuration/components/TimelineStage.weapp.tsx

@@ -21,8 +21,6 @@ export default function Component(props: { data: any, title?: string, subTitle?:
     const common = useSelector((state: any) => state.common);
 
 
-
-
     const { t } = useTranslation()
 
     function followWxPub() {

+ 63 - 29
src/features/trackTimeDuration/components/TotalTime.tsx

@@ -10,30 +10,30 @@ import { durationDatas, durationIndex, getColor, getDurationTitle } from "../hoo
 import PickerViews from "@/components/input/PickerViews";
 import { useSelector } from "react-redux";
 import Taro from "@tarojs/taro";
+import { updateRecord } from "@/services/trackTimeDuration";
 
 export default function TotalTime(props: { record: any }) {
     const [showDurationPicker, setShowDurationPicker] = useState(false)
     const [fastPickerValue, setFastPickerValue] = useState([0, 0])
     const [sleepPickerValue, setSleepPickerValue] = useState([0, 0])
     const [showEditPicker, setShowEditPicker] = useState(false)
+    const [count, setCount] = useState(0)
     const common = useSelector((state: any) => state.common);
     const [isFast, setIsFast] = useState(true)
     const durationPickerRef = useRef(null)
     const { t } = useTranslation()
 
-    useEffect(()=>{
+    useEffect(() => {
         getStateDetail()
-    },[])
+        setCount((pre) => pre + 1)
+    }, [props.record])
 
     function getStateDetail() {
         var current_record = props.record
-        // var fastCount = current_record.fast.target_end_time - current_record.fast.target_start_time
-        // setFastDuration(fastCount)
-        setFastPickerValue(durationIndex(current_record.fast.target_start_time, current_record.fast.target_end_time, common))
-
-        // var sleepCount = current_record.sleep.target_end_time - current_record.sleep.target_start_time
-        // setSleepDuration(sleepCount)
-        setSleepPickerValue(durationIndex(current_record.sleep.target_start_time, current_record.sleep.target_end_time, common))
+        if (current_record.fast)
+            setFastPickerValue(durationIndex(current_record.fast.target_start_time, current_record.fast.target_end_time, common))
+        if (current_record.sleep)
+            setSleepPickerValue(durationIndex(current_record.sleep.target_start_time, current_record.sleep.target_end_time, common))
     }
 
     function sleepCompleteStatus() {
@@ -74,9 +74,12 @@ export default function TotalTime(props: { record: any }) {
         return TimeFormatter.countdown(props.record.sleep.target_end_time)
     }
 
-    function setFastDuration() {
+    function setFastDuration(e) {
         setIsFast(true)
         if (disableChange(true)) return
+        if (process.env.TARO_ENV == 'weapp') {
+            e.stopPropagation()
+        }
         if (props.record.status == 'WAIT_FOR_START') {
             setShowDurationPicker(true)
         }
@@ -85,9 +88,14 @@ export default function TotalTime(props: { record: any }) {
         }
     }
 
-    function setSleepDuration() {
+    function setSleepDuration(e) {
+
         setIsFast(false)
         if (disableChange(false)) return
+        if (process.env.TARO_ENV == 'weapp') {
+            e.stopPropagation()
+        }
+
         if (props.record.status == 'WAIT_FOR_START') {
             Taro.showToast({
                 title: t('feature.track_time_duration.common.start_fasting_first'),
@@ -200,7 +208,28 @@ export default function TotalTime(props: { record: any }) {
             global.changeTargetDuration(count, isFast)
         }
         else {
+            var params: any = {}
+            if (isFast) {
+                params = {
+                    fast: {
+                        target_duration: count * 60 * 1000
+                    }
+                }
+            }
+            else {
+                params = {
+                    sleep: {
+                        target_duration: count * 60 * 1000
+                    }
+                }
+            }
+            updateRecord({
+                ...params
+            }, props.record.id).then(res => {
+                global.indexPageRefresh()
+            }).catch(e => {
 
+            })
         }
         setShowDurationPicker(false)
         setShowEditPicker(false)
@@ -255,12 +284,12 @@ export default function TotalTime(props: { record: any }) {
                     {
                         props.record.status == 'COMPLETED' ?
                             <View className="cell_full" >
-                                <Text className="cell_title">实际完成</Text>
+                                <Text className="cell_title">{t('feature.track_time_duration.console.real_duration')}</Text>
                                 <Text className="cell_value" style={{ color: ColorType.fast }}>{TimeFormatter.durationFormate(props.record.fast.real_start_time, props.record.fast.real_end_time)}</Text>
                                 {/* <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} /> */}
                             </View> :
                             <View className="cell_full" onClick={setFastDuration}>
-                                <Text className="cell_title">本次目标</Text>
+                                <Text className="cell_title">{t('feature.track_time_duration.console.target')}</Text>
                                 <Text className="cell_value">{TimeFormatter.durationFormate(props.record.fast.target_start_time, props.record.fast.target_end_time)}</Text>
                                 {!disableChange(true) && <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />}
                             </View>
@@ -269,7 +298,7 @@ export default function TotalTime(props: { record: any }) {
                     {
                         props.record.status == 'COMPLETED' ?
                             <View className="cell_full" onClick={setFastDuration}>
-                                <Text className="cell_title" style={{ opacity: 0.2 }}>本次目标</Text>
+                                <Text className="cell_title" style={{ opacity: 0.2 }}>{t('feature.track_time_duration.console.target')}</Text>
                                 <Text className="cell_value" style={{ opacity: 0.2, color: '#fff' }}>{TimeFormatter.durationFormate(props.record.fast.target_start_time, props.record.fast.target_end_time)}</Text>
                                 {!disableChange(true) && <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />}
                             </View> :
@@ -284,25 +313,30 @@ export default function TotalTime(props: { record: any }) {
                 <Text className="cell_header">睡眠</Text>
                 <View className="cell_bg">
                     {
-                        props.record.status == 'COMPLETED' || props.record.status == 'ONGOING3' ?
-                            <View className="cell_full" >
-                                <Text className="cell_title">实际完成</Text>
-                                <Text className="cell_value" style={{ color: ColorType.sleep }}>{sleepCompleteStatus()}</Text>
-                            </View> :
-                            <View className="cell_full" onClick={setSleepDuration}>
-                                <Text className="cell_title">本次目标</Text>
-                                <Text className="cell_value">{TimeFormatter.durationFormate(props.record.sleep.target_start_time, props.record.sleep.target_end_time)}</Text>
-                                {!disableChange(false) && <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />}
-                            </View>
+                        // props.record.status == 'COMPLETED' || props.record.status == 'ONGOING3' ?
+                        //     <View className="cell_full" >
+                        //         <Text className="cell_title">{t('feature.track_time_duration.console.real_duration')}</Text>
+                        //         <Text className="cell_value" style={{ color: ColorType.sleep }}>{sleepCompleteStatus()}</Text>
+                        //     </View> :
+                        <View className="cell_full" onClick={setSleepDuration}>
+                            <Text className="cell_title">{t('feature.track_time_duration.console.target')}</Text>
+                            <Text className="cell_value">{TimeFormatter.durationFormate(props.record.sleep.target_start_time, props.record.sleep.target_end_time)}</Text>
+                            {!disableChange(false) && <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />}
+                        </View>
                     }
                     <View className="cell_line" style={{ height: 1 }} />
                     {
                         props.record.status == 'COMPLETED' || props.record.status == 'ONGOING3' ?
-                            <View className="cell_full" onClick={setSleepDuration}>
-                                <Text className="cell_title" style={{ opacity: 0.2 }}>本次目标</Text>
-                                <Text className="cell_value" style={{ opacity: 0.2, color: '#fff' }}>{TimeFormatter.durationFormate(props.record.sleep.target_start_time, props.record.sleep.target_end_time)}</Text>
-                                {!disableChange(false) && <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />}
-                            </View> :
+                            // <View className="cell_full" onClick={setSleepDuration}>
+                            //     <Text className="cell_title" style={{ opacity: 0.2 }}>{t('feature.track_time_duration.console.target')}</Text>
+                            //     <Text className="cell_value" style={{ opacity: 0.2, color: '#fff' }}>{TimeFormatter.durationFormate(props.record.sleep.target_start_time, props.record.sleep.target_end_time)}</Text>
+                            //     {!disableChange(false) && <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />}
+                            // </View> 
+                            <View className="cell_full" >
+                                <Text className="cell_title" style={{ opacity: 0.4 }}>{t('feature.track_time_duration.console.real_duration')}</Text>
+                                <Text className="cell_value" style={{ color: ColorType.sleep }}>{sleepCompleteStatus()}</Text>
+                            </View>
+                            :
                             sleepOtherStatus()
                     }
                 </View>

+ 2 - 0
src/features/trackTimeDuration/components/WeekCalendar.tsx

@@ -24,6 +24,8 @@ const WeekCalendar = memo(() => {
     const [isLoading, setIsLoading] = useState(false)
     const pageSize = 15
 
+    console.log('apple')
+
     useEffect(() => {
         pageIndex = -1
         getRecords()

+ 112 - 7
src/features/trackTimeDuration/hooks/RingData.tsx

@@ -153,7 +153,57 @@ export const getTarget = (data: any, isBigRing: boolean) => {
     }
 }
 
-export const getSchedule = (data: any, isFast: boolean, isBigRing: boolean) => {
+export const getSchedule = (data: any, isFast: boolean, isBigRing: boolean, isHourMinutesFormat?: boolean) => {
+
+    var detail = data;
+    if (isHourMinutesFormat) {
+        var obj = data.schedule
+        if (isFast) {
+            var startHour = parseInt(obj.fast.start_time.split(':')[0])
+            var startM = parseInt(obj.fast.start_time.split(':')[1])
+            var endHour = parseInt(obj.fast.end_time.split(':')[0])
+            var endM = parseInt(obj.fast.end_time.split(':')[1])
+            var dt1 = new Date()
+            dt1.setHours(startHour)
+            dt1.setMinutes(startM)
+            var startTimestamp = dt1.getTime()
+            var dt2 = new Date()
+            dt2.setHours(endHour)
+            dt2.setMinutes(endM)
+            var endTimestamp = dt2.getTime()
+            if (startTimestamp > endTimestamp) {
+                endTimestamp += 24 * 3600 * 1000
+            }
+            detail.fast = {
+                target_start_time: startTimestamp,
+                target_end_time: endTimestamp
+            }
+        }
+        else {
+            var startHour = parseInt(obj.sleep.start_time.split(':')[0])
+            var startM = parseInt(obj.sleep.start_time.split(':')[1])
+            var endHour = parseInt(obj.sleep.end_time.split(':')[0])
+            var endM = parseInt(obj.sleep.end_time.split(':')[1])
+            var dt1 = new Date()
+            dt1.setHours(startHour)
+            dt1.setMinutes(startM)
+            var startTimestamp = dt1.getTime()
+            var dt2 = new Date()
+            dt2.setHours(endHour)
+            dt2.setMinutes(endM)
+            var endTimestamp = dt2.getTime()
+            if (startTimestamp > endTimestamp) {
+                endTimestamp += 24 * 3600 * 1000
+            }
+            detail.sleep = {
+                target_start_time: startTimestamp,
+                target_end_time: endTimestamp
+            }
+        }
+    }
+
+
+
     const realRingBig: RealRing = {
         color: global.fastColor ? global.fastColor : ColorType.fast,
         startArc: 0,
@@ -168,23 +218,78 @@ export const getSchedule = (data: any, isFast: boolean, isBigRing: boolean) => {
 
     if (isBigRing) {
         if (isFast) {
-            realRingBig.startArc = startArc(data.fast.target_start_time)
-            realRingBig.durationArc = durationArc(data.fast.target_start_time, data.fast.target_end_time)
+            realRingBig.startArc = startArc(detail.fast.target_start_time)
+            realRingBig.durationArc = durationArc(detail.fast.target_start_time, detail.fast.target_end_time)
         }
         else {
             realRingBig.color = global.sleepColor ? global.sleepColor : ColorType.sleep
-            realRingBig.startArc = startArc(data.sleep.target_start_time)
-            realRingBig.durationArc = durationArc(data.sleep.target_start_time, data.sleep.target_end_time)
+            realRingBig.startArc = startArc(detail.sleep.target_start_time)
+            realRingBig.durationArc = durationArc(detail.sleep.target_start_time, detail.sleep.target_end_time)
         }
         return realRingBig
     }
     else {
-        realRingSmall.startArc = startArc(data.sleep.target_start_time)
-        realRingSmall.durationArc = durationArc(data.sleep.target_start_time, data.sleep.target_end_time)
+        realRingSmall.startArc = startArc(detail.sleep.target_start_time)
+        realRingSmall.durationArc = durationArc(detail.sleep.target_start_time, detail.sleep.target_end_time)
         return realRingSmall
     }
 }
 
+
+//把hh:mm转换成时间戳
+export const timeTotimestamp = (data: any) => {
+    var detail: any = {}
+    var obj = data.schedule
+    {
+        var startHour = parseInt(obj.fast.start_time.split(':')[0])
+        var startM = parseInt(obj.fast.start_time.split(':')[1])
+        var endHour = parseInt(obj.fast.end_time.split(':')[0])
+        var endM = parseInt(obj.fast.end_time.split(':')[1])
+        var dt1 = new Date()
+        dt1.setHours(startHour)
+        dt1.setMinutes(startM)
+        var startTimestamp = dt1.getTime()
+        var dt2 = new Date()
+        dt2.setHours(endHour)
+        dt2.setMinutes(endM)
+        var endTimestamp = dt2.getTime()
+        if (startTimestamp > endTimestamp) {
+            endTimestamp += 24 * 3600 * 1000
+        }
+        detail.fast = {
+            target_start_time: startTimestamp,
+            target_end_time: endTimestamp
+        }
+    }
+    {
+        var startHour = parseInt(obj.sleep.start_time.split(':')[0])
+        var startM = parseInt(obj.sleep.start_time.split(':')[1])
+        var endHour = parseInt(obj.sleep.end_time.split(':')[0])
+        var endM = parseInt(obj.sleep.end_time.split(':')[1])
+        var dt1 = new Date()
+        dt1.setHours(startHour)
+        dt1.setMinutes(startM)
+        var startTimestamp = dt1.getTime()
+        var dt2 = new Date()
+        dt2.setHours(endHour)
+        dt2.setMinutes(endM)
+        var endTimestamp = dt2.getTime()
+        if (startTimestamp > endTimestamp) {
+            endTimestamp += 24 * 3600 * 1000
+        }
+        if (startTimestamp < detail.fast.target_start_time) {
+            startTimestamp += 24 * 3600 * 1000
+            endTimestamp += 24 * 3600 * 1000
+        }
+        detail.sleep = {
+            target_start_time: startTimestamp,
+            target_end_time: endTimestamp
+        }
+    }
+
+    return detail
+}
+
 export const getReal = (data: any, isBigRing: boolean, isRecord: boolean) => {
     // console.log(data)
     const realRingBig: RealRing = {

+ 1 - 1
src/pages/clock/Index.scss

@@ -68,7 +68,7 @@
 }
 
 .swiper1{
-    height: 500px;
+    height: 850px;
 }
 
 /* #ifdef weapp */

+ 117 - 88
src/pages/clock/Index.tsx

@@ -27,7 +27,7 @@ import WeekCalendar from "@/features/trackTimeDuration/components/WeekCalendar";
 import { useTranslation } from "react-i18next";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import Layout from "@/components/layout/layout";
-import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
+import { ModalType, NaviBarTitleShowType, TemplateType } from "@/utils/types";
 import TitleView from "@/features/trackTimeDuration/components/TitleView";
 import ClockHeader from "@/features/trackTimeDuration/components/ClockHeader";
 
@@ -57,13 +57,17 @@ export default function Page() {
     const [homeData, setHomeData] = useState(null)
 
     const [selIndex, setSelIndex] = useState(0)
+
+
     const [showModal, setShowModal] = useState(false)
     const [modalDetail, setModalDetail] = useState<any>(null)
 
     const [showModal2, setShowModal2] = useState(false)
     const [modalDetail2, setModalDetail2] = useState<any>(null)
 
-    const [isModal1, setIsModal1] = useState(false)
+    const [showModal3, setShowModal3] = useState(false)
+    const [modalDetail3, setModalDetail3] = useState<any>(null)
+
     const [debugInfo, setDebugInfo] = useState(null)
 
     const [isMulti, setIsMulti] = useState(false)
@@ -90,7 +94,7 @@ export default function Page() {
     useEffect(() => {
         global.showNightRing = false;
         setInterval(() => {
-            if (isPause){
+            if (isPause) {
                 return
             }
             setCount((prevCounter) => prevCounter + 1)
@@ -141,7 +145,7 @@ export default function Page() {
             global.homeData = res
 
             if (user.isLogin) {
-                isPause = (res as any).fast_sleep.current_record.status=='WAIT_FOR_START'
+                isPause = (res as any).fast_sleep.current_record.status == 'WAIT_FOR_START'
                 dispatch(updateScenario((res as any).fast_sleep.current_record))
                 dispatch(setConfigs((res as any).time_input_schema));
                 dispatch(setScenario((res as any).fast_sleep.scenario));
@@ -264,7 +268,6 @@ export default function Page() {
 
     global.showIndexModal = (isShow: boolean, detail: any, debugNode?: any) => {
         global.showModal = isShow
-        setIsModal1(true)
         setDebugInfo(debugNode)
         setShowModal(isShow)
         setModalDetail(detail)
@@ -273,11 +276,17 @@ export default function Page() {
     global.showIndexModal2 = (isShow: boolean, detail: any) => {
         setDebugInfo(null)
         global.showModal = isShow
-        setIsModal1(false)
         setShowModal2(isShow)
         setModalDetail2(detail)
     }
 
+    global.showIndexModal3 = (isShow: boolean, detail: any) => {
+        setDebugInfo(null)
+        global.showModal = isShow
+        setShowModal3(isShow)
+        setModalDetail3(detail)
+    }
+
     global.changeTargetDuration = (duration: number, isFast: boolean) => {
         var obj = JSON.parse(JSON.stringify(homeData))
         var record = obj.fast_sleep.current_record
@@ -291,17 +300,25 @@ export default function Page() {
     }
 
     function modalContent() {
-        if (showModal || showModal2) {
+        if (showModal || showModal2 || showModal3) {
             if (process.env.TARO_ENV == 'weapp') {
+                if (showModal3) {
+                    return <Modal children={modalDetail3}
+                        modalType={ModalType.center}
+                        dismiss={() => { setShowModal3(false); clearInterval(global.popTimer) }}
+                        confirm={() => { }} />
+                }
                 return <Modal
                     testInfo={debugInfo}
                     dismiss={() => {
                         setDebugInfo(null)
-                        setShowModal(false); setShowModal2(false)
+                        setShowModal(false);
+                        setShowModal2(false);
+                        setShowModal3(false);
                     }}
                     confirm={() => { }}>
                     {
-                        isModal1 ? modalDetail : modalDetail2
+                        showModal ? modalDetail : showModal2 ? modalDetail2 : modalDetail3
                     }
                 </Modal>
             }
@@ -321,10 +338,10 @@ export default function Page() {
                     onClick={() => { alert('b') }}
                     onClickOverlay={() => { alert('a') }}
                     onAfterLeave={() => { setShowModal(false); setShowModal2(false) }}
-                    show={showModal || showModal2} round={true} overlay={true} position='bottom'
+                    show={showModal || showModal2 || showModal3} round={true} overlay={true} position='bottom'
                 >
                     {
-                        isModal1 ? modalDetail : modalDetail2
+                        showModal ? modalDetail : showModal2 ? modalDetail2 : modalDetail3
                     }
                 </PageContainer>
             }
@@ -366,97 +383,109 @@ export default function Page() {
 
             <View className="index_container">
                 <Text className="count">{count}</Text>
-                {/* <Text className="discovery">探索</Text> */}
-                <IndexItem type="FAST_SLEEP" data={(homeData as any).fast_sleep} time={timestamp} />
-                <Swiper className='swiper1' indicatorColor='#333'
-                    indicatorActiveColor='#999'
-                    current={0}
-                    autoplay={false}
-                    duration={300}
-                    interval={300}
-                    indicator-offset={[0, -30]}
-                    indicator-height={30}
-                    indicatorDots={(homeData as any).fast_sleep.current_record.status == 'WAIT_FOR_START'}
-                    onChange={(e) => {
-                        var pageIndex = e.detail.current
-                        global.changeMixIndex(pageIndex)
-                    }}
-                >
-                    <SwiperItem className='swiperItem'>
-                        <IndexConsole record={(homeData as any).fast_sleep} />
 
-                    </SwiperItem>
+                {
+                    (homeData as any).fast_sleep.current_record.status != 'WAIT_FOR_START' ?
+                        <View>
+                            <IndexItem type="FAST_SLEEP" data={(homeData as any).fast_sleep} time={timestamp} showStage={false} />
+                            <IndexConsole record={(homeData as any).fast_sleep} />
+                        </View> :
+
+                        <Swiper className='swiper1' indicatorColor='#333'
+                            indicatorActiveColor='#999'
+                            current={0}
+                            autoplay={false}
+                            duration={300}
+                            interval={300}
+
+                            indicator-offset={[0, -30]}
+                            indicator-height={30}
+                            indicatorDots={(homeData as any).fast_sleep.current_record.status == 'WAIT_FOR_START'}
+                            onChange={(e) => {
+                                var pageIndex = e.detail.current
+                                global.changeMixIndex(pageIndex)
+                            }}
+                        >
+                            <SwiperItem className='swiperItem'>
+                                <View>
+                                    <IndexItem type="FAST_SLEEP" data={(homeData as any).fast_sleep} time={timestamp} showStage={false} />
+                                    <IndexConsole record={(homeData as any).fast_sleep} />
+                                </View>
+
+                            </SwiperItem>
 
-                    {
-                        (homeData as any).fast_sleep.current_record.status == 'WAIT_FOR_START' &&
-                        <SwiperItem className='swiperItem'>
-                            <View>
-                                {
-                                    isMulti ? <View>
+                            {
+                                (homeData as any).fast_sleep.current_record.status == 'WAIT_FOR_START' &&
+                                <SwiperItem className='swiperItem'>
+                                    <IndexItem type="FAST_SLEEP" data={(homeData as any).fast_sleep} time={timestamp + 2000} showStage={true} />
+                                    <View>
                                         {
-                                            multiData.map((item, index) => {
-                                                return <View className={item.checked ? "single_check_sel" : "single_check_nor"} onClick={() => {
-                                                    item.checked = !item.checked
-                                                    global.updateMixItem([multiData[0].checked, multiData[1].checked, multiData[2].checked])
-                                                    setMultiData(JSON.parse(JSON.stringify(multiData)))
-                                                    setCount((prevCounter) => prevCounter + 1)
-                                                }}>
-                                                    <Text className={item.checked ? "single_check_text_sel" : "single_check_text_nor"}>{item.title}</Text>
+                                            isMulti ? <View>
+                                                {
+                                                    multiData.map((item, index) => {
+                                                        return <View className={item.checked ? "single_check_sel" : "single_check_nor"} onClick={() => {
+                                                            item.checked = !item.checked
+                                                            global.updateMixItem([multiData[0].checked, multiData[1].checked, multiData[2].checked])
+                                                            setMultiData(JSON.parse(JSON.stringify(multiData)))
+                                                            setCount((prevCounter) => prevCounter + 1)
+                                                        }}>
+                                                            <Text className={item.checked ? "single_check_text_sel" : "single_check_text_nor"}>{item.title}</Text>
+                                                            {
+                                                                item.checked ? <Image src={require('@assets/images/check_black.png')} className="single_checked" /> :
+                                                                    <IconPlus color={ColorType.fast} />
+                                                            }
+                                                        </View>
+                                                    })
+                                                }
+                                            </View> : <View>
+
+                                                <View className={selIndex == 0 ? "single_check_sel" : "single_check_nor"} onClick={() => { setSelIndex(0); global.updateMixItem([true, false, false]); setCount((prevCounter) => prevCounter + 1) }}>
+                                                    <Text className={selIndex == 0 ? "single_check_text_sel" : "single_check_text_nor"}>睡前断食</Text>
+                                                    {
+                                                        selIndex == 0 && <Image src={require('@assets/images/check_black.png')} className="single_checked" />
+                                                    }
+                                                </View>
+                                                <View className={selIndex == 1 ? "single_check_sel" : "single_check_nor"} onClick={() => { setSelIndex(1); global.updateMixItem([false, true, false]); setCount((prevCounter) => prevCounter + 1) }}>
+                                                    <Text className={selIndex == 1 ? "single_check_text_sel" : "single_check_text_nor"}>睡眠中断食</Text>
+                                                    {
+                                                        selIndex == 1 && <Image src={require('@assets/images/check_black.png')} className="single_checked" />
+                                                    }
+                                                </View>
+                                                <View className={selIndex == 2 ? "single_check_sel" : "single_check_nor"} onClick={() => { setSelIndex(2); global.updateMixItem([false, false, true]); setCount((prevCounter) => prevCounter + 1) }}>
+                                                    <Text className={selIndex == 2 ? "single_check_text_sel" : "single_check_text_nor"}>起床后断食</Text>
                                                     {
-                                                        item.checked ? <Image src={require('@assets/images/check_black.png')} className="single_checked" /> :
-                                                            <IconPlus color={ColorType.fast} />
+                                                        selIndex == 2 && <Image src={require('@assets/images/check_black.png')} className="single_checked" />
                                                     }
                                                 </View>
-                                            })
+                                            </View>
                                         }
-                                    </View> : <View>
-
-                                        <View className={selIndex == 0 ? "single_check_sel" : "single_check_nor"} onClick={() => { setSelIndex(0); global.updateMixItem([true, false, false]); setCount((prevCounter) => prevCounter + 1) }}>
-                                            <Text className={selIndex == 0 ? "single_check_text_sel" : "single_check_text_nor"}>睡前断食</Text>
-                                            {
-                                                selIndex == 0 && <Image src={require('@assets/images/check_black.png')} className="single_checked" />
-                                            }
-                                        </View>
-                                        <View className={selIndex == 1 ? "single_check_sel" : "single_check_nor"} onClick={() => { setSelIndex(1); global.updateMixItem([false, true, false]); setCount((prevCounter) => prevCounter + 1) }}>
-                                            <Text className={selIndex == 1 ? "single_check_text_sel" : "single_check_text_nor"}>睡眠中断食</Text>
-                                            {
-                                                selIndex == 1 && <Image src={require('@assets/images/check_black.png')} className="single_checked" />
-                                            }
-                                        </View>
-                                        <View className={selIndex == 2 ? "single_check_sel" : "single_check_nor"} onClick={() => { setSelIndex(2); global.updateMixItem([false, false, true]); setCount((prevCounter) => prevCounter + 1) }}>
-                                            <Text className={selIndex == 2 ? "single_check_text_sel" : "single_check_text_nor"}>起床后断食</Text>
-                                            {
-                                                selIndex == 2 && <Image src={require('@assets/images/check_black.png')} className="single_checked" />
-                                            }
+                                        <View style={{ display: 'flex', alignItems: 'center', flexDirection: 'row', paddingRight: rpxToPx(46), width: rpxToPx(750), boxSizing: 'border-box' }}>
+                                            <View style={{ flex: 1 }} />
+                                            <Text style={{ marginRight: 10 }}>多选</Text>
+                                            <Switch color={ColorType.fast} onChange={(e) => {
+                                                setIsMulti(e.detail.value)
+                                                if (e.detail.value) {
+                                                    global.updateMixItem([multiData[0].checked, multiData[1].checked, multiData[2].checked])
+                                                }
+                                                else {
+                                                    global.updateMixItem([selIndex == 0, selIndex == 1, selIndex == 2])
+                                                }
+                                                setCount((prevCounter) => prevCounter + 1)
+                                            }} />
                                         </View>
                                     </View>
-                                }
-                                <View style={{ display: 'flex', alignItems: 'center', flexDirection: 'row', paddingRight: rpxToPx(46), width: rpxToPx(750), boxSizing: 'border-box' }}>
-                                    <View style={{ flex: 1 }} />
-                                    <Text style={{ marginRight: 10 }}>多选</Text>
-                                    <Switch color={ColorType.fast} onChange={(e) => {
-                                        setIsMulti(e.detail.value)
-                                        if (e.detail.value) {
-                                            global.updateMixItem([multiData[0].checked, multiData[1].checked, multiData[2].checked])
-                                        }
-                                        else {
-                                            global.updateMixItem([selIndex == 0, selIndex == 1, selIndex == 2])
-                                        }
-                                        setCount((prevCounter) => prevCounter + 1)
-                                    }} />
-                                </View>
-                            </View>
-                        </SwiperItem>
-                    }
+                                </SwiperItem>
+                            }
 
-                </Swiper>
+                        </Swiper>
+                }
                 {
                     user.isLogin && <DayLight />
                 }
                 {
                     user.isLogin && records.length > 0 && <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
                         {
-                            <Text className="discovery">最近</Text>
+                            <Text className="discovery">{t('feature.track_time_duration.record_fast_sleep.header.latest_record')}</Text>
                         }
                         {
                             process.env.TARO_ENV == 'weapp' && <Text className="fast_sleep_more index_more" onClick={more}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>
@@ -473,12 +502,12 @@ export default function Page() {
                     </View>
                 }
 
-                {
+                {/* {
                     user.isLogin && <View>
                         <Text className="discovery">周统计</Text>
                         <WeekCalendar />
                     </View>
-                }
+                } */}
 
                 <View style={{ height: 100 }} />
                 {

+ 4 - 4
src/pages/common/RecordsHistory.tsx

@@ -338,16 +338,16 @@ export default function Page() {
     function filters() {
         return <View className="filter_bar">
             <View onClick={() => { tapFilter(0) }}>
-                <Text className={filterIndex == 0 ? 'filter_item_sel' : 'filter_item_normal'}>全部</Text>
+                <Text className={filterIndex == 0 ? 'filter_item_sel' : 'filter_item_normal'}>{t('feature.track_time_duration.record_fast_sleep.tab_all')}</Text>
             </View>
             <View onClick={() => { tapFilter(1) }}>
-                <Text className={filterIndex == 1 ? 'filter_item_sel' : 'filter_item_normal'}>断食与睡眠</Text>
+                <Text className={filterIndex == 1 ? 'filter_item_sel' : 'filter_item_normal'}>{t('feature.track_time_duration.record_fast_sleep.tab_fast_sleep')}</Text>
             </View>
             <View onClick={() => { tapFilter(2) }}>
-                <Text className={filterIndex == 2 ? 'filter_item_sel' : 'filter_item_normal'}>断食</Text>
+                <Text className={filterIndex == 2 ? 'filter_item_sel' : 'filter_item_normal'}>{t('feature.track_time_duration.record_fast_sleep.tab_fast')}</Text>
             </View>
             <View onClick={() => { tapFilter(3) }}>
-                <Text className={filterIndex == 3 ? 'filter_item_sel' : 'filter_item_normal'}>睡眠</Text>
+                <Text className={filterIndex == 3 ? 'filter_item_sel' : 'filter_item_normal'}>{t('feature.track_time_duration.record_fast_sleep.tab_sleep')}</Text>
             </View>
         </View>
     }

+ 5 - 4
src/services/http/api.js

@@ -1,4 +1,4 @@
-let online = process.env.TARO_ENV=='rn'?false:false;
+let online = process.env.TARO_ENV == 'rn' ? false : false;
 export let baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
 export let imgUrl = online
     ? 'https://api.fast.liveplus.fun/static/image/'
@@ -23,9 +23,9 @@ export const API_CLEAR_MIX = `${baseUrl}/api/clear-data/FAST_SLEEP`
 export const API_CHECK_UNIQUE = `${baseUrl}/api/user/check-unique`
 export const API_UPLOAD_SESSION = `${baseUrl}/api/thirdparty/wx/session`
 export const API_DEL_SESSION = `${baseUrl}/api/thirdparty/wx/session`
-export const API_USER_PERMS =  `${baseUrl}/api/user/perms`
-export const API_SYSTEM_LOCATION =  `${baseUrl}/api/system/location`
-export const API_USER_LOCATION =  `${baseUrl}/api/user/location`
+export const API_USER_PERMS = `${baseUrl}/api/user/perms`
+export const API_SYSTEM_LOCATION = `${baseUrl}/api/system/location`
+export const API_USER_LOCATION = `${baseUrl}/api/user/location`
 
 //track time duration
 export const API_FAST_PLANS = `${baseUrl}/api/fast/plans`
@@ -37,6 +37,7 @@ export const API_FAST_CHECK_ABANDONED = `${baseUrl}/api/fast/check-abandoned`
 export const API_FAST_RECORDS = `${baseUrl}/api/fast/records`
 export const API_FAST_SCHEDULES = `${baseUrl}/api/fast/schedules`
 export const API_FAST_CALENDARS = `${baseUrl}/api/fast/calendars/`
+export const API_CLOCK_RECORD_UPDATE = `${baseUrl}/api/clock/records`
 
 
 //track something

+ 14 - 12
src/services/http/request.ts

@@ -56,12 +56,14 @@ export async function request<T>(param: RequestParam): Promise<T> {
 
         var split = new Date().toString().split(' ');
         var timeZoneFormatted = split[split.length - 2];
+        var timeZoneLocation = Intl.DateTimeFormat().resolvedOptions().timeZone
 
         header['content-type'] = 'application/json'
         header['X-Time-Zone'] = timeZoneFormatted; //new Date().getTimezoneOffset() / 60
-        header['X-Platform'] = Taro.getSystemInfoSync().platform=='ios'?'IOS':'ANDROID'; //IOS ANDROID
-        header['X-Lang'] = process.env.TARO_ENV=='rn'?'en':'zh' //zh en
-        header['X-Client-Type'] = 'WX_APP' //WX_APP APP
+        header['X-Time-Zone-Id'] = timeZoneLocation;
+        header['X-Platform'] = Taro.getSystemInfoSync().platform == 'ios' ? 'IOS' : 'ANDROID'; //IOS ANDROID
+        header['X-Lang'] = process.env.TARO_ENV == 'rn' ? 'en' : 'zh' //zh en
+        header['X-Client-Type'] = process.env.TARO_ENV == 'rn' ? 'APP' : 'WX_APP' //WX_APP APP
         header['X-Client_Version'] = '1.0'
         if (token.length > 0) {
             header['Authorization'] = `Bearer ${token}`;
@@ -78,15 +80,15 @@ export async function request<T>(param: RequestParam): Promise<T> {
                 performRequest(resolve, reject);
                 return;
             }
-            if (global.language=='en'){
-                ToastUtil.getInstance().showToast(method == 'GET' ? 
-                'Network connection failed. Please check your network.' : 
-                'Posting failed. Please check your network.');
+            if (global.language == 'en') {
+                ToastUtil.getInstance().showToast(method == 'GET' ?
+                    'Network connection failed. Please check your network.' :
+                    'Posting failed. Please check your network.');
             }
             else {
                 ToastUtil.getInstance().showToast(method == 'GET' ? '网络连接失败,请检查网络' : '操作失败,请检查网络');
             }
-            
+
             reject('timeout');
         }, kTimeout);
 
@@ -115,11 +117,11 @@ export async function request<T>(param: RequestParam): Promise<T> {
                 } else if (statusCode == 401) {
                     // global.postBtnUpdateStatus('idle')
                     //未登录或挤下线处理
-                    if (process.env.TARO_ENV=='weapp'){
+                    if (process.env.TARO_ENV == 'weapp') {
                         Taro.stopPullDownRefresh()
                     }
-                    else if (process.env.TARO_ENV=='rn'){
-                        if (url.indexOf('login/password')!=-1){
+                    else if (process.env.TARO_ENV == 'rn') {
+                        if (url.indexOf('login/password') != -1) {
                             reject(data);
                             return;
                         }
@@ -138,7 +140,7 @@ export async function request<T>(param: RequestParam): Promise<T> {
                 }
             },
             fail: err => {
-                if ((err as any).statusCode >= 200 && (err as any).statusCode < 300){
+                if ((err as any).statusCode >= 200 && (err as any).statusCode < 300) {
                     clearTimeout(timer);
                     resolve()
                     return;

+ 16 - 4
src/services/trackTimeDuration.tsx

@@ -1,6 +1,6 @@
 
 import exp from 'constants';
-import { API_FAST_PLANS, API_FAST_CHECKS, API_FAST_CLOCKS, API_CLOCK_RECORDS, API_CLOCK_HOME, API_CLOCK_STATS, API_CLOCK_SUMMARY_RECORDS } from './http/api'
+import { API_FAST_PLANS, API_FAST_CHECKS, API_FAST_CLOCKS, API_CLOCK_RECORDS, API_CLOCK_HOME, API_CLOCK_STATS, API_CLOCK_SUMMARY_RECORDS, API_CLOCK_RECORD_UPDATE } from './http/api'
 import { request } from './http/request';
 
 export const getPlans = () => {
@@ -32,7 +32,7 @@ export const setPlan = (params: Record<string, any> | undefined) => {
 export const getChecks = () => {
     return new Promise((resolve) => {
         request({
-            url: API_FAST_CHECKS+`?scenario=${global.scenario}`, method: 'GET', data: {}
+            url: API_FAST_CHECKS + `?scenario=${global.scenario}`, method: 'GET', data: {}
         }).then(res => {
             resolve(res);
         })
@@ -51,7 +51,7 @@ export const clockHome = () => {
     })
 }
 
-export const clockSummaryStats = (params:any)=>{
+export const clockSummaryStats = (params: any) => {
     return new Promise((resolve) => {
         request({
             url: API_CLOCK_STATS, method: 'GET', data: { ...params }
@@ -94,7 +94,7 @@ export const recordCheck = (params: Record<string, any>) => {
     }
     return new Promise((resolve) => {
         request({
-            url: API_FAST_CLOCKS+`?scenario=${global.scenario}`, method: 'POST', data: { ...params }
+            url: API_FAST_CLOCKS + `?scenario=${global.scenario}`, method: 'POST', data: { ...params }
         }).then(res => {
             resolve(res);
         }).catch(e => {
@@ -103,6 +103,18 @@ export const recordCheck = (params: Record<string, any>) => {
     })
 }
 
+export const updateRecord = (params: any, id: any) => {
+    return new Promise((resolve, reject) => {
+        request({
+            url: API_CLOCK_RECORD_UPDATE + '/' + id, method: 'POST', data: { ...params }
+        }).then(res => {
+            resolve(res);
+        }).catch(e => {
+            reject(e)
+        })
+    })
+}
+
 export const delRecord = (id: string) => {
     return new Promise((resolve) => {
         request({

+ 1 - 1
src/utils/common.scss

@@ -9,7 +9,7 @@ $activityColor: #EEC01F;
 $alertFastColor: #00ffff66;
 $alertSleepColor: #8961F566;
 
-$boxColor: #121212;
+$boxColor: #1c1c1c;
 $ringColor: #1c1c1c;
 $blackColor: #000000;
 $whiteColor: #ffffff;

+ 15 - 1
yarn.lock

@@ -6239,7 +6239,7 @@ data-urls@^4.0.0:
     whatwg-mimetype "^3.0.0"
     whatwg-url "^12.0.0"
 
-dayjs@^1.7.7, dayjs@^1.8.15, dayjs@^1.9.1:
+dayjs@^1.10.7, dayjs@^1.7.7, dayjs@^1.8.15, dayjs@^1.9.1:
   version "1.11.10"
   resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0"
   integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==
@@ -15891,6 +15891,20 @@ taro-ui@^3.1.1:
     prop-types "^15.7.2"
     react-native-modal "^13.0.0"
 
+tdesign-miniprogram-taro@^0.0.4:
+  version "0.0.4"
+  resolved "https://registry.yarnpkg.com/tdesign-miniprogram-taro/-/tdesign-miniprogram-taro-0.0.4.tgz#e6cc312f9d234b417823ee6ea2740df552112fc4"
+  integrity sha512-53zHmCqkmnCN4EXuK6Z7rt8SonNcByY1ikLOWt6X+VKIdrGua51WiRC9IqXKfKyeLHdwF6dvG+O4dfiv4Cioxw==
+  dependencies:
+    dayjs "^1.10.7"
+
+tdesign-miniprogram@^1.2.8:
+  version "1.2.8"
+  resolved "https://registry.yarnpkg.com/tdesign-miniprogram/-/tdesign-miniprogram-1.2.8.tgz#22ff9895634ac40ce08c889f9555b599e6e7b2d8"
+  integrity sha512-1zeAvLaee7J38G5EE7LvKiYHRaouhrNey/UbF1aEo+gRni4dhr+GeSx6dOwxQuknZbfh4j4bI9XGEHbCLSvGyw==
+  dependencies:
+    dayjs "^1.10.7"
+
 temp-dir@^1.0.0:
   version "1.0.0"
   resolved "https://registry.npmmirror.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d"