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

@@ -195,19 +195,6 @@ export function WeightHistoryCard() {
};
});
// 如果正在加载,显示加载状态
if (isLoading) {
return (
<TouchableOpacity style={styles.card} onPress={navigateToWeightRecords} activeOpacity={0.8}>
<View style={styles.cardHeader}>
<Text style={styles.cardTitle}></Text>
</View>
<View style={styles.emptyContent}>
<Text style={styles.emptyDescription}>...</Text>
</View>
</TouchableOpacity>
);
}
// 如果没有体重数据,显示引导卡片
if (!hasWeight) {
@@ -574,6 +561,7 @@ const styles = StyleSheet.create({
shadowOpacity: 0.1,
shadowRadius: 8,
elevation: 3,
marginTop: 16
},
cardHeader: {
flexDirection: 'row',
@@ -649,6 +637,7 @@ const styles = StyleSheet.create({
summaryInfo: {
position: 'absolute',
width: '100%',
marginTop: 10,
},
chartContainer: {
position: 'absolute',