"use strict";
const common_vendor = require("../common/vendor.js");
if (!Array) {
  const _easycom_uv_tabbar_item2 = common_vendor.resolveComponent("uv-tabbar-item");
  const _easycom_uv_tabbar2 = common_vendor.resolveComponent("uv-tabbar");
  (_easycom_uv_tabbar_item2 + _easycom_uv_tabbar2)();
}
const _easycom_uv_tabbar_item = () => "../uni_modules/uv-tabbar/components/uv-tabbar-item/uv-tabbar-item.js";
const _easycom_uv_tabbar = () => "../uni_modules/uv-tabbar/components/uv-tabbar/uv-tabbar.js";
if (!Math) {
  (_easycom_uv_tabbar_item + _easycom_uv_tabbar)();
}
const _sfc_main = {
  __name: "tabber",
  setup(__props) {
    const tabList = common_vendor.ref([
      {
        id: 1,
        text: "访客预约",
        icon: "account"
      },
      {
        id: 2,
        text: "到访代办",
        icon: "file-text"
      },
      {
        id: 3,
        text: "预约记录",
        icon: "clock"
      }
    ]);
    const activeIndex = common_vendor.ref(0);
    const customStyle = {
      height: "120rpx"
    };
    common_vendor.onLoad(() => {
      const i = common_vendor.index.getStorageSync("Tab-activeIndex");
      i ? activeIndex.value = i : activeIndex.value = 0;
    });
    const handleChange = (index, item) => {
      if (index != activeIndex.value) {
        activeIndex.value = index;
        common_vendor.index.setStorageSync("Tab-activeIndex", activeIndex.value);
        if (item.icon === "account") {
          common_vendor.index.redirectTo({
            url: "/pagesReservation/reservation/reservation"
          });
        } else if (item.icon === "file-text") {
          common_vendor.index.redirectTo({
            url: "/pagesReservation/backlog/backlog"
          });
        } else if (item.icon === "clock") {
          common_vendor.index.redirectTo({
            url: "/pagesReservation/record/record"
          });
        }
      }
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.f(tabList.value, (item, index, i0) => {
          return {
            a: item.id,
            b: common_vendor.o(($event) => handleChange(index, item), item.id),
            c: "687dc275-1-" + i0 + ",687dc275-0",
            d: common_vendor.p({
              text: item.text,
              icon: item.icon
            })
          };
        }),
        b: common_vendor.p({
          customStyle,
          activeColor: "#0061FF",
          inactiveColor: "#A6A6A6",
          value: activeIndex.value
        })
      };
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "E:/workSpace/WanZai_School_app/components/tabber.vue"]]);
wx.createComponent(Component);
