This commit is contained in:
Vladimir Voronin
2024-11-06 19:14:53 +03:00
parent 04fae4dec7
commit 9d546f6069
23 changed files with 1008 additions and 108 deletions

View File

@@ -1,17 +1,21 @@
<template>
<div id="app" class="flex flex-col h-screen bg-gray-100 gap-4">
<div id="app" class="flex flex-col h-screen bg-gray-300">
<!-- MenuBar всегда фиксирован сверху -->
<MenuBar class="w-full sticky hidden lg:block top-0 z-10"/>
<ToolBar class=" fixed visible lg:invisible bottom-0 z-10"/>
<!-- Контентная часть заполняет оставшееся пространство -->
<div class="flex-grow ">
<!-- {{ tg_id }}-->
<div class="flex-grow gap-4 ">
<!-- {{ tg_id }}-->
<Button label="Sub" :class="checkNotif ? 'flex' : '!hidden'" @click="checkSubscribe"/>
<router-view/>
<div class="bg-gray-100 h-12 block lg:hidden"></div>
</div>
<!-- <OverlayView class="w-full sticky invisible lg:visible top-0 z-10"/>-->
<TransactionForm v-if="visible" :visible="visible"
:transaction-type="drawerStore.transactionType ? drawerStore.transactionType : 'INSTANT'"
:category-type="drawerStore.categoryType ? drawerStore.categoryType : 'EXPENSE'" @close-drawer="closeDrawer"/>
</div>
</template>
@@ -23,6 +27,16 @@ import Button from "primevue/button";
import {computed, onMounted} from "vue";
import {subscribeUserToPush} from "@/services/pushManager";
import apiClient from '@/services/axiosSetup';
import {useUserStore} from "@/stores/userStore";
import {useDrawerStore} from '@/stores/drawerStore'
import TransactionForm from "@/components/TransactionForm.vue";
const drawerStore = useDrawerStore();
const visible = computed(() => drawerStore.visible);
const closeDrawer = () => {
drawerStore.setVisible(false);
};
const checkNotif = computed(() => {
@@ -65,11 +79,20 @@ const sendSubscribe = async () => {
}
}
console.log('vyzyvaem app')
const userStore = useUserStore();
const user = computed(() => userStore.user);
console.log('vyzvali app')
onMounted(async () => {
await checkSubscribe()
})
console.log("Загружаем данные при монтировании...");
if (!userStore.user) {
console.log('vyzyvaem app2')
await userStore.fetchUserProfile();
console.log('vyzvali app2')
}
await checkSubscribe();
});
// @Options({