"use strict";
const common_vendor = require("../../common/vendor.js");
const util_getParams = require("../../util/getParams.js");
const _sfc_main = {
  __name: "index",
  setup(__props) {
    const APPKEY = "4AA7B3944BDF3739";
    const ocode = "1015730314";
    const URL = "https://chtech.ncjti.edu.cn/carstop/carbook/appopenid.action";
    common_vendor.onLoad(() => {
      loginFilter();
    });
    const loginFilter = () => {
      const card_number = common_vendor.index.getStorageSync("card_number");
      if (!card_number) {
        const card_number2 = util_getParams.getQueryString("card_number");
        if (!card_number2) {
          getCardnumberURL();
        } else {
          common_vendor.index.setStorageSync("card_number", card_number2);
          common_vendor.index.switchTab({
            url: "/pages/home/home"
          });
        }
      } else {
        common_vendor.index.switchTab({
          url: "/pages/home/home"
        });
      }
    };
    const getCardnumberURL = () => {
      window.location.href = `https://open.wecard.qq.com/connect/oauth/authorize?app_key=${APPKEY}&response_type=code&scope=snsapi_base&ocode=${ocode}&redirect_uri=${URL}&state=${URL}`;
    };
    return (_ctx, _cache) => {
      return {};
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "E:/workSpace/schoolBus-reservation/pages/index/index.vue"]]);
wx.createPage(MiniProgramPage);
