67 lines
1.2 KiB
Vue
67 lines
1.2 KiB
Vue
<template>
|
|
<view class="page-container">
|
|
<CastloveContent />
|
|
|
|
<!-- 蒙层 - 导航栏展开时显示 -->
|
|
<view v-if="navExpanded" class="nav-mask" @click="navExpanded = false"></view>
|
|
|
|
<BottomNav :activeTab="2" :isExpanded="navExpanded" @update:activeTab="handleTabChange" @update:isExpanded="navExpanded = $event" />
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from "vue";
|
|
import BottomNav from "../components/BottomNav.vue";
|
|
import CastloveContent from "../components/CastloveContent.vue";
|
|
|
|
const navExpanded = ref(false);
|
|
|
|
const handleTabChange = (newTab) => {
|
|
const routes = [
|
|
'/pages/square/square',
|
|
'/pages/starbook/index',
|
|
'/pages/castlove/mall',
|
|
'/pages/starcity/index',
|
|
'/pages/friends/index'
|
|
];
|
|
|
|
if (newTab >= 0 && newTab < routes.length) {
|
|
uni.redirectTo({
|
|
url: routes[newTab]
|
|
});
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
.page-container {
|
|
position: relative;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
min-height: 100vh;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.nav-mask {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.3);
|
|
z-index: 999;
|
|
animation: fadeIn 0.3s ease-out;
|
|
}
|
|
|
|
@keyframes fadeIn {
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
</style>
|