feat: complete all remaining backlog tasks 25.1 to 25.14
Deploy Canina / deploy (push) Waiting to run
Deploy Canina / deploy (push) Waiting to run
This commit is contained in:
1 parent
1542c85b29
commit
ce30ade808
4 files changed
+103
-25
No files matched your search
@@ -134,7 +134,9 @@ export default function Products() {
|
||||
podcastUrl: '',
|
||||
videoUrl: '',
|
||||
pdfUrl: '',
|
||||
symptoms: [] as string[]
|
||||
symptoms: [] as string[],
|
||||
isPreorder: false,
|
||||
preorderDeposit: '' as number | string
|
||||
});
|
||||
|
||||
const fetchData = useCallback(async () => {
|
||||
@@ -211,7 +213,9 @@ export default function Products() {
|
||||
podcastUrl: product.podcastUrl || '',
|
||||
videoUrl: product.videoUrl || '',
|
||||
pdfUrl: product.pdfUrl || '',
|
||||
symptoms: product.symptoms ? product.symptoms.map((s: { symptom: string } | string) => typeof s === 'string' ? s : s.symptom) : []
|
||||
symptoms: product.symptoms ? product.symptoms.map((s: { symptom: string } | string) => typeof s === 'string' ? s : s.symptom) : [],
|
||||
isPreorder: Boolean((product as any).isPreorder),
|
||||
preorderDeposit: (product as any).preorderDeposit || ''
|
||||
});
|
||||
} else {
|
||||
setEditingProduct(null);
|
||||
@@ -221,7 +225,7 @@ export default function Products() {
|
||||
priceDisplay: '', unit: '', packageSize: 0, dosageLogic: '', suitableFor: 'سگ و گربه',
|
||||
imageUrl: '', metaTitle: '', metaDescription: '', keywords: '', canonicalUrl: '', slug: '',
|
||||
images: [], podcastUrl: '', videoUrl: '', pdfUrl: '',
|
||||
symptoms: []
|
||||
symptoms: [], isPreorder: false, preorderDeposit: ''
|
||||
});
|
||||
}
|
||||
setActiveTab('general');
|
||||
@@ -887,6 +891,40 @@ export default function Products() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Pre-order Configuration (TASK-25.13) */}
|
||||
<div className="p-4 bg-purple-50 rounded-2xl border border-purple-100 space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h4 className="font-bold text-purple-900 text-sm">قابلیت پیشخرید کالا (Pre-Order Mode)</h4>
|
||||
<p className="text-xs text-purple-700 mt-0.5">امکان پیشخرید کالا قبل از موجود شدن رسمی با بیعانه یا ثبت رایگان.</p>
|
||||
</div>
|
||||
<label className="relative inline-flex items-center cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="sr-only peer"
|
||||
checked={formData.isPreorder}
|
||||
onChange={(e) => setFormData({ ...formData, isPreorder: e.target.checked })}
|
||||
/>
|
||||
<div className="w-12 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-purple-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{formData.isPreorder && (
|
||||
<div className="pt-2 border-t border-purple-200/60">
|
||||
<label className="block text-xs font-bold text-purple-900 mb-1">مبلغ بیعانه پیشخرید (تومان - ۰ برای ثبت رایگان)</label>
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
placeholder="مثلاً: 200000 یا 0 برای پیشخرید بدون بیعانه"
|
||||
value={formData.preorderDeposit}
|
||||
onChange={(e) => setFormData({ ...formData, preorderDeposit: e.target.value ? Number(e.target.value) : '' })}
|
||||
className="w-full px-4 py-2.5 rounded-xl border border-purple-200 bg-white font-mono text-xs outline-none focus:ring-2 focus:ring-purple-500"
|
||||
dir="ltr"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="space-y-2 col-span-1 md:col-span-2 pt-2">
|
||||
<label className="text-sm font-bold text-gray-700 flex items-center justify-between">
|
||||
<span>منطق و دوز دقیق مصرفی (Dosage Calculator Fields)</span>
|
||||
|
||||
Reference in new issue
Block a user