|
|
@@ -16,7 +16,7 @@ import { useTranslation } from "react-i18next";
|
|
|
import ConsoleCell from "./console_cell";
|
|
|
import StatusIndicator, { StatusType } from "../base/status_indicator";
|
|
|
|
|
|
-export default function FastSleepConsole(props: { step: number, data: any, del: any,showDetail:any }) {
|
|
|
+export default function FastSleepConsole(props: { step: number, data: any, del: any, showDetail: any }) {
|
|
|
const health = useSelector((state: any) => state.health);
|
|
|
let navigation, showActionSheetWithOptions;
|
|
|
const { t } = useTranslation()
|
|
|
@@ -172,7 +172,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
if (finish) {
|
|
|
return <Image style={{ width: rpxToPx(24), height: rpxToPx(24) }} src={require('@assets/_health/checked.png')} />
|
|
|
}
|
|
|
- return <IconCircle width={rpxToPx(32)} color={MainColorType.g02}/>
|
|
|
+ return <IconCircle width={rpxToPx(32)} color={MainColorType.g02} />
|
|
|
// return <View style={{ width: rpxToPx(26), height: rpxToPx(26), borderRadius: rpxToPx(13), backgroundColor: '#fff' }} />
|
|
|
// if (item.timeline.reminder) {
|
|
|
// return <IconNotification color="#fff" width={rpxToPx(24)} />
|
|
|
@@ -221,7 +221,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
}
|
|
|
|
|
|
|
|
|
- function timelineItem(item: any, index: number, count: number,fullLine:boolean) {
|
|
|
+ function timelineItem(item: any, index: number, count: number, fullLine: boolean) {
|
|
|
const { fast, sleep, status } = props.data
|
|
|
var showBtn = true;
|
|
|
var time = ''
|
|
|
@@ -286,7 +286,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
}
|
|
|
|
|
|
function rightView() {
|
|
|
- if (index==2 && status=='OG3') return null
|
|
|
+ if (index == 2 && status == 'OG3') return null
|
|
|
if (isError) {
|
|
|
return <View style={{
|
|
|
borderColor: MainColorType.error,
|
|
|
@@ -317,8 +317,8 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
|
|
|
}
|
|
|
return <NewButton
|
|
|
- color={item.timeline.target.timestamp >= new Date().getTime() ? MainColorType.g02 : getThemeColor(item.mode)}
|
|
|
- type={item.timeline.target.timestamp >= new Date().getTime() ? NewButtonType.alpha2 : NewButtonType.alpha}
|
|
|
+ color={(item.timeline.target.timestamp >= new Date().getTime() || status == 'OG2_MISALIGNED') ? MainColorType.g02 : getThemeColor(item.mode)}
|
|
|
+ type={(item.timeline.target.timestamp >= new Date().getTime() || status == 'OG2_MISALIGNED') ? NewButtonType.alpha2 : NewButtonType.alpha}
|
|
|
title={t('health.log')}
|
|
|
width={rpxToPx(128)}
|
|
|
height={rpxToPx(72)}
|
|
|
@@ -370,9 +370,9 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
return <ConsoleCell
|
|
|
status={
|
|
|
<StatusIndicator type={StatusType.console}
|
|
|
- color={isError ? MainColorType.error : getIconColor(index, finish)==MainColorType.g02?'transparent':getIconColor(index, finish)}
|
|
|
- fontColor={isError ? MainColorType.error : getIconColor(index, finish)==MainColorType.g02?MainColorType.g01:getIconColor(index, finish)}
|
|
|
- bold={getIconColor(index, finish)!=MainColorType.g02}
|
|
|
+ color={isError ? MainColorType.error : getIconColor(index, finish) == MainColorType.g02 ? 'transparent' : getIconColor(index, finish)}
|
|
|
+ fontColor={isError ? MainColorType.error : getIconColor(index, finish) == MainColorType.g02 ? MainColorType.g01 : getIconColor(index, finish)}
|
|
|
+ bold={getIconColor(index, finish) != MainColorType.g02}
|
|
|
fontSize={rpxToPx(24)}
|
|
|
text={time}
|
|
|
>{
|
|
|
@@ -408,8 +408,8 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
action: props.data.fast.timeline[0].action,
|
|
|
moment: props.data.fast.timeline[0].moment,
|
|
|
timeline: props.data.fast.timeline[0],
|
|
|
-
|
|
|
- }, 0, 4,false)
|
|
|
+
|
|
|
+ }, 0, 4, false)
|
|
|
}
|
|
|
{
|
|
|
props.step != 3 && timelineItem({
|
|
|
@@ -419,7 +419,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
action: props.data.fast.timeline[0].action,
|
|
|
moment: props.data.sleep.timeline[0].moment,
|
|
|
timeline: props.data.sleep.timeline[0]
|
|
|
- }, 1, 4,props.step==1)
|
|
|
+ }, 1, 4, props.step == 1)
|
|
|
}
|
|
|
{
|
|
|
props.step != 1 && timelineItem({
|
|
|
@@ -428,7 +428,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
is_start: false,
|
|
|
moment: props.data.sleep.timeline[1].moment,
|
|
|
timeline: props.data.sleep.timeline[1]
|
|
|
- }, 2, 4,props.step==2)
|
|
|
+ }, 2, 4, props.step == 2)
|
|
|
}
|
|
|
{
|
|
|
props.step != 1 && props.step != 2 && timelineItem({
|
|
|
@@ -437,15 +437,18 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
is_start: false,
|
|
|
moment: props.data.fast.timeline[1].moment,
|
|
|
timeline: props.data.fast.timeline[1]
|
|
|
- }, 3, 4,true)
|
|
|
+ }, 3, 4, true)
|
|
|
}
|
|
|
{
|
|
|
<View className="main_console_footer">
|
|
|
- <NewButton
|
|
|
- type={NewButtonType.link}
|
|
|
- title={props.data.status=='WFS'?t('health.three_stages'):t('health.current_progress')}
|
|
|
- onClick={props.showDetail}
|
|
|
- />
|
|
|
+ {
|
|
|
+ props.data.status != 'OG2_MISALIGNED' && <NewButton
|
|
|
+ type={NewButtonType.link}
|
|
|
+ title={props.data.status == 'WFS' ? t('health.three_stages') : t('health.current_progress')}
|
|
|
+ onClick={props.showDetail}
|
|
|
+ />
|
|
|
+ }
|
|
|
+
|
|
|
<NewButton
|
|
|
btnStyle={{
|
|
|
position: 'absolute',
|