[更新]更新了底部菜单栏数据错误问题

This commit is contained in:
唐明明
2020-12-30 16:50:03 +08:00
parent 2c3a5a8ec5
commit 26bdcb6ffb
2 changed files with 13 additions and 18 deletions

View File

@@ -14,18 +14,19 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(e) {
if (e.companyoid && e.companyoid == "") {
wx.showToast({
title: "参数错误缺少companyoId"
})
return
}
// if (e.companyoid && e.companyoid == "") {
// wx.showToast({
// title: "参数错误缺少companyoId"
// })
// return
// }
wx.getStorage({
key : 'compayId',
success : res=>{
wx.$api.publics.storeConfig({
company_id: res.data
}).then(res => {
console.log(res)
let tabBarVal = res.concat({}),
newTabBar = []
@@ -40,18 +41,12 @@ Page({
case "ticket":
newTabBar.push(ticket)
break;
default :
newTabBar.push(user)
break;
}
})
if(tabBarVal.length == newTabBar.length){
getApp().globalData.storeTabBarConfig = newTabBar
wx.redirectTo({
url: newTabBar[0].pagePath,
})
}
getApp().globalData.storeTabBarConfig = newTabBar.concat([user])
wx.redirectTo({
url: newTabBar[0].pagePath,
})
}).catch(()=>{
this.setData({
loding: false