leon 1 rok pred
rodič
commit
4e048cf6ec

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
ios/main.jsbundle


+ 3 - 0
src/app.tsx

@@ -69,6 +69,9 @@ const App: React.FC<PropsWithChildren> = ({ children }) => {
   //   // });
   //   // alert(Intl.DateTimeFormat().resolvedOptions().timeZone)
   // }
+  if (process.env.TARO_ENV == 'rn') {
+    global.language = 'en'
+  }
   if (process.env.TARO_ENV == 'weapp') {
     loadWXCache()
     global.isDebug = Taro.getStorageSync('isDebug')

+ 13 - 6
src/context/locales/en.js

@@ -118,7 +118,10 @@ export default {
             fast_sleep_desc: 'Track your overnight fast before bed, during sleep, and after waking up',
             free: 'Free',
             limit_time_offer: 'Limit-Time Offer',
-            next:'Next'
+            next:'Next',
+            alert_title:'Premium Access Required',
+            alert_content:'Grow your faststreak to {{day}} {{day_unit}} to unlock.',
+            alert_btn:'Got it',
         },
         suggest: {
             step_0_title: 'Set End Time for Fasting',
@@ -127,7 +130,7 @@ export default {
             step_1_title: 'Suggested Fast schedule',
             fast_suggest_header: 'To end fasting at {{time}}, start at one of the following times:',
             start_fast_time: 'Start fasting at {{time}}',
-            intermitent_fast: '{{data}} Intermittent Fasting',
+            intermittent_fast: '{{data}} Intermittent Fasting',
             fast_desc: '{{start_time}} hours fasting, {{end_time}} hours eating',
             step_2_title: 'Set Wake Time',
             end_sleep_picker_header: 'What time do you want to wake up?',
@@ -144,7 +147,10 @@ export default {
             popular: 'Popular',
             recent: 'Recent',
             btn:'Suggest Schedule',
-            done:'Done'
+            done:'Done',
+            hour:' hours',
+            hours2:' hrs ',
+            minute:' mins',
         },
         set_goal: {
             set_action_plan: 'Set Schedule',
@@ -157,7 +163,8 @@ export default {
             go_to_bed:'Go to bed',
             wake_up:'Wake up',
             end_fasting:'End fasting',
-            done:'Done'
+            done:'Done',
+            next_day: 'Next day ',
         },
 
         check_access: {
@@ -171,7 +178,7 @@ export default {
                 desc:'You\'ve earned access to \'Fasting with Sleep\' {{reason}} Are you ready to upgrade?',
                 // desc:'You\'ve unlocked \'Fasting with Sleep\' since you\'re on a {{day}}-day streak.\nAre you ready to up the game?',
                 upgrade:'Upgrade to Fasting with Sleep',
-                upgrade_desc:'Offer Expiring in {{time}}',
+                upgrade_desc:'Expiring in {{time}}',
                 stay_btn:'Stay with Fasting Only',
                 reason:'since you\'re on a {{day}}-day faststreak.',
                 // more:'Learn more'
@@ -205,7 +212,7 @@ export default {
                 sleep_streak_lost:'since you lost your sleepstreak.',
                 fast_sleep_streaks_lost:'since you lost your fast and sleepstreaks.',
                 sleep_streak_not_growing:'since you didn\'t grow your sleepstreak.',
-                not_satisfied_after_delete:'since your faststreak fell below {{day}}.',
+                not_satisfied_after_delete:'since your faststreak fell below {{day}} {{day_unit}}.',
                 // fast_streak_lost:'since you lost your fasting streak on {{date}}',
                 // sleep_streak_lost:'since you lost your sleep streak on {{date}}',
                 // fast_sleep_streaks_lost:'since you lost both of your fasting and sleep streaks on {{date}}',

+ 26 - 19
src/context/locales/zh.js

@@ -121,7 +121,10 @@ export default {
             fast_sleep_desc: '记录每晚断食的三个阶段,\n睡前、睡眠期间、及起床后',
             free: '免费',
             limit_time_offer: '限时免费',
-            next:'下一步'
+            next:'下一步',
+            alert_title:'需要高级权限',
+            alert_content:'断食连续打卡{{day}} 天可解锁。',
+            alert_btn:'我知道了',
         },
         suggest: {
             step_0_title: '设置断食结束时间',
@@ -129,9 +132,9 @@ export default {
             end_fast_picker_footer: '即您开始吃早餐或第一餐的时间。',
             step_1_title: '断食日程推荐',
             fast_suggest_header: '{{time}} 结束断食, 为你推荐以下开始时间:',
-            start_fast_time: 'Start fasting at {{time}}',
-            intermitent_fast: '{{data}} Intermittent Fasting',
-            fast_desc: '{{start_time}} hours fasting, {{end_time}} hours eating',
+            start_fast_time: '{{time}} 开始断食',
+            intermittent_fast: '{{data}} 间歇性断食',
+            fast_desc: '{{start_time}}小时断食, {{end_time}}小时进食',
             step_2_title: '设置起床时间',
             end_sleep_picker_header: '您想几点起床?',
             fall_sleep_picker_header: '您平时多久入睡?',
@@ -139,15 +142,18 @@ export default {
             step_3_title: '睡眠日程推荐',
             sleep_suggest_header: '{{time}} 起床感觉清爽, 为你推荐以下就寝时间:',
             sleep_suggest_footer:'睡个好觉需要 5-6 个完整睡眠周期, 每个睡眠周期平均90分钟。',
-            cycles: '{{times}} sleep cycles',
-            go_to_bed_at: 'Go to bed at {{time}}',
-            restorative: 'Restorative',
+            cycles: '{{times}}个睡眠周期',
+            go_to_bed_at: '{{time}} 上床睡觉',
+            restorative: '滋养',
             suggest_plan: '推荐日程',
             set_myself: '自己设置',
-            popular: 'Popular',
-            recent: 'Recent',
+            popular: '热门',
+            recent: '最近',
             btn:'推荐日程',
-            done:'完成'
+            done:'完成',
+            hour:'小时',
+            hours2:'小时',
+            minute:'分钟',
         },
         set_goal: {
             set_action_plan: '设置日程',
@@ -160,7 +166,8 @@ export default {
             go_to_bed:'就寝',
             wake_up:'起床',
             end_fasting:'结束断食',
-            done:'完成'
+            done:'完成',
+            next_day: '次日 ',
         },
 
         check_access: {
@@ -171,10 +178,10 @@ export default {
             },
             gain_access:{
                 title:'高级功能已解锁',
-                desc:'{{reason}}您可解锁“断食与睡眠”功能。\n现在要升级体验吗?',
+                desc:'{{reason}}您已解锁“断食与睡眠”功能。\n现在要启用高级功能吗?',
                 // desc:'You\'ve unlocked \'Fasting with Sleep\' since you\'re on a {{day}}-day streak.\nAre you ready to up the game?',
-                upgrade:'升级到"断食与睡眠"',
-                upgrade_desc:'即将到期 {{time}}',
+                upgrade:'启用"断食与睡眠"',
+                upgrade_desc:'{{time}} 后失效',
                 stay_btn:'保持仅断食',
                 reason:'因您已连续{{day}}天完成断食记录,',
                 // more:'Learn more'
@@ -198,7 +205,7 @@ export default {
             },
             lose_access:{
                 title:'高级权限已失效',
-                desc:'{{reason}} 您失去了"断食与睡眠"的体验资格。下次完成断食记录后满足连续纪录达{{require_days}}天, 即可重获资格。',
+                desc:'{{reason}} 您失去了"断食与睡眠"的体验资格。下次完成断食打卡并连续{{require_days}}天, 即可重获资格。',
                 btn:'我知道了'
                 // confirm:'Become a PRO member',
                 // cancel:'Achieve New Fasting Streak'
@@ -206,9 +213,9 @@ export default {
             lost_reason:{
                 fast_streak_lost:'因断食连续天数已中断,',
                 sleep_streak_lost:'因睡眠连续天数已中断,',
-                fast_sleep_streaks_lost:'因断食和睡眠连续天数均已中断,',
-                sleep_streak_not_growing:'因睡眠连续天数未增长,',
-                not_satisfied_after_delete:'因断食连续天数现已低于{{day}},',
+                fast_sleep_streaks_lost:'因断食和睡眠连续打卡中断,',
+                sleep_streak_not_growing:'因未启用睡眠打卡记录,',
+                not_satisfied_after_delete:'因断食连续打卡不足{{day}}天,',
                 // fast_streak_lost:'since you lost your fasting streak on {{date}}',
                 // sleep_streak_lost:'since you lost your sleep streak on {{date}}',
                 // fast_sleep_streaks_lost:'since you lost both of your fasting and sleep streaks on {{date}}',
@@ -487,7 +494,7 @@ export default {
                 countdown_sleep: '当前睡眠连续天数将在 {{time}} 后重置归零。',
                 last_reset:'上次归零',
                 next_reset:'下次归零',
-                not_determined: '未确定',
+                not_determined: '定',
                 faststreak:'断食连续',
                 sleepstreak:'睡眠连续',
                 alert_title:'开启睡眠连续纪录',

+ 9 - 78
src/features/trackTimeDuration/components/CheckAccess.tsx

@@ -69,17 +69,11 @@ export default function CheckAccess(props: { record: any, count: number }) {
                     if (global.indexPageRefresh) {
                         global.indexPageRefresh()
                     }
-                    if (global.refreshStreaks){
-                        global.refreshStreaks()
-                    }
                 }
                 if (sleep_expire && new Date().getTime() > sleep_expire && obj.current_record.status == 'WAIT_FOR_START') {
                     if (global.indexPageRefresh) {
                         global.indexPageRefresh()
                     }
-                    if (global.refreshStreaks){
-                        global.refreshStreaks()
-                    }
                 }
 
             }
@@ -126,6 +120,8 @@ export default function CheckAccess(props: { record: any, count: number }) {
 
         global.chooseMixed = () => {
             setChooseMixedSuccess(true)
+            setShowFastAlert(false)
+            setKeepContent(false)
         }
         global.checkAccess = (acccessData: any) => {
             const currentStatus = acccessData.current.qualification.status
@@ -166,7 +162,7 @@ export default function CheckAccess(props: { record: any, count: number }) {
                 Taro.setStorage({ key: 'showedDisqualifiedAlert', data: false })
                 var expire = acccessData.current.qualification.fast_expire
                 setShowFastAlert(true)
-                setKeepContent(false)
+                setKeepContent(true)
                 setAlertTitle(t('feature.check_access.gain_access.title'))
                 setAlertContent(t('feature.check_access.gain_access.desc', { reason: reason }))
                 setShowCancel(true)
@@ -231,6 +227,7 @@ export default function CheckAccess(props: { record: any, count: number }) {
     }, [])
 
     function upgradeSuccess() {
+        setShowFastAlert(false)
     //     var expire = access.current.qualification.fast_expire
     //     setShowFastAlert(true)
     //     setKeepContent(false)
@@ -266,6 +263,7 @@ export default function CheckAccess(props: { record: any, count: number }) {
             dt = sleep_expire
         }
         var date = TimeFormatter.getMonthAndDayByTimestamp(dt, true)
+        var day_unit = Math.max(condition.streak_fast_min_required-1,1)==1?'day':'days';
 
         switch (trigger_event) {
             case 'FAST_STREAK_LOST':
@@ -281,7 +279,7 @@ export default function CheckAccess(props: { record: any, count: number }) {
                 desc = t('feature.check_access.lost_reason.sleep_streak_not_growing');
                 break;
             case 'NOT_SATISFIED_AFTER_DELETE':
-                desc = t('feature.check_access.lost_reason.not_satisfied_after_delete',{day:condition.streak_fast_min_required});
+                desc = t('feature.check_access.lost_reason.not_satisfied_after_delete',{day:Math.max(condition.streak_fast_min_required-1,1),day_unit:day_unit});
                 break;
             case 'NA':
             default:
@@ -471,6 +469,8 @@ export default function CheckAccess(props: { record: any, count: number }) {
                         <Text style={{ color: '#fff', fontSize: 12 }}>current status:{props.record.access.current.qualification.status}</Text>
                         <Text style={{ color: '#fff', fontSize: 12 }}>previous status:{props.record.access.previous.qualification.status}</Text>
                         <Text style={{ color: '#fff', fontSize: 12 }}>trigger event:{props.record.access.current.qualification.trigger_event}</Text>
+                        <Text style={{ color: '#fff', fontSize: 12 }}>lost_access_total:{props.record.access.current.qualification.condition.lost_access_total}</Text>
+                        <Text style={{ color: '#fff', fontSize: 12 }}>streak_fast_min_required:{props.record.access.current.qualification.condition.streak_fast_min_required}</Text>
                     </View>
                 }
 
@@ -491,73 +491,4 @@ export default function CheckAccess(props: { record: any, count: number }) {
             </Modal>
         }
     </View>
-}
-
-// export const checkAccessProvisional = (acccessData: any, showFastAlert: any) => {
-//     debugger
-
-//     const currentStatus = acccessData.current.qualification.status
-//     const preStatus = acccessData.previous.qualification.status
-
-//     function upgrade() {
-//         showAlert({
-//             title: 'Congrats on Your PRO Status!',
-//             content: `To preserve this status, continue your fasting streak in 倒计时 and begin your sleep streak. Remember to keep both of them going.`,
-//             showCancel: false,
-//             confirmText: 'Got it!',
-//         })
-//     }
-
-//     if (preStatus == 'NOT_QUALIFIED' && currentStatus == 'NOT_QUALIFIED') {
-//         debugger
-//         const { streak_fast_current } = acccessData.current.qualification.condition
-//         showFastAlert({
-//             title: 'hello world'
-//         })
-//         // showAlert({
-//         //     title: 'Well Done',
-//         //     content: `You're on a ${streak_fast_current}-day streak.
-//         //         Two more days until unlocking 'Fasting with sleep.'`,
-//         //     showCancel: false,
-//         //     confirmText: 'Got it!',
-//         // })
-//         return;
-//     }
-//     else if (preStatus == 'NOT_QUALIFIED' && currentStatus == 'PROVISIONAL_QUALIFIED') {
-//         showAlert({
-//             title: 'Premium Access Unlocked',
-//             content: `You've unlocked 'Fasting with Sleep' since you're on a x-day streak.
-//             Are you ready to up the game?`,
-//             showCancel: true,
-//             cancelText: 'Stay',
-//             confirmText: 'Upgrade',
-//             confirm: upgrade
-//         })
-//         return;
-//     }
-//     else if (preStatus == 'PROVISIONAL_QUALIFIED' && currentStatus == 'PROVISIONAL_QUALIFIED') {
-//         const { streak_fast_current, streak_sleep_current } = acccessData.current.qualification.condition
-//         showAlert({
-//             title: 'Well Done',
-//             content: `You're on a ${streak_fast_current}-day fasting streak${streak_sleep_current > 0 ? ' and a ' + streak_sleep_current + '-day sleep streak' : ''}.
-//             Keep 'em going to stay in the game.'`,
-//             showCancel: false,
-//             confirmText: 'Got it!',
-//         })
-//         return;
-//     }
-//     else if (preStatus == 'PROVISIONAL_QUALIFIED' && currentStatus == 'NOT_QUALIFIED') {
-//         showFastAlert({
-//             title: 'hello world2'
-//         })
-//         // showAlert({
-//         //     title: 'Premium Access Lost',
-//         //     content: `You've lost premium access to the 'Fasting with Sleep' feature
-//         //     since you lost your fasting streak. To regain access, become a PRO or achieve a new 3-day fasting streak.`,
-//         //     showCancel: true,
-//         //     cancelText:'Achieve',
-//         //     confirmText: 'Become',
-//         // })
-//         return;
-//     }
-// }
+}

+ 3 - 0
src/features/trackTimeDuration/components/ClockHeader.tsx

@@ -229,6 +229,9 @@ export default function ClockHeader(props: { homeData: any }) {
                 ...params
             }, (currentRecord as any).id).then(res => {
                 global.indexPageRefresh()
+                if (global.refreshStreaks){
+                    global.refreshStreaks()
+                }
             }).catch(e => {
 
             })

+ 0 - 1
src/features/trackTimeDuration/components/SetSchedule.rn.tsx

@@ -276,7 +276,6 @@ export default function Component() {
                 global.indexPageRefresh()
             }
 
-
             // if (process.env.TARO_ENV == 'weapp') {
             //     Taro.navigateBack({ delta: 4 })
             // }

+ 5 - 2
src/features/trackTimeDuration/components/StreakItem.tsx

@@ -90,10 +90,13 @@ export default function StreakItem(props: { isFast: boolean, data: any }) {
 
             var date = new Date(ts)
             var time = TimeFormatter.padZero(date.getHours()) + ':' + TimeFormatter.padZero(date.getMinutes())
-            if (TimeFormatter.dateDescription(ts, false) == 'Today') {
+            if (TimeFormatter.dateDescription(ts, true) == 'Today') {
                 return 'Tonight ' + time
             }
-            return TimeFormatter.dateDescription(ts, false) + ' ' + time
+            if (TimeFormatter.dateDescription(ts, true) == '今天') {
+                return '今晚 ' + time
+            }
+            return TimeFormatter.dateDescription(ts, true) + ' ' + time
    
     }
 

+ 1 - 0
src/pages/clock/ChooseScenario.scss

@@ -165,6 +165,7 @@
     line-height: 24px;
     color: #fff;
     opacity: 0.2;
+    margin-top: 5px;
 }
 
 .suggest_choose {

+ 16 - 9
src/pages/clock/ChooseScenario.tsx

@@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
 import { ChooseScenarioBtn } from "@/features/common/SpecBtns";
 import { ColorType } from "@/context/themes/color";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
-import { getPlans } from "@/services/trackTimeDuration";
+import { getClocks, getPlans } from "@/services/trackTimeDuration";
 import { chooseMode, initTarget, updateStep } from "@/store/set_target";
 import { useDispatch, useSelector } from "react-redux";
 import { useDidShow, useRouter } from "@tarojs/taro";
@@ -15,6 +15,7 @@ import { rpxToPx, vibrate } from "@/utils/tools";
 import { IconCheck } from "@/components/basic/Icons";
 import Rings2, { BgRing, RingCommon, TargetRing } from '@/features/trackTimeDuration/components/Rings';
 import { useTranslation } from "react-i18next";
+import showAlert from "@/components/basic/Alert";
 
 
 let LinearGradient
@@ -23,8 +24,9 @@ if (process.env.TARO_ENV == 'rn') {
 }
 
 export default function ChooseScenario() {
-    const [selected, setSelected] = useState(0);
+    const [selected, setSelected] = useState(-1);
     const ring = useSelector((state: any) => state.ring);
+    const [access,setAccess] = useState<any>(null);
     const { t } = useTranslation();
     const [count, setCount] = useState(0)
     const dispatch = useDispatch();
@@ -43,6 +45,10 @@ export default function ChooseScenario() {
     }
 
     useEffect(() => {
+        getClocks().then(res => {
+            setSelected((res as any).current_record.scenario == 'FAST_SLEEP' ? 1 : 0)
+            setAccess((res as any).access)
+        })
         getPlans().then(res => {
             const data = res as { scenarios: any[] };
             console.log(data)
@@ -79,14 +85,15 @@ export default function ChooseScenario() {
     }
 
     function chooseType(index: number) {
-        var obj = global.homeData;
-        if (obj.access.current.qualification.status != "PROVISIONAL_QUALIFIED" && index == 1) {
-            Taro.showToast({
-                title: '暂无权限',
-                icon: 'none'
-
+        const {qualification} = access.current
+        if (qualification.status != "PROVISIONAL_QUALIFIED" && index == 1) {
+            const {streak_fast_min_required} = qualification.condition;
+            showAlert({
+                title: t('feature.choose_scenario.alert_title'),
+                content: t('feature.choose_scenario.alert_content',{day:streak_fast_min_required,day_unit:streak_fast_min_required==1?'day':'days'}),
+                showCancel: false,
+                confirmText: t('feature.choose_scenario.alert_btn'),
             })
-            vibrate()
             return;
         }
         setSelected(index)

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

@@ -237,7 +237,7 @@ export default function Page() {
                         title: (res as any).title,
                         content: (res as any).description,
                         showCancel: true,
-                        confirmText: '更新',
+                        confirmText: 'Update',
                         confirm: () => {
                             Linking.openURL((res as any).download_url)
                         }
@@ -248,7 +248,7 @@ export default function Page() {
                         title: (res as any).title,
                         content: (res as any).description,
                         showCancel: false,
-                        confirmText: '更新',
+                        confirmText: 'Update',
                         confirm: () => {
                             Linking.openURL((res as any).download_url)
                         }
@@ -258,16 +258,16 @@ export default function Page() {
             return;
         }
 
-        const showAlert1 = await getStorage('120alert') || false;
+        const showAlert1 = await getStorage('121alert') || false;
         if (!showAlert1) {
             showAlert({
-                title: '版本更新提示',
-                content: '「连续纪录」新增归零倒计时提示⏳\n别让连续记录终止, 将它们一直保持下去!',
+                title: '重要更新提示!',
+                content: '🔥 连续打卡天数, 现根据结束日期统计;\n 🪐 断食与睡眠, 升级为高级功能。\n连续打卡的老用户, 仍可继续使用。\n更多高级功能,\n如『进食窗口』显示、『社区排行』等功能,敬请期待!',
                 showCancel: false,
                 confirmText: '我知道了'
             })
         }
-        Taro.setStorage({ key: '120alert', data: true })
+        Taro.setStorage({ key: '121alert', data: true })
 
     }
 
@@ -536,11 +536,15 @@ export default function Page() {
     }
 
     global.indexPageRefresh = () => {
+        if (global.refreshStreaks){
+            global.refreshStreaks()
+        }
         getCheckData()
 
         if (global.swiperDayNightRefresh) {
             global.swiperDayNightRefresh()
         }
+        
     }
 
     global.showIndexModal = (isShow: boolean, detail: any, debugNode?: any) => {

+ 4 - 3
src/pages/clock/SetGoal.tsx

@@ -293,6 +293,7 @@ export default function SetGoal() {
                 global.indexPageRefresh()
             }
 
+
             if (process.env.TARO_ENV === 'rn') {
                 popRNAlert()
             }
@@ -516,7 +517,7 @@ export default function SetGoal() {
                         setShowTimePicker(true)
                     }}>
                         <Text className="cell_title">{t('feature.set_goal.go_to_bed')}</Text>
-                        <Text className="cell_value" style={{ color: ColorType.sleep }}>{isNextDay(false, true) ? '次日 ' : ' '}{sleepTarget.start_time}</Text>
+                        <Text className="cell_value" style={{ color: ColorType.sleep }}>{isNextDay(false, true) ? t('feature.set_goal.next_day') : ' '}{sleepTarget.start_time}</Text>
                         <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
                         <View className="cell_line" style={{ height: 1 }} />
                     </View>
@@ -534,7 +535,7 @@ export default function SetGoal() {
                     }}>
                         <Text className="cell_title">{t('feature.set_goal.wake_up')}</Text>
 
-                        <Text className="cell_value" style={{ color: ColorType.sleep }}>{isNextDay(false, false) ? '次日 ' : ' '}{sleepTarget.end_time}</Text>
+                        <Text className="cell_value" style={{ color: ColorType.sleep }}>{isNextDay(false, false) ? t('feature.set_goal.next_day') : ' '}{sleepTarget.end_time}</Text>
                         <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
                     </View>
                 }
@@ -550,7 +551,7 @@ export default function SetGoal() {
                 }}>
                     <Text className="cell_title">{t('feature.set_goal.end_fasting')}</Text>
 
-                    <Text className="cell_value" style={{ color: ColorType.fast }}>{isNextDay(true, false) ? '次日 ' : ' '}{fastTarget.end_time}</Text>
+                    <Text className="cell_value" style={{ color: ColorType.fast }}>{isNextDay(true, false) ? t('feature.set_goal.next_day') : ' '}{fastTarget.end_time}</Text>
                     <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
                 </View>
             </View>

+ 2 - 2
src/pages/clock/StreakDetail.tsx

@@ -102,7 +102,7 @@ export default function StreakDetail() {
         var second = ''
         if (intro.current && intro.current.date_scope && intro.current.date_scope) {
             var startStr = intro.current.date_scope.first_start_date + ''
-            var endStr = intro.current.date_scope.first_end_date + ''
+            var endStr = intro.current.date_scope.last_start_date + ''
             var startObj = dayjs(startStr.substring(0, 4) + '-' + startStr.substring(4, 6) + '-' + startStr.substring(6, 8))
             var endObj = dayjs(endStr.substring(0, 4) + '-' + endStr.substring(4, 6) + '-' + endStr.substring(6, 8))
             if (global.language == 'en') {
@@ -130,7 +130,7 @@ export default function StreakDetail() {
 
         if (intro.longest && intro.longest.date_scope && intro.longest.date_scope) {
             var startStr2 = intro.longest.date_scope.first_start_date + ''
-            var endStr2 = intro.longest.date_scope.first_end_date + ''
+            var endStr2 = intro.longest.date_scope.last_start_date + ''
             var startObj2 = dayjs(startStr2.substring(0, 4) + '-' + startStr2.substring(4, 6) + '-' + startStr2.substring(6, 8))
             var endObj2 = dayjs(endStr2.substring(0, 4) + '-' + endStr2.substring(4, 6) + '-' + endStr2.substring(6, 8))
             if (global.language == 'en') {

+ 15 - 5
src/pages/clock/Suggest.tsx

@@ -484,11 +484,11 @@ export default function Suggest() {
                         </View>
                         <View style={{ flex: 1 }}>
 
-                            <View className="suggest_item_title">{item.hours} hours</View>
+                            <View className="suggest_item_title">{item.hours}{t('feature.suggest.hour')}</View>
 
                             <View className="suggest_item_desc">{index == suggestIndex ?
                                 t('feature.suggest.fast_desc', { start_time: item.hours, end_time: item.left }) :
-                                t('feature.suggest.intermitent_fast', { data: `${item.hours}/${item.left}` })
+                                t('feature.suggest.intermittent_fast', { data: `${item.hours}/${item.left}` })
                             }</View>
                             {
                                 index == suggestIndex &&
@@ -577,8 +577,8 @@ export default function Suggest() {
                         </View>
                         <View>
 
-                            <View className="suggest_item_title">{item.hours} hrs {item.minutes} mins</View>
-                            <View className="suggest_item_desc">{item.number} sleep cycles</View>
+                            <View className="suggest_item_title">{item.hours}{t('feature.suggest.hours2')}{item.minutes>0&&item.minutes+t('feature.suggest.minute')}</View>
+                            <View className="suggest_item_desc">{t('feature.suggest.cycles',{times:item.number})}</View>
                             {
                                 index == suggestIndex && <View className="suggest_choose">
                                     <View style={{ color: ColorType.sleep }}>{t('feature.suggest.go_to_bed_at', { time: item.time })}</View>
@@ -624,6 +624,16 @@ export default function Suggest() {
         </View>
     }
 
+    function btnText(){
+        if (pageStep == 3){
+            return t('feature.suggest.done')
+        }
+        if (pageStep == 1 && !target.isMixed){
+            return t('feature.suggest.done')
+        }
+        return t('feature.suggest.btn')
+    }
+
 
     return <View style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>
         <Text className="target_title">{suggestTitle()}</Text>
@@ -636,7 +646,7 @@ export default function Suggest() {
             <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>
                 <ChooseScenarioBtn
                     onClick={next}
-                    title={pageStep == 0 || pageStep == 2 ? t('feature.suggest.btn') : t('feature.suggest.done')}
+                    title={btnText()}
                     background={pageStep < 2 ? ColorType.fast : ColorType.sleep}
                 />
                 <Text className="suggest_footer_btn" onClick={myself}>{t('feature.suggest.set_myself')}</Text>

+ 1 - 0
src/pages/common/RecordsHistory.tsx

@@ -326,6 +326,7 @@ export default function Page() {
                 if (global.indexPageRefresh) {
                     global.indexPageRefresh()
                 }
+ 
                 // global.refreshTime()
                 // global.refreshMetric()
                 // Taro.getCurrentPages()[0].refresh()

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov