feat: 新增财务健康评分弹窗组件,展示用户财务状况、提供AI建议并说明评分规则。

This commit is contained in:
2026-01-28 17:01:32 +08:00
parent 75131c8d6c
commit a28b026ed0
2 changed files with 4 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ export const HealthScoreModal: React.FC<HealthScoreModalProps> = ({
const [loadingAdvice, setLoadingAdvice] = useState(false);
// --- Logic & Calculations ---
const netAssets = totalAssets - totalLiabilities;
const debtRatio = totalAssets > 0 ? (totalLiabilities / totalAssets) * 100 : 0;
const spendDiff = todaySpend - yesterdaySpend;

View File

@@ -9,7 +9,7 @@
* @param categoryId - 保留参数接口,虽然不再用于查表
* @param defaultIcon - 可选的默认图标
*/
export const getCategoryIcon = (categoryId: number): string => {
export const getCategoryIcon = (_categoryId: number): string => {
// 不再维护本地大表,统一返回默认图标
// 组件应当优先使用 props 传入的 icon
return 'solar:question-circle-bold-duotone';
@@ -30,7 +30,7 @@ const COLOR_PALETTE = [
* 获取分类颜色
* 使用 consistent hashing 算法根据 ID 生成一致的颜色
*/
export const getCategoryColor = (categoryId: number, isDarkMode = false): string => {
export const getCategoryColor = (categoryId: number, _isDarkMode = false): string => {
// 简单的哈希算法确保同一个ID总是对应同一个颜色
const index = Math.abs(categoryId) % COLOR_PALETTE.length;
return COLOR_PALETTE[index];
@@ -47,7 +47,7 @@ export const getCategoryGradient = (categoryId: number): string => {
};
// 辅助函数:调整颜色亮度 (简单实现)
function adjustColor(color: string, amount: number) {
function adjustColor(color: string, _amount: number) {
return color; // 暂不需要复杂计算,直接返回原色
}