|
|
@@ -23,6 +23,7 @@ import { clearLocation } from "@/services/user";
|
|
|
import OnBoard from "@/_health/components/onboard";
|
|
|
import NewButton, { NewButtonType } from "@/_health/base/new_button";
|
|
|
import showAlert from "@/components/basic/Alert";
|
|
|
+import { useTranslation } from "react-i18next";
|
|
|
|
|
|
let useNavigation;
|
|
|
let min = 0
|
|
|
@@ -37,13 +38,10 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
const health = useSelector((state: any) => state.health);
|
|
|
const user = useSelector((state: any) => state.user);
|
|
|
const [showPicker, setShowPicker] = useState(false)
|
|
|
- const [showTimePicker, setShowTimePicker] = useState(false)
|
|
|
const [durationPicker, setDurationPicker] = useState(false)
|
|
|
- const [operateType, setOperateType] = useState('')
|
|
|
const [btnDisable, setBtnDisable] = useState(false)
|
|
|
const [selItem, setSelItem] = useState<any>(null)
|
|
|
-
|
|
|
- const limitPickerRef = useRef(null)
|
|
|
+ const { t } = useTranslation()
|
|
|
const dispatch = useDispatch()
|
|
|
|
|
|
let navigation, showActionSheetWithOptions;
|
|
|
@@ -100,25 +98,13 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
switch (item.action) {
|
|
|
case 'START':
|
|
|
{
|
|
|
- // defaultTimestamp = new Date().getTime()
|
|
|
- // min = defaultTimestamp - 1 * 24 * 3600 * 1000
|
|
|
- // max = defaultTimestamp
|
|
|
|
|
|
- // setOperateType('startFast')
|
|
|
- // setShowTimePicker(true)
|
|
|
|
|
|
jumpPage(`/_health/pages/log_time?index=${health.mode == 'FAST' ? 0 : 1}&single=1&is_start=1&window=${health.mode}`)
|
|
|
}
|
|
|
return;
|
|
|
case 'END':
|
|
|
{
|
|
|
- // defaultTimestamp = new Date().getTime()
|
|
|
- // // defaultTimestamp = e ? new Date().getTime() : logEventTimestamp
|
|
|
- // min = defaultTimestamp - 1 * 24 * 3600 * 1000
|
|
|
- // max = defaultTimestamp
|
|
|
- // setOperateType('endFast')
|
|
|
- // setShowTimePicker(true)
|
|
|
- console.log(item)
|
|
|
|
|
|
var sceniaro = getScenario(health.windows, health.mode)
|
|
|
|
|
|
@@ -135,12 +121,6 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
timestamp: new Date().getTime()
|
|
|
}]
|
|
|
}).then(res => {
|
|
|
- // dispatch(setShowActionTip({
|
|
|
- // isShow: true,
|
|
|
- // isCompleted: (selItem.event == 'FAST_END' || selItem.event == 'SLEEP_WAKE_UP')
|
|
|
- // }))
|
|
|
- // setBtnDisable(false)
|
|
|
- // setShowTimePicker(false)
|
|
|
Taro.showToast({
|
|
|
title: '操作成功',
|
|
|
icon: 'success'
|
|
|
@@ -194,7 +174,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
if (item.action && item.action != 'NA') {
|
|
|
if (health.mode == 'FAST' || health.mode == 'SLEEP') {
|
|
|
if (item.action == 'POST_MOMENT') {
|
|
|
- return <IconArrow width={rpxToPx(34)} color={MainColorType.g03}/>
|
|
|
+ return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -265,7 +245,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
if (timeline.real) {
|
|
|
return <Image style={{ width: rpxToPx(20), height: rpxToPx(20) }} src={require('@assets/_health/checked.png')} />
|
|
|
}
|
|
|
- return timeline.reminder?<IconNotification color="#fff" width={rpxToPx(20)}/>:<IconNotificationOff color="#fff" width={rpxToPx(20)}/>
|
|
|
+ return timeline.reminder ? <IconNotification color="#fff" width={rpxToPx(20)} /> : <IconNotificationOff color="#fff" width={rpxToPx(20)} />
|
|
|
}
|
|
|
|
|
|
function timelineItem(item: any, index: number, count: number) {
|
|
|
@@ -416,210 +396,77 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- function modalContent() {
|
|
|
- global.set_time = new Date().getTime()
|
|
|
- return <Modal
|
|
|
- testInfo={null}
|
|
|
- dismiss={() => {
|
|
|
- setShowTimePicker(false)
|
|
|
- }}
|
|
|
- confirm={() => { }}>
|
|
|
- {
|
|
|
- timePickerContent()
|
|
|
- }
|
|
|
- </Modal>
|
|
|
- }
|
|
|
-
|
|
|
- function timePickerContent() {
|
|
|
- var title, color;
|
|
|
- switch (selItem.scenario) {
|
|
|
- case 'FAST':
|
|
|
- title = selItem.event == 'FAST_END' ? '结束断食' : '开始断食'
|
|
|
- color = MainColorType.fast
|
|
|
- break;
|
|
|
- case 'SLEEP':
|
|
|
- title = selItem.event == 'SLEEP_WAKE_UP' ? '结束睡眠' : '开始睡眠'
|
|
|
- color = MainColorType.sleep
|
|
|
- break
|
|
|
- }
|
|
|
-
|
|
|
- var endTimestamp = 0
|
|
|
- if (selItem.envent == 'FAST_END') {
|
|
|
- endTimestamp = new Date().getTime()//fastData.target.end_time
|
|
|
- }
|
|
|
-
|
|
|
- var duration = 24 * 3600 * 1000//fastData.target.duration
|
|
|
-
|
|
|
- global.set_time = new Date().getTime()
|
|
|
-
|
|
|
- return <View className="modal_content">
|
|
|
- <ConsolePicker ref={limitPickerRef}
|
|
|
- themeColor={color}
|
|
|
- title={title}
|
|
|
- onCancel={() => {
|
|
|
- setShowTimePicker(false)
|
|
|
- }}
|
|
|
- min={min}
|
|
|
- max={max}
|
|
|
- current={defaultTimestamp}
|
|
|
- duration={duration}
|
|
|
- endTimestamp={endTimestamp}
|
|
|
- isFast={true}
|
|
|
- isEnd={operateType == 'endFast'}
|
|
|
- isTimeout={false}
|
|
|
- isLoading={btnDisable}
|
|
|
- onChange={(e) => {
|
|
|
- pickerConfirm(e, null)
|
|
|
- global.pauseIndexTimer = false
|
|
|
- }}
|
|
|
- />
|
|
|
- </View>
|
|
|
- }
|
|
|
-
|
|
|
- function pickerConfirm(t1: number, event: any) {
|
|
|
- if (btnDisable) {
|
|
|
- return
|
|
|
- }
|
|
|
- global.scenario = 'FAST'
|
|
|
- setBtnDisable(true)
|
|
|
-
|
|
|
- if (selItem.event == 'FAST_END') {
|
|
|
- const fast = getScenario(health.windows, 'FAST')
|
|
|
- if (fast.status == 'OG') {
|
|
|
- if (t1 - fast.real.start_timestamp > 24 * 3600 * 1000) {
|
|
|
- showAlert({
|
|
|
- title: 'Saving as Long Fast',
|
|
|
- content: 'Fasting that lasts more than 24 hours will be saved as Long Fast. ',
|
|
|
- showCancel: true,
|
|
|
- cancelText: '取消',
|
|
|
- confirmText: '保存',
|
|
|
- cancel: () => {
|
|
|
- setBtnDisable(false)
|
|
|
- },
|
|
|
- confirm: () => {
|
|
|
- save(t1)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- else {
|
|
|
- save(t1)
|
|
|
- // showAlert({
|
|
|
- // title: 'Saving as Intermittent Fasting',
|
|
|
- // content: 'Fasting that lasts fewer than 24 hours will be saved as Intermittent Fasting.',
|
|
|
- // showCancel: true,
|
|
|
- // cancelText: '取消',
|
|
|
- // confirmText: '保存',
|
|
|
- // cancel: () => {
|
|
|
- // setBtnDisable(false)
|
|
|
- // },
|
|
|
- // confirm: () => {
|
|
|
- // save(t1)
|
|
|
- // }
|
|
|
- // })
|
|
|
- }
|
|
|
- }
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- save(t1)
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
function changeToIF() {
|
|
|
updateFast({ fast_type: 'IF' }).then(res => {
|
|
|
global.refreshWindow()
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- function save(t1: number) {
|
|
|
-
|
|
|
-
|
|
|
- var params: any = {
|
|
|
- schedule_id: selItem.schedule_id,
|
|
|
- date: dayjs(t1).format('YYYYMMDD'),
|
|
|
- timestamp: t1,
|
|
|
- extra: {
|
|
|
- set_time: global.set_time ? global.set_time : new Date().getTime(),
|
|
|
- confirm_time: new Date().getTime()
|
|
|
- }
|
|
|
- }
|
|
|
- clockTimes({
|
|
|
- check_items: [params]
|
|
|
- }).then(res => {
|
|
|
- dispatch(setShowActionTip({
|
|
|
- isShow: true,
|
|
|
- isCompleted: (selItem.event == 'FAST_END' || selItem.event == 'SLEEP_WAKE_UP')
|
|
|
- }))
|
|
|
- setBtnDisable(false)
|
|
|
- setShowTimePicker(false)
|
|
|
- global.refreshWindow()
|
|
|
- global.refreshHistory()
|
|
|
- jumpPage('/_health/pages/post_result?data=' + JSON.stringify(res))
|
|
|
- }).catch(e => {
|
|
|
- setBtnDisable(false)
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- function more() {
|
|
|
- if (!user.isLogin) {
|
|
|
- jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
- return
|
|
|
- }
|
|
|
+ function actionList() {
|
|
|
var list: any = []
|
|
|
switch (health.mode) {
|
|
|
- case 'DAY':
|
|
|
- case 'NIGHT':
|
|
|
- list = ['设置提醒', '设置位置']
|
|
|
- break;
|
|
|
- case 'FAST':
|
|
|
- case 'SLEEP':
|
|
|
+ case 'ACTIVE':
|
|
|
{
|
|
|
- const obj = getScenario(health.windows, health.mode)
|
|
|
- if (obj.window_id) {
|
|
|
- // list.push('编辑本次时长')
|
|
|
- // if (obj.timeline && obj.timeline[0].moment) {
|
|
|
- // list.push('删除本次记录')
|
|
|
- // }
|
|
|
-
|
|
|
- list.push('删除本次记录')
|
|
|
+ if (!health.finish_setup) {
|
|
|
+ list.push(t('health.finish_setup'))
|
|
|
}
|
|
|
- list.push('编辑日程列表')
|
|
|
+ list.push(t('health.add_active'))
|
|
|
+ list.push(t('health.mark_done'))
|
|
|
|
|
|
+ if (health.finish_setup) {
|
|
|
+ list.push(t('health.edit_schedule'))
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
case 'EAT':
|
|
|
{
|
|
|
- list = [
|
|
|
- 'Add Snack',
|
|
|
- '编辑日程列表',
|
|
|
- ]
|
|
|
-
|
|
|
- if (getScenario(health.windows, health.mode).window_id) {
|
|
|
- list.push('Make done')
|
|
|
+ if (!health.finish_setup) {
|
|
|
+ list.push(t('health.finish_setup'))
|
|
|
+ }
|
|
|
+ list.push(t('health.add_meal'))
|
|
|
+ list.push(t('health.mark_done'))
|
|
|
+ if (health.finish_setup) {
|
|
|
+ list.push(t('health.edit_schedule'))
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 'ACTIVE':
|
|
|
+ case 'FAST':
|
|
|
+ case 'SLEEP':
|
|
|
{
|
|
|
- list = [
|
|
|
- '记录一次活动',
|
|
|
- '编辑日程列表',
|
|
|
- ]
|
|
|
-
|
|
|
- if (getScenario(health.windows, health.mode).window_id) {
|
|
|
- list.push('Make done')
|
|
|
+ if (!health.finish_setup) {
|
|
|
+ list.push(t('health.finish_setup'))
|
|
|
+ }
|
|
|
+ const obj = getScenario(health.windows, health.mode)
|
|
|
+ if (obj.window_id) {
|
|
|
+ list.push(t('health.delete_current_record'))
|
|
|
+ }
|
|
|
+ if (health.finish_setup) {
|
|
|
+ list.push(t('health.edit_schedule'))
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
+ case 'DAY':
|
|
|
+ case 'NIGHT':
|
|
|
+ {
|
|
|
+ list = [t('health.change_location'), t('health.clear_location')]
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
|
|
|
+ function more() {
|
|
|
+ if (!user.isLogin) {
|
|
|
+ jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
showActionSheet({
|
|
|
showActionSheetWithOptions: showActionSheetWithOptions,
|
|
|
- title: 'Oprate Title',
|
|
|
- itemList: list,
|
|
|
+ title: t('health.more_actions'),
|
|
|
+ itemList: actionList(),
|
|
|
success: (res) => {
|
|
|
tapActionSheet(res)
|
|
|
}
|
|
|
@@ -627,91 +474,64 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
}
|
|
|
|
|
|
function tapActionSheet(index) {
|
|
|
- switch (index) {
|
|
|
- case 0:
|
|
|
- {
|
|
|
- switch (health.mode) {
|
|
|
- case 'DAY':
|
|
|
- case 'NIGHT':
|
|
|
- //var url = `./schedules_edit?type=${res == 0 ? 'reminder' : 'name'}&mode=${selMode}`
|
|
|
- jumpPage(`/_health/pages/schedules_edit?type=reminder&mode=${health.mode}`)
|
|
|
- // jumpPage('/_health/pages/schedules?mode=' + health.mode)
|
|
|
- break;
|
|
|
- case 'FAST':
|
|
|
- case 'SLEEP':
|
|
|
- {
|
|
|
- const obj = getScenario(health.windows, health.mode)
|
|
|
- if (obj.window_id) {
|
|
|
- //编辑本次时长
|
|
|
- // setDurationPicker(true)
|
|
|
- showAlert({
|
|
|
- title: 'del',
|
|
|
- content: '确认删除此记录?',
|
|
|
- showCancel: true,
|
|
|
- confirm: () => {
|
|
|
- delRecord(obj.window_id).then(res => {
|
|
|
- global.refreshWindow()
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- else {
|
|
|
- jumpPage('/_health/pages/schedules?mode=' + health.mode)
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case 'EAT':
|
|
|
- //add snack
|
|
|
- jumpPage(`/_health/pages/add_moment?title=加餐&is_temp=${true}`)
|
|
|
- break;
|
|
|
- case 'ACTIVE':
|
|
|
- //记录一次活动
|
|
|
- jumpPage(`/_health/pages/add_moment?title=&is_temp=${true}`)
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ var title = actionList()[index]
|
|
|
+ switch (title) {
|
|
|
+ case t('health.finish_setup'):
|
|
|
+ tapGuide();
|
|
|
break;
|
|
|
- case 1:
|
|
|
- {
|
|
|
- switch (health.mode) {
|
|
|
- case 'EAT':
|
|
|
- jumpPage('/_health/pages/schedules?mode=' + health.mode)
|
|
|
- break;
|
|
|
- case 'FAST':
|
|
|
- case 'SLEEP':
|
|
|
- const obj = getScenario(health.windows, health.mode)
|
|
|
- if (obj.window_id) {
|
|
|
- //del record
|
|
|
- jumpPage('/_health/pages/schedules?mode=' + health.mode)
|
|
|
- console.log('zzzzzzzzz')
|
|
|
- }
|
|
|
- else {
|
|
|
-
|
|
|
- }
|
|
|
- break;
|
|
|
- case 'ACTIVE':
|
|
|
- jumpPage('/_health/pages/schedules?mode=' + health.mode)
|
|
|
- break;
|
|
|
- case 'DAY':
|
|
|
- case 'NIGHT':
|
|
|
- chooseLocation()
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ case t('health.add_active'):
|
|
|
+ jumpPage(`/_health/pages/add_moment?title=&is_temp=${true}`)
|
|
|
+ break;
|
|
|
+ case t('health.add_meal'):
|
|
|
+ jumpPage(`/_health/pages/add_moment?title=加餐&is_temp=${true}`)
|
|
|
break;
|
|
|
- case 2:
|
|
|
+ case t('health.mark_done'):
|
|
|
+ tapMakeDone()
|
|
|
+ break
|
|
|
+ case t('health.edit_schedule'):
|
|
|
+ jumpPage('/_health/pages/schedules?mode=' + health.mode)
|
|
|
+ break
|
|
|
+ case t('health.delete_current_record'):
|
|
|
{
|
|
|
- switch (health.mode) {
|
|
|
- case 'EAT':
|
|
|
- case 'ACTIVE':
|
|
|
- tapMakeDone()
|
|
|
- break;
|
|
|
- }
|
|
|
+ const obj = getScenario(health.windows, health.mode)
|
|
|
+ showAlert({
|
|
|
+ title: 'del',
|
|
|
+ content: '确认删除此记录?',
|
|
|
+ showCancel: true,
|
|
|
+ confirm: () => {
|
|
|
+ delRecord(obj.window_id).then(res => {
|
|
|
+ global.refreshWindow()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
break;
|
|
|
+ case t('health.change_location'):
|
|
|
+ chooseLocation()
|
|
|
+ break
|
|
|
+ case t('health.clear_location'):
|
|
|
+ tapClearLocation()
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ function tapGuide() {
|
|
|
+ jumpPage('/_health/pages/guide_fast')
|
|
|
+ // showAlert({
|
|
|
+ // title:'设置引导弹窗',
|
|
|
+ // content:'设置引导描述',
|
|
|
+ // showCancel:true,
|
|
|
+ // cancelText:'稍后',
|
|
|
+ // confirmText:'设置',
|
|
|
+ // cancel:()=>{
|
|
|
+
|
|
|
+ // },
|
|
|
+ // confirm:()=>{
|
|
|
+ // jumpPage('/_health/pages/guide_fast')
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ }
|
|
|
+
|
|
|
function tapMakeDone() {
|
|
|
makeDone(getScenario(health.windows, health.mode).window_id).then(res => {
|
|
|
global.refreshWindow()
|
|
|
@@ -727,20 +547,20 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
switch (health.mode) {
|
|
|
case 'DAY':
|
|
|
list = day.timeline
|
|
|
- if (day.onboard == false) {
|
|
|
- return <OnBoard title='你还没有开启位置授权'
|
|
|
- desc="获取准确的日出日落信息需要您开启微信运动授权,点击下方按钮进行授权"
|
|
|
- btnTitle="去开启"
|
|
|
+ if (day.extra.choose_location == false) {
|
|
|
+ return <OnBoard title={t('health.sunrise_to_sunset')}
|
|
|
+ desc={t('health.rise_to_set_desc')}
|
|
|
+ btnTitle={t('health.choose_location')}
|
|
|
onClick={chooseLocation}
|
|
|
/>
|
|
|
}
|
|
|
break;
|
|
|
case 'NIGHT':
|
|
|
list = night.timeline
|
|
|
- if (night.onboard == false) {
|
|
|
- return <OnBoard title='你还没有开启位置授权'
|
|
|
- desc='获取准确的日出日落信息需要您开启微信运动授权,点击下方按钮进行授权'
|
|
|
- btnTitle="去开启"
|
|
|
+ if (night.extra.choose_location == false) {
|
|
|
+ return <OnBoard title={t('health.sunset_to_sunrise')}
|
|
|
+ desc={t('health.set_to_rise_desc')}
|
|
|
+ btnTitle={t('health.choose_location')}
|
|
|
onClick={chooseLocation}
|
|
|
/>
|
|
|
}
|
|
|
@@ -784,17 +604,17 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
function switchText() {
|
|
|
switch (health.mode) {
|
|
|
case 'FAST':
|
|
|
- return 'Switch to Eat'
|
|
|
+ return t('health.switch_to', { scenario: t('health.eat') })
|
|
|
case 'EAT':
|
|
|
- return 'Switch to Fast'
|
|
|
+ return t('health.switch_to', { scenario: t('health.fast') })
|
|
|
case 'DAY':
|
|
|
- return 'Switch to Night'
|
|
|
+ return t('health.switch_to', { scenario: t('health.night') })
|
|
|
case 'NIGHT':
|
|
|
- return 'Switch to Daylight'
|
|
|
+ return t('health.switch_to', { scenario: global.language == 'en' ? 'Daylight' : '白天' })//'Switch to Daylight'
|
|
|
case 'SLEEP':
|
|
|
- return 'Switch to Activity'
|
|
|
+ return t('health.switch_to', { scenario: t('health.active') })
|
|
|
case 'ACTIVE':
|
|
|
- return 'Switch to Sleep'
|
|
|
+ return t('health.switch_to', { scenario: t('health.sleep') })
|
|
|
|
|
|
}
|
|
|
return ''
|
|
|
@@ -828,19 +648,6 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function windowStatus() {
|
|
|
- var statusType = getWindowStatus(health.windows, health.mode)
|
|
|
- switch (statusType) {
|
|
|
- case WindowStatusType.open:
|
|
|
- return 'New open'
|
|
|
- case WindowStatusType.process:
|
|
|
- return 'In process'
|
|
|
- case WindowStatusType.upcoming:
|
|
|
- return 'Upcoming'
|
|
|
- }
|
|
|
- return ''
|
|
|
- }
|
|
|
-
|
|
|
function tapClearLocation() {
|
|
|
Taro.showModal({
|
|
|
title: '提示',
|
|
|
@@ -945,29 +752,39 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
return <View className="h26" style={{ color: MainColorType.g01 }}>{status == 'OG' ? 'In progress' : ''}</View>
|
|
|
}
|
|
|
|
|
|
+ function showMoreBtn() {
|
|
|
+ if (health.mode == 'DAY' || health.mode == 'NIGHT') {
|
|
|
+ if (!getScenario(health.windows, health.mode).extra.choose_location) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
return <View className="main-console-bg">
|
|
|
<Image className="main_arrow" src={require('@assets/images/center_arrow.png')} />
|
|
|
<View className="main_summary">
|
|
|
{/* <View className="main_summary_status" style={{ color: getThemeColor(health.mode) }}>{windowStatus()}</View> */}
|
|
|
- <View className="main_summary_time bold" style={{
|
|
|
- marginTop:rpxToPx(14),
|
|
|
- color: getWindowStatus(health.windows, health.mode) == WindowStatusType.upcoming ? '#B2B2B2' : '#000' }} >{getCountownTime(health.windows, health.mode)}
|
|
|
+ <View className="main_summary_time bold" style={{
|
|
|
+ marginTop: rpxToPx(14),
|
|
|
+ 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>
|
|
|
- <Text className="main_summary_duration" style={{ color: MainColorType.g01,marginBottom:rpxToPx(30) }}>{getDuration(health.windows, health.mode)}</Text>
|
|
|
+ <Text className="main_summary_duration" style={{ color: MainColorType.g01, marginBottom: rpxToPx(30) }}>{getDuration(health.windows, health.mode)}</Text>
|
|
|
<View className="border_footer_line" />
|
|
|
</View>
|
|
|
<View style={{ backgroundColor: '#fff', width: rpxToPx(750) }}>
|
|
|
{
|
|
|
detail()
|
|
|
}
|
|
|
- {
|
|
|
+ {/* {
|
|
|
health.mode == 'ACTIVE' && <View onClick={() => {
|
|
|
var list = getScenario(health.windows, health.mode).timeline
|
|
|
jumpPage('/_health/pages/active_plan?schedule=' + JSON.stringify(list.length > 0 ? list[0] : '{}'))
|
|
|
}}>测试</View>
|
|
|
- }
|
|
|
+ } */}
|
|
|
</View>
|
|
|
<View className="main_footer2">
|
|
|
<View style={{ width: rpxToPx(316), height: rpxToPx(128), display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
@@ -978,24 +795,18 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
>
|
|
|
</NewButton>
|
|
|
</View>
|
|
|
- {/* {
|
|
|
- (health.mode == 'EAT' || health.mode == 'ACTIVE') && <Text style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }} onClick={more}>更多</Text>
|
|
|
- } */}
|
|
|
- {/* {
|
|
|
- (health.mode == 'DAY' || health.mode == 'NIGHT') && <Text onClick={chooseLocation}>选择位置</Text>
|
|
|
- } */}
|
|
|
{
|
|
|
- (health.mode == 'DAY' || health.mode == 'NIGHT') && <Text onClick={tapClearLocation}>清除位置</Text>
|
|
|
+ showMoreBtn() && <NewButton
|
|
|
+ btnStyle={{
|
|
|
+ position: 'absolute',
|
|
|
+ top: rpxToPx(42),
|
|
|
+ right: rpxToPx(40)
|
|
|
+ }}
|
|
|
+ type={NewButtonType.more}
|
|
|
+ onClick={more}
|
|
|
+ />
|
|
|
}
|
|
|
- <NewButton
|
|
|
- btnStyle={{
|
|
|
- position: 'absolute',
|
|
|
- top: rpxToPx(42),
|
|
|
- right: rpxToPx(40)
|
|
|
- }}
|
|
|
- type={NewButtonType.more}
|
|
|
- onClick={more}
|
|
|
- />
|
|
|
+
|
|
|
|
|
|
</View>
|
|
|
{
|
|
|
@@ -1010,7 +821,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
}}>
|
|
|
<Image className="active_icon" src={require('@assets/_health/walk.png')} />
|
|
|
<Text className="active_text">Move More</Text>
|
|
|
- <IconArrow width={rpxToPx(34)} color={MainColorType.g03}/>
|
|
|
+ <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
|
|
|
</View>
|
|
|
|
|
|
</View>
|
|
|
@@ -1048,17 +859,17 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
fastWithSleepStatus()
|
|
|
}
|
|
|
{
|
|
|
- health.fast_with_sleep.status=='OG2_MISALIGNED' && <View style={{
|
|
|
- backgroundColor:MainColorType.error,
|
|
|
- width:rpxToPx(12),
|
|
|
- height:rpxToPx(12),
|
|
|
- borderRadius:rpxToPx(6),
|
|
|
- marginLeft:rpxToPx(12),
|
|
|
- marginRight:rpxToPx(12)
|
|
|
- }}/>
|
|
|
+ health.fast_with_sleep.status == 'OG2_MISALIGNED' && <View style={{
|
|
|
+ backgroundColor: MainColorType.error,
|
|
|
+ width: rpxToPx(12),
|
|
|
+ height: rpxToPx(12),
|
|
|
+ borderRadius: rpxToPx(6),
|
|
|
+ marginLeft: rpxToPx(12),
|
|
|
+ marginRight: rpxToPx(12)
|
|
|
+ }} />
|
|
|
}
|
|
|
- <View style={{width:rpxToPx(12)}}/>
|
|
|
- <IconArrow width={rpxToPx(34)} color={MainColorType.g03}/>
|
|
|
+ <View style={{ width: rpxToPx(12) }} />
|
|
|
+ <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
|
|
|
{
|
|
|
health.mode == 'FAST' && <View className="border_footer_line" style={{ left: rpxToPx(100) }} />
|
|
|
}
|
|
|
@@ -1081,24 +892,13 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
{
|
|
|
longFastStatus()
|
|
|
}
|
|
|
- <View style={{width:rpxToPx(12)}}/>
|
|
|
- <IconArrow width={rpxToPx(34)} color={MainColorType.g03}/>
|
|
|
+ <View style={{ width: rpxToPx(12) }} />
|
|
|
+ <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
|
|
|
</View>
|
|
|
|
|
|
</View>
|
|
|
}
|
|
|
- <View onClick={()=>{
|
|
|
- if (!user.isLogin) {
|
|
|
- jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
- return
|
|
|
- }
|
|
|
- jumpPage('/_health/pages/guide_fast')
|
|
|
- }}>Guide</View>
|
|
|
<View className="circle" />
|
|
|
-
|
|
|
- {
|
|
|
- showTimePicker && modalContent()
|
|
|
- }
|
|
|
{
|
|
|
showPicker && timeContent()
|
|
|
}
|