parent
107d71edbb
commit
90cc6f967d
@ -1,52 +1,51 @@
|
||||
|
||||
Component({
|
||||
data: {
|
||||
selected: 0,//当前选中的tab下标
|
||||
color: "#1E1E1E",
|
||||
selectedColor: "#646464",//tabbar选中字体颜色
|
||||
list: [{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "/components/tabbarComponent/icons/home.png",
|
||||
"selectedIconPath": "icons/homeActive.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/insight/index",
|
||||
"iconPath": "/components/tabbarComponent/icons/insight.png",
|
||||
"selectedIconPath": "icons/insightActive.png",
|
||||
"text": "洞察"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/brandSearch/index",
|
||||
"iconPath": "/components/tabbarComponent/icons/appSearch.png",
|
||||
"selectedIconPath": "icons/appSearchActive.png",
|
||||
"text": "品牌搜索"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/varComm/index",
|
||||
"iconPath": "/components/tabbarComponent/icons/varComm.png",
|
||||
"selectedIconPath": "icons/varCommActive.png",
|
||||
"text": "对比"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/index",
|
||||
"iconPath": "/components/tabbarComponent/icons/mine.png",
|
||||
"selectedIconPath": "icons/mineActive.png",
|
||||
"text": "我的"
|
||||
}
|
||||
],//tabbar循环数据集
|
||||
},
|
||||
attached() {
|
||||
selected: 0, //当前选中的tab下标
|
||||
color: "#1E1E1E",
|
||||
selectedColor: "#646464", //tabbar选中字体颜色
|
||||
list: [{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "icons/home.png",
|
||||
"selectedIconPath": "icons/homeActive.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/insight/index",
|
||||
"iconPath": "icons/insight.png",
|
||||
"selectedIconPath": "icons/insightActive.png",
|
||||
"text": "洞察"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/brandSearch/index",
|
||||
"iconPath": "icons/appSearch.png",
|
||||
"selectedIconPath": "icons/appSearchActive.png",
|
||||
"text": "品牌搜索"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/varComm/index",
|
||||
"iconPath": "icons/varComm.png",
|
||||
"selectedIconPath": "icons/varCommActive.png",
|
||||
"text": "对比"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/index",
|
||||
"iconPath": "icons/mine.png",
|
||||
"selectedIconPath": "icons/mineActive.png",
|
||||
"text": "我的"
|
||||
}
|
||||
], //tabbar循环数据集
|
||||
},
|
||||
attached() {},
|
||||
methods: {
|
||||
switchTab(e) {
|
||||
const data = e.currentTarget.dataset;
|
||||
const url = data.path
|
||||
this.setData({
|
||||
selected: data.index
|
||||
})
|
||||
wx.switchTab({url})
|
||||
}
|
||||
switchTab(e) {
|
||||
const data = e.currentTarget.dataset;
|
||||
const url = data.path
|
||||
this.setData({
|
||||
selected: data.index
|
||||
})
|
||||
wx.switchTab({
|
||||
url
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
})
|
Loading…
Reference in new issue