diff --git a/components/HeaderBlock.vue b/components/HeaderBlock.vue index f57672e..efa03b7 100644 --- a/components/HeaderBlock.vue +++ b/components/HeaderBlock.vue @@ -25,9 +25,9 @@ - @@ -218,6 +218,10 @@ const colorMode = useColorMode(); const route = useRoute() +function navigateToShop() { + menuStore.navigateToItem(menuStore.menuItems?.items.find(item => item.page_name === 'shop')) +} + const isDark = computed({ get() { return colorMode.value === "dark"; diff --git a/components/section/login-page/LoginMain.vue b/components/section/login-page/LoginMain.vue index 9a944c7..f1d7f60 100644 --- a/components/section/login-page/LoginMain.vue +++ b/components/section/login-page/LoginMain.vue @@ -7,7 +7,7 @@ }" />
-
+

{{ $t('login') }}

{{ $t('email') }}

-

{{ $t('password') }}

-

{{ $t('forgot_password_question') - }}

+ }}

- {{ $t('login') }} + {{ $t('login') }}

{{ $t('no_account') - }}

+ }}

{{ $t('sign_up_now') - }}

+ }}

@@ -49,4 +49,6 @@ type Component = { section_id: string; section_img: string; section_lang_data: {}; -}; \ No newline at end of file +}; +const store = useStore() + \ No newline at end of file diff --git a/components/section/registration-page/RegistrationMain.vue b/components/section/registration-page/RegistrationMain.vue index 017338f..7edd626 100644 --- a/components/section/registration-page/RegistrationMain.vue +++ b/components/section/registration-page/RegistrationMain.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/components/section/shop-page/CategoryTree.vue b/components/section/shop-page/CategoryTree.vue new file mode 100644 index 0000000..ec386ec --- /dev/null +++ b/components/section/shop-page/CategoryTree.vue @@ -0,0 +1,44 @@ + + + \ No newline at end of file diff --git a/components/section/shop-page/Product.vue b/components/section/shop-page/Product.vue new file mode 100644 index 0000000..16fee20 --- /dev/null +++ b/components/section/shop-page/Product.vue @@ -0,0 +1,53 @@ + + + diff --git a/components/section/shop-page/ShopMain.vue b/components/section/shop-page/ShopMain.vue new file mode 100644 index 0000000..5919ea1 --- /dev/null +++ b/components/section/shop-page/ShopMain.vue @@ -0,0 +1,377 @@ + + + + \ No newline at end of file diff --git a/stores/menuStore.ts b/stores/menuStore.ts index 768526b..3ac3652 100644 --- a/stores/menuStore.ts +++ b/stores/menuStore.ts @@ -139,7 +139,8 @@ export const useMenuStore = defineStore("menuStore", () => { name: `id-slug___${$i18n.locale.value}`, }); openDropDown.value = false; - } else { + } + else { router.push({ params: { slug: defaultMenu.value.link_rewrite, diff --git a/stores/store.ts b/stores/store.ts index 1f07948..b060b3e 100644 --- a/stores/store.ts +++ b/stores/store.ts @@ -13,6 +13,10 @@ export const useStore = defineStore("store", () => { const totalInvestment = ref() const minValue = ref() + // login + const email = ref() + const password = ref() + const components = ref({} as PBPageItem[]); const getSections = async (id: string) => { pb.cancelRequest("menu_view"); @@ -111,6 +115,34 @@ export const useStore = defineStore("store", () => { } } + async function logIn() { + try { + const res = await fetch( + 'http://127.0.0.1:4000/api/public/user/session/start', + { + method: 'POST', + body: JSON.stringify({ + mail: email.value, + password: password.value + }), + headers: { + "Content-Type": "application/json", + }, + } + ); + + if (!res.ok) { + throw new Error(`HTTP error: ${res.status}`); + } + + const data = await res.json(); + minValue.value = data.data + + } catch (error) { + console.error("getList error:", error); + } + } + getCalculator() getMinValue() @@ -121,6 +153,9 @@ export const useStore = defineStore("store", () => { monthlySavings, storagePeriod, minValue, + email, + password, + logIn, getCalculator, getComponents, getSections, diff --git a/types/index.ts b/types/index.ts index 18bc385..2a1b1c4 100644 --- a/types/index.ts +++ b/types/index.ts @@ -126,4 +126,34 @@ export type Currencies = { sign: string; active: boolean; suffix: boolean; +} + +export type FeatureValue = { + parent: number, + products_with_value: number, + value: string, + value_id: number, +} + +export type Feature = { + feature: string, + feature_id: number, + feature_values: FeatureValue[], + products_with_feature: number, +} + +export type ProductType = { + applied_tax_rate: number, + cover_picture_uuid: string, + description: string, + formatted_price: string, + id: number, + in_stock: number, + is_sale_active: boolean, + link_rewrite: string, + name: string, + price: number, + tax_name: string, + cart_item_id?: number + product_id?: number } \ No newline at end of file