feat: 更新营养雷达图组件,优化营养分析卡片
- 在营养分析卡片中引入更新日期和图标,提升信息展示 - 修改营养维度标签,简化文本内容 - 更新雷达图组件,支持自定义尺寸和标签显示 - 增加尺寸配置,优化图表显示效果 - 更新饮食记录服务,添加更新时间字段以支持新功能
This commit is contained in:
@@ -34,6 +34,7 @@ export type NutritionSummary = {
|
||||
totalFiber: number;
|
||||
totalSugar: number;
|
||||
totalSodium: number;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export async function getDietRecords({
|
||||
@@ -67,6 +68,7 @@ export function calculateNutritionSummary(records: DietRecord[]): NutritionSumma
|
||||
totalFiber: 0,
|
||||
totalSugar: 0,
|
||||
totalSodium: 0,
|
||||
updatedAt: '',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -79,6 +81,7 @@ export function calculateNutritionSummary(records: DietRecord[]): NutritionSumma
|
||||
totalFiber: summary.totalFiber + (record.fiberGrams || 0),
|
||||
totalSugar: summary.totalSugar + (record.sugarGrams || 0),
|
||||
totalSodium: summary.totalSodium + (record.sodiumMg || 0),
|
||||
updatedAt: record.updatedAt,
|
||||
}),
|
||||
{
|
||||
totalCalories: 0,
|
||||
@@ -88,6 +91,7 @@ export function calculateNutritionSummary(records: DietRecord[]): NutritionSumma
|
||||
totalFiber: 0,
|
||||
totalSugar: 0,
|
||||
totalSodium: 0,
|
||||
updatedAt: '',
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user