Commit 18ae5f8f by zhangpeng

调整

parent addd16e1
...@@ -3,11 +3,6 @@ ...@@ -3,11 +3,6 @@
}, },
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index",
"style": {
"navigationBarTitleText": ""
}
},{
"path" : "pages/menu/menu", "path" : "pages/menu/menu",
"style" : "style" :
{ {
...@@ -16,6 +11,12 @@ ...@@ -16,6 +11,12 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": ""
}
} }
,{ ,{
"path" : "pages/order/order", "path" : "pages/order/order",
......
<template> <template>
<view> <view>
<view>菜单</view> <view>菜单</view>
<u-tabbar :list="list" inactive-color="#000000" active-color="#006ECF" :before-switch="beforeSwitch"></u-tabbar> <view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单</view>
<view>菜单111</view>
<u-tabbar :value="selectedTabbar" :border="false" inactive-color="#000000" active-color="#006ECF" :fixed="true" :safeAreaInsetBottom="true" @change="beforeSwitch">
<u-tabbar-item v-for="(item,index) in list" :key="item.text" :text="item.text" :icon="selectedTabbar==index?item.activeIcon:item.icon"></u-tabbar-item>
</u-tabbar>
</view> </view>
</template> </template>
...@@ -9,7 +103,7 @@ ...@@ -9,7 +103,7 @@
export default { export default {
data() { data() {
return { return {
selectedTabbar:0,
} }
}, },
computed:{ computed:{
...@@ -20,6 +114,9 @@ ...@@ -20,6 +114,9 @@
}, },
methods: { methods: {
beforeSwitch(index) { beforeSwitch(index) {
console.log(index,44)
this.selectedTabbar=index;
uni.switchTab({url:this.list[index].pagePath});
return true; return true;
} }
} }
......
...@@ -5,23 +5,22 @@ const store = new Vuex.Store({ ...@@ -5,23 +5,22 @@ const store = new Vuex.Store({
state: { state: {
list: [ list: [
{ {
iconPath: "/static/logo.png", icon: "/static/logo.png",
selectedIconPath: "/static/logo.png", activeIcon: '/static/logo.png',
customIcon: false, customIcon: false,
pagePath: "/pages/menu/menu", pagePath: "/pages/menu/menu",
text: '菜单' text: '菜单'
}, },
{ {
iconPath: "/static/logo.png", icon: "/static/logo.png",
selectedIconPath: "/static/logo.png", activeIcon: '/static/logo.png',
pagePath: "/pages/order/order", pagePath: "/pages/order/order",
text: '订单', text: '订单',
customIcon: false customIcon: false
}, },
{ {
iconPath: "/static/logo.png", icon: "/static/logo.png",
selectedIconPath: "/static/logo.png", activeIcon: '/static/logo.png',
customIcon: false,
pagePath: "/pages/mine/mine", pagePath: "/pages/mine/mine",
text: '我的' text: '我的'
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment