|
|
@@ -91,7 +91,7 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
|
|
|
}
|
|
|
|
|
|
- function itemDisableStatus(index){
|
|
|
+ function itemDisableStatus(index) {
|
|
|
if (index == 0 && props.data.fast.status == 'OG') {
|
|
|
return false
|
|
|
}
|
|
|
@@ -126,6 +126,32 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
}
|
|
|
|
|
|
function getIconColor(index: number, finish: boolean) {
|
|
|
+ const { fast, sleep } = props.data
|
|
|
+ // if (new Date().getTime() <= fast.target.start_timestamp && health.fast_with_sleep.status == 'WFS') {
|
|
|
+ // return MainColorType.g03
|
|
|
+ // }
|
|
|
+ switch (index) {
|
|
|
+ case 0:
|
|
|
+ if (new Date().getTime() <= fast.target.start_timestamp) {
|
|
|
+ return MainColorType.g02
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case 1:
|
|
|
+ if (new Date().getTime() <= sleep.target.start_timestamp) {
|
|
|
+ return MainColorType.g02
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ if (new Date().getTime() <= sleep.target.end_timestamp) {
|
|
|
+ return MainColorType.g02
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case 3:
|
|
|
+ if (new Date().getTime() <= fast.target.end_timestamp) {
|
|
|
+ return MainColorType.g02
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
var color = MainColorType.g03
|
|
|
if (index == 1 || index == 2) {
|
|
|
color = MainColorType.sleep
|
|
|
@@ -133,9 +159,6 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
else {
|
|
|
color = MainColorType.fast
|
|
|
}
|
|
|
- if (finish) {
|
|
|
- color = MainColorType.g03
|
|
|
- }
|
|
|
return color;
|
|
|
}
|
|
|
|
|
|
@@ -146,10 +169,11 @@ 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')} />
|
|
|
}
|
|
|
- if (item.timeline.reminder) {
|
|
|
- return <IconNotification color="#fff" width={rpxToPx(24)} />
|
|
|
- }
|
|
|
- return <IconNotificationOff color="#fff" width={rpxToPx(24)} />
|
|
|
+ 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)} />
|
|
|
+ // }
|
|
|
+ // return <IconNotificationOff color="#fff" width={rpxToPx(24)} />
|
|
|
}
|
|
|
|
|
|
function actionList() {
|
|
|
@@ -278,17 +302,18 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
</View>
|
|
|
}
|
|
|
else {
|
|
|
- if (item.action == 'POST_MOMENT' && item.timeline.real)
|
|
|
- return <IconArrow color={MainColorType.g03} width={rpxToPx(34)} />
|
|
|
- if (item.moment && item.moment.media && item.moment.media.length > 0)
|
|
|
- return <Image
|
|
|
- src={item.moment.media[0].url}
|
|
|
- mode="aspectFill"
|
|
|
- className="console_item_img" />
|
|
|
- if (showBtn)
|
|
|
+ // let themeColor: any = getThemeColor(health.mode)
|
|
|
+ // if (item.target.timestamp >= new Date().getTime()) {
|
|
|
+ // themeColor = MainColorType.g02
|
|
|
+ // }
|
|
|
+ if (item.timeline.action && item.timeline.action != 'NA') {
|
|
|
+
|
|
|
+ if (item.timeline.action == 'POST_MOMENT') {
|
|
|
+ return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
|
|
|
+ }
|
|
|
return <NewButton
|
|
|
- color={getThemeColor(item.mode)}
|
|
|
- type={NewButtonType.alpha}
|
|
|
+ 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}
|
|
|
title={'Log'}
|
|
|
width={rpxToPx(128)}
|
|
|
height={rpxToPx(72)}
|
|
|
@@ -296,37 +321,57 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
onClick={() => {
|
|
|
tapLogBtn(index)
|
|
|
}} />
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.timeline.action && item.timeline.action == 'NA') {
|
|
|
+ // if (health.mode == 'FAST' || health.mode == 'SLEEP') {
|
|
|
+ if (item.moment && item.moment.media && item.moment.media.length > 0) {
|
|
|
+ return <Image
|
|
|
+ src={item.moment.media[0].url}
|
|
|
+ mode="aspectFill"
|
|
|
+ className="console_item_img" />
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
|
|
|
+ }
|
|
|
+
|
|
|
+ // }
|
|
|
+ }
|
|
|
+
|
|
|
+ return <View />
|
|
|
+ // if (item.timeline.action == 'POST_MOMENT'){
|
|
|
+ // return <IconArrow color={MainColorType.g03} width={rpxToPx(34)} />
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (item.moment && item.moment.media && item.moment.media.length > 0)
|
|
|
+ // return <Image
|
|
|
+ // src={item.moment.media[0].url}
|
|
|
+ // mode="aspectFill"
|
|
|
+ // className="console_item_img" />
|
|
|
+ // if (showBtn)
|
|
|
+ // return <NewButton
|
|
|
+ // color={item.timeline.target.timestamp >= new Date().getTime() ? MainColorType.link : getThemeColor(item.mode)}
|
|
|
+ // type={item.timeline.target.timestamp >= new Date().getTime() ? NewButtonType.alpha2 : NewButtonType.alpha}
|
|
|
+ // title={'Log'}
|
|
|
+ // width={rpxToPx(128)}
|
|
|
+ // height={rpxToPx(72)}
|
|
|
+ // bold={true}
|
|
|
+ // onClick={() => {
|
|
|
+ // tapLogBtn(index)
|
|
|
+ // }} />
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return <ConsoleCell
|
|
|
status={
|
|
|
- <StatusIndicator type={StatusType.console}
|
|
|
- color={isError ? MainColorType.error : getIconColor(index, finish)}
|
|
|
- fontColor={ isError ? MainColorType.error : MainColorType.g01 }
|
|
|
- fontSize={rpxToPx(24)}
|
|
|
- text={time}
|
|
|
- >{
|
|
|
- processIcon(item, finish, isError)
|
|
|
- }</StatusIndicator>
|
|
|
- // <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
|
- // <View style={{
|
|
|
- // flexShrink: 0,
|
|
|
- // width: rpxToPx(26),
|
|
|
- // height: rpxToPx(26),
|
|
|
- // borderRadius: rpxToPx(13),
|
|
|
- // marginRight: rpxToPx(8),
|
|
|
- // display: 'flex',
|
|
|
- // alignItems: 'center',
|
|
|
- // justifyContent: 'center',
|
|
|
- // backgroundColor: isError ? MainColorType.error : getIconColor(index, finish)
|
|
|
- // }}>
|
|
|
- // {
|
|
|
- // processIcon(item, finish, isError)
|
|
|
- // }
|
|
|
- // </View>
|
|
|
- // <Text className="timeline_time" style={{ color: isError ? MainColorType.error : MainColorType.g01 }}>{time}</Text>
|
|
|
- // </View>
|
|
|
+ <StatusIndicator type={StatusType.console}
|
|
|
+ color={isError ? MainColorType.error : getIconColor(index, finish)}
|
|
|
+ fontColor={isError ? MainColorType.error : MainColorType.g01}
|
|
|
+ fontSize={rpxToPx(24)}
|
|
|
+ text={time}
|
|
|
+ >{
|
|
|
+ processIcon(item, finish, isError)
|
|
|
+ }</StatusIndicator>
|
|
|
}
|
|
|
title={(item.moment && item.moment.title) ? item.moment.title : item.title}
|
|
|
description={hasDescription ? item.moment.description : null}
|
|
|
@@ -338,92 +383,6 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
|
|
|
showLine={true}
|
|
|
fullLine={count - 1 == index}
|
|
|
/>
|
|
|
- return <View key={index}
|
|
|
- className="timeline_item"
|
|
|
- onClick={() => {
|
|
|
- goDetail(index)
|
|
|
- }}>
|
|
|
- <View className="timeline_left">
|
|
|
- <View style={{
|
|
|
-
|
|
|
- height: hasDescription ? rpxToPx(28) : rpxToPx(36), flexShrink: 0
|
|
|
- }} />
|
|
|
- <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
|
- <View style={{
|
|
|
- flexShrink: 0,
|
|
|
- width: rpxToPx(26),
|
|
|
- height: rpxToPx(26),
|
|
|
- borderRadius: rpxToPx(13),
|
|
|
- marginRight: rpxToPx(8),
|
|
|
- display: 'flex',
|
|
|
- alignItems: 'center',
|
|
|
- justifyContent: 'center',
|
|
|
- backgroundColor: isError ? MainColorType.error : getIconColor(index, finish)
|
|
|
- }}>
|
|
|
- {
|
|
|
- processIcon(item, finish, isError)
|
|
|
- }
|
|
|
- </View>
|
|
|
- <Text className="timeline_time" style={{ color: isError ? MainColorType.error : MainColorType.g01 }}>{time}</Text>
|
|
|
- </View>
|
|
|
-
|
|
|
-
|
|
|
- <Text className="timeline_title"
|
|
|
- onClick={() => { }}>{(item.moment && item.moment.title) ? item.moment.title : item.title}</Text>
|
|
|
-
|
|
|
- {
|
|
|
- hasDescription && <Text className="timeline_desc">{item.moment.description}</Text>
|
|
|
- }
|
|
|
- <View style={{
|
|
|
- height: hasDescription ? rpxToPx(28) : rpxToPx(54), flexShrink: 0,
|
|
|
-
|
|
|
- }} />
|
|
|
-
|
|
|
- </View>
|
|
|
- <View style={{ flex: 1 }} />
|
|
|
-
|
|
|
- {
|
|
|
- !isError && item.moment && item.moment.media && item.moment.media.length > 0 && <Image
|
|
|
- src={item.moment.media[0].url}
|
|
|
- mode="aspectFill"
|
|
|
- className="console_item_img" />
|
|
|
- }
|
|
|
- {
|
|
|
- !isError && showBtn && <NewButton
|
|
|
- color={getThemeColor(item.mode)}
|
|
|
- type={NewButtonType.alpha}
|
|
|
- title={'Log'}
|
|
|
- width={rpxToPx(128)}
|
|
|
- height={rpxToPx(72)}
|
|
|
- bold={true}
|
|
|
- onClick={() => {
|
|
|
- tapLogBtn(index)
|
|
|
- }} />
|
|
|
- }
|
|
|
- {
|
|
|
- isError && <View style={{
|
|
|
- borderColor: MainColorType.error,
|
|
|
- borderWidth: rpxToPx(2),
|
|
|
- borderRadius: rpxToPx(76 / 4),
|
|
|
- borderStyle: 'solid'
|
|
|
- }}>
|
|
|
- <NewButton
|
|
|
- type={NewButtonType.gray}
|
|
|
- title='Correct'
|
|
|
- fontSize={rpxToPx(34)}
|
|
|
- width={rpxToPx(128)}
|
|
|
- height={rpxToPx(72)}
|
|
|
- onClick={() => {
|
|
|
- jumpPage(`/_health/pages/log_time?is_fast_with_sleep=1&index=${1}&single=0&initCheck=1&initIndex=${index}`)
|
|
|
- }}
|
|
|
- />
|
|
|
- </View>
|
|
|
- }
|
|
|
- {
|
|
|
- !isError && item.action == 'POST_MOMENT' && item.timeline.real && <IconArrow color={MainColorType.g03} width={rpxToPx(34)} />
|
|
|
- }
|
|
|
- <View className="seperate_line" style={{ left: count - 1 == index ? -rpxToPx(52) : rpxToPx(52) }} />
|
|
|
- </View>
|
|
|
}
|
|
|
|
|
|
return <View style={{ backgroundColor: '#fff' }}>
|