jialh
2025-01-06 4d6d772771d2da54a4887d60f3b2ea21a72b3d7d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initTabBar = void 0;
const uni_shared_1 = require("@dcloudio/uni-shared");
const borderStyles = {
    black: 'rgba(0,0,0,0.4)',
    white: 'rgba(255,255,255,0.4)',
};
function initTabBar(entryPagePath, manifestJson, pagesJson) {
    var _a, _b;
    if (!((_b = (_a = pagesJson.tabBar) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b.length)) {
        return;
    }
    const tabBar = JSON.parse(JSON.stringify(pagesJson.tabBar));
    if (tabBar.borderStyle in borderStyles) {
        tabBar.borderStyle = borderStyles[tabBar.borderStyle];
    }
    if (!tabBar.selectedColor) {
        tabBar.selectedColor = uni_shared_1.SELECTED_COLOR;
    }
    tabBar.height = `${parseFloat(tabBar.height) || uni_shared_1.TABBAR_HEIGHT}px`;
    // 首页是 tabBar 页面
    const item = tabBar.list.find((page) => page.pagePath === entryPagePath);
    if (item) {
        ;
        tabBar.child = ['lauchwebview'];
        tabBar.selected = tabBar.list.indexOf(item);
    }
    manifestJson.plus.tabBar = tabBar;
}
exports.initTabBar = initTabBar;