feat(design): product link in cart

This commit is contained in:
2025-09-25 19:24:00 +03:00
parent 35dd0de261
commit 39a350d517
2 changed files with 16 additions and 12 deletions

View File

@@ -35,7 +35,9 @@
</div>
<div>
<h2 class="card-title">{{ item.name }} <span v-if="! item.stock" class="text-error font-bold">***</span></h2>
<RouterLink :to="{name: 'product.show', params: {id: item.product_id}}" class="card-title">
{{ item.name }} <span v-if="! item.stock" class="text-error font-bold">***</span>
</RouterLink>
<p class="text-sm font-bold">{{ item.total }}</p>
<p>{{ item.price }}/ед</p>
<div>

View File

@@ -3,8 +3,8 @@
<div>
<swiper-container ref="swiperEl" init="false">
<swiper-slide
v-for="(image, index) in product.images"
lazy="true"
v-for="(image, index) in product.images"
lazy="true"
>
<img
:src="image.thumbnailURL"
@@ -15,10 +15,10 @@
</swiper-container>
<FullScreenImageViewer
v-if="isFullScreen"
:images="product.images"
:activeIndex="initialFullScreenIndex"
@close="closeFullScreen"
v-if="isFullScreen"
:images="product.images"
:activeIndex="initialFullScreenIndex"
@close="closeFullScreen"
/>
<!-- Product info -->
@@ -44,11 +44,12 @@
</p>
<p v-if="false" class="text-xs">Кол-во на складе: {{ product.quantity }} шт.</p>
<p v-if="product.minimum && product.minimum > 1">Минимальное кол-во для заказа: {{ product.minimum }}</p>
<p v-if="product.minimum && product.minimum > 1" class="text-xs">
Минимальное кол-во для заказа: {{ product.minimum }}
</p>
<p class="text-xs">Наличие: {{ product.stock }}</p>
</div>
<div class="badge badge-primary">{{ product.stock }}</div>
<div v-if="product.options && product.options.length" class="mt-4">
<ProductOptions v-model="product.options"/>
</div>
@@ -88,7 +89,8 @@
</div>
</div>
<div v-if="product.product_id" class="fixed px-4 pb-10 pt-4 bottom-0 left-0 w-full bg-base-200 z-50 flex flex-col gap-2 border-t-1 border-t-base-300">
<div v-if="product.product_id"
class="fixed px-4 pb-10 pt-4 bottom-0 left-0 w-full bg-base-200 z-50 flex flex-col gap-2 border-t-1 border-t-base-300">
<div class="text-error">
{{ error }}
</div>
@@ -175,7 +177,7 @@ function showFullScreen(index) {
isFullScreen.value = true;
initialFullScreenIndex.value = index;
document.body.style.overflow = 'hidden';
history.pushState({ fullscreen: true }, '');
history.pushState({fullscreen: true}, '');
}
function closeFullScreen() {