diff --git a/frontend/spa/src/components/Loader.vue b/frontend/spa/src/components/Loader.vue new file mode 100644 index 0000000..198b439 --- /dev/null +++ b/frontend/spa/src/components/Loader.vue @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/frontend/spa/src/components/SingleProductImageSwiper.vue b/frontend/spa/src/components/SingleProductImageSwiper.vue new file mode 100644 index 0000000..67adca7 --- /dev/null +++ b/frontend/spa/src/components/SingleProductImageSwiper.vue @@ -0,0 +1,111 @@ + + + + + \ No newline at end of file diff --git a/frontend/spa/src/utils/ftch.js b/frontend/spa/src/utils/ftch.js index 3292755..0dbde7a 100644 --- a/frontend/spa/src/utils/ftch.js +++ b/frontend/spa/src/utils/ftch.js @@ -15,7 +15,7 @@ export const apiFetch = ofetch.create({ if (data) { const encoded = encodeBase64Unicode(data); options.headers = { - ...(isDev && { 'XDEBUG_TRIGGER': 'PHPSTORM' }), + ...(isDev && {'XDEBUG_TRIGGER': 'PHPSTORM'}), ...options.headers, 'X-Telegram-InitData': encoded, }; @@ -131,4 +131,16 @@ export async function heartbeat() { return await ftch('heartbeat'); } +export async function fetchProductById(productId) { + return await ftch('product_show', { + id: productId, + }); +} + +export async function fetchProductImages(productId) { + return await ftch('getProductImages', { + id: productId, + }); +} + export default ftch; diff --git a/frontend/spa/src/views/Product.vue b/frontend/spa/src/views/Product.vue index b1418ad..0acde54 100644 --- a/frontend/spa/src/views/Product.vue +++ b/frontend/spa/src/views/Product.vue @@ -1,55 +1,36 @@