[更新]变更了获取企业信息配置,简化配置文件

This commit is contained in:
唐明明
2020-12-30 10:31:55 +08:00
parent 3e59b16c27
commit 49a7bade36
4 changed files with 13 additions and 26 deletions

View File

@@ -4,7 +4,6 @@
* 碌碌无为枉半生,一朝惊醒万事空。
*/
import { tabBar } from "../../lib/storeConfig"
import { mall, video, ticket, user } from "../../lib/tabBarData"
Page({
@@ -21,31 +20,33 @@ Page({
wx.getStorage({
key : 'compayId',
success : res=>{
wx.$api.publics.storeConfig({
company_id: res.data
}).then(res => {
let tabBarVal = res.concat({})
let tabBarVal = res.concat({}),
newTabBar = []
tabBarVal.forEach(res => {
switch (res.slug) {
case "video":
tabBar.push(video)
newTabBar.push(video)
break;
case "mall":
tabBar.push(mall)
newTabBar.push(mall)
break;
case "ticket":
tabBar.push(ticket)
newTabBar.push(ticket)
break;
default :
tabBar.push(user)
newTabBar.push(user)
break;
}
})
if(tabBarVal.length == tabBar.length){
wx.reLaunch({
url: tabBar[0].pagePath,
if(tabBarVal.length == newTabBar.length){
getApp().globalData.storeTabBarConfig = newTabBar
wx.redirectTo({
url: newTabBar[0].pagePath,
})
}
})