|
@@ -1,7 +1,9 @@
|
|
<template>
|
|
<template>
|
|
<van-nav-bar
|
|
<van-nav-bar
|
|
- :title="$t(route.meta.title)"
|
|
|
|
v-if="route.meta.navbar"
|
|
v-if="route.meta.navbar"
|
|
|
|
+ :left-arrow="route.meta.leftArrow"
|
|
|
|
+ @click-left="goBack()"
|
|
|
|
+ :title="$t(route.meta.title)"
|
|
class="app-bar-header"
|
|
class="app-bar-header"
|
|
:style="notchStyle"
|
|
:style="notchStyle"
|
|
/>
|
|
/>
|
|
@@ -11,15 +13,21 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { getNotchHeight } from "@/utils/statusBar";
|
|
import { getNotchHeight } from "@/utils/statusBar";
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
+const router = useRouter();
|
|
|
|
|
|
const notchStyle = ref({});
|
|
const notchStyle = ref({});
|
|
const mainStyle = ref({});
|
|
const mainStyle = ref({});
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+const goBack = () => {
|
|
|
|
+ if (route.meta.navbar) {
|
|
|
|
+ router.back();
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
onBeforeMount(async () => {
|
|
onBeforeMount(async () => {
|
|
const height = await getNotchHeight();
|
|
const height = await getNotchHeight();
|
|
- notchStyle.value = {
|
|
|
|
- height: `calc(46px + ${height}px)`,
|
|
|
|
|
|
+ notchStyle.value = {
|
|
|
|
+ paddingTop: `${height}px`,
|
|
};
|
|
};
|
|
|
|
|
|
if (route.meta.navbar) {
|
|
if (route.meta.navbar) {
|
|
@@ -39,17 +47,16 @@ body {
|
|
height: 100%;
|
|
height: 100%;
|
|
background-color: @bg-color2;
|
|
background-color: @bg-color2;
|
|
}
|
|
}
|
|
|
|
+
|
|
</style>
|
|
</style>
|
|
|
|
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
.app-bar-header {
|
|
.app-bar-header {
|
|
- :deep(.van-nav-bar__content) {
|
|
|
|
- height: 100%;
|
|
|
|
|
|
+ :deep(.van-nav-bar__title){
|
|
|
|
+ font-weight: 500;
|
|
}
|
|
}
|
|
- :deep(.van-nav-bar__title) {
|
|
|
|
- height: 72%;
|
|
|
|
- display: flex;
|
|
|
|
- align-items: flex-end;
|
|
|
|
|
|
+ :deep(.van-icon){
|
|
|
|
+ color: @font-color3;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|