"use strict";
const common_vendor = require("../../common/vendor.js");
const api_request = require("../../api/request.js");
const _sfc_main = {
  __name: "home",
  setup(__props) {
    common_vendor.onShow(() => {
      common_vendor.index.removeStorageSync("businessId");
      getMyUser();
    });
    common_vendor.onLoad(() => {
      getFonts();
    });
    const getMyUser = async () => {
      const res = await common_vendor.index.request({
        url: api_request.baseUrl + "/user/get/login",
        method: "GET",
        header: {
          // 读取JSESSIONID
          "cookie": common_vendor.wx$1.getStorageSync("cookie")
        }
      });
      console.log("获取用户信息==>", res.data);
      if (res.data.code === 40100) {
        common_vendor.index.navigateTo({
          url: "/pages/login/login"
        });
        common_vendor.index.showToast({
          icon: "loading",
          title: "请登录"
        });
      }
    };
    const jump_xiezhen = () => {
      common_vendor.index.navigateTo({
        url: "../../pages/booking/respectable/respectable"
      });
    };
    const jump_feiyi = () => {
      common_vendor.index.navigateTo({
        url: "/pages/workshop/index/index"
      });
    };
    const jump_store = () => {
      common_vendor.index.switchTab({
        url: "/pages/store-home/main/testMain"
      });
    };
    const getFonts = () => {
      common_vendor.index.loadFontFace({
        family: "ZhongShanFonts",
        source: `url("https://carbon2.obs.cn-north-4.myhuaweicloud.com/fonts/ZhongShanFonts.ttf")`,
        success: (res) => {
          console.log("success", res);
        },
        fail: (err) => {
          console.log("err", err);
        }
      });
      common_vendor.index.loadFontFace({
        family: "FangZhengFonts",
        source: `url("https://carbon2.obs.cn-north-4.myhuaweicloud.com/fonts/FangZhengFonts.TTF")`,
        success: (res) => {
          console.log("success", res);
        },
        fail: (err) => {
          console.log("err", err);
        }
      });
    };
    const showStop = () => {
      common_vendor.index.showModal({
        title: "提示",
        content: "正在开发中!"
      });
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.o(jump_xiezhen),
        b: common_vendor.o(jump_feiyi),
        c: common_vendor.o(jump_store),
        d: common_vendor.o(showStop)
      };
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-07e72d3c"], ["__file", "D:/微信小程序/课设整合/匠承非遗小程序端/jiangchengfeiyi-xiaochengxu/pages/home/home.vue"]]);
wx.createPage(MiniProgramPage);
