[新增]新增自定义tabbar组件
This commit is contained in:
@@ -18,30 +18,44 @@ Page({
|
||||
})
|
||||
return
|
||||
}
|
||||
wx.getStorage({
|
||||
key : 'compayId',
|
||||
success : res=>{
|
||||
|
||||
wx.$api.publics.storeConfig({
|
||||
company_id: res.data
|
||||
}).then(res => {
|
||||
let tabBarVal = res.concat({})
|
||||
tabBarVal.forEach(res => {
|
||||
switch (res.slug) {
|
||||
case "video":
|
||||
tabBar.push(video)
|
||||
break;
|
||||
case "mall":
|
||||
tabBar.push(mall)
|
||||
break;
|
||||
case "ticket":
|
||||
tabBar.push(ticket)
|
||||
break;
|
||||
default :
|
||||
tabBar.push(user)
|
||||
break;
|
||||
}
|
||||
})
|
||||
|
||||
wx.$api.publics.storeConfig({
|
||||
company_id: e.companyoid
|
||||
}).then(res => {
|
||||
let tabBarVal = res.concat({})
|
||||
tabBarVal.forEach(res => {
|
||||
switch (res.slug) {
|
||||
case "video":
|
||||
tabBar.push(video)
|
||||
break;
|
||||
case "mall":
|
||||
tabBar.push(mall)
|
||||
break;
|
||||
case "ticket":
|
||||
tabBar.push(ticket)
|
||||
break;
|
||||
default :
|
||||
tabBar.push(user)
|
||||
break;
|
||||
}
|
||||
})
|
||||
wx.switchTab({
|
||||
url: tabBar[0].pagePath
|
||||
})
|
||||
if(tabBarVal.length == tabBar.length){
|
||||
wx.reLaunch({
|
||||
url: tabBar[0].pagePath,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数
|
||||
*/
|
||||
onShow(){
|
||||
wx.hideHomeButton()
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user