app.js 4.29 KB
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const common_vendor = require("./common/vendor.js");
const common_login = require("./common/login.js");
require("./common/api.js");
const config = require("./config.js");
require("./common/request.js");
if (!Math) {
  "./pages/index/index.js";
  "./pages/index/order.js";
  "./pages/index/booking.js";
  "./pages/usercenter/usercenter.js";
  "./pages/usercenter/address.js";
  "./pages/usercenter/mycard/mycard.js";
  "./pages/usercenter/mycard/renew.js";
  "./pages/usercenter/bills.js";
  "./pages/usercenter/match.js";
  "./pages/usercenter/matchSignDetail.js";
  "./pages/usercenter/matchBillDetail.js";
  "./pages/usercenter/myInfo.js";
  "./pages/usercenter/teamList.js";
  "./pages/usercenter/teamInfo.js";
  "./pages/usercenter/billsDetail.js";
  "./pages/form/index.js";
  "./pages/train/index.js";
  "./pages/train/detailPage/detailPage.js";
  "./pages/train/apply/apply.js";
  "./pages/train/costBreakdown/costBreakdown.js";
  "./pages/usercenter/myTrain/index/index.js";
  "./pages/usercenter/myTrain/trainSing/trainSing.js";
  "./pages/usercenter/myTrain/trainBillDetail/trainBillDetail.js";
  "./pages/train/payScuess/payScuess.js";
  "./pages_match/match/index.js";
  "./pages_match/match/single.js";
  "./pages_match/match/singleLs.js";
  "./pages_match/match/sign_single.js";
  "./pages_match/match/matchBill.js";
  "./pages_match/match/matchPayDone.js";
  "./pages_match/match/choose_sportman.js";
  "./pages_match/match/team_choose_sportman.js";
  "./pages_match/match/choose_coach.js";
  "./pages_match/match/add_coach.js";
  "./pages_match/match/add_rank.js";
  "./pages_match/match/choose_project.js";
  "./pages_match/match/projectList.js";
  "./pages_hotel/hotel/index.js";
  "./pages_hotel/hotel/detail.js";
  "./pages_hotel/hotel/hotelList.js";
  "./pages_hotel/hotel/hotelDetail.js";
  "./pages_hotel/hotel/order.js";
  "./pages_hotel/hotel/mycenter.js";
  "./pages_hotel/hotel/pay.js";
  "./pages_hotel/hotel/myBills.js";
  "./pages_hotel/hotel/billDetail.js";
  "./pages_hotel/hotel/invoice.js";
  "./pages_hotel/hotel/addInvoice.js";
  "./pages_hotel/hotel/canInvoiceBills.js";
  "./pages_hotel/hotel/invoiceDetail.js";
  "./pages_hotel/hotel/myInvoice.js";
  "./pages_hotel/hotel/illustrate.js";
  "./pages_hotel/hotel/aboutUs.js";
  "./pages_hotel/car/index.js";
  "./pages_hotel/car/order.js";
  "./pages_hotel/eat/index.js";
  "./pages_hotel/eat/menu.js";
  "./pages_hotel/eat/order.js";
  "./pages_hotel/eat/billDetail.js";
  "./pages_hotel/car/billDetail.js";
}
let firstload = false;
const _sfc_main = {
  onLaunch: function() {
    console.log("App Launch");
    firstload = true;
    this.globalData.baseUrl = config.config.baseUrl;
    this.globalData.baseUrl_api = config.config.baseUrl_api;
    this.globalData.fileUrl = config.config.fileUrl;
    new Promise((resolve, reject) => {
      common_vendor.index.checkSession({
        success: (res) => {
          common_login.getCurrUser(true).catch(() => {
            return common_login.pcLogin();
          }).then((user) => {
            resolve(user);
          });
        },
        fail: (res) => {
          common_login.wxLogin().then((loginRes) => {
            return common_login.pcLogin(loginRes.code);
          }).then((user) => {
            resolve(user);
          });
        }
      });
    }).then(() => {
      return common_login.getNowOpenId();
    }).then(() => {
      return common_login.initData();
    }).then(() => {
      this.globalData.isLogin = true;
      let firstLoadCallback = getApp().firstLoadCallback;
      if (firstLoadCallback) {
        firstLoadCallback();
      }
    });
  },
  onShow: function() {
    console.log("App Show");
    if (!firstload) {
      common_login.getCurrUser(true).catch(() => {
        return common_login.pcLogin().then(() => {
          common_vendor.index.redirectTo({
            url: getCurrentPages()[getCurrentPages().length - 1].$page.fullPath
          });
        });
      });
    }
  },
  onHide: function() {
    console.log("App Hide");
  }
};
const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/yangyang/project/j-mini/Venue/App.vue"]]);
function createApp() {
  const app = common_vendor.createSSRApp(App);
  return {
    app
  };
}
createApp().app.mount("#app");
exports.createApp = createApp;