Commit 7560f9df by 程默

fix tabbar

parent add36e11
......@@ -2,6 +2,17 @@ const app = getApp()
console.log(app, 'apppppppppp')
Component({
pageLifetimes: {
show() {
console.log('哈哈哈哈')
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 1
})
}
}
},
data: {
selected: 0,
color: "#7A7E83",
......@@ -65,7 +76,9 @@ Component({
}
// ----------webview 变化
console.log('启动1111')
console.log('启动1111',this.getTabBar())
app.webviewCallBack = function (state,params) {
console.log('webview变化',state,params)
}
......@@ -75,27 +88,22 @@ Component({
},
switchTab(e) {
// mpApp.$themeToLink //
const {
index
} = e.currentTarget.dataset
console.log('755555555', this.data.list[index].link)
// if (index == this.data.selected) return
app.globalData.tabBarPageLink=this.data.list[index].link.link
console.log(app,'aaaa')
this.toPage(this.data.list[index].link,index)
app.$themeToLink(this.data.list[index]['link'],1)
// return
// app.$themeToLink(this.data.list[index].link)
// this.toPage(this.data.list[index].link,index)
// this.setData({
// selected: index
// })
},
toPage(data,index){
console.log('index98',index)
console.log('index98',index,this)
// index=index==0?index+1:index
// 跳转
if (data.link=='/') {
wx.switchTab({
......
<!--miniprogram/custom-tab-bar/index.wxml-->
<cover-view class="tab-bar">
<cover-view class="antt ant-daipinglun"></cover-view>
<cover-view class="iconfont icon-fenzhi">3</cover-view>
<cover-view class="tab-bar-border"></cover-view>
<cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.link}}" data-index="{{index}}"
bindtap="switchTab">
......
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