diff --git a/assets/scss/main.scss b/assets/scss/main.scss
index 00771a4..2fcee9c 100644
--- a/assets/scss/main.scss
+++ b/assets/scss/main.scss
@@ -58,7 +58,7 @@ body {
//swiper
.swiper {
width: 100%;
- height: 100%;
+ height: calc(100vh - 54px);
}
.swiper-slide {
@@ -75,6 +75,12 @@ body {
.swiper-slide img {
display: block;
width: 100%;
- height: 100%;
+ height: calc(100vh - 54px);
object-fit: cover;
+}
+
+.swiper-pagination {
+ position: absolute;
+ bottom: 200px !important;
+ --swiper-pagination-bullet-size: 4px
}
\ No newline at end of file
diff --git a/components/ProductDescription.vue b/components/ProductDescription.vue
index a5c1218..d14b8f4 100644
--- a/components/ProductDescription.vue
+++ b/components/ProductDescription.vue
@@ -2,7 +2,7 @@
{{ productsData?.name }}
-
{{ currentVariant?.options[0]?.price }}
+
@@ -47,6 +47,7 @@
diff --git a/components/ProductImages.vue b/components/ProductImages.vue
index d01e53c..488f9c5 100644
--- a/components/ProductImages.vue
+++ b/components/ProductImages.vue
@@ -17,7 +17,7 @@
>
diff --git a/components/ProductPrice.vue b/components/ProductPrice.vue
new file mode 100644
index 0000000..08dcb79
--- /dev/null
+++ b/components/ProductPrice.vue
@@ -0,0 +1,26 @@
+
+
+
{{ price }}
+
+
+
+
+
+
diff --git a/pages/product/[id].vue b/pages/product/[id].vue
index 6e31747..90058b3 100644
--- a/pages/product/[id].vue
+++ b/pages/product/[id].vue
@@ -8,6 +8,30 @@
>
+
+
+
+
+ {{ productsData?.name }}
+
+
+
+
+
+
+
@@ -22,7 +46,10 @@
import type { UseSwipeDirection } from '@vueuse/core'
import { useMediaQuery, useSwipe } from '@vueuse/core'
import { computed, shallowRef } from 'vue'
+import ProductPrice from '~/components/ProductPrice.vue'
+import { useCurrentProduct, useProduct } from '~/composables'
+const { productsData } = useProduct()
const isMobile = useMediaQuery('(max-width: 1280px)')
const open = ref(false)
const target = shallowRef
(null)
@@ -35,25 +62,28 @@ const { isSwiping, lengthY } = useSwipe(
passive: false,
onSwipe(e: TouchEvent) {
if (targetHeight.value) {
- if (lengthY.value > 200) {
+ if (lengthY.value > 100) {
open.value = true
}
}
},
onSwipeEnd(e: TouchEvent, direction: UseSwipeDirection) {
console.log('lengthY.value', lengthY.value)
- if (lengthY.value > 200 && targetHeight.value && (Math.abs(lengthY.value) / targetHeight.value) >= 0.5) {
+ if (lengthY.value > 100 && targetHeight.value && (Math.abs(lengthY.value) / targetHeight.value) >= 0.5) {
open.value = true
}
},
},
)
+
+const { currentVariant } = useCurrentProduct()