97 lines
2.7 KiB
JavaScript
97 lines
2.7 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
const common_vendor = require("./common/vendor.js");
|
|
const locale_index = require("./locale/index.js");
|
|
if (!Math) {
|
|
"./pages/index/index.js";
|
|
"./pages/login/login-page.js";
|
|
"./pages/appointment/appointment-page.js";
|
|
"./pages/me/me-page.js";
|
|
"./pages/index/reserve-details-page.js";
|
|
"./pages/appointment/info-entry-page.js";
|
|
"./pages/me/notification-page.js";
|
|
"./pages/me/contact-us-page.js";
|
|
"./pages/me/invite-reward-page.js";
|
|
"./pages/service-detail/service-detail.js";
|
|
"./pages/me/profile-edit-page.js";
|
|
}
|
|
const _sfc_main = {
|
|
globalData: {
|
|
token: "",
|
|
user: null,
|
|
shouldRefresh: false,
|
|
loginTime: 0
|
|
},
|
|
onLaunch: function() {
|
|
common_vendor.index.__f__("log", "at App.vue:10", "App Launch");
|
|
this.initGlobalData();
|
|
this.setTabBarText();
|
|
},
|
|
onShow: function() {
|
|
common_vendor.index.__f__("log", "at App.vue:18", "App Show");
|
|
this.setTabBarText();
|
|
},
|
|
onHide: function() {
|
|
common_vendor.index.__f__("log", "at App.vue:22", "App Hide");
|
|
},
|
|
methods: {
|
|
/**
|
|
* 初始化全局数据
|
|
*/
|
|
initGlobalData() {
|
|
try {
|
|
const token = common_vendor.index.getStorageSync("token");
|
|
if (token) {
|
|
this.globalData.token = token;
|
|
}
|
|
const userStr = common_vendor.index.getStorageSync("user");
|
|
if (userStr) {
|
|
try {
|
|
this.globalData.user = JSON.parse(userStr);
|
|
} catch (e) {
|
|
common_vendor.index.__f__("error", "at App.vue:42", "解析用户信息失败:", e);
|
|
}
|
|
}
|
|
} catch (e) {
|
|
common_vendor.index.__f__("error", "at App.vue:46", "初始化全局数据失败:", e);
|
|
}
|
|
},
|
|
setTabBarText() {
|
|
const pages = getCurrentPages();
|
|
if (pages.length > 0) {
|
|
const currentPage = pages[pages.length - 1];
|
|
if (currentPage.$vm && currentPage.$vm.$t) {
|
|
common_vendor.index.setTabBarItem({
|
|
index: 0,
|
|
text: currentPage.$vm.$t("tabbar.home")
|
|
});
|
|
common_vendor.index.setTabBarItem({
|
|
index: 1,
|
|
text: currentPage.$vm.$t("tabbar.appointment")
|
|
});
|
|
common_vendor.index.setTabBarItem({
|
|
index: 2,
|
|
text: currentPage.$vm.$t("tabbar.me")
|
|
});
|
|
}
|
|
}
|
|
}
|
|
},
|
|
watch: {
|
|
"$i18n.locale"() {
|
|
this.setTabBarText();
|
|
}
|
|
}
|
|
};
|
|
function createApp() {
|
|
const app = common_vendor.createSSRApp(_sfc_main);
|
|
app.use(common_vendor.uviewPlus);
|
|
app.use(locale_index.i18n);
|
|
return {
|
|
app
|
|
};
|
|
}
|
|
createApp().app.mount("#app");
|
|
exports.createApp = createApp;
|
|
//# sourceMappingURL=../.sourcemap/mp-weixin/app.js.map
|