This commit is contained in:
che
2026-07-23 12:06:08 +05:00
parent 4cfc5d6ae6
commit dddf6516d3
47 changed files with 2253 additions and 94 deletions
+23 -26
View File
@@ -1,12 +1,18 @@
<script setup lang="ts">
import { computed } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useAuth } from "./composables/useAuth";
const route = useRoute();
const router = useRouter();
const { logout } = useAuth();
const activeTab = computed({
get() {
if (route.path.startsWith("/contracts")) {
return "/contracts";
}
return route.path.startsWith("/users") ? "/users" : "/tasks";
},
set(path: string) {
@@ -18,17 +24,32 @@ const activeTab = computed({
const title = computed(() => String(route.meta.title ?? "EWA Mobile"));
const showBack = computed(() => Boolean(route.meta.back));
const showShellNavigation = computed(() => route.path !== "/login");
async function logoutAndRedirect() {
await logout();
router.replace("/login");
}
</script>
<template>
<van-nav-bar :title="title" :left-arrow="showBack" fixed placeholder @click-left="router.back()" />
<van-nav-bar
:title="title"
:left-arrow="showBack"
:right-text="showShellNavigation ? 'Выйти' : ''"
fixed
placeholder
@click-left="router.back()"
@click-right="logoutAndRedirect"
/>
<main class="page">
<router-view />
</main>
<van-tabbar v-model="activeTab" route placeholder safe-area-inset-bottom>
<van-tabbar v-if="showShellNavigation" v-model="activeTab" route placeholder safe-area-inset-bottom>
<van-tabbar-item to="/tasks" name="/tasks" icon="todo-list-o">Задачи</van-tabbar-item>
<van-tabbar-item to="/contracts" name="/contracts" icon="orders-o">Контракты</van-tabbar-item>
<van-tabbar-item to="/users" name="/users" icon="friends-o">Пользователи</van-tabbar-item>
</van-tabbar>
</template>
@@ -65,30 +86,6 @@ body {
padding: 24px 14px 40px;
}
.hero {
margin: 12px 2px 18px;
}
.eyebrow {
margin: 0 0 6px;
color: #1989fa;
font-size: 0.75rem;
font-weight: 800;
letter-spacing: 0.1em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-size: clamp(2rem, 9vw, 4rem);
line-height: 1;
}
.subtitle {
margin: 12px 0 0;
color: #646566;
}
.notice {
margin-bottom: 12px;
border-radius: 14px;