feat:修改路由
This commit is contained in:
parent
34ae7247b1
commit
2cd3f78598
@ -519,11 +519,11 @@ const handleBack = async () => {
|
|||||||
// 底部导航切换
|
// 底部导航切换
|
||||||
const handleTabChange = (newTab) => {
|
const handleTabChange = (newTab) => {
|
||||||
const routes = [
|
const routes = [
|
||||||
'/pages/square/square',
|
'/pages/friends/index',
|
||||||
'/pages/starbook/index',
|
'/pages/starbook/index',
|
||||||
'/pages/castlove/mall',
|
'/pages/castlove/mall',
|
||||||
'/pages/starcity/index',
|
'/pages/starcity/index',
|
||||||
'/pages/friends/index'
|
'/pages/square/square'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (newTab >= 0 && newTab < routes.length) {
|
if (newTab >= 0 && newTab < routes.length) {
|
||||||
|
|||||||
@ -18,11 +18,11 @@ const navExpanded = ref(false);
|
|||||||
|
|
||||||
const handleTabChange = (newTab) => {
|
const handleTabChange = (newTab) => {
|
||||||
const routes = [
|
const routes = [
|
||||||
'/pages/square/square',
|
'/pages/friends/index',
|
||||||
'/pages/starbook/index',
|
'/pages/starbook/index',
|
||||||
'/pages/castlove/mall',
|
'/pages/castlove/mall',
|
||||||
'/pages/starcity/index',
|
'/pages/starcity/index',
|
||||||
'/pages/friends/index'
|
'/pages/square/square'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (newTab >= 0 && newTab < routes.length) {
|
if (newTab >= 0 && newTab < routes.length) {
|
||||||
|
|||||||
@ -59,8 +59,8 @@
|
|||||||
// 导航项配置
|
// 导航项配置
|
||||||
const navItems = [
|
const navItems = [
|
||||||
{
|
{
|
||||||
name: '广场',
|
name: '搭子',
|
||||||
icon: '/static/icon/square.png',
|
icon: '/static/icon/dazi.png',
|
||||||
angle: 122 // 左上方
|
angle: 122 // 左上方
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -79,8 +79,8 @@
|
|||||||
angle: 73 // 右方
|
angle: 73 // 右方
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '好友',
|
name: '广场',
|
||||||
icon: '/static/icon/friends.png',
|
icon: '/static/icon/square.png',
|
||||||
angle: 57 // 右下方
|
angle: 57 // 右下方
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<!-- 蒙层 - 导航栏展开时显示 -->
|
<!-- 蒙层 - 导航栏展开时显示 -->
|
||||||
<view v-if="navExpanded" class="nav-mask" @click="navExpanded = false"></view>
|
<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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -20,11 +20,11 @@ const navExpanded = ref(false);
|
|||||||
|
|
||||||
const handleTabChange = (newTab) => {
|
const handleTabChange = (newTab) => {
|
||||||
const routes = [
|
const routes = [
|
||||||
'/pages/square/square',
|
'/pages/friends/index',
|
||||||
'/pages/starbook/index',
|
'/pages/starbook/index',
|
||||||
'/pages/castlove/mall',
|
'/pages/castlove/mall',
|
||||||
'/pages/starcity/index',
|
'/pages/starcity/index',
|
||||||
'/pages/friends/index'
|
'/pages/square/square'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (newTab >= 0 && newTab < routes.length) {
|
if (newTab >= 0 && newTab < routes.length) {
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
<!-- 底部导航栏 -->
|
<!-- 底部导航栏 -->
|
||||||
<BottomNav
|
<BottomNav
|
||||||
:activeTab="0"
|
:activeTab="4"
|
||||||
:isExpanded="navExpanded"
|
:isExpanded="navExpanded"
|
||||||
@update:activeTab="handleTabChange"
|
@update:activeTab="handleTabChange"
|
||||||
@update:isExpanded="navExpanded = $event"
|
@update:isExpanded="navExpanded = $event"
|
||||||
@ -122,20 +122,17 @@ const handleRankingModalClose = (visible) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleTabChange = (newTab) => {
|
const handleTabChange = (newTab) => {
|
||||||
if (newTab === 0) {
|
if (newTab === 4) {
|
||||||
navExpanded.value = false
|
navExpanded.value = false
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/square/square'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
'/pages/square/square',
|
'/pages/friends/index',
|
||||||
'/pages/starbook/index',
|
'/pages/starbook/index',
|
||||||
'/pages/castlove/mall',
|
'/pages/castlove/mall',
|
||||||
'/pages/starcity/index',
|
'/pages/starcity/index',
|
||||||
'/pages/friends/index'
|
'/pages/square/square'
|
||||||
]
|
]
|
||||||
|
|
||||||
if (newTab >= 0 && newTab < routes.length) {
|
if (newTab >= 0 && newTab < routes.length) {
|
||||||
|
|||||||
@ -20,11 +20,11 @@ const navExpanded = ref(false);
|
|||||||
|
|
||||||
const handleTabChange = (newTab) => {
|
const handleTabChange = (newTab) => {
|
||||||
const routes = [
|
const routes = [
|
||||||
'/pages/square/square',
|
'/pages/friends/index',
|
||||||
'/pages/starbook/index',
|
'/pages/starbook/index',
|
||||||
'/pages/castlove/mall',
|
'/pages/castlove/mall',
|
||||||
'/pages/starcity/index',
|
'/pages/starcity/index',
|
||||||
'/pages/friends/index'
|
'/pages/square/square'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (newTab >= 0 && newTab < routes.length) {
|
if (newTab >= 0 && newTab < routes.length) {
|
||||||
|
|||||||
@ -20,11 +20,11 @@ const navExpanded = ref(false);
|
|||||||
|
|
||||||
const handleTabChange = (newTab) => {
|
const handleTabChange = (newTab) => {
|
||||||
const routes = [
|
const routes = [
|
||||||
'/pages/square/square',
|
'/pages/friends/index',
|
||||||
'/pages/starbook/index',
|
'/pages/starbook/index',
|
||||||
'/pages/castlove/mall',
|
'/pages/castlove/mall',
|
||||||
'/pages/starcity/index',
|
'/pages/starcity/index',
|
||||||
'/pages/friends/index'
|
'/pages/square/square'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (newTab >= 0 && newTab < routes.length) {
|
if (newTab >= 0 && newTab < routes.length) {
|
||||||
|
|||||||
@ -148,11 +148,11 @@ function handleTabChange(newTab) {
|
|||||||
|
|
||||||
// 根据tab索引跳转到对应页面
|
// 根据tab索引跳转到对应页面
|
||||||
const tabRoutes = [
|
const tabRoutes = [
|
||||||
'/pages/square/square', // 广场
|
'/pages/friends/index', // 搭子
|
||||||
'/pages/starbook/index', // 星册
|
'/pages/starbook/index', // 星册
|
||||||
'/pages/castlove/mall', // 铸爱
|
'/pages/castlove/mall', // 铸爱
|
||||||
'/pages/starcity/index', // 星城
|
'/pages/starcity/index', // 星城
|
||||||
'/pages/friends/index' // 好友
|
'/pages/square/square' // 广场
|
||||||
]
|
]
|
||||||
|
|
||||||
if (newTab >= 0 && newTab < tabRoutes.length) {
|
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