33 lines
1.4 KiB
JavaScript
33 lines
1.4 KiB
JavaScript
"use strict";
|
|
let menu = [{
|
|
pagePath: "/pages/index/index",
|
|
iconPath: "/static/tabbar/home_icon.png",
|
|
selectedIconPath: "/static/tabbar/home_active.png",
|
|
text: "首页"
|
|
}, {
|
|
pagePath: "/pages/me/index",
|
|
iconPath: "/static/tabbar/news_icon.png",
|
|
selectedIconPath: "/static/tabbar/news_active.png",
|
|
text: "我的"
|
|
}];
|
|
function setTabBar(res) {
|
|
var _a, _b, _c, _d, _e;
|
|
const pages = getCurrentPages();
|
|
const currentPage = pages[pages.length - 1];
|
|
if (currentPage) {
|
|
const tabBar = (currentPage == null ? void 0 : currentPage.getTabBar) ? currentPage == null ? void 0 : currentPage.getTabBar() : null;
|
|
let list = (_c = (_b = (_a = res == null ? void 0 : res.companyConfig) == null ? void 0 : _a.config_value) == null ? void 0 : _b.menu) == null ? void 0 : _c.map((i) => {
|
|
var _a2, _b2, _c2, _d2;
|
|
return { ...i, iconPath: (_b2 = (_a2 = i.iconPath) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.url, selectedIconPath: (_d2 = (_c2 = i.selectedIconPath) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.url };
|
|
});
|
|
getApp().globalData.menuList = list || menu;
|
|
if (tabBar) {
|
|
tabBar.setData({
|
|
list: list || menu
|
|
});
|
|
}
|
|
}
|
|
console.log("App.globalData.selectedOrg", (_e = (_d = res == null ? void 0 : res.companyConfig) == null ? void 0 : _d.config_value) == null ? void 0 : _e.menu);
|
|
}
|
|
exports.setTabBar = setTabBar;
|