feat:修改路由
This commit is contained in:
parent
34ae7247b1
commit
2cd3f78598
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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 // 右下方
|
||||
}
|
||||
];
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
|
Before Width: | Height: | Size: 530 KiB After Width: | Height: | Size: 530 KiB |
Loading…
Reference in New Issue
Block a user