Files
AGuestSaas/pages/config/config.js

72 lines
1.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 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 => {
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"
})
}
})