123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- "use strict";
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
- const common_vendor = require("./common/vendor.js");
- const util_api = require("./util/api.js");
- if (!Math) {
- "./pages/index/index.js";
- "./pages/user/index.js";
- "./pages/planning/index.js";
- "./pages/info/index.js";
- "./pages/ai-assistant/index.js";
- "./pages/ai-assistant/simple.js";
- "./pages/custom-trip/map.js";
- "./pages/custom-trip/plan-detail.js";
- "./pages/planning/all-trips.js";
- "./pages/travel-detail/index.js";
- }
- const _sfc_main = {
- globalData: {
- schemeUrl: null
- },
- onLaunch: function(options) {
- common_vendor.index.__f__("log", "at App.vue:7", "App Launch", options);
- this.handleSchemeUrl(options);
- },
- onShow: function(options) {
- common_vendor.index.__f__("log", "at App.vue:12", "App Show", options);
- this.handleSchemeUrl(options);
- },
- onHide: function() {
- common_vendor.index.__f__("log", "at App.vue:17", "App Hide");
- },
- methods: {
- // 处理URL Scheme
- handleSchemeUrl(options) {
- try {
- common_vendor.index.__f__("log", "at App.vue:23", "检查URL Scheme启动参数:", options);
- let schemeUrl = "";
- if (options && options.query && options.query.url) {
- schemeUrl = decodeURIComponent(options.query.url);
- } else if (options && options.path && options.query) {
- schemeUrl = options.path + "?" + Object.keys(options.query).map((key) => {
- return key + "=" + options.query[key];
- }).join("&");
- } else if (options && options.scene) {
- schemeUrl = decodeURIComponent(options.scene);
- } else if (common_vendor.index.getEnv && common_vendor.index.getEnv().uniPlatform === "app-plus") {
- if (options && options.arguments) {
- if (typeof options.arguments === "string") {
- if (options.arguments.indexOf("traveler://") === 0) {
- schemeUrl = options.arguments;
- }
- } else if (options.arguments.data && typeof options.arguments.data === "string") {
- schemeUrl = options.arguments.data;
- }
- }
- }
- if (schemeUrl && schemeUrl.indexOf("traveler://") === 0) {
- common_vendor.index.__f__("log", "at App.vue:56", "发现URL Scheme:", schemeUrl);
- this.globalData.schemeUrl = schemeUrl;
- this.parseSchemeUrl(schemeUrl);
- }
- } catch (e) {
- common_vendor.index.__f__("error", "at App.vue:61", "处理URL Scheme出错:", e);
- }
- },
- // 解析URL Scheme并执行相应操作
- parseSchemeUrl(url) {
- try {
- const path = url.replace("traveler://", "");
- const [routePath, paramStr] = path.split("?");
- const params = {};
- if (paramStr) {
- paramStr.split("&").forEach((item) => {
- const [key, value] = item.split("=");
- if (key && value) {
- params[key] = decodeURIComponent(value);
- }
- });
- }
- common_vendor.index.__f__("log", "at App.vue:85", "解析URL Scheme:", routePath, params);
- switch (routePath) {
- case "trip/detail":
- case "trip":
- if (params.id) {
- common_vendor.index.__f__("log", "at App.vue:93", "准备跳转到行程详情页:", params.id);
- setTimeout(() => {
- common_vendor.index.navigateTo({
- url: "/pages/travel-detail/index?planId=" + params.id,
- success: () => {
- common_vendor.index.__f__("log", "at App.vue:100", "成功跳转到行程详情页");
- },
- fail: (err) => {
- common_vendor.index.__f__("error", "at App.vue:103", "跳转失败:", err);
- common_vendor.index.switchTab({
- url: "/pages/planning/index",
- success: () => {
- common_vendor.index.$emit("loadTripDetail", { tripId: params.id });
- }
- });
- }
- });
- }, 1e3);
- } else if (params.name && params.days && params.budget) {
- const tempTrip = {
- id: "temp_" + Date.now(),
- name: params.name,
- days: params.days,
- budget: params.budget,
- startDate: params.startDate || (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
- peopleCount: params.peopleCount || 1
- };
- const savedTrips = common_vendor.index.getStorageSync("savedTrips") || [];
- savedTrips.push(tempTrip);
- common_vendor.index.setStorageSync("savedTrips", savedTrips);
- setTimeout(() => {
- common_vendor.index.navigateTo({
- url: "/pages/travel-detail/index?planId=" + tempTrip.id
- });
- }, 1e3);
- }
- break;
- default:
- common_vendor.index.__f__("log", "at App.vue:142", "未知的URL Scheme路径:", routePath);
- setTimeout(() => {
- common_vendor.index.switchTab({
- url: "/pages/index/index"
- });
- }, 1e3);
- break;
- }
- } catch (e) {
- common_vendor.index.__f__("error", "at App.vue:153", "解析URL Scheme出错:", e);
- }
- }
- }
- };
- const tabBarMidButtonEventCallbacksVue3 = [];
- common_vendor.index.onTabBarMidButtonTap = function() {
- tabBarMidButtonEventCallbacksVue3.forEach((callback) => {
- callback();
- });
- };
- function createApp() {
- const app = common_vendor.createSSRApp(_sfc_main);
- app.config.globalProperties.$onTabBarMidButtonTap = function(callback) {
- tabBarMidButtonEventCallbacksVue3.push(callback);
- };
- app.config.globalProperties.$api = util_api.API;
- app.config.globalProperties.$baseUrl = util_api.BASE_URL;
- return {
- app
- };
- }
- createApp().app.mount("#app");
- exports.createApp = createApp;
- //# sourceMappingURL=../.sourcemap/mp-weixin/app.js.map
|