|
|
@@ -138,7 +138,7 @@ export default function Page() {
|
|
|
mainTimer()
|
|
|
}, [])
|
|
|
|
|
|
- function mainTimer(){
|
|
|
+ function mainTimer() {
|
|
|
if (timer) {
|
|
|
clearInterval(timer)
|
|
|
timer = null
|
|
|
@@ -657,7 +657,7 @@ export default function Page() {
|
|
|
else {
|
|
|
PushNotification.checkPermissions((res) => {
|
|
|
//允许授权
|
|
|
- if ((kIsIOS && res.authorizationStatus == 2) || (!kIsIOS && res.alert)){
|
|
|
+ if ((kIsIOS && res.authorizationStatus == 2) || (!kIsIOS && res.alert)) {
|
|
|
}
|
|
|
else {
|
|
|
showAlert({
|
|
|
@@ -702,7 +702,7 @@ export default function Page() {
|
|
|
else {
|
|
|
PushNotification.checkPermissions((res) => {
|
|
|
//允许授权
|
|
|
- if ((kIsIOS && res.authorizationStatus == 2) || (!kIsIOS && res.alert)){
|
|
|
+ if ((kIsIOS && res.authorizationStatus == 2) || (!kIsIOS && res.alert)) {
|
|
|
}
|
|
|
else {
|
|
|
showAlert({
|
|
|
@@ -821,7 +821,7 @@ export default function Page() {
|
|
|
</Box>
|
|
|
|
|
|
{
|
|
|
- user.isLogin && records.length > 0 && <View className="index_section" style={{ marginTop: -rpxToPx(25-12), marginBottom: -rpxToPx(20) }}>
|
|
|
+ user.isLogin && records && records.length > 0 && <View className="index_section" style={{ marginTop: -rpxToPx(25 - 12), marginBottom: -rpxToPx(20) }}>
|
|
|
<Text className="index_section_title">{t('feature.track_time_duration.record_fast_sleep.header.latest_record')}</Text>
|
|
|
{
|
|
|
process.env.TARO_ENV == 'weapp' && <Text className="fast_sleep_more index_more" onClick={more}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>
|
|
|
@@ -834,11 +834,11 @@ export default function Page() {
|
|
|
</View>
|
|
|
}
|
|
|
{
|
|
|
- user.isLogin && records.length==0 && <View style={{ marginTop: -rpxToPx(25) }}/>
|
|
|
+ user.isLogin && records && records.length == 0 && <View style={{ marginTop: -rpxToPx(25) }} />
|
|
|
}
|
|
|
|
|
|
{
|
|
|
- user.isLogin && records.length > 0 && <View id="latest" className="fast_sleep_item_bg">
|
|
|
+ user.isLogin && records && records.length > 0 && <View id="latest" className="fast_sleep_item_bg">
|
|
|
<RecordFastSleep data={records[0]} type='record' index={-20000} />
|
|
|
</View>
|
|
|
}
|
|
|
@@ -864,17 +864,17 @@ export default function Page() {
|
|
|
</View>
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
{
|
|
|
- user.isLogin && !showErrorPage && <View className="index_section" style={{height:rpxToPx(120),marginTop:rpxToPx(40)}}>
|
|
|
+ user.isLogin && !showErrorPage && <View className="index_section" style={{ height: rpxToPx(120), marginTop: rpxToPx(40) }}>
|
|
|
<Text className="index_main_title">{t('feature.pro.for_pro')}</Text>
|
|
|
</View>
|
|
|
}
|
|
|
|
|
|
{
|
|
|
- user.isLogin && !showErrorPage && <View className="index_section" style={{marginBottom:-rpxToPx(10),marginTop:-rpxToPx(40)}}>
|
|
|
+ user.isLogin && !showErrorPage && <View className="index_section" style={{ marginBottom: -rpxToPx(10), marginTop: -rpxToPx(40) }}>
|
|
|
<Text className="index_section_title">{t('feature.day_night.group_title')}</Text>
|
|
|
</View>
|
|
|
}
|
|
|
@@ -892,7 +892,7 @@ export default function Page() {
|
|
|
user.isLogin && (process.env.TARO_ENV == 'weapp') && <Discovery />
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
{
|
|
|
modalContent()
|
|
|
}
|