|
|
@@ -3,7 +3,7 @@ import './move.scss'
|
|
|
import { useDispatch, useSelector } from "react-redux";
|
|
|
import { getScenario, getThemeColor } from "@/features/health/hooks/health_hooks";
|
|
|
import { useEffect, useState } from "react";
|
|
|
-import Taro from "@tarojs/taro";
|
|
|
+import Taro, { useDidShow } from "@tarojs/taro";
|
|
|
import { checkStart, setResult } from "@/store/action_results";
|
|
|
import RequestType, { thirdPartRequest } from "@/services/thirdPartRequest";
|
|
|
import { setAuth } from "@/features/trackSomething/hooks/werun";
|
|
|
@@ -12,12 +12,15 @@ import { getActiveMoves, getActiveMovesCurrent, uploadActiveMoves } from "@/serv
|
|
|
import dayjs from "dayjs";
|
|
|
import { TimeFormatter } from "@/utils/time_format";
|
|
|
import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
|
|
|
+import { rpxToPx } from "@/utils/tools";
|
|
|
+import { IconMore } from "@/components/basic/Icons";
|
|
|
|
|
|
let timer
|
|
|
export default function Move() {
|
|
|
const health = useSelector((state: any) => state.health);
|
|
|
const [allowRun, setAllowRun] = useState(false)
|
|
|
const [loaded, setLoaded] = useState(false)
|
|
|
+ const [loadAuth, setLoadAuth] = useState(false)
|
|
|
const [count, setCount] = useState(0)
|
|
|
const [data, setData] = useState<any>(null)
|
|
|
const [list, setList] = useState<any>([])
|
|
|
@@ -33,6 +36,22 @@ export default function Move() {
|
|
|
useEffect(() => {
|
|
|
getMovesCurrent()
|
|
|
getMovesHistory()
|
|
|
+ checkAuth()
|
|
|
+ timer = setInterval(() => {
|
|
|
+ setCount((index) => index + 1)
|
|
|
+ const date = new Date()
|
|
|
+ if (date.getMinutes() == 10 && date.getSeconds() == 0) {
|
|
|
+ getMovesCurrent()
|
|
|
+ getMovesHistory()
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+
|
|
|
+ return () => {
|
|
|
+ clearInterval(timer)
|
|
|
+ }
|
|
|
+ }, [])
|
|
|
+
|
|
|
+ function checkAuth() {
|
|
|
Taro.getSetting({
|
|
|
success: res => {
|
|
|
//第一步,检测是否有授权 - 没有授权
|
|
|
@@ -44,23 +63,16 @@ export default function Move() {
|
|
|
setAllowRun(true)
|
|
|
Taro.setStorage({ key: 'auth', data: true })
|
|
|
}
|
|
|
+ setLoadAuth(true)
|
|
|
}
|
|
|
})
|
|
|
- timer = setInterval(() => {
|
|
|
- setCount((index) => index + 1)
|
|
|
- const date = new Date()
|
|
|
- if (date.getMinutes() == 10 && date.getSeconds() == 0) {
|
|
|
- getMovesCurrent()
|
|
|
- getMovesHistory()
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
+ }
|
|
|
|
|
|
- return () => {
|
|
|
- clearInterval(timer)
|
|
|
- }
|
|
|
- }, [])
|
|
|
+ useDidShow(() => {
|
|
|
+ checkAuth()
|
|
|
+ })
|
|
|
|
|
|
- global.updateMove = ()=>{
|
|
|
+ global.updateMove = () => {
|
|
|
getMovesCurrent()
|
|
|
getMovesHistory()
|
|
|
}
|
|
|
@@ -101,6 +113,9 @@ export default function Move() {
|
|
|
// if (getStatus() != 'open') {
|
|
|
// return
|
|
|
// }
|
|
|
+ if (isExtra()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (allowRun) {
|
|
|
checkout()
|
|
|
}
|
|
|
@@ -115,7 +130,6 @@ export default function Move() {
|
|
|
}
|
|
|
|
|
|
function refuseAuth() {
|
|
|
- // setTitle('开启');
|
|
|
Taro.setStorage({ key: 'auth', data: false })
|
|
|
setAllowRun(false)
|
|
|
}
|
|
|
@@ -145,15 +159,6 @@ export default function Move() {
|
|
|
})
|
|
|
|
|
|
thirdPartRequest(RequestType.RequestTypeWXRunData).then(res => {
|
|
|
- // var params = {
|
|
|
- // is_manual: autoCheck ? 0 : 1,
|
|
|
- // timestamp: time,
|
|
|
- // encryptedData: (res as any).encryptedData,
|
|
|
- // iv: (res as any).iv,
|
|
|
- // date: strDate,
|
|
|
- // cloudID: (res as any).cloudID,
|
|
|
- // }
|
|
|
-
|
|
|
uploadActiveMoves({
|
|
|
wechat_run: {
|
|
|
encryptedData: (res as any).encryptedData,
|
|
|
@@ -193,7 +198,7 @@ export default function Move() {
|
|
|
const currentHour = currentCheckHour()
|
|
|
var isChecked = false
|
|
|
data.hours.map((item) => {
|
|
|
- if (item.hour == currentHour && item.status != 'NOT_CHECK') {
|
|
|
+ if (item.hour == currentHour && item.status != 'WFS') {
|
|
|
isChecked = true
|
|
|
}
|
|
|
})
|
|
|
@@ -213,69 +218,6 @@ export default function Move() {
|
|
|
return 'upcoming'
|
|
|
}
|
|
|
|
|
|
- function currentFootDesc() {
|
|
|
- var isChecked = currentHourChecked()
|
|
|
- const minute = new Date().getMinutes()
|
|
|
-
|
|
|
- if (isChecked && (minute < 10 || minute >= 50)) {
|
|
|
- let time = new Date()
|
|
|
- time.setMinutes(50)
|
|
|
- time.setSeconds(0)
|
|
|
- time.setMilliseconds(0)
|
|
|
-
|
|
|
- // 获取总秒数
|
|
|
- const totalSeconds = Math.floor((time.getTime() + 3600 * 1000 - new Date().getTime()) / 1000);
|
|
|
-
|
|
|
- // 计算小时、分钟和秒
|
|
|
- // const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
|
|
|
- const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
|
|
|
- const seconds = String(totalSeconds % 60).padStart(2, '0');
|
|
|
-
|
|
|
- // return `${hours}:${minutes}:${seconds}`;
|
|
|
- return `Opening soon ${minutes}:${seconds}`
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- const pre = new Date().getTime()
|
|
|
- const next = new Date().getTime() + 3600 * 1000
|
|
|
- if (minute >= 50) {
|
|
|
- return `Now open ${dayjs(pre).format('HH:50')}-${dayjs(next).format('HH:10')}`
|
|
|
- }
|
|
|
- else if (minute < 10) {
|
|
|
- let time = new Date()
|
|
|
- time.setMinutes(10)
|
|
|
- time.setSeconds(0)
|
|
|
- time.setMilliseconds(0)
|
|
|
-
|
|
|
- // 获取总秒数
|
|
|
- const totalSeconds = Math.floor((time.getTime() - new Date().getTime()) / 1000);
|
|
|
-
|
|
|
- // 计算小时、分钟和秒
|
|
|
- // const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
|
|
|
- const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
|
|
|
- const seconds = String(totalSeconds % 60).padStart(2, '0');
|
|
|
-
|
|
|
- // return `${hours}:${minutes}:${seconds}`;
|
|
|
- return `Closing in ${minutes}:${seconds}`
|
|
|
- }
|
|
|
-
|
|
|
- let time = new Date()
|
|
|
- time.setMinutes(50)
|
|
|
- time.setSeconds(0)
|
|
|
- time.setMilliseconds(0)
|
|
|
-
|
|
|
- // 获取总秒数
|
|
|
- const totalSeconds = Math.floor((time.getTime() - new Date().getTime()) / 1000);
|
|
|
-
|
|
|
- // 计算小时、分钟和秒
|
|
|
- // const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
|
|
|
- const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
|
|
|
- const seconds = String(totalSeconds % 60).padStart(2, '0');
|
|
|
-
|
|
|
- // return `${hours}:${minutes}:${seconds}`;
|
|
|
- return `Opening soon ${minutes}:${seconds}`
|
|
|
- }
|
|
|
-
|
|
|
function getDuration() {
|
|
|
let now = new Date()
|
|
|
let pre = new Date().getTime()
|
|
|
@@ -303,7 +245,7 @@ export default function Move() {
|
|
|
const hour = new Date(pre).getHours()
|
|
|
for (var i = 0; i < data.hours.length; i++) {
|
|
|
if (data.hours[i].hour == hour) {
|
|
|
- return `${data.hours[i].real_steps}/${data.hours[i].target_steps}`
|
|
|
+ return `${data.hours[i].target_steps}`//`${data.hours[i].real_steps}/${data.hours[i].target_steps}`
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -336,41 +278,6 @@ export default function Move() {
|
|
|
return !isFind
|
|
|
}
|
|
|
|
|
|
- function currentContent() {
|
|
|
- const hour = currentHourPeriod()
|
|
|
- let info: any = null
|
|
|
- data.hours.map(item => {
|
|
|
- if (item.hour == hour) {
|
|
|
- info = item
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- return <View className="move-header">
|
|
|
- <View className="header-current">
|
|
|
- <View className="current_intro">
|
|
|
- <View style={{ color: (new Date().getMinutes() < 10 && getStatus() == 'open') ? getThemeColor(health.mode) : '#b2b2b2' }}>{getDuration()}</View>
|
|
|
- {
|
|
|
- isExtra() ? <Text style={{ color: getThemeColor('SLEEP') }}>is extra</Text> : <Text>{getCurrentTarget()} steps</Text>
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- </View>
|
|
|
- <View className="log_btn" style={{
|
|
|
- backgroundColor: getStatus() == 'open' ? getThemeColor(health.mode) : '#6666661A',
|
|
|
- color: getStatus() == 'open' ? '#fff' : '#666666'
|
|
|
- }} onClick={tapLog}>Log</View>
|
|
|
- <View className="border_footer_line" />
|
|
|
- </View>
|
|
|
- <View className="current_footer">
|
|
|
- <Text>{currentFootDesc()}</Text>
|
|
|
- <Text onClick={() => {
|
|
|
- jumpPage(`/_health/pages/move_schedule?hours=${JSON.stringify(data.hours)}`)
|
|
|
- }}>Show More</Text>
|
|
|
- </View>
|
|
|
-
|
|
|
- </View>
|
|
|
- }
|
|
|
-
|
|
|
function currentHistory(item) {
|
|
|
var start = item.hour
|
|
|
var isYesterday = start > new Date().getHours()
|
|
|
@@ -390,7 +297,7 @@ export default function Move() {
|
|
|
item.status == 'MISSED' && <Text className="missed">Missed</Text>
|
|
|
}
|
|
|
{
|
|
|
- item.status == 'SEDENTARY' && <Image className="history_item_detail_icon" src={require('@assets/_health/sit.png')} />
|
|
|
+ item.status == 'SEDENTARY' && <Image className="history_item_detail_icon" src={require('@assets/_health/sit.png')} />
|
|
|
}
|
|
|
{
|
|
|
item.status == 'ACTIVE' && <Image className="history_item_detail_icon" src={require('@assets/_health/walk.png')} />
|
|
|
@@ -405,7 +312,7 @@ export default function Move() {
|
|
|
|
|
|
return <View className="summary">
|
|
|
<View className="summary_header">
|
|
|
- <Text>Active Hours</Text>
|
|
|
+ <Text>Last {hours.length} Hour{hours.length == 1 ? '' : 's'}</Text>
|
|
|
<Image className="arrow_hide"
|
|
|
onClick={() => {
|
|
|
setHideCurrentRecent(!hideCurrentRecent)
|
|
|
@@ -416,10 +323,9 @@ export default function Move() {
|
|
|
<View className="border_footer_line" />
|
|
|
</View>
|
|
|
{
|
|
|
- !hideCurrentRecent && <View className="summary_content">
|
|
|
+ !hideCurrentRecent && <View className="summary_content2">
|
|
|
{
|
|
|
hours.map((item, index) => {
|
|
|
- // if (item.status == 'NOT_CHECK') return <View key={index} />
|
|
|
if (index >= 3 && !moreActive) return <View key={index} />
|
|
|
return <View key={index}>
|
|
|
{
|
|
|
@@ -441,40 +347,236 @@ export default function Move() {
|
|
|
{
|
|
|
hours.length == 0 && <View className="no_current">
|
|
|
<Text>No Active Hours Yet.</Text>
|
|
|
- <View className="border_footer_line"/>
|
|
|
+ <View className="border_footer_line" />
|
|
|
</View>
|
|
|
}
|
|
|
|
|
|
- <View className="summary_footer">
|
|
|
- <View className="summary_footer_item">
|
|
|
- <Text className="light_desc">Steps</Text>
|
|
|
- <Text>{data.stat.real_steps}/{data.stat.target_steps}</Text>
|
|
|
- </View>
|
|
|
- <View className="summary_footer_item">
|
|
|
- <Text className="light_desc">Calories</Text>
|
|
|
- <Text>{data.stat.real_calories}/{data.stat.target_calories}</Text>
|
|
|
+
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+
|
|
|
+ function consoleFooter() {
|
|
|
+ if (getStatus() == 'open') {
|
|
|
+ if (new Date().getMinutes() < 10) {
|
|
|
+ let time = new Date()
|
|
|
+ time.setMinutes(10)
|
|
|
+ time.setSeconds(0)
|
|
|
+ time.setMilliseconds(0)
|
|
|
+
|
|
|
+ // 获取总秒数
|
|
|
+ const totalSeconds = Math.floor((time.getTime() - new Date().getTime()) / 1000);
|
|
|
+
|
|
|
+ // 计算小时、分钟和秒
|
|
|
+ // const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
|
|
|
+ const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
|
|
|
+ const seconds = String(totalSeconds % 60).padStart(2, '0');
|
|
|
+
|
|
|
+ return <Text className="console_footer" style={{ color: getThemeColor('ACTIVE') }}>Ending soon {minutes}:{seconds}</Text>
|
|
|
+ }
|
|
|
+
|
|
|
+ const pre = new Date().getTime()
|
|
|
+ const next = new Date().getTime() + 3600 * 1000
|
|
|
+ return <Text className="console_footer">Check In available {dayjs(pre).format('HH:50')}-{dayjs(next).format('HH:10')}</Text>
|
|
|
+ }
|
|
|
+ else if (isExtra()) {
|
|
|
+ return <Text className="console_footer">to do 倒计时</Text>
|
|
|
+ }
|
|
|
+
|
|
|
+ const minute = new Date().getMinutes()
|
|
|
+ var isChecked = currentHourChecked()
|
|
|
+ if (isChecked && (minute < 10 || minute >= 50)) {
|
|
|
+ debugger
|
|
|
+ let time = new Date()
|
|
|
+ time.setMinutes(50)
|
|
|
+ time.setSeconds(0)
|
|
|
+ time.setMilliseconds(0)
|
|
|
+
|
|
|
+ // 获取总秒数
|
|
|
+ const totalSeconds = Math.floor((time.getTime() + 3600 * 1000 - new Date().getTime()) / 1000);
|
|
|
+
|
|
|
+ // 计算小时、分钟和秒
|
|
|
+ // const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
|
|
|
+ const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
|
|
|
+ const seconds = String(totalSeconds % 60).padStart(2, '0');
|
|
|
+
|
|
|
+ // return `${hours}:${minutes}:${seconds}`;
|
|
|
+ return <Text className="console_footer">Opening soon {minutes}:{seconds}</Text>
|
|
|
+ }
|
|
|
+
|
|
|
+ let time = new Date()
|
|
|
+ time.setMinutes(50)
|
|
|
+ time.setSeconds(0)
|
|
|
+ time.setMilliseconds(0)
|
|
|
+
|
|
|
+ // 获取总秒数
|
|
|
+ const totalSeconds = Math.floor((time.getTime() - new Date().getTime()) / 1000);
|
|
|
+
|
|
|
+ // 计算小时、分钟和秒
|
|
|
+ // const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
|
|
|
+ const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
|
|
|
+ const seconds = String(totalSeconds % 60).padStart(2, '0');
|
|
|
+ return <Text className="console_footer">Opening soon {minutes}:{seconds}</Text>
|
|
|
+ }
|
|
|
+
|
|
|
+ function hoursPassed(timeStr) {
|
|
|
+ // 获取当前时间
|
|
|
+ const now = new Date();
|
|
|
+
|
|
|
+ // 解析输入时间字符串
|
|
|
+ const [hours, minutes] = timeStr.split(':').map(Number);
|
|
|
+
|
|
|
+ // 创建一个 Date 对象,设置为今天的输入时间
|
|
|
+ const inputTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), hours, minutes);
|
|
|
+
|
|
|
+ // 如果输入时间在当前时间之后,假设它是前一天的时间
|
|
|
+ if (inputTime > now) {
|
|
|
+ inputTime.setDate(inputTime.getDate() - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 计算时间差(以毫秒为单位)
|
|
|
+ const timeDiff = now.getTime() - inputTime.getTime();
|
|
|
+
|
|
|
+ // 将时间差转换为小时,最大为 23 小时
|
|
|
+ const hours2 = Math.min(Math.floor(timeDiff / (1000 * 60 * 60)), 23);
|
|
|
+
|
|
|
+ return hours2 + 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ function hourIndex() {
|
|
|
+ const { start_time, end_time } = data.time_range
|
|
|
+ if (isExtra()) {
|
|
|
+ return hoursPassed(end_time)
|
|
|
+ }
|
|
|
+ return hoursPassed(start_time)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function becomeTime() {
|
|
|
+ var hour = new Date().getHours()
|
|
|
+ var tHour = parseInt(getDuration().substring(0, 2))
|
|
|
+ if (hour > tHour) {
|
|
|
+ return `Check in begins at ${getDuration().substring(0, 2)}:50 tomorrow`
|
|
|
+ }
|
|
|
+ return `Check in begins at ${getDuration().substring(0, 2)}:50`
|
|
|
+ }
|
|
|
+
|
|
|
+ function console() {
|
|
|
+
|
|
|
+ if (!allowRun) {
|
|
|
+ return <View className="move_console">
|
|
|
+ <Text className="console_duration" style={{ color: '#000', fontSize: rpxToPx(34) }}>你还没有开启步数授权</Text>
|
|
|
+ <Text className="console_open_tip">体验Move More需要您开启微信运动授权,点击下方按钮进行授权</Text>
|
|
|
+ <View className="console_checkbtn"
|
|
|
+ onClick={tapLog}
|
|
|
+ style={{ color: '#fff', backgroundColor: getThemeColor('ACTIVE') }}>去授权</View>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+
|
|
|
+ return <View className="move_console">
|
|
|
+ <View className="summary_status_bg">
|
|
|
+ <View className="summary_status_point" style={{ backgroundColor: isExtra() ? getThemeColor('SLEEP') : getThemeColor('ACTIVE') }} />
|
|
|
+ <Text className="summary_status_text">{isExtra() ? 'SLEEP HOUR ' : 'WAKING HOUR '}{hourIndex()}</Text>
|
|
|
+ </View>
|
|
|
+ <Text className="console_duration">{getDuration()}</Text>
|
|
|
+ <Text className="console_desc" style={{
|
|
|
+ color: isExtra() ? getThemeColor('SLEEP') : getThemeColor('ACTIVE'),
|
|
|
+ fontSize: isExtra() ? rpxToPx(48) : rpxToPx(34)
|
|
|
+ }}>{
|
|
|
+ isExtra() ? 'Sleep well.' : getStatus() == 'open' ? `Think you've hit ${getCurrentTarget()} steps this hour?` : `Hit ${getCurrentTarget()} steps within the hour`
|
|
|
+ }</Text>
|
|
|
+ {
|
|
|
+ getStatus() == 'open' ? <View className="console_checkbtn"
|
|
|
+ onClick={tapLog}
|
|
|
+ style={{ color: '#fff', backgroundColor: getThemeColor('ACTIVE') }}>I Think So!</View> :
|
|
|
+ <View className="console_checkbtn" onClick={tapLog}>{becomeTime()}</View>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ consoleFooter()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+
|
|
|
+ function tools() {
|
|
|
+ return <View className="tools">
|
|
|
+ <View className="upcoming" onClick={() => {
|
|
|
+ jumpPage(`/_health/pages/move_schedule?hours=${JSON.stringify(data.hours)}`)
|
|
|
+ }}>
|
|
|
+ <Image className="calendar" src={require('@assets/_health/calendar.png')} />
|
|
|
+ <Text>Upcoming{data.hours.length - hours.length > 0 ? `(${data.hours.length - hours.length})` : ''}</Text>
|
|
|
+ </View>
|
|
|
+ <View className="more" onClick={() => {
|
|
|
+ jumpPage('./move_setting_time')
|
|
|
+ }}>
|
|
|
+ <IconMore width={17} color="#b2b2b2" />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+
|
|
|
+ function summary() {
|
|
|
+ return <View className="move_summary">
|
|
|
+
|
|
|
+ <View className="summary_header">
|
|
|
+ <Text>Summary</Text>
|
|
|
+ <View style={{ flex: 1 }} />
|
|
|
+ {
|
|
|
+ data.last_updated && <Text style={{ color: '#b2b2b2', fontSize: 10, fontWeight: 'normal' }}>最近更新于 {dayjs(data.last_updated).format('HH:mm')}</Text>
|
|
|
+ }
|
|
|
+
|
|
|
+ <View className="border_footer_line" />
|
|
|
+ </View>
|
|
|
+ <View className="summary_content">
|
|
|
+ <View className="summary_footer">
|
|
|
+ <View className="summary_footer_item">
|
|
|
+ <Text className="light_desc">Hours Sedentary</Text>
|
|
|
+ <Text>{data.stat.sedentary_hours}/{data.stat.waking_hours}</Text>
|
|
|
+ </View>
|
|
|
+ <View className="summary_footer_item">
|
|
|
+ <Text className="light_desc">Hours Active</Text>
|
|
|
+ <Text style={{ color: getThemeColor('ACTIVE') }}>{data.stat.active_hours}/{data.stat.waking_hours}</Text>
|
|
|
+ </View>
|
|
|
+ <View className="summary_footer_item">
|
|
|
+ <Text className="light_desc">Hours Missed</Text>
|
|
|
+ <Text>{data.stat.missed_hours}/{data.stat.waking_hours}</Text>
|
|
|
+ </View>
|
|
|
</View>
|
|
|
- <View className="summary_footer_item">
|
|
|
- <Text className="light_desc">Distance</Text>
|
|
|
- <Text>{data.stat.real_distance}/{data.stat.target_distance}</Text>
|
|
|
+ <View className="summary_footer" style={{ marginTop: rpxToPx(48) }}>
|
|
|
+ <View className="summary_footer_item">
|
|
|
+ <Text className="light_desc">Total Steps</Text>
|
|
|
+ <Text>{data.stat.real_steps}/{data.stat.target_steps}</Text>
|
|
|
+ </View>
|
|
|
+ <View className="summary_footer_item">
|
|
|
+ <Text className="light_desc">Total Calories</Text>
|
|
|
+ <Text>{data.stat.real_calories}/{data.stat.target_calories}</Text>
|
|
|
+ </View>
|
|
|
+ <View className="summary_footer_item">
|
|
|
+ <Text className="light_desc">Total Distance</Text>
|
|
|
+ <Text>{data.stat.real_distance}/{data.stat.target_distance}</Text>
|
|
|
+ </View>
|
|
|
</View>
|
|
|
</View>
|
|
|
+
|
|
|
</View>
|
|
|
}
|
|
|
|
|
|
- if (!loaded) return <View />
|
|
|
+ if (!loaded || !loadAuth) return <View />
|
|
|
|
|
|
return <View style={{ display: 'flex', flexDirection: 'column' }}>
|
|
|
<Text className="move-title">Move Every Hour</Text>
|
|
|
- <Text onClick={() => {
|
|
|
- jumpPage('./move_setting_time')
|
|
|
- }}>Setting</Text>
|
|
|
{
|
|
|
- currentContent()
|
|
|
+ console()
|
|
|
+ }
|
|
|
+ {
|
|
|
+ tools()
|
|
|
+ }
|
|
|
+ {
|
|
|
+ summary()
|
|
|
}
|
|
|
{
|
|
|
activeHour()
|
|
|
}
|
|
|
+
|
|
|
{
|
|
|
list.length > 0 && <View className="history">
|
|
|
<View className="history_header">
|