feat: TASK-115 - enhance dosage and treatment cost calculator in ProductPage

This commit is contained in:
parsa aghaei 2026-07-26 16:04:39 +03:30
parent 21ef2149ba
commit 5284717cfb
3 changed files with 38 additions and 10 deletions

View File

@ -186,7 +186,7 @@
"title": "افزودن نشانگر نشان‌دار بودن محصولات رسمی کاتالوگ Canina و لینک دانلود کاتالوگ پی‌دی‌اف در هدر و فوتر",
"priority": "MEDIUM",
"assigned_role": "05_dev_frontend",
"status": "pending",
"status": "completed",
"max_file_count": 3,
"estimated_minutes": 15,
"dependency_task_ids": ["TASK-113"],
@ -194,5 +194,19 @@
"افزودن دکمه دانلود کاتالوگ رسمی PDF برند Canina در فوتر و منوی اصلی",
"نمایش بنر اصالت کاتالوگ رسمی محصولات در صفحات جزئیات محصول"
]
},
{
"id": "TASK-115",
"title": "افزودن ماشین‌حساب محاسبه دوز دقیق و هزینه دوره درمانی مکمل‌ها در ProductPage برای پت‌دارها",
"priority": "HIGH",
"assigned_role": "05_dev_frontend",
"status": "pending",
"max_file_count": 3,
"estimated_minutes": 15,
"dependency_task_ids": ["TASK-114"],
"acceptance_criteria": [
"محاسبه تعداد قوطی/بسته مورد نیاز دوره درمانی بر اساس وزن پت",
"نمایش تخمین هزینه دوره درمانی و تعداد روزهای تامین مکمل"
]
}
]

View File

@ -5,7 +5,7 @@
"checkpoint": {
"stage": "TASK_EXECUTION",
"active_agent": "05_dev_frontend",
"current_ticket_id": "TASK-114",
"current_ticket_id": "TASK-115",
"sub_step_index": 10,
"total_sub_steps": 10
},

View File

@ -415,23 +415,37 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
</div>
{/* Calculation Results Output */}
<div className="bg-canina-blue rounded-[2rem] p-8 text-white border-b-8 border-white/20 shadow-2xl flex flex-col justify-between h-full min-h-[220px]">
<div className="flex items-center gap-2 mb-4 opacity-90 border-b border-white/10 pb-3">
<Sparkles className="w-4 h-4 text-white" />
<span className="text-[10px] font-bold uppercase tracking-widest font-vazir text-white">تخمین هوش مصنوعی (AI Advice)</span>
<div className="bg-canina-blue rounded-[2rem] p-8 text-white border-b-8 border-white/20 shadow-2xl flex flex-col justify-between h-full min-h-[240px]">
<div className="flex items-center justify-between mb-4 opacity-90 border-b border-white/10 pb-3">
<div className="flex items-center gap-2">
<Sparkles className="w-4 h-4 text-amber-300" />
<span className="text-[10px] font-bold uppercase tracking-widest font-vazir text-white">محاسبهگر دوره درمانی (AI Calculator)</span>
</div>
<span className="text-[10px] bg-white/20 px-2.5 py-0.5 rounded-full font-black">
پیشنهاد: {toPersian(itemQuantity)} بسته
</span>
</div>
<div className="flex items-center justify-between">
<div className="grid grid-cols-2 gap-4">
<div>
<div className="text-3xl font-black font-vazir text-white">{toPersian(calculation.duration)} روز</div>
<div className="text-[10px] font-bold text-white/80 font-vazir whitespace-nowrap mt-1">تخمین اتمام مصرف بسته</div>
<div className="text-[10px] font-bold text-white/80 font-vazir whitespace-nowrap mt-1">مدت تامین یک بسته</div>
</div>
<div className="text-left">
<div className="text-2xl font-black font-vazir text-white">{toPersian(calculation.dailyDose)}</div>
<div className="text-[10px] font-bold text-white/80 font-vazir whitespace-nowrap mt-1">دوز روزانه ({calculation.unit === 'g' ? 'گرم' : calculation.unit})</div>
</div>
</div>
<p className="text-[11px] text-white/60 font-bold font-vazir mt-6 leading-relaxed">
* دوزها تخمینی هستند؛ توصیه میشود برای مصرف دقیق کاتالوگ محصول را مطالعه کنید.
<div className="mt-4 pt-4 border-t border-white/10 flex items-center justify-between">
<span className="text-[11px] font-bold text-white/80">تخمین هزینه دوره ۳۰ روزه:</span>
<span className="text-sm font-black text-amber-300">
{toPersian((Math.ceil(30 / (calculation.duration || 30)) * (product.priceValue || 0)).toLocaleString())} تومان
</span>
</div>
<p className="text-[10px] text-white/60 font-bold font-vazir mt-3 leading-relaxed">
* دوز دقیق بر اساس وزن پت محاسبه شده است؛ برای ماندگاری کامل دوره، خرید تعداد بستههای پیشنهادی توصیه میشود.
</p>
</div>
</div>