|
@@ -16,7 +16,7 @@ import { TimeFormatter } from "@/utils/time_format";
|
|
|
let min = 0
|
|
let min = 0
|
|
|
let max = 0
|
|
let max = 0
|
|
|
let defaultTimestamp = 0
|
|
let defaultTimestamp = 0
|
|
|
-export default function IndexConsoleMuti(props: { status: string, event: string, close: Function,scenario:string }) {
|
|
|
|
|
|
|
+export default function IndexConsoleMuti(props: { status: string, event: string, close: Function, scenario: string }) {
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
const isLoading = false;
|
|
const isLoading = false;
|
|
|
var color = ColorType.fast;
|
|
var color = ColorType.fast;
|
|
@@ -170,14 +170,15 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
|
|
|
global.scrollToLatest()
|
|
global.scrollToLatest()
|
|
|
global.refrehWeekly()
|
|
global.refrehWeekly()
|
|
|
global.refreshStreaks()
|
|
global.refreshStreaks()
|
|
|
- global.checkAccess((res as any).access)
|
|
|
|
|
|
|
+ if (props.event == 'end_fast')
|
|
|
|
|
+ global.checkAccess((res as any).access)
|
|
|
|
|
|
|
|
cancel()
|
|
cancel()
|
|
|
}).catch(e => {
|
|
}).catch(e => {
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
function tapItem(index: number) {
|
|
function tapItem(index: number) {
|
|
|
setShowPicker(true);
|
|
setShowPicker(true);
|
|
|
switch (index) {
|
|
switch (index) {
|
|
@@ -200,7 +201,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
|
|
|
return <View className="new_item_cell" onClick={() => tapItem(0)}>
|
|
return <View className="new_item_cell" onClick={() => tapItem(0)}>
|
|
|
<Text className="new_item_cell_title">{t('feature.track_time_duration.common.start_fast')}</Text>
|
|
<Text className="new_item_cell_title">{t('feature.track_time_duration.common.start_fast')}</Text>
|
|
|
<View style={{ flex: 1 }} />
|
|
<View style={{ flex: 1 }} />
|
|
|
- <Text className="new_item_cell_desc">{fastStart?TimeFormatter.dateTimeFormate(fastStart.time,true):'Pick Time'}</Text>
|
|
|
|
|
|
|
+ <Text className="new_item_cell_desc">{fastStart ? TimeFormatter.dateTimeFormate(fastStart.time, true) : 'Pick Time'}</Text>
|
|
|
<Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
|
|
<Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
@@ -209,7 +210,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
|
|
|
return <View className="new_item_cell" onClick={() => tapItem(1)}>
|
|
return <View className="new_item_cell" onClick={() => tapItem(1)}>
|
|
|
<Text className="new_item_cell_title">{t('feature.track_time_duration.common.start_sleep')}</Text>
|
|
<Text className="new_item_cell_title">{t('feature.track_time_duration.common.start_sleep')}</Text>
|
|
|
<View style={{ flex: 1 }} />
|
|
<View style={{ flex: 1 }} />
|
|
|
- <Text className="new_item_cell_desc">{sleepStart?TimeFormatter.dateTimeFormate(sleepStart.time,true):'Pick Time'}</Text>
|
|
|
|
|
|
|
+ <Text className="new_item_cell_desc">{sleepStart ? TimeFormatter.dateTimeFormate(sleepStart.time, true) : 'Pick Time'}</Text>
|
|
|
<Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
|
|
<Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
@@ -218,7 +219,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
|
|
|
return <View className="new_item_cell" onClick={() => tapItem(2)}>
|
|
return <View className="new_item_cell" onClick={() => tapItem(2)}>
|
|
|
<Text className="new_item_cell_title">{t('feature.track_time_duration.common.end_sleep')}</Text>
|
|
<Text className="new_item_cell_title">{t('feature.track_time_duration.common.end_sleep')}</Text>
|
|
|
<View style={{ flex: 1 }} />
|
|
<View style={{ flex: 1 }} />
|
|
|
- <Text className="new_item_cell_desc">{sleepEnd?TimeFormatter.dateTimeFormate(sleepEnd.time,true):'Pick Time'}</Text>
|
|
|
|
|
|
|
+ <Text className="new_item_cell_desc">{sleepEnd ? TimeFormatter.dateTimeFormate(sleepEnd.time, true) : 'Pick Time'}</Text>
|
|
|
<Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
|
|
<Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
@@ -227,7 +228,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
|
|
|
return <View className="new_item_cell" onClick={() => tapItem(3)}>
|
|
return <View className="new_item_cell" onClick={() => tapItem(3)}>
|
|
|
<Text className="new_item_cell_title">{t('feature.track_time_duration.common.end_fast')}</Text>
|
|
<Text className="new_item_cell_title">{t('feature.track_time_duration.common.end_fast')}</Text>
|
|
|
<View style={{ flex: 1 }} />
|
|
<View style={{ flex: 1 }} />
|
|
|
- <Text className="new_item_cell_desc">{fastEnd?TimeFormatter.dateTimeFormate(fastEnd.time,true):'Pick Time'}</Text>
|
|
|
|
|
|
|
+ <Text className="new_item_cell_desc">{fastEnd ? TimeFormatter.dateTimeFormate(fastEnd.time, true) : 'Pick Time'}</Text>
|
|
|
<Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
|
|
<Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
@@ -369,10 +370,10 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
|
|
|
props.event == 'end_fast' && props.status == 'WAIT_FOR_START' && startFastCell()
|
|
props.event == 'end_fast' && props.status == 'WAIT_FOR_START' && startFastCell()
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- props.event == 'end_fast' && props.scenario=='FAST_SLEEP' && (props.status == 'ONGOING1' || props.status == 'WAIT_FOR_START') && startSleepCell()
|
|
|
|
|
|
|
+ props.event == 'end_fast' && props.scenario == 'FAST_SLEEP' && (props.status == 'ONGOING1' || props.status == 'WAIT_FOR_START') && startSleepCell()
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- props.event == 'end_fast' && props.scenario=='FAST_SLEEP' && (props.status == 'ONGOING1' || props.status == 'ONGOING2' || props.status == 'WAIT_FOR_START') && endSleepCell()
|
|
|
|
|
|
|
+ props.event == 'end_fast' && props.scenario == 'FAST_SLEEP' && (props.status == 'ONGOING1' || props.status == 'ONGOING2' || props.status == 'WAIT_FOR_START') && endSleepCell()
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
props.event == 'end_fast' && endFastCell()
|
|
props.event == 'end_fast' && endFastCell()
|