diff --git a/frontend/components/global/Header.vue b/frontend/components/global/Header.vue index 0e149ba..bd383d9 100644 --- a/frontend/components/global/Header.vue +++ b/frontend/components/global/Header.vue @@ -32,7 +32,12 @@ const megaMenuCategories = computed(() => { subitems: item.subcategorys.map((item) => { return { title: item.name, - link: item.slug, + subitems: item.subcategorys.map((item) => { + return { + title: item.name, + link: item.slug, + }; + }), }; }), }; diff --git a/frontend/components/global/MegaMenu.vue b/frontend/components/global/MegaMenu.vue index 0843000..32c99e7 100644 --- a/frontend/components/global/MegaMenu.vue +++ b/frontend/components/global/MegaMenu.vue @@ -7,7 +7,10 @@ type Props = { title: string; subitems: { title: string; - link: string; + subitems: { + title: string; + link: string; + }[]; }[]; }[]; }; @@ -157,14 +160,12 @@ onMounted(() => { />
-
+
diff --git a/frontend/components/global/ProductsGrid.vue b/frontend/components/global/ProductsGrid.vue index 6af65f3..30723e8 100644 --- a/frontend/components/global/ProductsGrid.vue +++ b/frontend/components/global/ProductsGrid.vue @@ -45,7 +45,7 @@ withDefaults(defineProps(), { :id="product.id" :slug="product.slug" :title="product.name" - :picture="product.variants[0].images[0].image" + :picture="product.image ?? product.variants[0].images[0].image" :colors="product.colors" :price="product.variants[0].price" :rate="product.rating" diff --git a/frontend/components/global/ServiceHighlights.vue b/frontend/components/global/ServiceHighlights.vue index 6090dce..a864877 100644 --- a/frontend/components/global/ServiceHighlights.vue +++ b/frontend/components/global/ServiceHighlights.vue @@ -13,12 +13,12 @@ const highlights = ref([ { icon: "/img/heymlz/footer-support.gif", title: "خدمات مشتری", - description: "پشتیبانی استثنایی، راه‌حل‌های پایدار برای شما", + description: "پشتیبانی ویژه، راه‌حلی پایدار برای شما", }, { icon: "/img/heymlz/footer-send.gif", - title: "ارسال سریع و رایگان", - description: "ارسال رایگان برای سفارش‌های بالای ۱۵۰ دلار", + title: "ارسال سریع و مطمئن", + description: "پردازش محصولات با سرعت بالا و ارسال مطمئن", }, { icon: "/img/heymlz/footer-share.gif", diff --git a/frontend/components/global/product-detail/ProductsSlider.vue b/frontend/components/global/product-detail/ProductsSlider.vue index d486ae1..f08954a 100644 --- a/frontend/components/global/product-detail/ProductsSlider.vue +++ b/frontend/components/global/product-detail/ProductsSlider.vue @@ -91,7 +91,7 @@ const onSwiper = (swiper: SwiperClass) => { :id="product.id" :slug="product.slug" :title="product.name" - :picture="product.variants[0].images[0].image" + :picture="product.image ?? product.variants[0].images[0].image" :colors="product.colors" :price="product.variants[0].price" :rate="product.rating" diff --git a/frontend/components/product/ProductHero/index.vue b/frontend/components/product/ProductHero/index.vue index 592b13c..325ff4d 100644 --- a/frontend/components/product/ProductHero/index.vue +++ b/frontend/components/product/ProductHero/index.vue @@ -77,14 +77,32 @@ watch( diff --git a/frontend/constants/index.ts b/frontend/constants/index.ts index a67d595..56f126e 100644 --- a/frontend/constants/index.ts +++ b/frontend/constants/index.ts @@ -37,7 +37,7 @@ export const API_ENDPOINTS = { }, products: { get_all: "/products", - categories: "/products/categories", + categories: "/products/categories/v2", saved: "/accounts/favorites", }, resellers_products: { diff --git a/frontend/types/global.d.ts b/frontend/types/global.d.ts index 0b400c9..bb10682 100644 --- a/frontend/types/global.d.ts +++ b/frontend/types/global.d.ts @@ -1,4 +1,4 @@ -export { }; +export {}; declare global { type ApiPaginated = { @@ -105,9 +105,13 @@ declare global { category: SubCategory; colors: string[]; added_to_favorites: boolean; + image: string | null; }; - type ProductListItem = Pick; + type ProductListItem = Pick< + Product, + "id" | "variants" | "name" | "rating" | "slug" | "category" | "colors" | "image" + >; type Article = { id: number; @@ -156,6 +160,7 @@ declare global { image: string; product_count: number; parent: string; + subcategorys: SubCategory[]; }; type Address = {