"use strict";
require("../vendor.js");
const common_libraries_updateMenu = require("./updateMenu.js");
function setTabBarData(idx, type) {
  const pages = getCurrentPages();
  const currentPage = pages[pages.length - 1];
  if (currentPage) {
    const tabBar = currentPage.getTabBar ? currentPage.getTabBar() : null;
    if (tabBar) {
      if (idx === 3) {
        if (type === "boss") {
          tabBar.setData({
            selected: 3,
            list: common_libraries_updateMenu.Merchant
          });
        }
        if (type === "investor") {
          tabBar.setData({
            selected: 3,
            list: common_libraries_updateMenu.Investor
          });
        }
        if (type === "agent") {
          tabBar.setData({
            selected: 3,
            list: common_libraries_updateMenu.Agent
          });
        }
        return;
      }
      tabBar.setData({
        selected: idx
      });
    } else {
      console.error("当前页面没有TabBar");
    }
  }
}
exports.setTabBarData = setTabBarData;
