feat: 优化统计页面和BMI卡片,移除压力分析相关代码
- 在统计页面中移除压力分析模态框及相关状态管理,简化组件逻辑 - 更新BMI卡片,改进弹窗展示方式,增加渐变背景和健康建议 - 新增更新体重的功能,支持将体重数据写入健康数据中 - 优化压力计组件,调整数据展示逻辑,提升用户体验
This commit is contained in:
@@ -3,7 +3,6 @@ import { BMICard } from '@/components/BMICard';
|
||||
import { CircularRing } from '@/components/CircularRing';
|
||||
import { NutritionRadarCard } from '@/components/NutritionRadarCard';
|
||||
import { ProgressBar } from '@/components/ProgressBar';
|
||||
import { StressAnalysisModal } from '@/components/StressAnalysisModal';
|
||||
import { StressMeter } from '@/components/StressMeter';
|
||||
import { WeightHistoryCard } from '@/components/WeightHistoryCard';
|
||||
import { Colors } from '@/constants/Colors';
|
||||
@@ -87,9 +86,6 @@ export default function ExploreScreen() {
|
||||
const [nutritionSummary, setNutritionSummary] = useState<NutritionSummary | null>(null);
|
||||
const [isNutritionLoading, setIsNutritionLoading] = useState(false);
|
||||
|
||||
// 压力分析浮窗状态
|
||||
const [showStressModal, setShowStressModal] = useState(false);
|
||||
|
||||
// 记录最近一次请求的“日期键”,避免旧请求覆盖新结果
|
||||
const latestRequestKeyRef = useRef<string | null>(null);
|
||||
|
||||
@@ -209,15 +205,6 @@ export default function ExploreScreen() {
|
||||
}
|
||||
};
|
||||
|
||||
// 处理压力卡片点击
|
||||
const handleStressCardPress = () => {
|
||||
setShowStressModal(true);
|
||||
};
|
||||
|
||||
// 关闭压力分析浮窗
|
||||
const handleCloseStressModal = () => {
|
||||
setShowStressModal(false);
|
||||
};
|
||||
|
||||
// 使用统一的渐变背景色
|
||||
const backgroundGradientColors = [colorTokens.backgroundGradientStart, colorTokens.backgroundGradientEnd] as const;
|
||||
@@ -280,7 +267,7 @@ export default function ExploreScreen() {
|
||||
value={hrvValue}
|
||||
updateTime={hrvUpdateTime}
|
||||
style={styles.masonryCard}
|
||||
onPress={handleStressCardPress}
|
||||
hrvValue={hrvValue}
|
||||
/>
|
||||
|
||||
<View style={[styles.masonryCard, styles.caloriesCard]}>
|
||||
@@ -371,14 +358,6 @@ export default function ExploreScreen() {
|
||||
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
|
||||
{/* 压力分析浮窗 */}
|
||||
<StressAnalysisModal
|
||||
visible={showStressModal}
|
||||
onClose={handleCloseStressModal}
|
||||
hrvValue={hrvValue}
|
||||
updateTime={hrvUpdateTime}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user