|
|
@@ -115,7 +115,7 @@ export default function Move() {
|
|
|
useDidShow(() => {
|
|
|
checkAuth()
|
|
|
getMovesCurrent()
|
|
|
- getMovesHistory(1)
|
|
|
+ // getMovesHistory(1)
|
|
|
})
|
|
|
|
|
|
global.updateMove = () => {
|
|
|
@@ -180,7 +180,7 @@ export default function Move() {
|
|
|
myScrollTop = top
|
|
|
if (e.detail.scrollTop > 70) {
|
|
|
Taro.setNavigationBarTitle({
|
|
|
- title:'Move Every Hour'
|
|
|
+ title:t('health.move_every_hour')
|
|
|
})
|
|
|
}
|
|
|
else {
|
|
|
@@ -195,9 +195,24 @@ export default function Move() {
|
|
|
list.forEach((item, index) => {
|
|
|
if (top >= itemLayouts[index] - 50) {
|
|
|
i = index
|
|
|
- var currentDate = (list[index].date + '').substring(0, 6)
|
|
|
+ // var currentDate = (list[index].date + '').substring(0, 6)
|
|
|
+
|
|
|
+ // date = currentDate.substring(0, 4) + '年' + currentDate.substring(4, 6) + '月'
|
|
|
+ var currentDate = list[index].date + ''
|
|
|
+ var date1 = currentDate.substring(0, 4) + '-' + currentDate.substring(4, 6) + '-'+ currentDate.substring(6, 8)
|
|
|
+ var timestamp = new Date(date1).getTime()
|
|
|
+
|
|
|
+ if (TimeFormatter.isTimestampInThisWeek(timestamp)) {
|
|
|
+ date = t('health.this_week')
|
|
|
+ }
|
|
|
+ else if (dayjs(timestamp).format('YYYY') == dayjs().format('YYYY')) {
|
|
|
+ date = global.language == 'en' ? dayjs(timestamp).format('MMMM') : dayjs(timestamp).format('MMMM')
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ date = global.language == 'en' ? dayjs(timestamp).format('YYYY') : dayjs(timestamp).format('YYYY年')
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- date = currentDate.substring(0, 4) + '年' + currentDate.substring(4, 6) + '月'
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -440,7 +455,7 @@ export default function Move() {
|
|
|
{
|
|
|
item.is_extra && <Text style={{ color: getThemeColor('SLEEP') }}>is Extra</Text>
|
|
|
}
|
|
|
- <Text className="h24 bold"><Text className="h34 bold">{item.real_steps}</Text> / {item.target_steps} steps</Text>
|
|
|
+ <Text className="h24 bold"><Text className="h34 bold">{item.real_steps}</Text> / {item.target_steps} {t('health.steps')}</Text>
|
|
|
<View style={{
|
|
|
height: rpxToPx(18), flexShrink: 0,
|
|
|
|
|
|
@@ -448,7 +463,7 @@ export default function Move() {
|
|
|
</View>
|
|
|
|
|
|
{
|
|
|
- item.status == 'MISSED' && <Text className="missed">Missed</Text>
|
|
|
+ item.status == 'MISSED' && <Text className="missed">{t('health.missed')}</Text>
|
|
|
}
|
|
|
{
|
|
|
item.status == 'SEDENTARY' && <IconSit width={rpxToPx(44)} color={MainColorType.g02} />
|
|
|
@@ -466,7 +481,8 @@ export default function Move() {
|
|
|
|
|
|
return <View className="summary">
|
|
|
<View className="summary_header">
|
|
|
- <Text className="h34 bold">Last {hours.length} Hour{hours.length == 1 ? '' : 's'}</Text>
|
|
|
+ {/* <Text className="h34 bold">Last {hours.length} Hour{hours.length == 1 ? '' : 's'}</Text> */}
|
|
|
+ <Text className="h34 bold">{t('health.past_few_hour')}</Text>
|
|
|
<View className="border_footer_line" />
|
|
|
</View>
|
|
|
{
|
|
|
@@ -490,7 +506,7 @@ export default function Move() {
|
|
|
}}
|
|
|
type={NewButtonType.link}
|
|
|
fontSize={rpxToPx(24)}
|
|
|
- title={moreActive ? '收起' : `展开剩余${hours.length - 3}条`}
|
|
|
+ title={moreActive ? t('health.show_less') : t('health.show_all',{count:hours.length})}
|
|
|
btnStyle={{ minWidth: rpxToPx(170) }}
|
|
|
/>
|
|
|
</View>
|
|
|
@@ -501,7 +517,7 @@ export default function Move() {
|
|
|
}
|
|
|
{
|
|
|
hours.length == 0 && <View className="no_current">
|
|
|
- <Text>No Active Hours Yet.</Text>
|
|
|
+ <Text>{t('health.no_active_hour')}</Text>
|
|
|
<View className="border_footer_line" />
|
|
|
</View>
|
|
|
}
|
|
|
@@ -625,7 +641,7 @@ export default function Move() {
|
|
|
<StatusIndicator
|
|
|
type={StatusType.normal}
|
|
|
color={selItem.type == 'SLEEP' ? getThemeColor('SLEEP') : getThemeColor('ACTIVE')}
|
|
|
- text={`${selItem.type == 'SLEEP' ? 'SLEEP HOUR ' : 'WAKING HOUR '}${selItem.index}`}
|
|
|
+ text={`${selItem.type == 'SLEEP' ? t('health.sleeping_hour') : t('health.waking_hour')}${selItem.index}`}
|
|
|
// fontSize={}
|
|
|
// fontColor={}
|
|
|
/>
|
|
|
@@ -642,22 +658,24 @@ export default function Move() {
|
|
|
tHour = data.hours[0].hour
|
|
|
}
|
|
|
if (hour > tHour) {
|
|
|
- return `Check in begins at ${getDuration().substring(0, 2)}:50 tomorrow`
|
|
|
+ return global.language == 'en'?t('health.check_begin_at',{time:getDuration().substring(0, 2)+':50 tomorrow'}):
|
|
|
+ t('health.check_begin_at',{time:'明天'+getDuration().substring(0, 2)+':50'})
|
|
|
+ // return `Check in begins at ${getDuration().substring(0, 2)}:50 tomorrow`
|
|
|
}
|
|
|
- return `Check in begins at ${getDuration().substring(0, 2)}:50`
|
|
|
+ return t('health.check_begin_at',{time:getDuration().substring(0, 2)+':50'})
|
|
|
}
|
|
|
|
|
|
function consolePanel() {
|
|
|
|
|
|
- if (!allowRun) {
|
|
|
- return <View className="move_console move_console_auth">
|
|
|
- <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>
|
|
|
- }
|
|
|
+ // if (!allowRun) {
|
|
|
+ // return <View className="move_console move_console_auth">
|
|
|
+ // <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 style={{ flex: 1 }} />
|
|
|
@@ -715,7 +733,15 @@ export default function Move() {
|
|
|
}
|
|
|
|
|
|
function toolBtnText() {
|
|
|
- return `Upcoming (${data.hours.length - hours.length > 0 ? data.hours.length - hours.length : ''})`
|
|
|
+ var str = ''
|
|
|
+ if (data.hours.length - hours.length ==1){
|
|
|
+ str = t('health.upcoming')
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ str = t('health.upcomings')
|
|
|
+ }
|
|
|
+
|
|
|
+ return `${str} (${data.hours.length - hours.length > 0 ? data.hours.length - hours.length : '0'})`
|
|
|
}
|
|
|
|
|
|
function showMore() {
|
|
|
@@ -753,10 +779,10 @@ export default function Move() {
|
|
|
return <View className="move_summary">
|
|
|
|
|
|
<View className="summary_header">
|
|
|
- <Text className="h34 bold">Summary</Text>
|
|
|
+ <Text className="h34 bold">{t('health.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>
|
|
|
+ data.last_updated && <Text style={{ color: '#b2b2b2', fontSize: 10, fontWeight: 'normal' }}>{t('health.last_updated')} {dayjs(data.last_updated).format('HH:mm')}</Text>
|
|
|
}
|
|
|
|
|
|
<View className="border_footer_line" />
|
|
|
@@ -764,30 +790,30 @@ export default function Move() {
|
|
|
<View className="summary_content">
|
|
|
<View className="summary_footer">
|
|
|
<View className="summary_footer_item">
|
|
|
- <Text className="light_desc">Hours Sedentary</Text>
|
|
|
+ <Text className="light_desc">{t('health.sedentary_hours')}</Text>
|
|
|
<Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.sedentary_hours}</Text> / {data.stat.waking_hours}</Text>
|
|
|
</View>
|
|
|
<View className="summary_footer_item">
|
|
|
- <Text className="light_desc">Hours Active</Text>
|
|
|
+ <Text className="light_desc">{t('health.active_hours')}</Text>
|
|
|
<Text style={{ color: getThemeColor('ACTIVE'), fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.active_hours}</Text> / {data.stat.waking_hours}</Text>
|
|
|
</View>
|
|
|
<View className="summary_footer_item">
|
|
|
- <Text className="light_desc">Hours Missed</Text>
|
|
|
+ <Text className="light_desc">{t('health.missed_hours')}</Text>
|
|
|
<Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.missed_hours}</Text> / {data.stat.waking_hours}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
<View className="summary_footer" style={{ marginTop: rpxToPx(48) }}>
|
|
|
<View className="summary_footer_item">
|
|
|
- <Text className="light_desc">Total Steps</Text>
|
|
|
+ <Text className="light_desc">{t('health.step')}</Text>
|
|
|
<Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_steps}</Text> / {data.stat.target_steps}</Text>
|
|
|
</View>
|
|
|
<View className="summary_footer_item">
|
|
|
- <Text className="light_desc">Total Calories</Text>
|
|
|
- <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_calories}</Text> / {data.stat.target_calories}</Text>
|
|
|
+ <Text className="light_desc">{t('health.calories')}</Text>
|
|
|
+ <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_calories}</Text> / {data.stat.target_calories}{t('health.kcal')}</Text>
|
|
|
</View>
|
|
|
<View className="summary_footer_item">
|
|
|
- <Text className="light_desc">Total Distance</Text>
|
|
|
- <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_distance}</Text> / {data.stat.target_distance}</Text>
|
|
|
+ <Text className="light_desc">{t('health.distance')}</Text>
|
|
|
+ <Text style={{ fontWeight: 'bold', fontSize: rpxToPx(24) }}><Text style={{ fontSize: rpxToPx(34) }}>{data.stat.real_distance}</Text> / {data.stat.target_distance}{t('health.km')}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
@@ -857,7 +883,7 @@ export default function Move() {
|
|
|
loadMore={more}>
|
|
|
|
|
|
<View style={{ display: 'flex', flexDirection: 'column' }}>
|
|
|
- <NewHeader type={NewHeaderType.left} title="Move Every Hour" />
|
|
|
+ <NewHeader type={NewHeaderType.left} title={t('health.move_every_hour')} />
|
|
|
{
|
|
|
consolePanel()
|
|
|
}
|
|
|
@@ -886,7 +912,8 @@ export default function Move() {
|
|
|
</View>
|
|
|
<View className="history_item_detail_bg">
|
|
|
<IconActive width={rpxToPx(32)} color={MainColorType.active} />
|
|
|
- <Text style={{ fontSize: rpxToPx(26), marginLeft: rpxToPx(16) }}> Hours Active {item.active_hours} · Total Steps {item.stat.real_steps}</Text>
|
|
|
+ <Text style={{ fontSize: rpxToPx(26), marginLeft: rpxToPx(16) }}> {item.description}</Text>
|
|
|
+ {/* <Text style={{ fontSize: rpxToPx(26), marginLeft: rpxToPx(16) }}> Hours Active {item.active_hours} · Total Steps {item.stat.real_steps}</Text> */}
|
|
|
</View>
|
|
|
{/* <View className="border_footer_line" /> */}
|
|
|
</View>
|