[更新]更新了底部菜单栏数据错误问题
This commit is contained in:
@@ -3,8 +3,8 @@ import {errInfo} from './err'
|
|||||||
import {updToken} from './updateToken'
|
import {updToken} from './updateToken'
|
||||||
|
|
||||||
// 请求方式配置
|
// 请求方式配置
|
||||||
const api = "https://new-web-test.cnskl.com/api/"
|
// const api = "https://new-web-test.cnskl.com/api/"
|
||||||
// const api = "https://mi-org.cnskl.com/api/"
|
const api = "https://mi-org.cnskl.com/api/"
|
||||||
const header = {
|
const header = {
|
||||||
"Accept" : "application/json"
|
"Accept" : "application/json"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,18 +14,19 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
if (e.companyoid && e.companyoid == "") {
|
// if (e.companyoid && e.companyoid == "") {
|
||||||
wx.showToast({
|
// wx.showToast({
|
||||||
title: "参数错误,缺少companyoId"
|
// title: "参数错误,缺少companyoId"
|
||||||
})
|
// })
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
wx.getStorage({
|
wx.getStorage({
|
||||||
key : 'compayId',
|
key : 'compayId',
|
||||||
success : res=>{
|
success : res=>{
|
||||||
wx.$api.publics.storeConfig({
|
wx.$api.publics.storeConfig({
|
||||||
company_id: res.data
|
company_id: res.data
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
console.log(res)
|
||||||
let tabBarVal = res.concat({}),
|
let tabBarVal = res.concat({}),
|
||||||
newTabBar = []
|
newTabBar = []
|
||||||
|
|
||||||
@@ -40,18 +41,12 @@ Page({
|
|||||||
case "ticket":
|
case "ticket":
|
||||||
newTabBar.push(ticket)
|
newTabBar.push(ticket)
|
||||||
break;
|
break;
|
||||||
default :
|
|
||||||
newTabBar.push(user)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
getApp().globalData.storeTabBarConfig = newTabBar.concat([user])
|
||||||
if(tabBarVal.length == newTabBar.length){
|
|
||||||
getApp().globalData.storeTabBarConfig = newTabBar
|
|
||||||
wx.redirectTo({
|
wx.redirectTo({
|
||||||
url: newTabBar[0].pagePath,
|
url: newTabBar[0].pagePath,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}).catch(()=>{
|
}).catch(()=>{
|
||||||
this.setData({
|
this.setData({
|
||||||
loding: false
|
loding: false
|
||||||
|
|||||||
Reference in New Issue
Block a user