73 lines
2.0 KiB
JavaScript
73 lines
2.0 KiB
JavaScript
/**
|
||
* Web唐明明
|
||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||
*/
|
||
|
||
import { mall, video, ticket, user } from "../../lib/tabBarData"
|
||
|
||
Page({
|
||
data: {
|
||
loding: true
|
||
},
|
||
/**
|
||
* 生命周期函数--监听页面加载
|
||
*/
|
||
onLoad(e) {
|
||
// 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 = []
|
||
|
||
tabBarVal.forEach(res => {
|
||
switch (res.slug) {
|
||
case "video":
|
||
newTabBar.push(video)
|
||
break;
|
||
case "mall":
|
||
newTabBar.push(mall)
|
||
break;
|
||
case "ticket":
|
||
newTabBar.push(ticket)
|
||
break;
|
||
}
|
||
})
|
||
getApp().globalData.storeTabBarConfig = newTabBar.concat([user])
|
||
wx.redirectTo({
|
||
url: newTabBar[0].pagePath,
|
||
})
|
||
}).catch(()=>{
|
||
this.setData({
|
||
loding: false
|
||
})
|
||
})
|
||
}
|
||
})
|
||
},
|
||
/**
|
||
* 生命周期函数
|
||
*/
|
||
onShow(){
|
||
wx.hideHomeButton()
|
||
},
|
||
|
||
/**
|
||
* 打开企业广场
|
||
*/
|
||
openIndex(){
|
||
wx.reLaunch({
|
||
url: "/pages/company/index"
|
||
})
|
||
}
|
||
}) |