Fixes: 1) Replace `ElNotification` with `useNotification` across all components and composables; 2) Add missing semicolons, consistent formatting, and type annotations in multiple files; 3) Resolve non-reactive elements in wishlist and cart state management; Extra: 1) Update i18n translations with new strings for promocodes, balance, authentication, and profile settings; 2) Refactor SCSS styles including variable additions and component-specific tweaks; 3) Remove redundant queries, unused imports, and `storePage.ts` file for cleanup.
90 lines
No EOL
2.1 KiB
Vue
90 lines
No EOL
2.1 KiB
Vue
<template>
|
|
<div class="cart">
|
|
<div class="cart__top">
|
|
<div class="cart__top-left">
|
|
<p><span>{{ t('profile.cart.quantity') }}</span> {{ productsInCartQuantity }}</p>
|
|
<p><span>{{ t('profile.cart.total') }}</span> {{ totalPrice }}</p>
|
|
</div>
|
|
<ui-button class="cart__top-button">{{ t('buttons.checkout') }}</ui-button>
|
|
</div>
|
|
<div class="cart__list">
|
|
<cards-product
|
|
v-for="product in productsInCart"
|
|
:key="product.node.uuid"
|
|
:product="product.node.product"
|
|
:isList="true"
|
|
:isToolsVisible="true"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import {usePageTitle} from "~/composables/utils";
|
|
|
|
const {t} = useI18n();
|
|
const cartStore = useCartStore();
|
|
|
|
const productsInCart = computed(() => {
|
|
return cartStore.currentOrder.orderProducts ? cartStore.currentOrder.orderProducts.edges : [];
|
|
});
|
|
const totalPrice = computed(() => {
|
|
return cartStore.currentOrder.totalPrice ? cartStore.currentOrder.totalPrice : [];
|
|
});
|
|
const productsInCartQuantity = computed(() => {
|
|
let count = 0;
|
|
cartStore.currentOrder.orderProducts?.edges.forEach((el) => {
|
|
count = count + el.node.quantity;
|
|
});
|
|
|
|
return count;
|
|
});
|
|
|
|
const { setPageTitle } = usePageTitle();
|
|
|
|
setPageTitle(t('breadcrumbs.cart'));
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.cart {
|
|
width: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 50px;
|
|
flex: 1;
|
|
min-height: 0;
|
|
|
|
&__top {
|
|
width: 100%;
|
|
background-color: $white;
|
|
padding: 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
box-shadow: 0 0 20px 2px rgba(0, 0, 0, 0.2);
|
|
border-radius: $default_border_radius;
|
|
|
|
& p {
|
|
font-weight: 600;
|
|
}
|
|
|
|
&-button {
|
|
width: fit-content;
|
|
padding-inline: 20px;
|
|
}
|
|
}
|
|
|
|
&__list {
|
|
width: 100%;
|
|
padding: 20px;
|
|
background-color: $white;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 20px;
|
|
box-shadow: 0 0 20px 2px rgba(0, 0, 0, 0.2);
|
|
border-radius: $default_border_radius;
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
}
|
|
}
|
|
</style> |