import { AnimatedNumber } from '@/components/AnimatedNumber'; import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; interface BasalMetabolismCardProps { value: number | null; resetToken?: number; style?: any; } export function BasalMetabolismCard({ value, resetToken, style }: BasalMetabolismCardProps) { // 获取基础代谢状态描述 const getMetabolismStatus = () => { if (value === null || value === 0) { return { text: '未知', color: '#9AA3AE' }; } // 基于常见的基础代谢范围来判断状态 if (value >= 1800) { return { text: '高代谢', color: '#10B981' }; } else if (value >= 1400) { return { text: '正常', color: '#3B82F6' }; } else if (value >= 1000) { return { text: '偏低', color: '#F59E0B' }; } else { return { text: '较低', color: '#EF4444' }; } }; const status = getMetabolismStatus(); return ( {/* 头部区域 */} 基础代谢 {status.text} {/* 数值显示区域 */} {value != null && value > 0 ? ( Math.round(v).toString()} /> ) : ( -- )} 千卡/日 ); } const styles = StyleSheet.create({ container: { backgroundColor: '#FFFFFF', borderRadius: 20, padding: 16, shadowColor: '#000', shadowOffset: { width: 0, height: 4, }, shadowOpacity: 0.08, shadowRadius: 12, elevation: 4, position: 'relative', overflow: 'hidden', }, header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 16, zIndex: 1, }, leftSection: { flexDirection: 'row', alignItems: 'center', }, iconContainer: { width: 32, height: 32, borderRadius: 10, backgroundColor: '#FFFFFF', alignItems: 'center', justifyContent: 'center', marginRight: 8, shadowColor: '#000', shadowOffset: { width: 0, height: 1, }, shadowOpacity: 0.1, shadowRadius: 2, elevation: 1, }, fireIcon: { width: 14, height: 18, backgroundColor: '#EF4444', borderTopLeftRadius: 7, borderTopRightRadius: 7, borderBottomLeftRadius: 2, borderBottomRightRadius: 2, }, title: { fontSize: 14, color: '#0F172A', }, statusBadge: { paddingHorizontal: 8, paddingVertical: 4, borderRadius: 12, }, statusText: { fontSize: 11, fontWeight: '600', }, valueSection: { flexDirection: 'row', alignItems: 'center', zIndex: 1, }, value: { fontSize: 24, fontWeight: '800', color: '#0F172A', lineHeight: 28, }, unit: { fontSize: 14, fontWeight: '500', color: '#64748B', marginLeft: 6, }, });