feat: add product view page

This commit is contained in:
Nikita Kiselev
2025-07-12 11:30:26 +03:00
parent 252854e67e
commit f13e128d03
11 changed files with 309 additions and 112 deletions

View File

@@ -1,46 +1,9 @@
<template>
<FullscreenViewport v-if="platform === 'ios' && platform === 'android'"/>
<div
class="hero min-h-screen relative"
style="background-image: url(https://img.daisyui.com/images/stock/photo-1507358522600-9f71e620c44e.webp);"
>
<div class="hero-overlay"></div>
<div class="hero-content text-neutral-content text-center">
<div class="max-w-md">
<h1 class="mb-5 text-5xl font-bold">Товарняк</h1>
<p class="mb-5">
Мы гордо продаём то, что другие боятся.
</p>
<button class="btn btn-primary" @click="scrollToProducts">
Показать товар лицом
</button>
<div class="mt-4 flex justify-center">
<svg
class="w-6 h-6 text-white animate-bounce"
fill="none"
stroke="currentColor"
stroke-width="2"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7" />
</svg>
</div>
<div class="absolute text-gray-400 left-3 bottom-3">
{{ platform }}
</div>
</div>
</div>
</div>
<div ref="goodsRef">
<ProductList/>
</div>
<FullscreenViewport/>
<router-view />
</template>
<script setup>
import ProductList from "./components/ProductList.vue";
import {onMounted, ref} from "vue";
import { useWebAppViewport } from 'vue-tg';
import { useMiniApp, FullscreenViewport } from 'vue-tg';
@@ -49,21 +12,6 @@ const tg = useMiniApp();
const platform = ref();
platform.value = tg.platform;
// const backButton = useBackButton();
// backButton.show();
const goodsRef = ref();
function scrollToProducts() {
goodsRef.value?.scrollIntoView({ behavior: 'smooth' });
}
const { disableVerticalSwipes } = useWebAppViewport();
disableVerticalSwipes();
onMounted(() => {
});
</script>