feat(orders): tg notifications, ya metrika, meta tags
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-if="route.name !== 'cart.show'" class="fixed right-2 bottom-30 z-50 opacity-90">
|
||||
<div v-if="isCartBtnShow" class="fixed right-2 bottom-30 z-50 opacity-90">
|
||||
<div class="indicator">
|
||||
<span class="indicator-item indicator-top indicator-start badge badge-secondary">{{ cart.productsCount }}</span>
|
||||
<button class="btn btn-primary btn-lg btn-circle" @click="openCart">
|
||||
@@ -15,7 +15,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {onMounted} from "vue";
|
||||
import {computed, onMounted} from "vue";
|
||||
import {useCartStore} from "@/stores/CartStore.js";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
|
||||
@@ -23,6 +23,11 @@ const cart = useCartStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const isCartBtnShow = computed(() => {
|
||||
return route.name !== 'cart.show' && route.name !== 'checkout';
|
||||
});
|
||||
|
||||
|
||||
function openCart() {
|
||||
window.Telegram.WebApp.HapticFeedback.selectionChanged();
|
||||
router.push({name: 'cart.show'});
|
||||
|
||||
@@ -11,7 +11,3 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -104,11 +104,8 @@ watch(() => route.params.id, async newId => {
|
||||
|
||||
onMounted(async () => {
|
||||
const saved = productsStore.savedCategoryId === categoryId;
|
||||
|
||||
console.log("Saved Category: ", saved);
|
||||
if (saved && productsStore.products.data.length > 0) {
|
||||
await nextTick();
|
||||
console.log("Products exists, scrolling to ", productsStore.savedScrollY);
|
||||
// повторяем до тех пор, пока высота не станет больше savedScrollY
|
||||
const interval = setInterval(() => {
|
||||
const maxScroll = document.documentElement.scrollHeight - window.innerHeight
|
||||
|
||||
Reference in New Issue
Block a user