From 51571135630382042d6a7640b6b22890391c1cd3 Mon Sep 17 00:00:00 2001 From: Bivekich Date: Fri, 18 Jul 2025 15:56:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D1=81=D1=82=D0=B8=D0=BB=D0=B8=20=D0=B8=20=D1=84=D1=83?= =?UTF-8?q?=D0=BD=D0=BA=D1=86=D0=B8=D0=BE=D0=BD=D0=B0=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=86=D1=8B=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BF=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D0=BA=D0=B8.=20=D0=98?= =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D1=8B=20=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=D1=81=D1=81=D1=8B=20=D1=81=D0=B5=D1=82=D0=BA=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=B0=D0=B4?= =?UTF-8?q?=D0=B0=D0=BF=D1=82=D0=B8=D0=B2=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BE?= =?UTF-8?q?=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F,?= =?UTF-8?q?=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=B1=D0=B5=D0=B9=D0=B4=D0=B6?= =?UTF-8?q?=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D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=D1=80=D0=B8=D1=8F=D1=82=D0=B8=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/globals.css | 11 + .../supplies/create-supply-page.tsx | 193 ++++++++---------- 2 files changed, 91 insertions(+), 113 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index ae0c3bb..297d0a5 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -380,3 +380,14 @@ 0 0 40px rgba(192, 132, 252, 0.25); } } + +/* Убираем стрелки у input[type="number"] */ +input[type="number"]::-webkit-outer-spin-button, +input[type="number"]::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +input[type="number"] { + -moz-appearance: textfield; +} diff --git a/src/components/supplies/create-supply-page.tsx b/src/components/supplies/create-supply-page.tsx index 631bbe4..684edca 100644 --- a/src/components/supplies/create-supply-page.tsx +++ b/src/components/supplies/create-supply-page.tsx @@ -403,7 +403,7 @@ export function CreateSupplyPage() { )} -
+
{mockProducts.map((product) => { const selectedQuantity = getSelectedQuantity(product.id) const discountedPrice = product.discount @@ -419,34 +419,22 @@ export function CreateSupplyPage() { className="w-full h-full object-cover group-hover:scale-110 transition-transform duration-500" /> - {/* Badges в верхних углах */} -
- {product.isNew && ( - - - NEW - - )} - {product.isBestseller && ( - - - ХИТ - - )} - {product.discount && ( - - -{product.discount}% - - )} -
- {/* Количество в наличии */} -
- 50 ? 'bg-green-500/80' : product.quantity > 10 ? 'bg-yellow-500/80' : 'bg-red-500/80'} text-white border-0 backdrop-blur`}> - {product.quantity} шт +
+ 50 ? 'bg-green-500/80' : product.quantity > 10 ? 'bg-yellow-500/80' : 'bg-red-500/80'} text-white border-0 backdrop-blur text-xs`}> + {product.quantity}
+ {/* Discount badge */} + {product.discount && ( +
+ + -{product.discount}% + +
+ )} + {/* Overlay с кнопками */}
@@ -460,123 +448,102 @@ export function CreateSupplyPage() {
-
+
{/* Заголовок и бренд */}
-
+
{product.brand && ( {product.brand} )} - - {product.category} - + {product.isNew && ( + + NEW + + )} + {product.isBestseller && ( + + ХИТ + + )}
-

+

{product.name}

-

- Артикул: {product.article} -

- {/* Описание */} -

- {product.description} -

- - {/* Характеристики */} -
- {product.color && ( -
-
- Цвет: {product.color} -
- )} - {product.size && ( -
- Размер: {product.size} -
- )} - {product.weight && ( -
- Вес: {product.weight} г -
- )} + {/* Основная характеристика */} +
+ {product.color && {product.color}} + {product.size && {product.size}}
{/* Цена */} -
-
-
-
- {formatCurrency(discountedPrice)} -
- {product.discount && ( -
- {formatCurrency(product.price)} -
- )} +
+
+
+ {formatCurrency(discountedPrice)}
-
за штуку
+ {product.discount && ( +
+ {formatCurrency(product.price)} +
+ )}
{/* Управление количеством */} -
-
- - { - const value = Math.max(0, Math.min(product.quantity, parseInt(e.target.value) || 0)) - updateProductQuantity(product.id, value) - }} - className="h-9 w-16 text-center bg-white/10 border-white/20 text-white text-sm" - min={0} - max={product.quantity} - /> - -
+
+ + { + const value = e.target.value.replace(/[^0-9]/g, '') + const numValue = Math.max(0, Math.min(product.quantity, parseInt(value) || 0)) + updateProductQuantity(product.id, numValue) + }} + onFocus={(e) => e.target.select()} + className="h-8 w-12 text-center bg-white/10 border border-white/20 text-white text-sm rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" + /> + {selectedQuantity > 0 && ( - + )}
{/* Сумма для выбранного товара */} {selectedQuantity > 0 && ( -
-
- Сумма: {formatCurrency(discountedPrice * selectedQuantity)} +
+
+ {formatCurrency(discountedPrice * selectedQuantity)} {product.discount && ( - - (экономия {formatCurrency((product.price - discountedPrice) * selectedQuantity)}) - +
+ экономия {formatCurrency((product.price - discountedPrice) * selectedQuantity)} +
)}