"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Array) {
  const _easycom_uv_qrcode2 = common_vendor.resolveComponent("uv-qrcode");
  _easycom_uv_qrcode2();
}
const _easycom_uv_qrcode = () => "../../uni_modules/uv-qrcode/components/uv-qrcode/uv-qrcode.js";
if (!Math) {
  _easycom_uv_qrcode();
}
const _sfc_main = {
  __name: "home",
  setup(__props) {
    common_vendor.useCssVars((_ctx) => ({
      "73922f18": statusBarH.value
    }));
    common_vendor.onLoad(() => {
      common_vendor.index.getSystemInfo({
        success: (e) => {
          statusBarH.value = e.statusBarHeight;
          let custom = common_vendor.index.getMenuButtonBoundingClientRect();
          customBarH.value = custom.height;
        }
      });
    });
    common_vendor.onPullDownRefresh(() => {
      qrcodeRef.value.remake();
      setTimeout(() => {
        common_vendor.index.stopPullDownRefresh();
      }, 1500);
    });
    common_vendor.onPageScroll((e) => {
      if (e.scrollTop > 70) {
        showHeader.value = true;
      } else {
        showHeader.value = false;
      }
    });
    const showHeader = common_vendor.ref(false);
    const statusBarH = common_vendor.ref(0);
    const customBarH = common_vendor.ref(0);
    const qrcodeRef = common_vendor.ref(null);
    const list = common_vendor.ref([
      // {
      // 	id: 1,
      // 	title: '考勤管理',
      // 	url: '../../static/images/icon.png'
      // },
      // {
      // 	id: 2,
      // 	title: '课表查询',
      // 	url: '../../static/images/icon.png',
      // 	path: ''
      // },
      {
        id: 3,
        title: "学生轨迹",
        url: "../../static/images/icon.png",
        path: "/pages/track/track"
      },
      // {
      // 	id: 4,
      // 	title: '打卡接龙',
      // 	url: '../../static/images/icon.png'
      // },
      // {
      // 	id: 5,
      // 	title: '人脸采集',
      // 	url: '../../static/images/icon.png'
      // },
      // {
      // 	id: 6,
      // 	title: '智慧教学',
      // 	url: '../../static/images/icon.png'
      // },
      {
        id: 7,
        title: "消息通知",
        url: "../../static/images/icon.png",
        path: "/pages/msgWarn/msgWarn"
      },
      {
        id: 8,
        title: "访客预约",
        url: "../../static/images/icon.png",
        path: "/pagesReservation/reservation/reservation"
      },
      // {
      // 	id: 9,
      // 	title: '课后作业',
      // 	url: '../../static/images/icon.png'
      // },
      {
        id: 10,
        title: "校园预警",
        url: "../../static/images/icon.png",
        path: "/pagesWarning/home/home"
      },
      {
        id: 11,
        title: "通讯录",
        url: "../../static/images/icon.png",
        path: "/pages/addressBook/addressBook"
      }
    ]);
    const QRCodeUrl = common_vendor.ref("123");
    const options = {
      typeNumber: 4,
      foregroundImageBorderRadius: 5,
      foregroundImageSrc: "/static/images/school-logo.jpg"
    };
    const goPage = (url) => {
      if (url === "/pagesReservation/reservation/reservation") {
        common_vendor.index.setStorageSync("Tab-activeIndex", 0);
      }
      common_vendor.index.navigateTo({
        url
      });
    };
    const handleClickCode = () => {
      common_vendor.index.navigateTo({
        url: `/pages/quickMark/quickMark?value=${QRCodeUrl.value}`
      });
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.o(($event) => goPage("/pages/myCenter/myCenter")),
        b: customBarH.value * 2 + "rpx",
        c: statusBarH.value * 2 + "rpx",
        d: !showHeader.value,
        e: customBarH.value * 2 + "rpx",
        f: statusBarH.value * 2 + "rpx",
        g: showHeader.value,
        h: common_vendor.sr(qrcodeRef, "07e72d3c-0", {
          "k": "qrcodeRef"
        }),
        i: common_vendor.o(handleClickCode),
        j: common_vendor.p({
          size: "82rpx",
          value: QRCodeUrl.value,
          options
        }),
        k: common_vendor.o(($event) => goPage("/pages/myMsg/myMsg")),
        l: common_vendor.o(($event) => goPage("/pages/change/change")),
        m: common_vendor.o(($event) => goPage("/pages/bind/bind")),
        n: common_vendor.o(($event) => goPage("/pages/bind/bind")),
        o: common_vendor.f(list.value, (item, k0, i0) => {
          return {
            a: item.url,
            b: common_vendor.t(item.title),
            c: item.id,
            d: common_vendor.o(($event) => goPage(item.path), item.id)
          };
        }),
        p: common_vendor.s(_ctx.__cssVars())
      };
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-07e72d3c"], ["__file", "E:/workSpace/WanZai_School_app/pages/home/home.vue"]]);
_sfc_main.__runtimeHooks = 1;
wx.createPage(MiniProgramPage);
