feat:修改路由

This commit is contained in:
zerosaturation 2026-05-06 13:16:45 +08:00
parent 34ae7247b1
commit 2cd3f78598
9 changed files with 26 additions and 29 deletions

View File

@ -519,11 +519,11 @@ const handleBack = async () => {
//
const handleTabChange = (newTab) => {
const routes = [
'/pages/square/square',
'/pages/friends/index',
'/pages/starbook/index',
'/pages/castlove/mall',
'/pages/starcity/index',
'/pages/friends/index'
'/pages/square/square'
];
if (newTab >= 0 && newTab < routes.length) {

View File

@ -18,11 +18,11 @@ const navExpanded = ref(false);
const handleTabChange = (newTab) => {
const routes = [
'/pages/square/square',
'/pages/friends/index',
'/pages/starbook/index',
'/pages/castlove/mall',
'/pages/starcity/index',
'/pages/friends/index'
'/pages/square/square'
];
if (newTab >= 0 && newTab < routes.length) {

View File

@ -59,8 +59,8 @@
//
const navItems = [
{
name: '广场',
icon: '/static/icon/square.png',
name: '搭子',
icon: '/static/icon/dazi.png',
angle: 122 //
},
{
@ -79,8 +79,8 @@
angle: 73 //
},
{
name: '好友',
icon: '/static/icon/friends.png',
name: '广场',
icon: '/static/icon/square.png',
angle: 57 //
}
];

View File

@ -6,7 +6,7 @@
<!-- 蒙层 - 导航栏展开时显示 -->
<view v-if="navExpanded" class="nav-mask" @click="navExpanded = false"></view>
<BottomNav :activeTab="4" :isExpanded="navExpanded" @update:activeTab="handleTabChange" @update:isExpanded="navExpanded = $event" />
<BottomNav :activeTab="0" :isExpanded="navExpanded" @update:activeTab="handleTabChange" @update:isExpanded="navExpanded = $event" />
</view>
</template>
@ -20,13 +20,13 @@ const navExpanded = ref(false);
const handleTabChange = (newTab) => {
const routes = [
'/pages/square/square',
'/pages/friends/index',
'/pages/starbook/index',
'/pages/castlove/mall',
'/pages/starcity/index',
'/pages/friends/index'
'/pages/square/square'
];
if (newTab >= 0 && newTab < routes.length) {
uni.navigateTo({
url: routes[newTab]

View File

@ -45,11 +45,11 @@
/>
<!-- 底部导航栏 -->
<BottomNav
:activeTab="0"
:isExpanded="navExpanded"
<BottomNav
:activeTab="4"
:isExpanded="navExpanded"
@update:activeTab="handleTabChange"
@update:isExpanded="navExpanded = $event"
@update:isExpanded="navExpanded = $event"
/>
<!-- 全局引导遮罩 -->
@ -122,20 +122,17 @@ const handleRankingModalClose = (visible) => {
}
const handleTabChange = (newTab) => {
if (newTab === 0) {
if (newTab === 4) {
navExpanded.value = false
uni.navigateTo({
url: '/pages/square/square'
})
return
}
const routes = [
'/pages/square/square',
'/pages/friends/index',
'/pages/starbook/index',
'/pages/castlove/mall',
'/pages/starcity/index',
'/pages/friends/index'
'/pages/square/square'
]
if (newTab >= 0 && newTab < routes.length) {

View File

@ -20,11 +20,11 @@ const navExpanded = ref(false);
const handleTabChange = (newTab) => {
const routes = [
'/pages/square/square',
'/pages/friends/index',
'/pages/starbook/index',
'/pages/castlove/mall',
'/pages/starcity/index',
'/pages/friends/index'
'/pages/square/square'
];
if (newTab >= 0 && newTab < routes.length) {

View File

@ -20,11 +20,11 @@ const navExpanded = ref(false);
const handleTabChange = (newTab) => {
const routes = [
'/pages/square/square',
'/pages/friends/index',
'/pages/starbook/index',
'/pages/castlove/mall',
'/pages/starcity/index',
'/pages/friends/index'
'/pages/square/square'
];
if (newTab >= 0 && newTab < routes.length) {

View File

@ -148,11 +148,11 @@ function handleTabChange(newTab) {
// tab
const tabRoutes = [
'/pages/square/square', // 广
'/pages/friends/index', //
'/pages/starbook/index', //
'/pages/castlove/mall', //
'/pages/starcity/index', //
'/pages/friends/index' //
'/pages/square/square' // 广
]
if (newTab >= 0 && newTab < tabRoutes.length) {

View File

Before

Width:  |  Height:  |  Size: 530 KiB

After

Width:  |  Height:  |  Size: 530 KiB