Refactor components and enhance background task management

- Updated font sizes and weights in BasalMetabolismCard, MoodCard, HealthDataCard, and NutritionRadarCard for improved readability.
- Removed loading state from MoodCard to simplify the component.
- Adjusted styles in WeightHistoryCard for better layout and spacing.
- Integrated expo-background-fetch for improved background task handling.
- Updated Info.plist to include background fetch capability.
- Enhanced background task registration and execution logic in backgroundTaskManager.
- Added debug function to manually trigger background task execution for testing purposes.
This commit is contained in:
richarjiang
2025-09-03 16:17:29 +08:00
parent 16b4fc8816
commit 8b9689b269
17 changed files with 163 additions and 85 deletions

View File

@@ -23,6 +23,7 @@ import { useFocusEffect } from '@react-navigation/native';
import dayjs from 'dayjs';
import * as Haptics from 'expo-haptics';
import { LinearGradient } from 'expo-linear-gradient';
import Lottie from 'lottie-react-native';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { Alert, FlatList, Image, RefreshControl, SafeAreaView, StatusBar, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
@@ -384,11 +385,12 @@ export default function GoalsScreen() {
borderBottomLeftRadius: 24,
borderBottomRightRadius: 24,
}}>
{/* 右下角图片 */}
<Image
source={require('@/assets/images/task/imageTodo.png')}
{/* 右下角Lottie动画 */}
<Lottie
source={require('@/assets/lottie/Goal.json')}
style={styles.bottomRightImage}
resizeMode="contain"
autoPlay
loop
/>
</View>
@@ -716,10 +718,10 @@ const styles = StyleSheet.create({
},
bottomRightImage: {
position: 'absolute',
top: 56,
top: 40,
right: 36,
width: 80,
height: 80,
width: 120,
height: 120,
},
// 任务进度卡片中的按钮样式
cardHeaderButtons: {