Leon 1 سال پیش
والد
کامیت
036e1e642a

BIN
src/assets/images/lock.png


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
src/components/basic/Icons.tsx


+ 1 - 1
src/components/input/Inputs.tsx

@@ -52,7 +52,7 @@ export default function Component({
                 placeholder={placeholder ? placeholder : ''}
                 value={inputValue}
                 password={isSecure ? true : false}
-                type={isSecure ? 'safe-password' : 'text'}
+                type={openType == 'nickname' ? 'nickname' : isSecure ? 'safe-password' : 'text'}
                 // type={openType?openType:'text'}
                 onInput={handleInputChange}
 

+ 11 - 5
src/context/locales/en.js

@@ -202,8 +202,8 @@ export default {
             this_morning: 'Today',//英文过长,简化
             tomorrow: 'Tomorrow',
             today: 'Today',
-            sunset_to_sunrise: 'Sunset to sunrise',
-            sunrise_to_sunset: 'Sunrise to sunset',
+            sunset_to_sunrise: 'Current sunset and sunrise times are based on the following location.',
+            sunrise_to_sunset: 'Current sunrise and sunset times are based on the following location.',
             time_to_sunset: 'Time to sunset',
             time_to_sunrise: 'Time to sunrise',
             time_past_sunset: 'Time past sunset',
@@ -217,10 +217,12 @@ export default {
             get_local_time_sunrise: 'Show local daytime',
             to:' to ',
             note:'Note',
+            night_tip:'Times displayed represent global annual averages for sunset and sunrise. Actual times vary based on your location and season.',
+            day_tip:'Times displayed represent global annual averages for sunrise and sunset. Actual times vary based on your location and season.',
             alert_night_content:'Sunset and sunrise times are global annual averages. Actual times vary depending on your location and season.',
             alert_day_content:'Sunrise and sunset times are global annual averages. Actual times vary depending on your location and season.',
-            close:'Close',
-            view_more:'View More',
+            choose_location:'Choose location',
+            view_more:'See More',
             got_it:'Got it',
             more:'More',
             night_alert_title:'Night Ring On',
@@ -342,6 +344,8 @@ export default {
                 real_sleep_end_dt: 'Wake-up time',
                 real_sleep_end_tip:'Expected wake-up time: {{time}}',
                 target: 'Target',
+                lock_fast_tip:'Start fasting first.',
+                lock_sleep_tip:'Start sleeping first.'
                 
             },
             schedule: {
@@ -373,7 +377,9 @@ export default {
                 tab_fast_sleep: 'Fast with Sleep',
                 tab_fast: 'Fast',
                 tab_sleep: 'Sleep',
-                delete: 'Delete'
+                delete: 'Delete',
+                none:'None',
+                
             },
 
             action_sheet: {

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

@@ -207,8 +207,8 @@ export default {
             this_morning: '今天',//英文过长,简化
             tomorrow: '明天',
             today: '今天',
-            sunset_to_sunrise: '日落日出',
-            sunrise_to_sunset: '日出日落',
+            sunset_to_sunrise: '当前日落日出时间基于以下地理位置',
+            sunrise_to_sunset: '当前日出日落时间基于以下地理位置',
             time_to_sunset: '距日落',
             time_to_sunrise: '距日出',
             time_past_sunset: '已日落',
@@ -218,13 +218,15 @@ export default {
             overview: '概览',
             events: '事件',
             stages: '阶段',
-            get_local_time: '显示当地时间',
-            get_local_time_sunrise: '显示当地时间',
+            get_local_time: '显示当地夜晚时间',
+            get_local_time_sunrise: '显示当地白天时间',
             to: '至',
             note: '提示',
-            alert_night_content: '日落日出时间为全球年平均值。\n实际时间会根据您所在的位置和季节有所变化。',
-            alert_day_content: '日出日落时间为全球年平均值。\n实际时间会根据您所在的位置和季节有所变化。',
-            close:'关闭',
+            night_tip:'当前显示时间为全球各地年均日落日出时间,\n实际时间会根据您所在地理位置和季节有所变化。',
+            day_tip:'当前显示时间为全球各地平均日出日落时间,\n实际时间会根据您所在地理位置和季节有所变化。',
+            alert_night_content: '当地日落日出时间\n会根据您所在地理位置和季节计算得出。',
+            alert_day_content: '当地日出日落时间\n会根据您所在地理位置和季节计算得出。',
+            choose_location:'选择位置',
             view_more:'查看更多',
             got_it: '我知道了',
             more: '更多',
@@ -344,7 +346,9 @@ export default {
                 real_sleep_start_tip:'预计{{time}} 起床',
                 real_sleep_end_dt: '起床时间',
                 real_sleep_end_tip:'原定于{{time}} 起床',
-                target: '目标'
+                target: '目标',
+                lock_fast_tip:'请先开始断食',
+                lock_sleep_tip:'请先开始睡眠'
             },
             schedule: {
                 section_title: '今天',
@@ -375,7 +379,8 @@ export default {
                 tab_fast_sleep: '断食与睡眠',
                 tab_fast: '断食',
                 tab_sleep: '睡眠',
-                delete: '删除'
+                delete: '删除',
+                none:'无'
             },
 
             action_sheet: {

+ 57 - 21
src/features/trackTimeDuration/components/DayNightCard.scss

@@ -5,25 +5,26 @@
     flex-direction: row;
     align-items: center;
     color: #fff;
+    // background-color: red;
 }
 
 .day_night_title {
     font-size: 32px;
     line-height: 32px;
-    font-weight: bold;
 
 }
 
 .free {
     height: 36px;
+    line-height: 35px;
     border-radius: 18px;
     font-size: 20px;
     display: flex;
-    align-items: center;
-    justify-content: center;
+    // align-items: center;
+    // justify-content: center;
     padding-left: 16px;
     padding-right: 16px;
-    margin-left: 16px;
+    margin-left: 6px;
 }
 
 .day_night_card_footer {
@@ -39,18 +40,21 @@
 }
 
 .day_night_value {
-    font-size: 36px;
-    line-height: 36px;
+    font-size: 32px;
+    line-height: 32px;
     font-weight: bold;
     left: 0;
+    // background-color: red;
 }
 
 .day_night_desc {
     font-size: 20px;
-    line-height: 20px;
+    line-height: 32px;
     color: #fff;
-    opacity: 0.6;
-    margin-top: 14px;
+    opacity: 0.2;
+    width: 468px;
+    margin-top: 8px;
+    // background-color: red;
 }
 
 .day_night_card_btn {
@@ -76,12 +80,12 @@
 .day_location_btn {
     background-color: #C9DAFF33;
     color: #C9DAFF;
-    height: 58px;
-    padding-left: 32px;
-    padding-right: 32px;
-    border-radius: 29px;
+    height: 48px;
+    padding-left: 24px;
+    padding-right: 24px;
+    border-radius: 24px;
     text-align: center;
-    font-size: 20px;
+    font-size: 24px;
     font-weight: bold;
     display: flex;
     align-items: center;
@@ -91,20 +95,52 @@
 .night_location_btn {
     background-color: #1446B933;
     color: #1446B9;
-    height: 58px;
-    padding-left: 32px;
-    padding-right: 32px;
-    border-radius: 29px;
+    height: 48px;
+    padding-left: 24px;
+    padding-right: 24px;
+    border-radius: 24px;
     text-align: center;
-    font-size: 20px;
+    font-size: 24px;
     font-weight: bold;
     display: flex;
     align-items: center;
     justify-content: center;
 }
 
+.night_choose_location{
+    margin-top: 8px;
+    line-height: 32px;
+    font-weight: bold;
+    font-size: 24px;
+    width: 438px;
+    font-weight: bold;
+    color: #1446B9;
+}
+
+.day_choose_location{
+    margin-top: 8px;
+    line-height: 32px;
+    font-weight: bold;
+    font-size: 24px;
+    width: 438px;
+    font-weight: bold;
+    color: #C9DAFF;
+}
+
 .switch{
-    transform: scale(0.75);
+    transform: scale(0.85);
     transform-origin: right center;
-    color: red;
+    margin-right: -10px;
+}
+
+.day_night_detail{
+    display: flex;
+    flex-direction: row;
+    margin-top: 18px;
+    margin-bottom: 14px;
+    // background-color: pink;
+}
+.day_night_detail_icon{
+    margin-right: 22px;
+    // background-color: red;
 }

+ 85 - 57
src/features/trackTimeDuration/components/DayNightCard.tsx

@@ -847,7 +847,11 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
     }
 
     function nightDurationDesc1() {
-        return t('feature.day_night.sunset_to_sunrise')
+        if (authInfo && authInfo.lat) {
+            return t('feature.day_night.sunset_to_sunrise')
+        }
+        return t('feature.day_night.night_tip')
+
         // if (!authInfo || !(authInfo as any).lat) {
         //     if (new Date().getHours() >= 6) {
         //         return `${t('feature.day_night.tonight')}${t('feature.day_night.to')}${t('feature.day_night.tomorrow_morning')}`
@@ -863,7 +867,10 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
     }
 
     function dayDurationDesc1() {
-        return t('feature.day_night.sunrise_to_sunset')
+        if (authInfo && authInfo.lat) {
+            return t('feature.day_night.sunrise_to_sunset')
+        }
+        return t('feature.day_night.day_tip')
         // if (!authInfo || !(authInfo as any).lat) {
         //     if (new Date().getHours() >= 18) {
         //         return `${t('feature.day_night.tomorrow')}`
@@ -907,14 +914,14 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
         Taro.showModal({
             title: t('feature.day_night.note'),
             content: props.isNight ? t('feature.day_night.alert_night_content') : t('feature.day_night.alert_day_content'),
-            cancelText: t('feature.day_night.close'),
-            confirmText: t('feature.day_night.view_more'),
+            confirmText: t('feature.day_night.choose_location'),
+            cancelText: t('feature.day_night.view_more'),
             success: function (res) {
                 if (res.confirm) {
-                    setShowDetailPopup(true)
+                    auth()
                     // console.log('用户点击确定')
                 } else if (res.cancel) {
-                    console.log('用户点击取消')
+                    setShowDetailPopup(true)
                 }
             }
         })
@@ -922,7 +929,7 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
 
     return <View style={{ color: '#fff' }} onLongPress={longClick}>
         <Box onClick={tapCard}>
-            <View style={{ marginTop: -rpxToPx(16) }}>
+            <View style={{ marginTop: -rpxToPx(14), marginBottom: -rpxToPx(14) }}>
                 <View className='day_night_top'>
                     {
                         user.isLogin ? <Text className='day_night_title'>{props.isNight ? t('feature.day_night.night_ring_login') : t('feature.day_night.day_ring_login')}</Text> :
@@ -934,60 +941,86 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
                     }
 
                     <View style={{ flex: 1 }} />
-                    {/* <mySwitch /> */}
-                    <Switch checked={props.isNight ? dayStore.showDayRing : dayStore.showDayRing}
-                        className='switch'
-                        color={props.isNight ? ColorType.night : ColorType.day}
-                        onClick={(e) => { e.stopPropagation() }}
-                        onChange={(e) => {
-                            e.stopPropagation()
-                            // setExpand(e.detail.value)
-                            // if (props.isNight) {
-                            dispatch(showNight(e.detail.value))
-                            // }
-                            // else {
-                            dispatch(showDay(e.detail.value))
-                            // }
+                    <View style={{ height: rpxToPx(50),display:'flex',alignItems:'center',flexDirection:'row' }}>
+                        <Switch checked={props.isNight ? dayStore.showDayRing : dayStore.showDayRing}
+                            className='switch'
+                            color={props.isNight ? ColorType.night : ColorType.day}
+                            onClick={(e) => { e.stopPropagation() }}
+                            onChange={(e) => {
+                                e.stopPropagation()
+                                // setExpand(e.detail.value)
+                                // if (props.isNight) {
+                                dispatch(showNight(e.detail.value))
+                                // }
+                                // else {
+                                dispatch(showDay(e.detail.value))
+                                // }
 
 
-                            Taro.setStorage({
-                                key: 'showNightRing',
-                                data: e.detail.value
-                            })
-                            Taro.setStorage({
-                                key: 'showDayRing',
-                                data: e.detail.value
-                            })
+                                Taro.setStorage({
+                                    key: 'showNightRing',
+                                    data: e.detail.value
+                                })
+                                Taro.setStorage({
+                                    key: 'showDayRing',
+                                    data: e.detail.value
+                                })
 
 
-                            if (user.isLogin) {
-                                uploadPerm({ show_ring: e.detail.value })
-                            }
-                            else {
-
-                                if (e.detail.value) {
-                                    setTimeout(() => {
-                                        Taro.showModal({
-                                            title: props.isNight ?
-                                                t('feature.day_night.night_alert_title') :
-                                                t('feature.day_night.day_alert_title'),
-                                            content: props.isNight ?
-                                                t('feature.day_night.night_alert_content') :
-                                                t('feature.day_night.day_alert_content'),
-                                            showCancel: false,
-                                            confirmText: t('feature.day_night.got_it')
-                                        })
-                                    }, 500)
+                                if (user.isLogin) {
+                                    uploadPerm({ show_ring: e.detail.value })
                                 }
+                                else {
+
+                                    if (e.detail.value) {
+                                        setTimeout(() => {
+                                            Taro.showModal({
+                                                title: props.isNight ?
+                                                    t('feature.day_night.night_alert_title') :
+                                                    t('feature.day_night.day_alert_title'),
+                                                content: props.isNight ?
+                                                    t('feature.day_night.night_alert_content') :
+                                                    t('feature.day_night.day_alert_content'),
+                                                showCancel: false,
+                                                confirmText: t('feature.day_night.got_it')
+                                            })
+                                        }, 500)
+                                    }
 
-                            }
+                                }
 
 
-                        }}
-                    />
+                            }}
+                        />
+                    </View>
                 </View>
                 {
-                    user.isLogin && dayStore.showDayRing && <View style={{ marginTop: rpxToPx(40) }}>
+                    user.isLogin && dayStore.showDayRing && <View className='day_night_detail' onClick={showLocationAlert}>
+                        <View className='day_night_detail_icon'>
+                            {
+                                props.isNight ? <IconNight width={rpxToPx(48)} color={ColorType.night} /> : <IconDay width={rpxToPx(48)} color={ColorType.day} />
+                            }
+                        </View>
+                        <View style={{ display: 'flex', flexDirection: 'column', paddingTop: rpxToPx(8) }}>
+                            <Text className='day_night_value' style={{ color: props.isNight ? ColorType.night : ColorType.day }}>{props.isNight ? nightDuration() : dayDuration()}</Text>
+                            <Text className='day_night_desc'>{props.isNight ? nightDurationDesc1() : dayDurationDesc1()}</Text>
+                            {
+                                authInfo && authInfo.lat ?
+                                    <View style={{ display: 'flex', flexDirection: 'row', marginTop: rpxToPx(18) }} onClick={auth}>
+                                        <View className={props.isNight ? 'night_location_btn' : 'day_location_btn'} onClick={auth}>{getLocation()}</View>
+                                    </View>
+                                    :
+                                    <View style={{ display: 'flex', flexDirection: 'row', marginTop: rpxToPx(18)}} onClick={auth}>
+                                        <View className={props.isNight ? 'night_location_btn' : 'day_location_btn'} onClick={auth}>
+                                            {props.isNight ? t('feature.day_night.get_local_time') : t('feature.day_night.get_local_time_sunrise')}
+                                        </View>
+                                    </View>
+                            }
+                        </View>
+                    </View>
+                }
+                {/* {
+                    user.isLogin && dayStore.showDayRing && <View style={{ marginTop: rpxToPx(12), marginBottom: rpxToPx(14), backgroundColor: 'pink' }}>
                         <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }} onClick={showLocationAlert}>
                             <View style={{ flexDirection: 'row', display: 'flex', alignItems: 'center' }}>
                                 {
@@ -1016,15 +1049,10 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
                                                 {props.isNight ? t('feature.day_night.get_local_time') : t('feature.day_night.get_local_time_sunrise')}
                                             </View>
                                         </View>
-                                // <View className='day_night_card_btn' style={{ backgroundColor: props.isNight ? ColorType.night : ColorType.day }} onClick={auth}>{
-                                //     props.isNight ? t('feature.day_night.get_local_time') : t('feature.day_night.get_local_time_sunrise')
-                                // }</View>
-
-
                             }
                         </View>
                     </View>
-                }
+                } */}
 
             </View>
         </Box >

+ 61 - 22
src/features/trackTimeDuration/components/IndexConsole.tsx

@@ -37,6 +37,8 @@ export default function IndexConsole(props: { record: any }) {
     const common = useSelector((state: any) => state.common);
     const [firstEnter, setFirstEnter] = useState(true);
     const [showTimePicker, setShowTimePicker] = useState(false);
+    const dayMillionSeconds = 24 * 3600 * 1000;
+    const [btnDisable, setBtnDisable] = useState(false)
     const dispatch = useDispatch();
 
 
@@ -78,7 +80,6 @@ export default function IndexConsole(props: { record: any }) {
             jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
             return
         }
-
         operateType = 'startFast'
         global.pauseIndexTimer = true
         global.set_time = new Date().getTime()
@@ -101,34 +102,41 @@ export default function IndexConsole(props: { record: any }) {
             return
         }
         if (status != 'ONGOING1' && props.record.scenario.name == 'FAST_SLEEP') {
+            if (status == 'WAIT_FOR_START') {
+                Taro.showToast({
+                    title: t('feature.track_time_duration.console.lock_fast_tip'),
+                    icon: 'none'
+                })
+            }
+
             vibrate()
             return;
         }
         operateType = 'startSleep'
         global.pauseIndexTimer = true
         global.set_time = new Date().getTime()
-        
+
 
         isTimeout = false
         if (props.record.scenario.name == 'SLEEP') {
             current = new Date().getTime()
-            min = current - 6 * 24 * 3600 * 1000
+            min = current - 6 * dayMillionSeconds
             max = current
         }
         else {
             //todolist
             var now = new Date().getTime()
             var last_check_time = props.record.current_record.last_real_check_time
-            if (now - last_check_time >= 24 * 3600 * 1000) {
+            if (now - last_check_time >= dayMillionSeconds) {
                 //ongoing1 严重超时单独处理
                 var schedule_start_time = props.record.current_record.sleep.target_start_time
                 current = Math.min(now, schedule_start_time)
-                min = Math.max(last_check_time, schedule_start_time - 3 * 24 * 3600 * 1000)
-                max = Math.min(now, schedule_start_time + 3 * 24 * 3600 * 1000)
+                min = Math.max(last_check_time, schedule_start_time - 3 * dayMillionSeconds)
+                max = Math.min(now, schedule_start_time + 3 * dayMillionSeconds)
             }
             else {
                 current = now
-                min = Math.max(last_check_time, current - 6 * 24 * 3600 * 1000)
+                min = Math.max(last_check_time, current - 6 * dayMillionSeconds)
                 max = current
             }
 
@@ -148,6 +156,12 @@ export default function IndexConsole(props: { record: any }) {
             return
         }
         if (status != 'ONGOING2' && status != 'ONGOING') {
+
+            Taro.showToast({
+                title: t('feature.track_time_duration.console.lock_sleep_tip'),
+                icon: 'none'
+            })
+
             vibrate()
             return;
         }
@@ -158,17 +172,17 @@ export default function IndexConsole(props: { record: any }) {
         var real_start_time = props.record.current_record.sleep.real_start_time
         var last_check_time = props.record.current_record.last_real_check_time
         var now = new Date().getTime()
-        if (now - real_start_time >= 24 * 3600 * 1000) {
+        if (now - real_start_time >= dayMillionSeconds) {
             //严重超时
             isTimeout = true
             current = props.record.current_record.sleep.target_end_time
-            min = Math.max(last_check_time, current - 3 * 24 * 3600 * 1000)
-            max = Math.min(now, current + 3 * 24 * 3600 * 1000)
+            min = Math.max(last_check_time, current - 3 * dayMillionSeconds)
+            max = Math.min(now, current + 3 * dayMillionSeconds)
         }
         else {
             isTimeout = false
             current = now
-            min = Math.max(last_check_time, current - 6 * 24 * 3600)
+            min = Math.max(last_check_time, current - 6 * dayMillionSeconds)
             max = current
         }
 
@@ -191,6 +205,10 @@ export default function IndexConsole(props: { record: any }) {
             return
         }
         if (status == 'WAIT_FOR_START') {
+            Taro.showToast({
+                title: t('feature.track_time_duration.console.lock_fast_tip'),
+                icon: 'none'
+            })
             vibrate()
             return;
         }
@@ -201,17 +219,17 @@ export default function IndexConsole(props: { record: any }) {
         var real_start_time = props.record.current_record.fast.real_start_time
         var last_check_time = props.record.current_record.last_real_check_time
         var now = new Date().getTime()
-        if (now - real_start_time >= 24 * 3600 * 1000) {
+        if (now - real_start_time >= dayMillionSeconds) {
             //严重超时
             isTimeout = true
             current = props.record.current_record.fast.target_end_time
-            min = Math.max(last_check_time, current - 3 * 24 * 3600 * 1000)
-            max = Math.min(now, current + 3 * 24 * 3600 * 1000)
+            min = Math.max(last_check_time, current - 3 * dayMillionSeconds)
+            max = Math.min(now, current + 3 * dayMillionSeconds)
         }
         else {
             isTimeout = false
             current = now
-            min = Math.max(last_check_time, current - 6 * 24 * 3600)
+            min = Math.max(last_check_time, current - 6 * dayMillionSeconds)
             max = current
         }
 
@@ -359,6 +377,7 @@ export default function IndexConsole(props: { record: any }) {
         var node = layoutContent()
         global.showIndexModal(false, node, null);
         setShowTimePicker(false)
+        setBtnDisable(false)
         global.pauseIndexTimer = false
     }
 
@@ -372,6 +391,10 @@ export default function IndexConsole(props: { record: any }) {
     }
 
     function pickerConfirm(t1: number) {
+        if (btnDisable) {
+            return
+        }
+        setBtnDisable(true)
         // hidePicker()
         var date = new Date(t1)
         var setDate = new Date(global.set_time);
@@ -386,6 +409,7 @@ export default function IndexConsole(props: { record: any }) {
                     global.indexPageRefresh()
                     setFirstEnter(false)
                     hidePicker()
+                    setBtnDisable(false)
 
                     if (permission.wxPubFollow) {
                         Taro.showModal({
@@ -414,6 +438,8 @@ export default function IndexConsole(props: { record: any }) {
                             }
                         })
                     }
+                }).catch(e => {
+                    setBtnDisable(false)
                 })
                 break
             case 'startSleep':
@@ -421,7 +447,7 @@ export default function IndexConsole(props: { record: any }) {
                     global.indexPageRefresh()
                     setFirstEnter(false)
                     hidePicker()
-
+                    setBtnDisable(false)
                     if (permission.wxPubFollow) {
                         Taro.showModal({
                             title: t('feature.track_time_duration.reminders.wake_title'),
@@ -447,29 +473,42 @@ export default function IndexConsole(props: { record: any }) {
                             }
                         })
                     }
-                }).catch((e)=>{
+                }).catch((e) => {
+                    setBtnDisable(false)
                     var picker = limitPickerRef.current;
                     (picker as any).resetPickerData()
                 })
                 break
             case 'endSleep':
                 endSleep(t1).then(res => {
+                    setBtnDisable(false)
                     global.indexPageRefresh()
                     setFirstEnter(false)
                     hidePicker()
-                }).catch((e)=>{
+                    if (props.record.current_record.scenario == 'SLEEP') {
+                        global.scrollToLatest()
+                    }
+                }).catch((e) => {
+                    setBtnDisable(false)
                     var picker = limitPickerRef.current;
                     (picker as any).resetPickerData()
+
+
                 })
                 break
             case 'endFast':
                 endFast(t1).then(res => {
+                    setBtnDisable(false)
                     global.indexPageRefresh()
                     setFirstEnter(false)
                     hidePicker()
-                }).catch((e)=>{
+                    global.scrollToLatest()
+                }).catch((e) => {
+                    setBtnDisable(false)
                     var picker = limitPickerRef.current;
                     (picker as any).resetPickerData()
+
+
                 })
                 break
         }
@@ -599,7 +638,7 @@ export default function IndexConsole(props: { record: any }) {
                 {
                     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', fontSize: rpxToPx(32) }}>{t('feature.track_time_duration.common.start_sleep')}</Text>
             </View>
         }
         {
@@ -621,7 +660,7 @@ export default function IndexConsole(props: { record: any }) {
                 {
                     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', fontSize: rpxToPx(32) }}>{t('feature.track_time_duration.common.end_sleep')}</Text>
             </View>
         }
         {
@@ -638,7 +677,7 @@ export default function IndexConsole(props: { record: any }) {
                 {
                     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', fontSize: rpxToPx(32) }}>{t('feature.track_time_duration.common.end_fast')}</Text>
             </View>
         }
         {

+ 30 - 21
src/features/trackTimeDuration/components/IndexItem.tsx

@@ -194,32 +194,40 @@ export default function Component(props: { type: string, data: any, time: any, s
                 realRing.durationArc = durationArc(record.sleep.target_start_time, (new Date()).getTime())
                 return <Rings common={common} bgRing={bgRing} currentDot={currentDot} canvasId={props.type + 'index_small'} targetRing={targetBigRing1} realRing={realRing} />
             }
-            else if (record.status == 'WAIT_FOR_START' || record.status == 'ONGOING1') {
+            else if (record.status == 'WAIT_FOR_START'||record.status == 'ONGOING1') {
 
                 var scenario = JSON.parse(JSON.stringify(props.data.scenario))
-                if (record.status == 'ONGOING1') {
-                    var countduration = (props.data.current_record.sleep.target_end_time - props.data.current_record.sleep.target_start_time) / 60000
-                    var min1 = TimeFormatter.timestringToSeconds(scenario.schedule.sleep.start_time) / 60
-                    var min2 = TimeFormatter.timestringToSeconds(scenario.schedule.sleep.end_time) / 60
-                    var leftMinutes = min1 < min2 ? min2 - min1 : min2 + 24 * 60 - min1
-                    if (leftMinutes != countduration) {
-                        min2 = min1 + countduration
-                        if (min2 > 1440) {
-                            min2 -= 1440
-                        }
-                        var hour = Math.floor(min2 / 60)
-                        var minute = min2 % 60
-                        scenario.schedule.sleep.end_time = `${hour}:${minute}`
-                    }
+                // if (record.status == 'ONGOING1') {
+                //     var countduration = (props.data.current_record.sleep.target_end_time - props.data.current_record.sleep.target_start_time) / 60000
+                //     var min1 = TimeFormatter.timestringToSeconds(scenario.schedule.sleep.start_time) / 60
+                //     var min2 = TimeFormatter.timestringToSeconds(scenario.schedule.sleep.end_time) / 60
+                //     var leftMinutes = min1 < min2 ? min2 - min1 : min2 + 24 * 60 - min1
+                //     if (leftMinutes != countduration) {
+                //         min2 = min1 + countduration
+                //         if (min2 > 1440) {
+                //             min2 -= 1440
+                //         }
+                //         var hour = Math.floor(min2 / 60)
+                //         var minute = min2 % 60
+                //         scenario.schedule.sleep.end_time = `${hour}:${minute}`
+                //     }
+                // }
+
+
+                if (record.status == 'WAIT_FOR_START'){
+                    realRing = getSchedule(scenario, false, true, record.status == 'WAIT_FOR_START')//getSchedule(record, false, true)
+                    
                 }
-
-
-                realRing = getSchedule(scenario, false, true, true)//getSchedule(record, false, true)
-
+                else {
+                    realRing.startArc = startArc(record.sleep.target_start_time)
+                    realRing.durationArc = durationArc(record.sleep.target_start_time, record.sleep.target_end_time)
+                }
+                
                 realRing.color = ColorType.sleep + '66'
 
                 var currentDot = getDot(record, false)
-                if (!user.isLogin) {
+                
+                if (!user.isLogin ) {
                     currentDot = null
                 }
 
@@ -234,7 +242,8 @@ export default function Component(props: { type: string, data: any, time: any, s
                 realRing = getReal(record, false, true)
                 var currentDot = getDot(record, false)
                 if (record.status == 'ONGOING3') {
-                    currentDot.color = '#ffffffff'
+                    currentDot = null
+                    // currentDot.color = '#ffffffff'
                 }
                 return <Rings common={common} bgRing={bgRing} currentDot={currentDot} canvasId={props.type + 'index_small'} realRing={realRing} />
             }

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

@@ -43,7 +43,7 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
     }, [props.data])
 
 
-    function formateTime(obj: any, isEnd: boolean) {
+    function formateTime(obj: any, isEnd: boolean, isFastMode?: boolean) {
         if (isEnd) {
             if (obj.real_end_time) {
                 var newTimestamp = TimeFormatter.transferTimestamp(obj.real_end_time, obj.real_end_time_zone)
@@ -51,33 +51,41 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
                 // return diffTimeZone ? TimeFormatter.timelineFullFormatTime(newTimestamp) : TimeFormatter.timelineFormatTime(obj.real_end_time)
             }
             else {
-                return TimeFormatter.timelineFormatTime(obj.target_end_time)
+
+                var real_time_zone = props.data.last_time_zone
+
+                var newTimestamp = TimeFormatter.transferTimestamp(obj.target_end_time, real_time_zone)
+                return TimeFormatter.timelineFormatTime(newTimestamp)
                 // return diffTimeZone ? TimeFormatter.timelineFullFormatTime(obj.target_end_time) : TimeFormatter.timelineFormatTime(obj.target_end_time)
             }
         }
         else {
+
             if (obj.real_start_time) {
                 var newTimestamp = TimeFormatter.transferTimestamp(obj.real_start_time, obj.real_start_time_zone)
                 return TimeFormatter.timelineFormatTime(newTimestamp)
                 // return diffTimeZone ? TimeFormatter.timelineFullFormatTime(newTimestamp) : TimeFormatter.timelineFormatTime(obj.real_start_time)
             }
             else {
-                return TimeFormatter.timelineFormatTime(obj.target_start_time)
+                var real_time_zone = props.data.last_time_zone
+                var newTimestamp = TimeFormatter.transferTimestamp(obj.target_start_time, real_time_zone)
+
+                return TimeFormatter.timelineFormatTime(newTimestamp)
                 // return diffTimeZone ? TimeFormatter.timelineFullFormatTime(obj.target_start_time) : TimeFormatter.timelineFormatTime(obj.target_start_time)
             }
         }
 
     }
 
-    function formateDate(currentStatus:string,obj: any, isEnd: boolean, isFastMode?: boolean) {
+    function formateDate(currentStatus: string, obj: any, isEnd: boolean, isFastMode?: boolean) {
         var now = new Date()
         var seconds = now.getHours() * 3600 + now.getMinutes() * 60 + now.getSeconds()
         if (currentStatus == 'WAIT_FOR_START') {
-            if (props.data.scenario == 'SLEEP'){
-                if (isEnd){
+            if (props.data.scenario == 'SLEEP') {
+                if (isEnd) {
                     var count = TimeFormatter.timestringToSeconds(scenario.schedule.sleep.start_time)
                     var count2 = TimeFormatter.timestringToSeconds(scenario.schedule.sleep.end_time)
-                    if (count2<count){
+                    if (count2 < count) {
                         return global.language == 'en' ? 'Tomorrow' : '明天'
                     }
                     return global.language == 'en' ? 'Today' : '今天'
@@ -85,25 +93,25 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
             }
             else {
                 var count = TimeFormatter.timestringToSeconds(scenario.schedule.fast.start_time)
-                if (isFastMode){
-                    if (isEnd){
+                if (isFastMode) {
+                    if (isEnd) {
                         var count2 = TimeFormatter.timestringToSeconds(scenario.schedule.fast.end_time)
-                        if (count2<count){
+                        if (count2 < count) {
                             return global.language == 'en' ? 'Tomorrow' : '明天'
                         }
                     }
                     return global.language == 'en' ? 'Today' : '今天'
                 }
                 else {
-                    if (isEnd){
+                    if (isEnd) {
                         var count2 = TimeFormatter.timestringToSeconds(scenario.schedule.sleep.end_time)
-                        if (count2<count){
+                        if (count2 < count) {
                             return global.language == 'en' ? 'Tomorrow' : '明天'
                         }
                     }
                     else {
                         var count2 = TimeFormatter.timestringToSeconds(scenario.schedule.sleep.start_time)
-                        if (count2<count){
+                        if (count2 < count) {
                             return global.language == 'en' ? 'Tomorrow' : '明天'
                         }
                     }
@@ -114,18 +122,36 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
         }
         if (isEnd) {
             if (obj.real_end_time) {
-                return TimeFormatter.dateDescription(obj.real_end_time, true)
+                var newTimestamp = TimeFormatter.transferTimestamp(obj.real_end_time, obj.real_end_time_zone)
+                if (diffTimeZone || multTimeZone){
+                    return TimeFormatter.getMonthAndDayByTimestamp(newTimestamp,true)+' '
+                }
+                return TimeFormatter.dateDescription(newTimestamp, true, diffTimeZone || multTimeZone)
             }
             else {
-                return TimeFormatter.dateDescription(obj.target_end_time, true)
+                var real_time_zone = props.data.last_time_zone
+                var newTimestamp = TimeFormatter.transferTimestamp(obj.target_end_time, real_time_zone)
+                if (diffTimeZone || multTimeZone){
+                    return TimeFormatter.getMonthAndDayByTimestamp(newTimestamp,true)+' '
+                }
+                return TimeFormatter.dateDescription(newTimestamp, true, diffTimeZone || multTimeZone)
             }
         }
         else {
             if (obj.real_start_time) {
-                return TimeFormatter.dateDescription(obj.real_start_time, true)
+                var newTimestamp = TimeFormatter.transferTimestamp(obj.real_start_time, obj.real_start_time_zone)
+                if (diffTimeZone || multTimeZone){
+                    return TimeFormatter.getMonthAndDayByTimestamp(newTimestamp,true)+' '
+                }
+                return TimeFormatter.dateDescription(newTimestamp, true, diffTimeZone || multTimeZone)
             }
             else {
-                return TimeFormatter.dateDescription(obj.target_start_time, true)
+                var real_time_zone = props.data.last_time_zone
+                var newTimestamp = TimeFormatter.transferTimestamp(obj.target_start_time, real_time_zone)
+                if (diffTimeZone || multTimeZone){
+                    return TimeFormatter.getMonthAndDayByTimestamp(newTimestamp,true)+' '
+                }
+                return TimeFormatter.dateDescription(obj.target_start_time, true, diffTimeZone || multTimeZone)
             }
         }
 
@@ -142,28 +168,40 @@ 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
         }
+        var desc = props.data.status == 'WAIT_FOR_START' ? '' : multTimeZone ? timeZone : ''
+        if (props.data.status != 'WAIT_FOR_START' && props.data.status != 'COMPLETED' && diffTimeZone) {
+            desc = timeZone
+        }
         timelineItems.push(
             {
                 status: getStatus(true, true, props.data),
                 title: getStatus(true, true, props.data) == 'padding' ?
                     t('feature.track_time_duration.common.start_fast') :
                     t('feature.track_time_duration.common.started_fasting'),
-                content: props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.status,props.data.fast, false, true) + scenario.schedule.fast.start_time : formateDate(props.data.status,props.data.fast, false) + formateTime(props.data.fast, false),
-                date: props.data.status == 'WAIT_FOR_START' ? '' : multTimeZone ? timeZone : '',
+                content: props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.status, props.data.fast, false, true) + scenario.schedule.fast.start_time : formateDate(props.data.status, props.data.fast, false, true) + formateTime(props.data.fast, false, true),
+                date: desc,
                 // (diffTimeZone ? timeZone : showDate(props.data.fast, false) ? formateDate(props.data.fast, false) : ''),
                 color: global.fastColor ? global.fastColor : ColorType.fast
             }
         )
     }
     if (props.data.sleep && props.data.scenario != 'FAST') {
+
+        var status = getStatus(false, true, props.data)
+        var strContent = props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.status, props.data.sleep, false, false) + scenario.schedule.sleep.start_time : formateDate(props.data.status, props.data.sleep, false, false) + formateTime(props.data.sleep, false, false)
+
+
         var timeZone = ''
         if (props.data.sleep.real_start_time_zone) {
             timeZone = ' ' + props.data.sleep.real_start_time_zone
         }
-        var status = getStatus(false, true, props.data)
-        var strContent = props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.status,props.data.sleep, false, false) + scenario.schedule.sleep.start_time : formateDate(props.data.status,props.data.sleep, false) + formateTime(props.data.sleep, false)
         var strDate = multTimeZone ? timeZone : ''
-        // (diffTimeZone ? timeZone : showDate(props.data.sleep, false) ? formateDate(props.data.sleep, false) : '')
+        if (props.data.status != 'WAIT_FOR_START' && props.data.status != 'COMPLETED') {
+            if ((!timeZone || timeZone.length == 0) && (multTimeZone || diffTimeZone)) {
+                strDate = props.data.last_time_zone
+            }
+        }
+
         timelineItems.push(
             {
                 status: status,
@@ -182,8 +220,16 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
             timeZone = ' ' + props.data.sleep.real_end_time_zone
         }
         var status = getStatus(false, false, props.data)
-        var strContent: string = props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.status,props.data.sleep, true, false) + scenario.schedule.sleep.end_time : formateDate(props.data.status,props.data.sleep, true) + formateTime(props.data.sleep, true)
+        var strContent: string = props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.status, props.data.sleep, true, false) + scenario.schedule.sleep.end_time : formateDate(props.data.status, props.data.sleep, true) + formateTime(props.data.sleep, true, false)
         var strDate = multTimeZone ? timeZone : ''
+
+        if (props.data.status != 'WAIT_FOR_START' && props.data.status != 'COMPLETED') {
+            if ((!timeZone || timeZone.length == 0) && (multTimeZone || diffTimeZone)) {
+                strDate = props.data.last_time_zone
+            }
+        }
+
+
         // (diffTimeZone ? timeZone : showDate(props.data.sleep, true) ? formateDate(props.data.sleep, true) : '')
         timelineItems.push(
             {
@@ -202,14 +248,27 @@ export default function TimelineFastSleep(props: { data: any, title?: string, fi
         if (props.data.fast.real_end_time_zone) {
             timeZone = ' ' + props.data.fast.real_end_time_zone
         }
+
+        console.log(timeZone, multTimeZone, diffTimeZone, props.data.status)
+        if (props.data.status != 'WAIT_FOR_START' && props.data.status != 'COMPLETED') {
+            if ((!timeZone || timeZone.length == 0) && (multTimeZone || diffTimeZone)) {
+                timeZone = props.data.last_time_zone
+            }
+        }
+
+        if ((diffTimeZone && !multTimeZone) && props.data.status == 'COMPLETED') {
+            timeZone = ''
+        }
+
         timelineItems.push(
             {
                 status: getStatus(true, false, props.data),
                 title: getStatus(true, false, props.data) == 'padding' ?
                     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.status,props.data.fast, true, true) + scenario.schedule.fast.end_time : formateDate(props.data.status,props.data.fast, true) + formateTime(props.data.fast, true),
-                date: multTimeZone ? timeZone : '',
+                content: props.data.status == 'WAIT_FOR_START' ? formateDate(props.data.status, props.data.fast, true, true) + scenario.schedule.fast.end_time : formateDate(props.data.status, props.data.fast, true) + formateTime(props.data.fast, true, true),
+                // date: multTimeZone ? timeZone : '',
+                date: timeZone,
                 // (diffTimeZone ? timeZone : showDate(props.data.fast, true) ? formateDate(props.data.fast, true) : ''),
                 color: global.fastColor ? global.fastColor : ColorType.fast
             }

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

@@ -6,6 +6,7 @@ import WeekCalendarItem from "./WeekCalendarItem";
 import { rpxToPx } from "@/utils/tools";
 import { TimeFormatter } from "@/utils/time_format";
 import { clockSummaryStats } from "@/services/trackTimeDuration";
+import { useTranslation } from "react-i18next";
 
 let pageIndex = 0
 let timer;
@@ -22,6 +23,7 @@ const WeekCalendar = memo(() => {
     const [minTime, setMinTime] = useState(0)
     const [left, setLeft] = useState(0)
     const [isLoading, setIsLoading] = useState(false)
+    const {t} = useTranslation()
     const pageSize = 34
 
     useEffect(() => {
@@ -120,11 +122,11 @@ const WeekCalendar = memo(() => {
         <View className="calendar_summary_top">
             <View className="calendar_summary_item">
                 <Text className="calendar_summary_title">平均断食</Text>
-                <Text className="calendar_summary_value" style={{ color: ColorType.fast }}>{!summary || summary.fast.avg == 0 ? '-' : TimeFormatter.calculateTimeDifference(new Date().getTime(), new Date().getTime() + summary.fast.avg)}</Text>
+                <Text className="calendar_summary_value" style={{ color: ColorType.fast }}>{!summary || summary.fast.avg == 0 ? t('feature.track_time_duration.record_fast_sleep.none') : TimeFormatter.calculateTimeDifference(new Date().getTime(), new Date().getTime() + summary.fast.avg)}</Text>
             </View>
             <View className="calendar_summary_item">
                 <Text className="calendar_summary_title">平均睡眠</Text>
-                <Text className="calendar_summary_value" style={{ color: ColorType.sleep }}>{!summary || summary.sleep.avg == 0 ? '-' : TimeFormatter.calculateTimeDifference(new Date().getTime(), new Date().getTime() + summary.sleep.avg)}</Text>
+                <Text className="calendar_summary_value" style={{ color: ColorType.sleep }}>{!summary || summary.sleep.avg == 0 ? t('feature.track_time_duration.record_fast_sleep.none') : TimeFormatter.calculateTimeDifference(new Date().getTime(), new Date().getTime() + summary.sleep.avg)}</Text>
             </View>
         </View>
         <Text className="calendar_summary_desc">{getDate(calendarData.start)} 周日中午 - {getDate(calendarData.end)} 周日中午</Text>

+ 44 - 10
src/pages/clock/Clock.tsx

@@ -90,12 +90,12 @@ export default function Page() {
     const nightStore = useSelector((state: any) => state.night);
     if (process.env.TARO_ENV == 'weapp') {
         useShareAppMessage((e) => {
-          return {
-            title: t('feature.track_time_duration.common.share_title'),
-            path: 'pages/clock/Clock'
-          }
+            return {
+                title: t('feature.track_time_duration.common.share_title'),
+                path: 'pages/clock/Clock'
+            }
         })
-      }
+    }
 
     useEffect(() => {
         dispatch(staticResources() as any);
@@ -128,8 +128,8 @@ export default function Page() {
 
         if (user.isLogin) {
             uploadUserClient();
-
             checkAuthorized();
+
         }
         else {
             dispatch(clearNightStore());
@@ -157,6 +157,23 @@ export default function Page() {
 
     })
 
+    async function checkVersionUpdate() {
+        if (!user.isLogin) {
+            return
+        }
+        const showAlert = await getStorage('117alert') || false;
+        if (!showAlert) {
+            Taro.showModal({
+                title: '版本更新提示',
+                content: '【昼夜环】追踪每天日出日落时间;\n【周统计】查看每周断食和睡眠平均时长;\n【记录筛选】根据场景, 浏览历史记录',
+                showCancel: false,
+                confirmText: '我知道了'
+            })
+        }
+        Taro.setStorage({ key: '117alert', data: true })
+
+    }
+
     useDidShow(() => {
         checkTimeZone()
         setCount(pre => pre + 1)
@@ -170,6 +187,10 @@ export default function Page() {
                 Taro.stopPullDownRefresh()
             })
         }
+        setTimeout(() => {
+            checkVersionUpdate();
+        }, 1000)
+
     })
 
     useDidHide(() => {
@@ -435,7 +456,7 @@ export default function Page() {
                 title: t('feature.track_time_duration.reminders.schedule_title'),
                 content:
                     t('feature.track_time_duration.reminders.schedule_mix_content'),
-                    cancelText: t('feature.track_time_duration.reminders.later'),
+                cancelText: t('feature.track_time_duration.reminders.later'),
                 confirmText: t('feature.track_time_duration.reminders.open'),
                 success: function (res) {
                     if (res.confirm) {
@@ -443,9 +464,9 @@ export default function Page() {
                     } else if (res.cancel) {
                     }
                 }
-                
+
             })
-            
+
         }
     }
 
@@ -527,6 +548,19 @@ export default function Page() {
         return <ClockHeader homeData={homeData} />
     }
 
+    global.scrollToLatest = () => {
+        setTimeout(() => {
+            Taro.createSelectorQuery().select('#latest').boundingClientRect((rect) => {
+                Taro.pageScrollTo({
+                    scrollTop: (rect as any).top,
+                    duration: 100
+                })
+                debugger
+            }).exec()
+        }, 1000)
+
+    }
+
     var timestamp = new Date().getTime()
 
     function render() {
@@ -570,7 +604,7 @@ export default function Page() {
                 }
 
                 {
-                    user.isLogin && records.length > 0 && <View className="fast_sleep_item_bg">
+                    user.isLogin && records.length > 0 && <View id="latest" className="fast_sleep_item_bg">
                         <RecordFastSleep data={records[0]} type='record' index={-20000} />
                     </View>
                 }

+ 2 - 2
src/pages/common/RecordsHistory.scss

@@ -1,9 +1,9 @@
 .no_records_bg {
     position: absolute;
     left: 0;
-    top: 0;
+    top: 100;
     right: 0;
-    height: 80vh;
+    height: 60vh;
     display: flex;
     align-items: center;
     justify-content: center;

+ 15 - 9
src/utils/time_format.ts

@@ -15,6 +15,9 @@ export class TimeFormatter {
 
   //把本地时间戳更改为指定时区的时间戳
   static transferTimestamp(timestamp: number, timeZone: string) {
+    if (!timeZone || timeZone.length == 0) {
+      return timestamp
+    }
     var date = new Date(timestamp)
 
     if (timeZone) {
@@ -139,7 +142,7 @@ export class TimeFormatter {
   }
 
   //2.基于日期显示日期,省略今天描述
-  static dateDescription(timestamp: number, showToday?: boolean): string {
+  static dateDescription(timestamp: number, showToday?: boolean, showFullDate?: boolean): string {
     if (!timestamp) {
       return ''
     }
@@ -150,7 +153,8 @@ export class TimeFormatter {
     if (
       inputDate.getDate() === currentDate.getDate() &&
       inputDate.getMonth() === currentDate.getMonth() &&
-      inputDate.getFullYear() === currentDate.getFullYear()
+      inputDate.getFullYear() === currentDate.getFullYear() &&
+      !showFullDate
     ) {
       if (currentDate.getTime() - timestamp <= TimeFormatter.nowDuration * 1000 && currentDate.getTime() - timestamp >= 0) {
         return TimeFormatter.getJustNowUnit()
@@ -166,7 +170,8 @@ export class TimeFormatter {
     if (
       inputDate.getDate() === yesterday.getDate() &&
       inputDate.getMonth() === yesterday.getMonth() &&
-      inputDate.getFullYear() === yesterday.getFullYear()
+      inputDate.getFullYear() === yesterday.getFullYear() &&
+      !showFullDate
     ) {
       return TimeFormatter.getYesterdayUnit();
     }
@@ -178,7 +183,8 @@ export class TimeFormatter {
     if (
       inputDate.getDate() === tomorrow.getDate() &&
       inputDate.getMonth() === tomorrow.getMonth() &&
-      inputDate.getFullYear() === tomorrow.getFullYear()
+      inputDate.getFullYear() === tomorrow.getFullYear() &&
+      !showFullDate
     ) {
       return TimeFormatter.getTomorrowUnit();
     }
@@ -268,7 +274,7 @@ export class TimeFormatter {
     }
   }
 
-  static getMonthAndDayByTimestamp(num: number): string {
+  static getMonthAndDayByTimestamp(num: number, showFullDate?: boolean): string {
     const dt = new Date(num);
 
     const now = new Date();
@@ -276,12 +282,12 @@ export class TimeFormatter {
     const diff = now.getTime() - dt.getTime();
     const day = 1000 * 60 * 60 * 24;
 
-    if (diff < day) {
+    if (diff < day && !showFullDate) {
       return TimeFormatter.getTodayUnit();
-    } else if (diff < 2 * day) {
+    } else if (diff < 2 * day && !showFullDate) {
       return TimeFormatter.getYesterdayUnit();
     } else {
-      var month = dt.getMonth()+1
+      var month = dt.getMonth() + 1
       var date = dt.getDate()
       if (global.language == 'en') {
         return TimeFormatter.getMonth(month) + ' ' + date
@@ -591,7 +597,7 @@ export class TimeFormatter {
   //hh:mm转换成秒数
   static timestringToSeconds = (strTime: string) => {
     var list = strTime.split(':')
-    return parseInt(list[0]) * 3600 + parseInt(list[1])*60
+    return parseInt(list[0]) * 3600 + parseInt(list[1]) * 60
   }
 
 }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است