feat: add discount UI for landing pages

Add discount configuration in admin editor and countdown timer
display on public purchase page.

- Add discount section to AdminLandingEditor with toggle, percent
  slider, datetime pickers, per-tariff overrides, live preview
- Add DiscountBanner with countdown timer to QuickPurchase page
  using AnimatePresence exit animation and proper interval cleanup
- Add strikethrough prices and discount badges to tariff cards,
  summary card and pay button with null/equality guards
- Add discount translations for ru and en locales
- Fix delete/toggle API return types to match backend contracts
- Fix isoToDatetimeLocal to preserve seconds on re-edit
- Fix preview rounding to match backend integer division
This commit is contained in:
Fringg
2026-03-07 07:01:46 +03:00
parent c3cf805827
commit f7afa002f0
6 changed files with 474 additions and 12 deletions

View File

@@ -3766,7 +3766,18 @@
"loadingPeriods": "Загрузка...",
"periodDaySuffix": "д",
"localeTab": "Язык",
"localeHint": "Переключите язык для редактирования текста на этом языке"
"localeHint": "Переключите язык для редактирования текста на этом языке",
"discount": "Скидка",
"discountEnabled": "Включить скидку",
"discountPercent": "Скидка %",
"discountStartsAt": "Дата начала",
"discountEndsAt": "Дата окончания",
"discountBadge": "Текст баннера (необязательно)",
"discountBadgePlaceholder": "напр. Весенняя распродажа!",
"discountOverrides": "Индивидуальные скидки по тарифам",
"discountOverridesHint": "Оставьте пустым для использования общей скидки",
"discountPreview": "Предпросмотр",
"discountActive": "Скидка"
}
},
"adminUpdates": {
@@ -4562,6 +4573,12 @@
"giftPendingActivationDesc": "У получателя уже есть активная подписка. Ему будет отправлена ссылка для активации подарка.",
"autoLoginFailed": "Не удалось выполнить автоматический вход",
"autoLoginProcessing": "Выполняется вход...",
"discount": {
"days": "д",
"hours": "ч",
"minutes": "м",
"seconds": "с"
},
"periodLabels": {
"d1": "1 день",
"d2": "2 дня",