"use strict";
const common_vendor = require("../../common/vendor.js");
const common_libraries_userUserLogin = require("../../common/libraries/userUserLogin.js");
require("../../common/libraries/request.js");
require("../../common/store/useWeAppAuthStore.js");
require("../../gen/Apis.js");
require("../../common/store/useWatermarkStore.js");
require("../../common/store/useWorkStore.js");
require("../../common/libraries/apiLoading.js");
if (!Array) {
  const _easycom_hs_footer2 = common_vendor.resolveComponent("hs-footer");
  _easycom_hs_footer2();
}
const _easycom_hs_footer = () => "../../components/hs-footer/hs-footer.js";
if (!Math) {
  _easycom_hs_footer();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "index",
  setup(__props) {
    const scanQrCode = common_vendor.ref(false);
    common_vendor.onShow(async () => {
      var _a, _b, _c;
      await ((_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$onLaunched);
      if ((_b = common_libraries_userUserLogin.getUser) == null ? void 0 : _b.getLoginStatus()) {
        const getQrcode = common_vendor.index.getEnterOptionsSync();
        console.log(getQrcode, "getQrcode");
        let qrData = getQrcode == null ? void 0 : getQrcode.query;
        if (!(qrData == null ? void 0 : qrData.scene)) {
          scanQrCode.value = true;
        } else {
          let data = (_c = qrData == null ? void 0 : qrData.scene) == null ? void 0 : _c.split("_");
          if (data[0] === "1") {
            common_vendor.index.redirectTo({
              url: `/INDEX/release_items/index?id=${data[1]}`
            });
          }
          if (data[0] === "2") {
            common_vendor.index.redirectTo({
              url: `/INDEX/pass/index?source=2&id=${data[1]}`
            });
          }
          if (data[0] === "3") {
            common_vendor.index.redirectTo({
              url: `/INDEX/patrol_task_list/index?id=${data[1]}`
            });
          }
          if (data[0] === "4") {
            common_vendor.index.redirectTo({
              url: `/INDEX/pass/index?source=4&customers_id=${data[1]}&asset_houses_id=${data[2]}`
            });
          }
        }
      } else {
        common_vendor.index.showModal({
          title: "提示",
          content: "检测到您还未登录，是否去登录？",
          confirmText: "去登录",
          cancelText: "返回首页",
          confirmColor: "#0082FA",
          success: function(res) {
            if (res.confirm) {
              common_vendor.index.navigateTo({
                url: "/pages/login?source=transfer"
              });
              console.log("用户点击确定");
            } else if (res.cancel) {
              common_vendor.index.switchTab({
                url: "/pages/index/index"
              });
              console.log("用户点击取消");
            }
          }
        });
      }
    });
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: !scanQrCode.value
      }, !scanQrCode.value ? {} : {
        b: common_vendor.p({
          btnParimaryName: "返回首页"
        })
      });
    };
  }
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/pages/transfer/index.vue"]]);
wx.createPage(MiniProgramPage);
