@dcloudio/uni-app-plus 3.0.0-alpha-4080720251125001 → 3.0.0-alpha-5000020260104004

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1870,7 +1870,9 @@ function initAppVm(appVm) {
1870
1870
  function initPageVm(pageVm, page) {
1871
1871
  pageVm.route = page.route;
1872
1872
  pageVm.$vm = pageVm;
1873
- pageVm.$page = page;
1873
+ {
1874
+ pageVm.$page = page;
1875
+ }
1874
1876
  pageVm.$mpType = 'page';
1875
1877
  pageVm.$fontFamilySet = new Set();
1876
1878
  if (page.meta.isTabBar) {
@@ -13401,10 +13403,13 @@ function parseTheme(pageStyle) {
13401
13403
  if (__uniConfig.darkmode) {
13402
13404
  let parsedStyle = {};
13403
13405
  let theme = plus.navigator.getUIStyle();
13404
- const systemInfo = weexGetSystemInfoSync();
13405
- // 小程序 SDK
13406
- if (systemInfo && systemInfo.hostTheme) {
13407
- theme = systemInfo.hostTheme;
13406
+ // @ts-expect-error 鸿蒙端编译时写入 plus.os.name 鸿蒙暂不支持 hostTheme
13407
+ if (plus.os.name !== 'HarmonyOS') {
13408
+ const systemInfo = weexGetSystemInfoSync();
13409
+ // 小程序 SDK
13410
+ if (systemInfo && systemInfo.hostTheme) {
13411
+ theme = systemInfo.hostTheme;
13412
+ }
13408
13413
  }
13409
13414
  parsedStyle = normalizeStyles(pageStyle, __uniConfig.themeConfig, theme);
13410
13415
  return parsedStyle;
@@ -13672,7 +13677,9 @@ var tabBarInstance = {
13672
13677
  },
13673
13678
  removeEventListener(_name, callback) {
13674
13679
  const callbackIndex = maskClickCallback.indexOf(callback);
13675
- maskClickCallback.splice(callbackIndex, 1);
13680
+ if (callbackIndex > -1) {
13681
+ maskClickCallback.splice(callbackIndex, 1);
13682
+ }
13676
13683
  },
13677
13684
  };
13678
13685
 
@@ -13816,7 +13823,10 @@ function weexGetSystemInfoSync() {
13816
13823
  if (!_initSystemInfo)
13817
13824
  return;
13818
13825
  const { getSystemInfoSync } = weex.requireModule('plus');
13819
- systemInfo = getSystemInfoSync();
13826
+ try {
13827
+ systemInfo = getSystemInfoSync();
13828
+ }
13829
+ catch (error) { }
13820
13830
  if (isString(systemInfo)) {
13821
13831
  try {
13822
13832
  systemInfo = JSON.parse(systemInfo);
@@ -16292,36 +16302,36 @@ const createLivePusherContext = defineSyncApi(API_CREATE_LIVE_PUSHER_CONTEXT, (i
16292
16302
  return new LivePusherContextVue(id, vm.$page.id);
16293
16303
  }, CreateLivePusherContextProtocol);
16294
16304
 
16295
- /******************************************************************************
16296
- Copyright (c) Microsoft Corporation.
16297
-
16298
- Permission to use, copy, modify, and/or distribute this software for any
16299
- purpose with or without fee is hereby granted.
16300
-
16301
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16302
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16303
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16304
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16305
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16306
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16307
- PERFORMANCE OF THIS SOFTWARE.
16308
- ***************************************************************************** */
16309
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
16310
-
16311
-
16312
- function __awaiter(thisArg, _arguments, P, generator) {
16313
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16314
- return new (P || (P = Promise))(function (resolve, reject) {
16315
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16316
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16317
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16318
- step((generator = generator.apply(thisArg, _arguments || [])).next());
16319
- });
16320
- }
16321
-
16322
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
16323
- var e = new Error(message);
16324
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
16305
+ /******************************************************************************
16306
+ Copyright (c) Microsoft Corporation.
16307
+
16308
+ Permission to use, copy, modify, and/or distribute this software for any
16309
+ purpose with or without fee is hereby granted.
16310
+
16311
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16312
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16313
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16314
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16315
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16316
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16317
+ PERFORMANCE OF THIS SOFTWARE.
16318
+ ***************************************************************************** */
16319
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
16320
+
16321
+
16322
+ function __awaiter(thisArg, _arguments, P, generator) {
16323
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16324
+ return new (P || (P = Promise))(function (resolve, reject) {
16325
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16326
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16327
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16328
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
16329
+ });
16330
+ }
16331
+
16332
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
16333
+ var e = new Error(message);
16334
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
16325
16335
  };
16326
16336
 
16327
16337
  const PI = 3.1415926535897932384626;
package/dist/uni.vue.js CHANGED
@@ -1,4 +1,4 @@
1
- import { invokeArrayFns, isUniLifecycleHook, decodedQuery, ON_LOAD, ON_SHOW, LINEFEED, RENDERJS_MODULES, formatLog, WXS_PROTOCOL, WXS_MODULES, ON_ERROR, UniLifecycleHooks, invokeCreateErrorHandler, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
1
+ import { invokeArrayFns, isUniLifecycleHook, UTSJSONObject, decodedQuery, ON_LOAD, ON_SHOW, LINEFEED, RENDERJS_MODULES, formatLog, WXS_PROTOCOL, WXS_MODULES, ON_ERROR, UniLifecycleHooks, invokeCreateErrorHandler, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
2
2
  import { isString, isArray, hasOwn, isFunction } from '@vue/shared';
3
3
  import { injectHook, logError } from 'vue';
4
4
 
@@ -1,4 +1,4 @@
1
- import { normalizeStyles as normalizeStyles$1, addLeadingSlash, invokeArrayFns, ON_HIDE, ON_SHOW, parseQuery, EventChannel, once, parseUrl, Emitter, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, ON_ERROR, removeLeadingSlash, getLen, ON_UNLOAD, ON_READY, ON_PAGE_SCROLL, ON_PULL_DOWN_REFRESH, ON_REACH_BOTTOM, ON_RESIZE, ON_BACK_PRESS, ON_LAUNCH, ON_EXIT, ON_LAST_PAGE_BACK_PRESS } from "@dcloudio/uni-shared";
1
+ import { normalizeStyles as normalizeStyles$1, addLeadingSlash, invokeArrayFns, ON_HIDE, ON_SHOW, parseQuery, UTSJSONObject, EventChannel, once, parseUrl, Emitter, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, ON_ERROR, removeLeadingSlash, getLen, ON_UNLOAD, ON_READY, ON_PAGE_SCROLL, ON_PULL_DOWN_REFRESH, ON_REACH_BOTTOM, ON_RESIZE, ON_BACK_PRESS, ON_LAUNCH, ON_EXIT, ON_LAST_PAGE_BACK_PRESS } from "@dcloudio/uni-shared";
2
2
  import { extend, isString, isPlainObject, isFunction as isFunction$1, isArray, isPromise, hasOwn, remove, invokeArrayFns as invokeArrayFns$1, capitalize, toTypeString, toRawType } from "@vue/shared";
3
3
  import { createMountPage, unmountPage, ref, onMounted, onBeforeUnmount, getCurrentGenericInstance, injectHook, defineComponent, getCurrentInstance, camelize, createVNode, renderSlot } from "vue";
4
4
  function get$pageByPage(page) {
@@ -211,7 +211,9 @@ function dialogPageTriggerPrevDialogPageLifeCycle(parentPage, lifeCycle) {
211
211
  function initPageVm(pageVm, page) {
212
212
  pageVm.route = page.route;
213
213
  pageVm.$vm = pageVm;
214
- pageVm.$page = page;
214
+ {
215
+ pageVm.$basePage = page;
216
+ }
215
217
  pageVm.$mpType = "page";
216
218
  pageVm.$fontFamilySet = /* @__PURE__ */ new Set();
217
219
  if (page.meta.isTabBar) {
@@ -707,8 +709,11 @@ function removePage(curPage) {
707
709
  }
708
710
  pages.splice(index2, 1);
709
711
  {
710
- curPage.$page.vm = null;
711
- curPage.$page = null;
712
+ var ins = curPage;
713
+ if (ins.$.page) {
714
+ ins.$.page.vm = null;
715
+ ins.$.page = null;
716
+ }
712
717
  }
713
718
  }
714
719
  function backbuttonListener() {
@@ -781,8 +786,7 @@ function setupXPage(instance, pageInstance, pageVm, pageId, pagePath) {
781
786
  } else {
782
787
  uniPage = new UniNormalPageImpl();
783
788
  }
784
- pageVm.$basePage = pageVm.$page;
785
- pageVm.$page = uniPage;
789
+ pageVm.$.page = uniPage;
786
790
  uniPage.route = pageVm.$basePage.route;
787
791
  uniPage.optionsByJS = pageVm.$basePage.options;
788
792
  Object.defineProperty(uniPage, "options", {
@@ -790,34 +794,27 @@ function setupXPage(instance, pageInstance, pageVm, pageId, pagePath) {
790
794
  return new UTSJSONObject(pageVm.$basePage.options);
791
795
  }
792
796
  });
793
- uniPage.getElementById = (id2) => {
794
- var _pageVm$$el;
795
- var containerNode = (_pageVm$$el = pageVm.$el) === null || _pageVm$$el === void 0 ? void 0 : _pageVm$$el.parentElement;
796
- if (containerNode == null) {
797
- console.warn("bodyNode is null");
798
- return null;
799
- }
800
- return containerNode.querySelector("#".concat(id2));
801
- };
802
797
  uniPage.vm = pageVm;
803
798
  uniPage.$vm = pageVm;
804
799
  if (getPage$BasePage(pageVm).openType !== OPEN_DIALOG_PAGE) {
805
800
  addCurrentPageWithInitScope(pageId, pageVm, pageInstance);
806
801
  }
807
- onMounted(() => {
808
- var _pageVm$$el2;
809
- var rootElement = (_pageVm$$el2 = pageVm.$el) === null || _pageVm$$el2 === void 0 ? void 0 : _pageVm$$el2.parentElement;
810
- if (rootElement) {
811
- rootElement._page = pageVm.$page;
812
- }
813
- });
814
- onBeforeUnmount(() => {
815
- var _pageVm$$el3;
816
- var rootElement = (_pageVm$$el3 = pageVm.$el) === null || _pageVm$$el3 === void 0 ? void 0 : _pageVm$$el3.parentElement;
817
- if (rootElement) {
818
- rootElement._page = null;
819
- }
820
- });
802
+ {
803
+ onMounted(() => {
804
+ var _pageVm$$el;
805
+ var rootElement = (_pageVm$$el = pageVm.$el) === null || _pageVm$$el === void 0 ? void 0 : _pageVm$$el.parentElement;
806
+ if (rootElement) {
807
+ rootElement._page = pageVm.$page;
808
+ }
809
+ });
810
+ onBeforeUnmount(() => {
811
+ var _pageVm$$el2;
812
+ var rootElement = (_pageVm$$el2 = pageVm.$el) === null || _pageVm$$el2 === void 0 ? void 0 : _pageVm$$el2.parentElement;
813
+ if (rootElement) {
814
+ rootElement._page = null;
815
+ }
816
+ });
817
+ }
821
818
  }
822
819
  var beforeSetupPage = (props, ctx) => {
823
820
  var {
@@ -1433,6 +1430,27 @@ function fixBorderStyle(tabBarConfig) {
1433
1430
  tabBarConfig.set("borderStyle", borderStyle);
1434
1431
  tabBarConfig.delete("borderColor");
1435
1432
  }
1433
+ function parseRedirectInfo(app) {
1434
+ var _redirectInfo$get, _redirectInfo$get2, _redirectInfo$get3, _redirectInfo$get4, _redirectInfo$get5;
1435
+ var redirectInfo = app.getRedirectInfo();
1436
+ var path = (_redirectInfo$get = redirectInfo.get("path")) !== null && _redirectInfo$get !== void 0 ? _redirectInfo$get : "";
1437
+ var query = (_redirectInfo$get2 = redirectInfo.get("query")) !== null && _redirectInfo$get2 !== void 0 ? _redirectInfo$get2 : "";
1438
+ var userAction = (_redirectInfo$get3 = redirectInfo.get("userAction")) !== null && _redirectInfo$get3 !== void 0 ? _redirectInfo$get3 : false;
1439
+ var appScheme = (_redirectInfo$get4 = redirectInfo.get("appScheme")) !== null && _redirectInfo$get4 !== void 0 ? _redirectInfo$get4 : "";
1440
+ var appLink = (_redirectInfo$get5 = redirectInfo.get("appLink")) !== null && _redirectInfo$get5 !== void 0 ? _redirectInfo$get5 : "";
1441
+ var referrerInfo = {
1442
+ appId: app.appid,
1443
+ extraData: {}
1444
+ };
1445
+ return {
1446
+ path: path || "",
1447
+ query: query ? "?" + query : "",
1448
+ referrerInfo,
1449
+ userAction,
1450
+ appScheme,
1451
+ appLink
1452
+ };
1453
+ }
1436
1454
  var onTabBarMidButtonTapCallback = [];
1437
1455
  var tabBar0 = null;
1438
1456
  var selected0 = -1;
@@ -2110,6 +2128,43 @@ function createVuePage(__pageId, __pagePath, __pageQuery, __pageInstance, pageOp
2110
2128
  }
2111
2129
  };
2112
2130
  }
2131
+ var isInitEntryPage = false;
2132
+ function initEntry(app) {
2133
+ if (isInitEntryPage) {
2134
+ return;
2135
+ }
2136
+ isInitEntryPage = true;
2137
+ var entryPagePath;
2138
+ var entryPageQuery;
2139
+ var redirectInfo = app.getRedirectInfo();
2140
+ if (redirectInfo.size > 0) {
2141
+ var {
2142
+ path,
2143
+ query
2144
+ /* referrerInfo, appScheme, appLink */
2145
+ } = parseRedirectInfo(app);
2146
+ if (path) {
2147
+ entryPagePath = path;
2148
+ entryPageQuery = query;
2149
+ }
2150
+ }
2151
+ if (!entryPagePath || entryPagePath === __uniConfig.entryPagePath) {
2152
+ if (entryPageQuery) {
2153
+ __uniConfig.entryPageQuery = entryPageQuery;
2154
+ }
2155
+ return;
2156
+ }
2157
+ var entryRoute = addLeadingSlash(entryPagePath);
2158
+ var routeOptions = getRouteOptions(entryRoute);
2159
+ if (!routeOptions) {
2160
+ return;
2161
+ }
2162
+ if (!routeOptions.meta.isTabBar) {
2163
+ __uniConfig.realEntryPagePath = __uniConfig.realEntryPagePath || __uniConfig.entryPagePath;
2164
+ }
2165
+ __uniConfig.entryPagePath = entryPagePath;
2166
+ __uniConfig.entryPageQuery = entryPageQuery;
2167
+ }
2113
2168
  function initGlobalEvent(app) {
2114
2169
  app.addKeyEventListener(ON_BACK_BUTTON, () => {
2115
2170
  var currentPage = getCurrentPage();
@@ -2422,7 +2477,9 @@ function _reLaunch(_ref3) {
2422
2477
  }
2423
2478
  var reLaunch = /* @__PURE__ */ defineAsyncApi(API_RE_LAUNCH, $reLaunch, ReLaunchProtocol, ReLaunchOptions);
2424
2479
  function closePage(page, animationType, animationDuration) {
2425
- clearDialogPages(page.$page);
2480
+ if (page.$page) {
2481
+ clearDialogPages(page.$page);
2482
+ }
2426
2483
  var nativePage = page.$nativePage;
2427
2484
  nativePage && closeWebview(nativePage, animationType, animationDuration);
2428
2485
  removePage(page);
@@ -2712,7 +2769,7 @@ function initComponentInstance(app) {
2712
2769
  initNativePage,
2713
2770
  initFontFace
2714
2771
  };
2715
- app.mixin({
2772
+ !app.vapor && app.mixin({
2716
2773
  beforeCreate() {
2717
2774
  initNativePage(this);
2718
2775
  },
@@ -2744,7 +2801,6 @@ function initUniApp(uniApp) {
2744
2801
  });
2745
2802
  }
2746
2803
  function registerApp(appVm, nativeApp2, uniApp) {
2747
- initEntryPagePath(nativeApp2);
2748
2804
  setNativeApp(nativeApp2);
2749
2805
  initVueApp(appVm);
2750
2806
  appCtx = appVm;
@@ -2756,6 +2812,8 @@ function registerApp(appVm, nativeApp2, uniApp) {
2756
2812
  extend(appCtx, defaultApp);
2757
2813
  defineGlobalData(appCtx, defaultApp.globalData);
2758
2814
  initService(nativeApp2, unregisterApp);
2815
+ initEntry(nativeApp2);
2816
+ initEntryPagePath(nativeApp2);
2759
2817
  initGlobalEvent(nativeApp2);
2760
2818
  initAppLaunch(appVm);
2761
2819
  initAppError(appVm, nativeApp2);
@@ -3289,17 +3347,11 @@ var setNavigationBarTitle = /* @__PURE__ */ defineAsyncApi(API_SET_NAVIGATION_BA
3289
3347
  resolve();
3290
3348
  });
3291
3349
  var getElementById = /* @__PURE__ */ defineSyncApi("getElementById", (id2) => {
3292
- var _page$$el;
3293
- var page = getCurrentPage().vm;
3350
+ var page = getCurrentPage();
3294
3351
  if (page == null) {
3295
3352
  return null;
3296
3353
  }
3297
- var bodyNode = (_page$$el = page.$el) === null || _page$$el === void 0 ? void 0 : _page$$el.parentNode;
3298
- if (bodyNode == null) {
3299
- console.warn("bodyNode is null");
3300
- return null;
3301
- }
3302
- return bodyNode.querySelector("#".concat(id2));
3354
+ return page.getElementById(id2);
3303
3355
  });
3304
3356
  function isVueComponent(comp) {
3305
3357
  var has$instance = typeof comp.$ === "object";
@@ -1,4 +1,4 @@
1
- import { normalizeStyles as normalizeStyles$1, addLeadingSlash, invokeArrayFns, ON_HIDE, ON_SHOW, parseQuery, EventChannel, once, parseUrl, Emitter, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, ON_ERROR, removeLeadingSlash, getLen, ON_UNLOAD, ON_READY, ON_PAGE_SCROLL, ON_PULL_DOWN_REFRESH, ON_REACH_BOTTOM, ON_RESIZE, ON_BACK_PRESS, ON_LAUNCH, ON_EXIT, ON_LAST_PAGE_BACK_PRESS } from "@dcloudio/uni-shared";
1
+ import { normalizeStyles as normalizeStyles$1, addLeadingSlash, invokeArrayFns, ON_HIDE, ON_SHOW, parseQuery, UTSJSONObject, EventChannel, once, parseUrl, Emitter, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, ON_ERROR, removeLeadingSlash, getLen, ON_UNLOAD, ON_READY, ON_PAGE_SCROLL, ON_PULL_DOWN_REFRESH, ON_REACH_BOTTOM, ON_RESIZE, ON_BACK_PRESS, ON_LAUNCH, ON_EXIT, ON_LAST_PAGE_BACK_PRESS } from "@dcloudio/uni-shared";
2
2
  import { extend, isString, isPlainObject, isFunction as isFunction$1, isArray, isPromise, hasOwn, remove, invokeArrayFns as invokeArrayFns$1, capitalize, toTypeString, toRawType } from "@vue/shared";
3
3
  import { createMountPage, unmountPage, ref, onMounted, onBeforeUnmount, getCurrentGenericInstance, injectHook, defineComponent, getCurrentInstance, camelize, createVNode, renderSlot } from "vue";
4
4
  function get$pageByPage(page) {
@@ -211,7 +211,9 @@ function dialogPageTriggerPrevDialogPageLifeCycle(parentPage, lifeCycle) {
211
211
  function initPageVm(pageVm, page) {
212
212
  pageVm.route = page.route;
213
213
  pageVm.$vm = pageVm;
214
- pageVm.$page = page;
214
+ {
215
+ pageVm.$basePage = page;
216
+ }
215
217
  pageVm.$mpType = "page";
216
218
  pageVm.$fontFamilySet = /* @__PURE__ */ new Set();
217
219
  if (page.meta.isTabBar) {
@@ -707,8 +709,11 @@ function removePage(curPage) {
707
709
  }
708
710
  pages.splice(index2, 1);
709
711
  {
710
- curPage.$page.vm = null;
711
- curPage.$page = null;
712
+ var ins = curPage;
713
+ if (ins.$.page) {
714
+ ins.$.page.vm = null;
715
+ ins.$.page = null;
716
+ }
712
717
  }
713
718
  }
714
719
  function backbuttonListener() {
@@ -781,8 +786,7 @@ function setupXPage(instance, pageInstance, pageVm, pageId, pagePath) {
781
786
  } else {
782
787
  uniPage = new UniNormalPageImpl();
783
788
  }
784
- pageVm.$basePage = pageVm.$page;
785
- pageVm.$page = uniPage;
789
+ pageVm.$.page = uniPage;
786
790
  uniPage.route = pageVm.$basePage.route;
787
791
  uniPage.optionsByJS = pageVm.$basePage.options;
788
792
  Object.defineProperty(uniPage, "options", {
@@ -790,34 +794,27 @@ function setupXPage(instance, pageInstance, pageVm, pageId, pagePath) {
790
794
  return new UTSJSONObject(pageVm.$basePage.options);
791
795
  }
792
796
  });
793
- uniPage.getElementById = (id2) => {
794
- var _pageVm$$el;
795
- var containerNode = (_pageVm$$el = pageVm.$el) === null || _pageVm$$el === void 0 ? void 0 : _pageVm$$el.parentElement;
796
- if (containerNode == null) {
797
- console.warn("bodyNode is null");
798
- return null;
799
- }
800
- return containerNode.querySelector("#".concat(id2));
801
- };
802
797
  uniPage.vm = pageVm;
803
798
  uniPage.$vm = pageVm;
804
799
  if (getPage$BasePage(pageVm).openType !== OPEN_DIALOG_PAGE) {
805
800
  addCurrentPageWithInitScope(pageId, pageVm, pageInstance);
806
801
  }
807
- onMounted(() => {
808
- var _pageVm$$el2;
809
- var rootElement = (_pageVm$$el2 = pageVm.$el) === null || _pageVm$$el2 === void 0 ? void 0 : _pageVm$$el2.parentElement;
810
- if (rootElement) {
811
- rootElement._page = pageVm.$page;
812
- }
813
- });
814
- onBeforeUnmount(() => {
815
- var _pageVm$$el3;
816
- var rootElement = (_pageVm$$el3 = pageVm.$el) === null || _pageVm$$el3 === void 0 ? void 0 : _pageVm$$el3.parentElement;
817
- if (rootElement) {
818
- rootElement._page = null;
819
- }
820
- });
802
+ {
803
+ onMounted(() => {
804
+ var _pageVm$$el;
805
+ var rootElement = (_pageVm$$el = pageVm.$el) === null || _pageVm$$el === void 0 ? void 0 : _pageVm$$el.parentElement;
806
+ if (rootElement) {
807
+ rootElement._page = pageVm.$page;
808
+ }
809
+ });
810
+ onBeforeUnmount(() => {
811
+ var _pageVm$$el2;
812
+ var rootElement = (_pageVm$$el2 = pageVm.$el) === null || _pageVm$$el2 === void 0 ? void 0 : _pageVm$$el2.parentElement;
813
+ if (rootElement) {
814
+ rootElement._page = null;
815
+ }
816
+ });
817
+ }
821
818
  }
822
819
  var beforeSetupPage = (props, ctx) => {
823
820
  var {
@@ -1433,6 +1430,27 @@ function fixBorderStyle(tabBarConfig) {
1433
1430
  tabBarConfig.set("borderStyle", borderStyle);
1434
1431
  tabBarConfig.delete("borderColor");
1435
1432
  }
1433
+ function parseRedirectInfo(app) {
1434
+ var _redirectInfo$get, _redirectInfo$get2, _redirectInfo$get3, _redirectInfo$get4, _redirectInfo$get5;
1435
+ var redirectInfo = app.getRedirectInfo();
1436
+ var path = (_redirectInfo$get = redirectInfo.get("path")) !== null && _redirectInfo$get !== void 0 ? _redirectInfo$get : "";
1437
+ var query = (_redirectInfo$get2 = redirectInfo.get("query")) !== null && _redirectInfo$get2 !== void 0 ? _redirectInfo$get2 : "";
1438
+ var userAction = (_redirectInfo$get3 = redirectInfo.get("userAction")) !== null && _redirectInfo$get3 !== void 0 ? _redirectInfo$get3 : false;
1439
+ var appScheme = (_redirectInfo$get4 = redirectInfo.get("appScheme")) !== null && _redirectInfo$get4 !== void 0 ? _redirectInfo$get4 : "";
1440
+ var appLink = (_redirectInfo$get5 = redirectInfo.get("appLink")) !== null && _redirectInfo$get5 !== void 0 ? _redirectInfo$get5 : "";
1441
+ var referrerInfo = {
1442
+ appId: app.appid,
1443
+ extraData: {}
1444
+ };
1445
+ return {
1446
+ path: path || "",
1447
+ query: query ? "?" + query : "",
1448
+ referrerInfo,
1449
+ userAction,
1450
+ appScheme,
1451
+ appLink
1452
+ };
1453
+ }
1436
1454
  var onTabBarMidButtonTapCallback = [];
1437
1455
  var tabBar0 = null;
1438
1456
  var selected0 = -1;
@@ -2110,6 +2128,43 @@ function createVuePage(__pageId, __pagePath, __pageQuery, __pageInstance, pageOp
2110
2128
  }
2111
2129
  };
2112
2130
  }
2131
+ var isInitEntryPage = false;
2132
+ function initEntry(app) {
2133
+ if (isInitEntryPage) {
2134
+ return;
2135
+ }
2136
+ isInitEntryPage = true;
2137
+ var entryPagePath;
2138
+ var entryPageQuery;
2139
+ var redirectInfo = app.getRedirectInfo();
2140
+ if (redirectInfo.size > 0) {
2141
+ var {
2142
+ path,
2143
+ query
2144
+ /* referrerInfo, appScheme, appLink */
2145
+ } = parseRedirectInfo(app);
2146
+ if (path) {
2147
+ entryPagePath = path;
2148
+ entryPageQuery = query;
2149
+ }
2150
+ }
2151
+ if (!entryPagePath || entryPagePath === __uniConfig.entryPagePath) {
2152
+ if (entryPageQuery) {
2153
+ __uniConfig.entryPageQuery = entryPageQuery;
2154
+ }
2155
+ return;
2156
+ }
2157
+ var entryRoute = addLeadingSlash(entryPagePath);
2158
+ var routeOptions = getRouteOptions(entryRoute);
2159
+ if (!routeOptions) {
2160
+ return;
2161
+ }
2162
+ if (!routeOptions.meta.isTabBar) {
2163
+ __uniConfig.realEntryPagePath = __uniConfig.realEntryPagePath || __uniConfig.entryPagePath;
2164
+ }
2165
+ __uniConfig.entryPagePath = entryPagePath;
2166
+ __uniConfig.entryPageQuery = entryPageQuery;
2167
+ }
2113
2168
  function initGlobalEvent(app) {
2114
2169
  app.addKeyEventListener(ON_BACK_BUTTON, () => {
2115
2170
  var currentPage = getCurrentPage();
@@ -2422,7 +2477,9 @@ function _reLaunch(_ref3) {
2422
2477
  }
2423
2478
  var reLaunch = /* @__PURE__ */ defineAsyncApi(API_RE_LAUNCH, $reLaunch, ReLaunchProtocol, ReLaunchOptions);
2424
2479
  function closePage(page, animationType, animationDuration) {
2425
- clearDialogPages(page.$page);
2480
+ if (page.$page) {
2481
+ clearDialogPages(page.$page);
2482
+ }
2426
2483
  var nativePage = page.$nativePage;
2427
2484
  nativePage && closeWebview(nativePage, animationType, animationDuration);
2428
2485
  removePage(page);
@@ -2712,7 +2769,7 @@ function initComponentInstance(app) {
2712
2769
  initNativePage,
2713
2770
  initFontFace
2714
2771
  };
2715
- app.mixin({
2772
+ !app.vapor && app.mixin({
2716
2773
  beforeCreate() {
2717
2774
  initNativePage(this);
2718
2775
  },
@@ -2744,7 +2801,6 @@ function initUniApp(uniApp) {
2744
2801
  });
2745
2802
  }
2746
2803
  function registerApp(appVm, nativeApp2, uniApp) {
2747
- initEntryPagePath(nativeApp2);
2748
2804
  setNativeApp(nativeApp2);
2749
2805
  initVueApp(appVm);
2750
2806
  appCtx = appVm;
@@ -2756,6 +2812,8 @@ function registerApp(appVm, nativeApp2, uniApp) {
2756
2812
  extend(appCtx, defaultApp);
2757
2813
  defineGlobalData(appCtx, defaultApp.globalData);
2758
2814
  initService(nativeApp2, unregisterApp);
2815
+ initEntry(nativeApp2);
2816
+ initEntryPagePath(nativeApp2);
2759
2817
  initGlobalEvent(nativeApp2);
2760
2818
  initAppLaunch(appVm);
2761
2819
  initAppError(appVm, nativeApp2);
@@ -3289,17 +3347,11 @@ var setNavigationBarTitle = /* @__PURE__ */ defineAsyncApi(API_SET_NAVIGATION_BA
3289
3347
  resolve();
3290
3348
  });
3291
3349
  var getElementById = /* @__PURE__ */ defineSyncApi("getElementById", (id2) => {
3292
- var _page$$el;
3293
- var page = getCurrentPage().vm;
3350
+ var page = getCurrentPage();
3294
3351
  if (page == null) {
3295
3352
  return null;
3296
3353
  }
3297
- var bodyNode = (_page$$el = page.$el) === null || _page$$el === void 0 ? void 0 : _page$$el.parentNode;
3298
- if (bodyNode == null) {
3299
- console.warn("bodyNode is null");
3300
- return null;
3301
- }
3302
- return bodyNode.querySelector("#".concat(id2));
3354
+ return page.getElementById(id2);
3303
3355
  });
3304
3356
  function isVueComponent(comp) {
3305
3357
  var has$instance = typeof comp.$ === "object";