|
|
@@ -1,5 +1,5 @@
|
|
|
import { WindowStatusType, WindowType } from "@/utils/types";
|
|
|
-import { View, Text, Image } from "@tarojs/components";
|
|
|
+import { View, Text, Image, Swiper, SwiperItem } from "@tarojs/components";
|
|
|
import dayjs from "dayjs";
|
|
|
import { useEffect, useRef, useState } from "react";
|
|
|
import { useDispatch, useSelector } from "react-redux";
|
|
|
@@ -54,7 +54,7 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
|
|
|
}, [props.type])
|
|
|
|
|
|
- global.chooseLocation = ()=>{
|
|
|
+ global.chooseLocation = () => {
|
|
|
chooseLocation()
|
|
|
}
|
|
|
|
|
|
@@ -204,6 +204,12 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
onClick={() => record(item)} />
|
|
|
}
|
|
|
|
|
|
+ if (item.action && item.action == 'NA') {
|
|
|
+ if (health.mode == 'FAST' || health.mode == 'SLEEP') {
|
|
|
+ return <IconArrow width={rpxToPx(34)} color={MainColorType.g03} />
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return <View />
|
|
|
}
|
|
|
|
|
|
@@ -612,17 +618,38 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
case 'ACTIVE':
|
|
|
list = active.timeline
|
|
|
if (active.onboard == false) {
|
|
|
- return <OnBoard title={list[0].title}
|
|
|
- desc="Subtitle"
|
|
|
- btnTitle="Action"
|
|
|
- onClick={() => {
|
|
|
- if (!user.isLogin) {
|
|
|
- jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
- return
|
|
|
- }
|
|
|
- jumpPage('/_health/pages/active_plan?schedule=' + JSON.stringify(list.length > 0 ? list[0] : '{}'))
|
|
|
- }}
|
|
|
- />
|
|
|
+ var seconds = new Date().getSeconds()
|
|
|
+
|
|
|
+ return <Swiper autoplay>
|
|
|
+ {
|
|
|
+ list.map((item, index) => {
|
|
|
+ return <SwiperItem key={index}>
|
|
|
+ <OnBoard title={item.title}
|
|
|
+ desc={item.time_label}
|
|
|
+ btnTitle="Action"
|
|
|
+ onClick={() => {
|
|
|
+ if (!user.isLogin) {
|
|
|
+ jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ jumpPage('/_health/pages/active_plan?schedule=' + JSON.stringify(item))
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </SwiperItem>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Swiper>
|
|
|
+ // return <OnBoard title={list[0].title}
|
|
|
+ // desc="Subtitle"
|
|
|
+ // btnTitle="Action"
|
|
|
+ // onClick={() => {
|
|
|
+ // if (!user.isLogin) {
|
|
|
+ // jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // jumpPage('/_health/pages/active_plan?schedule=' + JSON.stringify(list.length > 0 ? list[0] : '{}'))
|
|
|
+ // }}
|
|
|
+ // />
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
@@ -707,8 +734,8 @@ export default function MainConsole(props: { type: WindowType }) {
|
|
|
var scenario = getScenario(health.windows, health.mode)
|
|
|
debugger
|
|
|
Taro.chooseLocation({
|
|
|
- latitude: scenario.extra.choose_location ? parseFloat(scenario.extra.lat+'') : undefined,
|
|
|
- longitude: scenario.extra.choose_location ? parseFloat(scenario.extra.lng+'') : undefined,
|
|
|
+ latitude: scenario.extra.choose_location ? parseFloat(scenario.extra.lat + '') : undefined,
|
|
|
+ longitude: scenario.extra.choose_location ? parseFloat(scenario.extra.lng + '') : undefined,
|
|
|
success: function (res) {
|
|
|
uploadLocation(res)
|
|
|
},
|