schon/storefront/src/components/home/home-collection.vue
Alexandr SaVBaD Waltz 2d363e1740 Features: 1) Introduce new components including ui-counter, ui-link, base-auth, and base-header-catalogue with scoped styles; 2) Add useProductTags composable and integrate GraphQL queries for product tagging; 3) Build standalone pages for cart and wishlist with basic templates; 4) Integrate vue3-marquee-slider, swiper, and primeicons dependencies for enhanced UI interactions; 5) Add skeleton loaders for language switcher and counter components; 6) Localize the app with support for it-it, de-de, ja-jp, da-dk, fr-fr, and nl-nl locales;
Fixes: 1) Refactor `useProducts` and `useCategorybySlug` composables for improved error handling and lazy loading; 2) Correct import path in `product-page.vue` for `useProductBySlug`; 3) Update `useLanguages` composable to set current locale from local storage; 4) Remove unused `auth.js`, `base-header.vue`, and deprecated GraphQL fragments;

Extra: Minor styling adjustments and removal of redundant console logs; Updated `package-lock.json` dependencies for version consistency.
2025-05-31 17:43:33 +03:00

104 lines
No EOL
2.1 KiB
Vue

<template>
<div class="collection">
<div class="container">
<div class="collection__wrapper">
<h2 class="collection__title">{{ t('home.collection.title') }}</h2>
<div class="collection__inner">
<home-collection-inner
v-for="tag in tags"
:key="tag.uuid"
:tag="tag.node"
/>
<home-collection-inner
v-if="newProducts.length > 0"
:tag="newProductsTag"
/>
<home-collection-inner
v-if="priceProducts.length > 0"
:tag="priceProductsTag"
/>
</div>
</div>
</div>
</div>
</template>
<script setup>
import {useI18n} from "vue-i18n";
import HomeCollectionInner from "@/components/home/home-collection-inner.vue";
import {useProducts, useProductTags} from "@/composables/products";
import {computed, onMounted} from "vue";
const {t} = useI18n()
const { tags, loading: tagsLoading, getProductTags } = useProductTags();
const {
products: newProducts,
loading: newLoading,
getProducts: getNewProducts
} = useProducts();
const {
products: priceProducts,
loading: priceLoading,
getProducts: getPriceProducts
} = useProducts();
const newProductsTag = computed(() => {
return {
name: t('home.collection.newTag'),
uuid: 'new-products',
productSet: {
edges: newProducts.value
}
}
});
const priceProductsTag = computed(() => {
return {
name: t('home.collection.cheapTag'),
uuid: 'price-products',
productSet: {
edges: priceProducts.value
}
}
});
onMounted( async () => {
await getProductTags()
await Promise.all([
getProductTags(),
getNewProducts({
orderBy: '-modified'
}),
getPriceProducts({
orderBy: '-price'
})
]);
})
</script>
<style lang="scss" scoped>
.collection {
&__wrapper {
display: flex;
flex-direction: column;
align-items: center;
gap: 50px;
}
&__title {
font-size: 72px;
font-weight: 900;
color: #dd6878;
}
&__inner {
display: flex;
align-items: flex-start;
flex-wrap: wrap;
justify-content: center;
gap: 100px;
}
}
</style>