移除理性检查清单相关代码,优化决策检查组件逻辑,删除重复的大额支出等待时间提示

This commit is contained in:
zihanjian
2025-06-08 11:52:46 +08:00
parent ab8895a3d6
commit 5647b1a098
2 changed files with 5 additions and 41 deletions

View File

@@ -2,11 +2,9 @@ import React from 'react';
import { AlertTriangle, Clock, Brain } from 'lucide-react';
import {
getCooldownChecks,
getRationalChecklist,
getScoreBasedReminders,
getRecommendedWaitTime,
CooldownCheckItem,
RationalCheckItem
CooldownCheckItem
} from '../utils/decisionChecks';
interface DecisionChecksProps {
@@ -21,7 +19,6 @@ const DecisionChecks: React.FC<DecisionChecksProps> = ({
score
}) => {
const cooldownChecks = getCooldownChecks(productPrice, adjustments, score);
const rationalChecklist = getRationalChecklist();
const scoreReminders = getScoreBasedReminders(score);
const waitTime = getRecommendedWaitTime(parseInt(productPrice) || 0, score);
@@ -52,15 +49,7 @@ const DecisionChecks: React.FC<DecisionChecksProps> = ({
}
};
const getCategoryIcon = (category: RationalCheckItem['category']) => {
switch (category) {
case 'financial': return '💰';
case 'necessity': return '🎯';
case 'social': return '👥';
case 'risk': return '⚡';
default: return '❓';
}
};
const shouldShowCooldownChecks = productPrice && (cooldownChecks.length > 0 || scoreReminders.length > 0);
@@ -107,27 +96,9 @@ const DecisionChecks: React.FC<DecisionChecksProps> = ({
</div>
)}
{/* 理性检查清单 */}
<div className="bg-blue-50 border border-blue-200 rounded-lg p-4">
<h4 className="font-semibold text-blue-800 mb-3 flex items-center gap-2">
<Brain size={18} />
</h4>
<div className="space-y-2">
{rationalChecklist.map((item, index) => (
<div key={index} className="flex items-start gap-2 text-sm text-blue-700">
<span className="mt-0.5">{getCategoryIcon(item.category)}</span>
<span> {item.question}</span>
</div>
))}
</div>
<div className="mt-3 pt-2 border-t border-blue-300 text-xs text-blue-600">
💡 1-2
</div>
</div>
</div>
);
};
export default DecisionChecks;
export default DecisionChecks;

View File

@@ -26,14 +26,7 @@ export function getCooldownChecks(
return checks;
}
// 大额支出检查
if (price > 5000) {
checks.push({
condition: true,
message: "大额支出 → 建议等待24小时",
type: 'warning'
});
}
// 移除重复的大额支出等待时间提示(已在上方显示等待时间)
// 限时促销检查
if (adjustments.discount) {