|
@@ -38,6 +38,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
const [operateType, setOperateType] = useState('')
|
|
const [operateType, setOperateType] = useState('')
|
|
|
const [btnDisable, setBtnDisable] = useState(false)
|
|
const [btnDisable, setBtnDisable] = useState(false)
|
|
|
const [selItem, setSelItem] = useState<any>(null)
|
|
const [selItem, setSelItem] = useState<any>(null)
|
|
|
|
|
+
|
|
|
const limitPickerRef = useRef(null)
|
|
const limitPickerRef = useRef(null)
|
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
|
|
|
|
@@ -98,6 +99,28 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
setShowTimePicker(true)
|
|
setShowTimePicker(true)
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
|
|
|
+ case 'MARK_DONE':
|
|
|
|
|
+ {
|
|
|
|
|
+ setBtnDisable(true)
|
|
|
|
|
+ clockTimes({
|
|
|
|
|
+ check_items: [{
|
|
|
|
|
+ schedule_id: item.schedule_id,
|
|
|
|
|
+ date: dayjs().format('YYYYMMDD'),
|
|
|
|
|
+ timestamp: new Date().getTime()
|
|
|
|
|
+ }]
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ // dispatch(setShowActionTip({
|
|
|
|
|
+ // isShow: true,
|
|
|
|
|
+ // isCompleted: (selItem.event == 'FAST_END' || selItem.event == 'SLEEP_WAKE_UP')
|
|
|
|
|
+ // }))
|
|
|
|
|
+ // setBtnDisable(false)
|
|
|
|
|
+ // setShowTimePicker(false)
|
|
|
|
|
+ global.refreshWindow()
|
|
|
|
|
+ global.refreshHistory()
|
|
|
|
|
+ }).catch(e => {
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
jumpPage('/_health/pages/add_moment?moment=' + JSON.stringify(item))
|
|
jumpPage('/_health/pages/add_moment?moment=' + JSON.stringify(item))
|
|
@@ -108,6 +131,8 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
case 'START':
|
|
case 'START':
|
|
|
case 'END':
|
|
case 'END':
|
|
|
return '打卡'
|
|
return '打卡'
|
|
|
|
|
+ case 'MARK_DONE':
|
|
|
|
|
+ return 'Action'
|
|
|
}
|
|
}
|
|
|
return '记录'
|
|
return '记录'
|
|
|
}
|
|
}
|
|
@@ -136,10 +161,24 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
return <View />
|
|
return <View />
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function tapTimeline(item,inex){
|
|
|
|
|
+ if (health.mode == 'DAY'||health.mode =='NIGHT'){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!user.isLogin) {
|
|
|
|
|
+ jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!item.event_id){
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ jumpPage(`/_health/pages/timeline_detail?event_id=${item.event_id}&schedule_id=${item.schedule_id}`)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function timelineItem(item: any, index: number, count: number) {
|
|
function timelineItem(item: any, index: number, count: number) {
|
|
|
- return <View key={index} className="timeline_item" >
|
|
|
|
|
|
|
+ return <View key={index} className="timeline_item" onClick={()=>tapTimeline(item,index)}>
|
|
|
<View className="timeline_left">
|
|
<View className="timeline_left">
|
|
|
- <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center',height:rpxToPx(28) }}>
|
|
|
|
|
|
|
+ <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', height: rpxToPx(28) }}>
|
|
|
{
|
|
{
|
|
|
!item.reminder && <Image src={require('@assets/images/notification_off.png')} className='notification_icon' />
|
|
!item.reminder && <Image src={require('@assets/images/notification_off.png')} className='notification_icon' />
|
|
|
}
|
|
}
|
|
@@ -147,11 +186,11 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
|
|
|
|
|
- <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center',marginTop:rpxToPx(5) }}>
|
|
|
|
|
|
|
+ <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', marginTop: rpxToPx(5) }}>
|
|
|
<Text className="timeline_time" onClick={() => edit(item)}>{item.title}</Text>
|
|
<Text className="timeline_time" onClick={() => edit(item)}>{item.title}</Text>
|
|
|
</View>
|
|
</View>
|
|
|
{
|
|
{
|
|
|
- (item.moment && item.moment.description) ? <Text className="timeline_desc">{item.moment.description}</Text>:<View className="timeline_thirdspace"/>
|
|
|
|
|
|
|
+ (item.moment && item.moment.description) ? <Text className="timeline_desc">{item.moment.description}</Text> : <View className="timeline_thirdspace" />
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</View>
|
|
</View>
|
|
@@ -360,7 +399,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
list.push('编辑日程列表')
|
|
list.push('编辑日程列表')
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case 'EAT':
|
|
case 'EAT':
|
|
@@ -409,7 +448,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
switch (health.mode) {
|
|
switch (health.mode) {
|
|
|
case 'DAY':
|
|
case 'DAY':
|
|
|
case 'NIGHT':
|
|
case 'NIGHT':
|
|
|
- jumpPage('/_health/pages/schedules_list?mode='+health.mode)
|
|
|
|
|
|
|
+ jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
|
|
|
break;
|
|
break;
|
|
|
case 'FAST':
|
|
case 'FAST':
|
|
|
case 'SLEEP':
|
|
case 'SLEEP':
|
|
@@ -420,7 +459,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
setDurationPicker(true)
|
|
setDurationPicker(true)
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- jumpPage('/_health/pages/schedules_list?mode='+health.mode)
|
|
|
|
|
|
|
+ jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
@@ -437,14 +476,14 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
{
|
|
{
|
|
|
switch (health.mode) {
|
|
switch (health.mode) {
|
|
|
case 'EAT':
|
|
case 'EAT':
|
|
|
- jumpPage('/_health/pages/schedules_list?mode='+health.mode)
|
|
|
|
|
|
|
+ jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
|
|
|
break;
|
|
break;
|
|
|
case 'FAST':
|
|
case 'FAST':
|
|
|
case 'SLEEP':
|
|
case 'SLEEP':
|
|
|
const obj = getScenario(health.windows, health.mode)
|
|
const obj = getScenario(health.windows, health.mode)
|
|
|
if (obj.window_id) {
|
|
if (obj.window_id) {
|
|
|
//del record
|
|
//del record
|
|
|
- jumpPage('/_health/pages/schedules_list?mode='+health.mode)
|
|
|
|
|
|
|
+ jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
|
|
|
console.log('zzzzzzzzz')
|
|
console.log('zzzzzzzzz')
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
@@ -452,7 +491,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case 'ACTIVE':
|
|
case 'ACTIVE':
|
|
|
- jumpPage('/_health/pages/schedules_list?mode='+health.mode)
|
|
|
|
|
|
|
+ jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -615,8 +654,8 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function timePointClass(){
|
|
|
|
|
- if (getWindowStatus(health.windows, health.mode) == WindowStatusType.process){
|
|
|
|
|
|
|
+ function timePointClass() {
|
|
|
|
|
+ if (getWindowStatus(health.windows, health.mode) == WindowStatusType.process) {
|
|
|
return 'time_point time_point_animation'
|
|
return 'time_point time_point_animation'
|
|
|
}
|
|
}
|
|
|
return 'time_point'
|
|
return 'time_point'
|
|
@@ -626,8 +665,8 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
<View className="main_summary">
|
|
<View className="main_summary">
|
|
|
{/* <View className="main_summary_status" style={{ color: getThemeColor(health.mode) }}>{windowStatus()}</View> */}
|
|
{/* <View className="main_summary_status" style={{ color: getThemeColor(health.mode) }}>{windowStatus()}</View> */}
|
|
|
<View className="main_summary_time" style={{ color: getWindowStatus(health.windows, health.mode) == WindowStatusType.upcoming ? '#B2B2B2' : '#000' }}>{getCountownTime(health.windows, health.mode)}
|
|
<View className="main_summary_time" style={{ color: getWindowStatus(health.windows, health.mode) == WindowStatusType.upcoming ? '#B2B2B2' : '#000' }}>{getCountownTime(health.windows, health.mode)}
|
|
|
- <View className={timePointClass()}
|
|
|
|
|
- style={{backgroundColor:getWindowStatus(health.windows,health.mode)==WindowStatusType.upcoming?'#B2B2B2':getThemeColor(health.mode)}}/>
|
|
|
|
|
|
|
+ <View className={timePointClass()}
|
|
|
|
|
+ style={{ backgroundColor: getWindowStatus(health.windows, health.mode) == WindowStatusType.upcoming ? '#B2B2B2' : getThemeColor(health.mode) }} />
|
|
|
</View>
|
|
</View>
|
|
|
<Text className="main_summary_duration">Total {getDuration(health.windows, health.mode)}</Text>
|
|
<Text className="main_summary_duration">Total {getDuration(health.windows, health.mode)}</Text>
|
|
|
<View className="border_footer_line" />
|
|
<View className="border_footer_line" />
|
|
@@ -666,7 +705,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
|
|
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
- <View className="circle"/>
|
|
|
|
|
|
|
+ <View className="circle" />
|
|
|
|
|
|
|
|
{
|
|
{
|
|
|
showTimePicker && modalContent()
|
|
showTimePicker && modalContent()
|