@foundbyte/uni-libs 1.0.3 → 1.0.4-alpha.1

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.
@@ -0,0 +1,27 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
+ key = keys[i];
14
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ value: mod,
23
+ enumerable: true
24
+ }) : target, mod));
25
+
26
+ //#endregion
27
+ export { __commonJS, __toESM };
@@ -1,8 +1,11 @@
1
+ import { __toESM } from "../../_virtual/rolldown_runtime.js";
1
2
  import { EAppEnv } from "../../enums/environment/index.js";
3
+ import { require_objectSpread2 } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js";
2
4
  import app_hwtest_default from "./app.hwtest.js";
3
5
  import app_prod_default from "./app.prod.js";
4
6
 
5
7
  //#region src/configs/app/index.ts
8
+ var import_objectSpread2 = __toESM(require_objectSpread2(), 1);
6
9
  /**
7
10
  * 获取App配置信息
8
11
  * @param appEnv
@@ -17,15 +20,12 @@ function getAppConfig(appEnv) {
17
20
  config = app_prod_default;
18
21
  break;
19
22
  }
20
- return {
21
- domain: {
22
- shopping: "",
23
- food: "",
24
- onebuygz: "",
25
- movie: ""
26
- },
27
- ...config
28
- };
23
+ return (0, import_objectSpread2.default)({ domain: {
24
+ shopping: "",
25
+ food: "",
26
+ onebuygz: "",
27
+ movie: ""
28
+ } }, config);
29
29
  }
30
30
 
31
31
  //#endregion
package/es/entry.js CHANGED
@@ -1,21 +1,25 @@
1
+ import { __toESM } from "./_virtual/rolldown_runtime.js";
1
2
  import { EAppEnv } from "./enums/environment/index.js";
2
3
  import { ECaller } from "./enums/sdk/index.js";
4
+ import { require_defineProperty } from "./node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js";
5
+ import { require_objectSpread2 } from "./node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js";
3
6
  import { getAppConfig } from "./configs/app/index.js";
4
7
  import { GoodsService } from "./services/goods/service.js";
5
8
 
6
9
  //#region src/entry.ts
10
+ var import_defineProperty = __toESM(require_defineProperty());
11
+ var import_objectSpread2 = __toESM(require_objectSpread2());
7
12
  /**
8
13
  * 一码游SDK
9
14
  */
10
15
  var OneTravelSDK = class {
11
- sdkConfig;
12
- goodsService;
13
16
  constructor(config) {
14
- const value = {
17
+ (0, import_defineProperty.default)(this, "sdkConfig", void 0);
18
+ (0, import_defineProperty.default)(this, "goodsService", void 0);
19
+ const value = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, {
15
20
  appEnv: EAppEnv.prod,
16
- caller: ECaller.web,
17
- ...config || {}
18
- };
21
+ caller: ECaller.web
22
+ }), config || {});
19
23
  this.sdkConfig = value;
20
24
  this.goodsService = new GoodsService({ sdkConfig: value });
21
25
  }
@@ -0,0 +1,34 @@
1
+ import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
+
3
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js
4
+ var require_asyncToGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js"(exports, module) {
5
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
6
+ try {
7
+ var i = n[a](c), u = i.value;
8
+ } catch (n$1) {
9
+ return void e(n$1);
10
+ }
11
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
12
+ }
13
+ function _asyncToGenerator(n) {
14
+ return function() {
15
+ var t = this, e = arguments;
16
+ return new Promise(function(r, o) {
17
+ var a = n.apply(t, e);
18
+ function _next(n$1) {
19
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n$1);
20
+ }
21
+ function _throw(n$1) {
22
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n$1);
23
+ }
24
+ _next(void 0);
25
+ });
26
+ };
27
+ }
28
+ module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
29
+ } });
30
+
31
+ //#endregion
32
+ export default require_asyncToGenerator();
33
+
34
+ export { require_asyncToGenerator };
@@ -0,0 +1,21 @@
1
+ import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
+ import { require_toPropertyKey } from "./toPropertyKey.js";
3
+
4
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js
5
+ var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
6
+ var toPropertyKey = require_toPropertyKey();
7
+ function _defineProperty(e, r, t) {
8
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
9
+ value: t,
10
+ enumerable: !0,
11
+ configurable: !0,
12
+ writable: !0
13
+ }) : e[r] = t, e;
14
+ }
15
+ module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
16
+ } });
17
+
18
+ //#endregion
19
+ export default require_defineProperty();
20
+
21
+ export { require_defineProperty };
@@ -0,0 +1,34 @@
1
+ import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
+ import { require_defineProperty } from "./defineProperty.js";
3
+
4
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js
5
+ var require_objectSpread2 = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
6
+ var defineProperty = require_defineProperty();
7
+ function ownKeys(e, r) {
8
+ var t = Object.keys(e);
9
+ if (Object.getOwnPropertySymbols) {
10
+ var o = Object.getOwnPropertySymbols(e);
11
+ r && (o = o.filter(function(r$1) {
12
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
13
+ })), t.push.apply(t, o);
14
+ }
15
+ return t;
16
+ }
17
+ function _objectSpread2(e) {
18
+ for (var r = 1; r < arguments.length; r++) {
19
+ var t = null != arguments[r] ? arguments[r] : {};
20
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
21
+ defineProperty(e, r$1, t[r$1]);
22
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
23
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
24
+ });
25
+ }
26
+ return e;
27
+ }
28
+ module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
29
+ } });
30
+
31
+ //#endregion
32
+ export default require_objectSpread2();
33
+
34
+ export { require_objectSpread2 };
@@ -0,0 +1,22 @@
1
+ import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
+ import { require_objectWithoutPropertiesLoose } from "./objectWithoutPropertiesLoose.js";
3
+
4
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js
5
+ var require_objectWithoutProperties = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(exports, module) {
6
+ var objectWithoutPropertiesLoose = require_objectWithoutPropertiesLoose();
7
+ function _objectWithoutProperties(e, t) {
8
+ if (null == e) return {};
9
+ var o, r, i = objectWithoutPropertiesLoose(e, t);
10
+ if (Object.getOwnPropertySymbols) {
11
+ var s = Object.getOwnPropertySymbols(e);
12
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
13
+ }
14
+ return i;
15
+ }
16
+ module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
17
+ } });
18
+
19
+ //#endregion
20
+ export default require_objectWithoutProperties();
21
+
22
+ export { require_objectWithoutProperties };
@@ -0,0 +1,20 @@
1
+ import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
+
3
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js
4
+ var require_objectWithoutPropertiesLoose = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
5
+ function _objectWithoutPropertiesLoose(r, e) {
6
+ if (null == r) return {};
7
+ var t = {};
8
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
9
+ if (e.includes(n)) continue;
10
+ t[n] = r[n];
11
+ }
12
+ return t;
13
+ }
14
+ module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
15
+ } });
16
+
17
+ //#endregion
18
+ export default require_objectWithoutPropertiesLoose();
19
+
20
+ export { require_objectWithoutPropertiesLoose };
@@ -0,0 +1,23 @@
1
+ import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
+ import { require_typeof } from "./typeof.js";
3
+
4
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js
5
+ var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
6
+ var _typeof = require_typeof()["default"];
7
+ function toPrimitive(t, r) {
8
+ if ("object" != _typeof(t) || !t) return t;
9
+ var e = t[Symbol.toPrimitive];
10
+ if (void 0 !== e) {
11
+ var i = e.call(t, r || "default");
12
+ if ("object" != _typeof(i)) return i;
13
+ throw new TypeError("@@toPrimitive must return a primitive value.");
14
+ }
15
+ return ("string" === r ? String : Number)(t);
16
+ }
17
+ module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
18
+ } });
19
+
20
+ //#endregion
21
+ export default require_toPrimitive();
22
+
23
+ export { require_toPrimitive };
@@ -0,0 +1,19 @@
1
+ import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
+ import { require_typeof } from "./typeof.js";
3
+ import { require_toPrimitive } from "./toPrimitive.js";
4
+
5
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js
6
+ var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
7
+ var _typeof = require_typeof()["default"];
8
+ var toPrimitive = require_toPrimitive();
9
+ function toPropertyKey(t) {
10
+ var i = toPrimitive(t, "string");
11
+ return "symbol" == _typeof(i) ? i : i + "";
12
+ }
13
+ module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
14
+ } });
15
+
16
+ //#endregion
17
+ export default require_toPropertyKey();
18
+
19
+ export { require_toPropertyKey };
@@ -0,0 +1,19 @@
1
+ import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
+
3
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/typeof.js
4
+ var require_typeof = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
5
+ function _typeof(o) {
6
+ "@babel/helpers - typeof";
7
+ return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
8
+ return typeof o$1;
9
+ } : function(o$1) {
10
+ return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
11
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
12
+ }
13
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
14
+ } });
15
+
16
+ //#endregion
17
+ export default require_typeof();
18
+
19
+ export { require_typeof };
@@ -1,3 +1,4 @@
1
+ import { __toESM } from "../../_virtual/rolldown_runtime.js";
1
2
  import { routePrefix } from "../../constants/routes/index.js";
2
3
  import { EBusinessLine, ESubBizType } from "../../enums/business-line/index.js";
3
4
  import { ECaller } from "../../enums/sdk/index.js";
@@ -7,118 +8,143 @@ import { EHotelType } from "../../enums/sub/hotel/index.js";
7
8
  import { getWebviewPage } from "../../utils/pages/webview/index.js";
8
9
  import { getFoodPackagePage, getFoodStorePage } from "../../utils/pages/food/index.js";
9
10
  import { getMoviePage } from "../../utils/pages/movie/index.js";
11
+ import { require_defineProperty } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js";
10
12
  import { navigateTo } from "../../utils/web-view/index.js";
11
13
  import { getAppConfig } from "../../configs/app/index.js";
12
14
 
13
15
  //#region src/services/goods/service.ts
16
+ var import_defineProperty = __toESM(require_defineProperty(), 1);
14
17
  var GoodsService = class {
15
- goodsServiceConfig;
16
18
  constructor(config) {
17
- this.goodsServiceConfig = config;
18
- }
19
- /**
20
- * 跳转商品详情页面
21
- * @param item 商品数据
22
- */
23
- jumpToProductDetailPage = (item) => {
24
- const configOptions = this.goodsServiceConfig.sdkConfig;
25
- const appConfig = getAppConfig(configOptions.appEnv);
26
- let page = "";
27
- const businessLine = item?.businessLine || item?.common?.bizType || item?.common?.linkBusinessLine || item?.common?.businessType;
28
- const extInfo = item?.common?.extInfoMap || item?.common?.extInfo;
29
- switch (businessLine) {
30
- case EBusinessLine.Scenic:
31
- const scenicId = item?.scenic?.id || item?.common?.spuId || item?.common?.id || "";
32
- const scenicReservationId = item?.scenic?.reservationId || extInfo?.reservationId || item?.common?.reservationId || "";
33
- const scenicIsOld = item?.scenic?.isOld || extInfo?.isOld;
34
- page = `${routePrefix.ticket}/detail/index?scenicId=${scenicId}&reservationId=${scenicReservationId}&isOld=${scenicIsOld}`;
35
- break;
36
- case EBusinessLine.Hotel:
37
- const hotelId = item?.hotel?.id || extInfo?.storeId || item?.common?.storeId || "";
38
- page = `${routePrefix.hotel}/home/details/index?id=${hotelId}`;
39
- break;
40
- case EBusinessLine.Homestay:
41
- if ((item?.homestay?.type || extInfo?.type || item?.common?.type || "") === EHotelType.hotel) {
42
- /** 酒店 (天下房仓酒店详情页) */
43
- const id = item?.homestay?.id || extInfo?.storeId || item?.common?.storeId || "";
44
- page = `${routePrefix.hotel}/home/details/index?id=${id}`;
45
- } else {
46
- const subBizType = item?.homestay?.subBizType || extInfo?.subBizType;
47
- const id = item?.homestay?.id || item?.common?.spuId || item?.common?.id || "";
48
- /** 民宿 */
49
- if (`${subBizType}` === `${ESubBizType.HomestayHotel}`) page = `${routePrefix.hotel}/home/details/index?id=${id}`;
50
- else if (`${subBizType}` === `${ESubBizType.HomestayHot}`) page = `${routePrefix.hotel}/home/hot-sale-details/index?id=${id}`;
51
- else page = `${routePrefix.hotel}/home/pms-details/index?id=${id}`;
52
- }
53
- break;
54
- case EBusinessLine.Route:
55
- const routeId = item?.route?.id || item?.common?.spuId || item?.common?.id;
56
- page = `${routePrefix.road}/product-detail/index?id=${routeId}`;
57
- break;
58
- case EBusinessLine.Travel:
59
- const travelId = item?.travel?.id || item?.common?.spuId || item?.common?.id;
60
- page = `${routePrefix.travel}/charter/detail?routeId=${travelId}`;
61
- break;
62
- case EBusinessLine.Buy:
63
- const buySpuId = item?.buy?.spuId || item?.common?.spuId || item?.common?.id;
64
- page = getWebviewPage({ url: appConfig.domain.shopping + `goods?itemId=${buySpuId}` });
65
- break;
66
- case EBusinessLine.Onebuygz:
67
- const onebuySpuId = item?.onebuygz?.spuId || item?.common?.spuId || item?.common?.id;
68
- const onebuySkuId = item?.onebuygz?.skuId || item?.common?.skuId;
69
- page = getWebviewPage({ url: appConfig.domain.onebuygz + `pages/commodity-detail/index?itemId=${onebuySpuId}&skuId=${onebuySkuId}` });
70
- break;
71
- case EBusinessLine.Foods:
72
- const moduleType = item?.food?.moduleType || extInfo?.moduleType;
73
- const storeId = item?.food?.storeId || extInfo?.storeId || item?.common?.storeId || "";
74
- const spuId = item?.food?.spuId || item?.common?.spuId || item?.common?.id || "";
75
- const storePrecedentType = item?.food?.storePrecedentType || extInfo?.storePrecedentType || void 0;
76
- if (moduleType === EFoodsModuleType.store)
19
+ (0, import_defineProperty.default)(this, "goodsServiceConfig", void 0);
20
+ (0, import_defineProperty.default)(
21
+ this,
22
+ /**
23
+ * 跳转商品详情页面
24
+ * @param item 商品数据
25
+ */
26
+ "jumpToProductDetailPage",
27
+ (item) => {
28
+ var _item$common, _item$common2, _item$common3, _item$common4, _item$common5;
29
+ const configOptions = this.goodsServiceConfig.sdkConfig;
30
+ const appConfig = getAppConfig(configOptions.appEnv);
31
+ let page = "";
32
+ const businessLine = (item === null || item === void 0 ? void 0 : item.businessLine) || (item === null || item === void 0 || (_item$common = item.common) === null || _item$common === void 0 ? void 0 : _item$common.bizType) || (item === null || item === void 0 || (_item$common2 = item.common) === null || _item$common2 === void 0 ? void 0 : _item$common2.linkBusinessLine) || (item === null || item === void 0 || (_item$common3 = item.common) === null || _item$common3 === void 0 ? void 0 : _item$common3.businessType);
33
+ const extInfo = (item === null || item === void 0 || (_item$common4 = item.common) === null || _item$common4 === void 0 ? void 0 : _item$common4.extInfoMap) || (item === null || item === void 0 || (_item$common5 = item.common) === null || _item$common5 === void 0 ? void 0 : _item$common5.extInfo);
34
+ switch (businessLine) {
35
+ case EBusinessLine.Scenic:
36
+ var _item$scenic, _item$common6, _item$common7, _item$scenic2, _item$common8, _item$scenic3;
37
+ const scenicId = (item === null || item === void 0 || (_item$scenic = item.scenic) === null || _item$scenic === void 0 ? void 0 : _item$scenic.id) || (item === null || item === void 0 || (_item$common6 = item.common) === null || _item$common6 === void 0 ? void 0 : _item$common6.spuId) || (item === null || item === void 0 || (_item$common7 = item.common) === null || _item$common7 === void 0 ? void 0 : _item$common7.id) || "";
38
+ const scenicReservationId = (item === null || item === void 0 || (_item$scenic2 = item.scenic) === null || _item$scenic2 === void 0 ? void 0 : _item$scenic2.reservationId) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.reservationId) || (item === null || item === void 0 || (_item$common8 = item.common) === null || _item$common8 === void 0 ? void 0 : _item$common8.reservationId) || "";
39
+ const scenicIsOld = (item === null || item === void 0 || (_item$scenic3 = item.scenic) === null || _item$scenic3 === void 0 ? void 0 : _item$scenic3.isOld) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.isOld);
40
+ page = `${routePrefix.ticket}/detail/index?scenicId=${scenicId}&reservationId=${scenicReservationId}&isOld=${scenicIsOld}`;
41
+ break;
42
+ case EBusinessLine.Hotel:
43
+ var _item$hotel, _item$common9;
44
+ const hotelId = (item === null || item === void 0 || (_item$hotel = item.hotel) === null || _item$hotel === void 0 ? void 0 : _item$hotel.id) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storeId) || (item === null || item === void 0 || (_item$common9 = item.common) === null || _item$common9 === void 0 ? void 0 : _item$common9.storeId) || "";
45
+ page = `${routePrefix.hotel}/home/details/index?id=${hotelId}`;
46
+ break;
47
+ case EBusinessLine.Homestay:
48
+ var _item$homestay, _item$common10;
49
+ const homestayType = (item === null || item === void 0 || (_item$homestay = item.homestay) === null || _item$homestay === void 0 ? void 0 : _item$homestay.type) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.type) || (item === null || item === void 0 || (_item$common10 = item.common) === null || _item$common10 === void 0 ? void 0 : _item$common10.type) || "";
50
+ if (homestayType === EHotelType.hotel) {
51
+ var _item$homestay2, _item$common11;
52
+ /** 酒店 (天下房仓酒店详情页) */
53
+ const id = (item === null || item === void 0 || (_item$homestay2 = item.homestay) === null || _item$homestay2 === void 0 ? void 0 : _item$homestay2.id) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storeId) || (item === null || item === void 0 || (_item$common11 = item.common) === null || _item$common11 === void 0 ? void 0 : _item$common11.storeId) || "";
54
+ page = `${routePrefix.hotel}/home/details/index?id=${id}`;
55
+ } else {
56
+ var _item$homestay3, _item$homestay4, _item$common12, _item$common13;
57
+ const subBizType = (item === null || item === void 0 || (_item$homestay3 = item.homestay) === null || _item$homestay3 === void 0 ? void 0 : _item$homestay3.subBizType) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.subBizType);
58
+ const id = (item === null || item === void 0 || (_item$homestay4 = item.homestay) === null || _item$homestay4 === void 0 ? void 0 : _item$homestay4.id) || (item === null || item === void 0 || (_item$common12 = item.common) === null || _item$common12 === void 0 ? void 0 : _item$common12.spuId) || (item === null || item === void 0 || (_item$common13 = item.common) === null || _item$common13 === void 0 ? void 0 : _item$common13.id) || "";
59
+ /** 民宿 */
60
+ if (`${subBizType}` === `${ESubBizType.HomestayHotel}`) page = `${routePrefix.hotel}/home/details/index?id=${id}`;
61
+ else if (`${subBizType}` === `${ESubBizType.HomestayHot}`) page = `${routePrefix.hotel}/home/hot-sale-details/index?id=${id}`;
62
+ else page = `${routePrefix.hotel}/home/pms-details/index?id=${id}`;
63
+ }
64
+ break;
65
+ case EBusinessLine.Route:
66
+ var _item$route, _item$common14, _item$common15;
67
+ const routeId = (item === null || item === void 0 || (_item$route = item.route) === null || _item$route === void 0 ? void 0 : _item$route.id) || (item === null || item === void 0 || (_item$common14 = item.common) === null || _item$common14 === void 0 ? void 0 : _item$common14.spuId) || (item === null || item === void 0 || (_item$common15 = item.common) === null || _item$common15 === void 0 ? void 0 : _item$common15.id);
68
+ page = `${routePrefix.road}/product-detail/index?id=${routeId}`;
69
+ break;
70
+ case EBusinessLine.Travel:
71
+ var _item$travel, _item$common16, _item$common17;
72
+ const travelId = (item === null || item === void 0 || (_item$travel = item.travel) === null || _item$travel === void 0 ? void 0 : _item$travel.id) || (item === null || item === void 0 || (_item$common16 = item.common) === null || _item$common16 === void 0 ? void 0 : _item$common16.spuId) || (item === null || item === void 0 || (_item$common17 = item.common) === null || _item$common17 === void 0 ? void 0 : _item$common17.id);
73
+ page = `${routePrefix.travel}/charter/detail?routeId=${travelId}`;
74
+ break;
75
+ case EBusinessLine.Buy:
76
+ var _item$buy, _item$common18, _item$common19;
77
+ const buySpuId = (item === null || item === void 0 || (_item$buy = item.buy) === null || _item$buy === void 0 ? void 0 : _item$buy.spuId) || (item === null || item === void 0 || (_item$common18 = item.common) === null || _item$common18 === void 0 ? void 0 : _item$common18.spuId) || (item === null || item === void 0 || (_item$common19 = item.common) === null || _item$common19 === void 0 ? void 0 : _item$common19.id);
78
+ page = getWebviewPage({ url: appConfig.domain.shopping + `goods?itemId=${buySpuId}` });
79
+ break;
80
+ case EBusinessLine.Onebuygz:
81
+ var _item$onebuygz, _item$common20, _item$common21, _item$onebuygz2, _item$common22;
82
+ const onebuySpuId = (item === null || item === void 0 || (_item$onebuygz = item.onebuygz) === null || _item$onebuygz === void 0 ? void 0 : _item$onebuygz.spuId) || (item === null || item === void 0 || (_item$common20 = item.common) === null || _item$common20 === void 0 ? void 0 : _item$common20.spuId) || (item === null || item === void 0 || (_item$common21 = item.common) === null || _item$common21 === void 0 ? void 0 : _item$common21.id);
83
+ const onebuySkuId = (item === null || item === void 0 || (_item$onebuygz2 = item.onebuygz) === null || _item$onebuygz2 === void 0 ? void 0 : _item$onebuygz2.skuId) || (item === null || item === void 0 || (_item$common22 = item.common) === null || _item$common22 === void 0 ? void 0 : _item$common22.skuId);
84
+ page = getWebviewPage({ url: appConfig.domain.onebuygz + `pages/commodity-detail/index?itemId=${onebuySpuId}&skuId=${onebuySkuId}` });
85
+ break;
86
+ case EBusinessLine.Foods:
87
+ var _item$food, _item$food2, _item$common23, _item$food3, _item$common24, _item$common25, _item$food4;
88
+ const moduleType = (item === null || item === void 0 || (_item$food = item.food) === null || _item$food === void 0 ? void 0 : _item$food.moduleType) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.moduleType);
89
+ const storeId = (item === null || item === void 0 || (_item$food2 = item.food) === null || _item$food2 === void 0 ? void 0 : _item$food2.storeId) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storeId) || (item === null || item === void 0 || (_item$common23 = item.common) === null || _item$common23 === void 0 ? void 0 : _item$common23.storeId) || "";
90
+ const spuId = (item === null || item === void 0 || (_item$food3 = item.food) === null || _item$food3 === void 0 ? void 0 : _item$food3.spuId) || (item === null || item === void 0 || (_item$common24 = item.common) === null || _item$common24 === void 0 ? void 0 : _item$common24.spuId) || (item === null || item === void 0 || (_item$common25 = item.common) === null || _item$common25 === void 0 ? void 0 : _item$common25.id) || "";
91
+ const storePrecedentType = (item === null || item === void 0 || (_item$food4 = item.food) === null || _item$food4 === void 0 ? void 0 : _item$food4.storePrecedentType) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storePrecedentType) || void 0;
92
+ if (moduleType === EFoodsModuleType.store)
77
93
  /** 收藏跳店铺 */
78
- page = getWebviewPage({ url: getFoodStorePage(appConfig.domain.food, storeId) });
79
- else
94
+ page = getWebviewPage({ url: getFoodStorePage(appConfig.domain.food, storeId) });
95
+ else
80
96
  /** 跳转套餐 */
81
- page = getWebviewPage({ url: getFoodPackagePage(appConfig.domain.food, storeId, spuId, storePrecedentType) });
82
- break;
83
- case EBusinessLine.Entertainment:
84
- const entertainmentId = item?.entertainment?.id || item?.common?.spuId || item?.common?.id;
85
- const entertainmentStoreId = item?.entertainment?.storeId || extInfo?.storeId || item?.common?.storeId || "";
86
- const entertainmentSubBizType = item?.entertainment?.subBizType || extInfo?.subBizType;
87
- const entertainmentType = item?.entertainment?.type || extInfo?.type || item?.common?.type;
88
- const entertainmentReservationId = item?.entertainment?.reservationId || extInfo?.reservationId || item?.common?.reservationId;
89
- if (`${entertainmentType}` === EVenueSimpleTypes.Activity || `${entertainmentSubBizType}` === `${ESubBizType.EntertainmentPerform}`) page = `${routePrefix.enjoy}/g-activity/detail?id=` + entertainmentId + "&mchId=" + entertainmentStoreId;
90
- else page = `${routePrefix.enjoy}/g-venue/detail?id=${entertainmentId}&reservationId=${entertainmentReservationId}`;
91
- break;
92
- case EBusinessLine.Movie:
93
- let movieId = item?.movie?.id || "";
94
- try {
95
- movieId = JSON.parse(extInfo?.extInfo || "{}")?.thirdMovieId || "";
96
- } catch {}
97
- page = getMoviePage(appConfig.domain.movie, movieId);
98
- break;
99
- case EBusinessLine.Strategy:
100
- const strategyId = item?.strategy?.id || item?.common?.spuId || item?.common?.id;
101
- page = `${routePrefix.strategy}/strategy-detail/index?id=` + strategyId;
102
- break;
103
- case EBusinessLine.Recommend:
104
- const recommendId = item?.recommend?.id || item?.common?.spuId || item?.common?.id;
105
- const recommendMoreParameter = item?.recommend?.moreParameter || extInfo?.moreParameter || "";
106
- page = `${routePrefix.show}/details/index?id=${recommendId}${recommendMoreParameter}`;
107
- break;
108
- case EBusinessLine.SoundGuizhou:
109
- const soundGuizhouId = item?.soundGuizhou?.id || item?.common?.spuId || item?.common?.id;
110
- page = `${routePrefix.soundGuizhou}/detail?audioLibId=${soundGuizhouId}`;
111
- break;
112
- case EBusinessLine.ExcitingVideo:
113
- const excitingVideoId = item?.excitingVideo?.id || item?.common?.spuId || item?.common?.id;
114
- page = `${routePrefix.living}/wonderful-video/index?vid=${excitingVideoId}`;
115
- break;
116
- default: break;
117
- }
118
- if (!page) return;
119
- if (configOptions.caller === ECaller.web) navigateTo({ src: page });
120
- else if (configOptions.caller === ECaller.host) uni.navigateTo({ url: page });
121
- };
97
+ page = getWebviewPage({ url: getFoodPackagePage(appConfig.domain.food, storeId, spuId, storePrecedentType) });
98
+ break;
99
+ case EBusinessLine.Entertainment:
100
+ var _item$entertainment, _item$common26, _item$common27, _item$entertainment2, _item$common28, _item$entertainment3, _item$entertainment4, _item$common29, _item$entertainment5, _item$common30;
101
+ const entertainmentId = (item === null || item === void 0 || (_item$entertainment = item.entertainment) === null || _item$entertainment === void 0 ? void 0 : _item$entertainment.id) || (item === null || item === void 0 || (_item$common26 = item.common) === null || _item$common26 === void 0 ? void 0 : _item$common26.spuId) || (item === null || item === void 0 || (_item$common27 = item.common) === null || _item$common27 === void 0 ? void 0 : _item$common27.id);
102
+ const entertainmentStoreId = (item === null || item === void 0 || (_item$entertainment2 = item.entertainment) === null || _item$entertainment2 === void 0 ? void 0 : _item$entertainment2.storeId) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storeId) || (item === null || item === void 0 || (_item$common28 = item.common) === null || _item$common28 === void 0 ? void 0 : _item$common28.storeId) || "";
103
+ const entertainmentSubBizType = (item === null || item === void 0 || (_item$entertainment3 = item.entertainment) === null || _item$entertainment3 === void 0 ? void 0 : _item$entertainment3.subBizType) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.subBizType);
104
+ const entertainmentType = (item === null || item === void 0 || (_item$entertainment4 = item.entertainment) === null || _item$entertainment4 === void 0 ? void 0 : _item$entertainment4.type) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.type) || (item === null || item === void 0 || (_item$common29 = item.common) === null || _item$common29 === void 0 ? void 0 : _item$common29.type);
105
+ const entertainmentReservationId = (item === null || item === void 0 || (_item$entertainment5 = item.entertainment) === null || _item$entertainment5 === void 0 ? void 0 : _item$entertainment5.reservationId) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.reservationId) || (item === null || item === void 0 || (_item$common30 = item.common) === null || _item$common30 === void 0 ? void 0 : _item$common30.reservationId);
106
+ if (`${entertainmentType}` === EVenueSimpleTypes.Activity || `${entertainmentSubBizType}` === `${ESubBizType.EntertainmentPerform}`) page = `${routePrefix.enjoy}/g-activity/detail?id=` + entertainmentId + "&mchId=" + entertainmentStoreId;
107
+ else page = `${routePrefix.enjoy}/g-venue/detail?id=${entertainmentId}&reservationId=${entertainmentReservationId}`;
108
+ break;
109
+ case EBusinessLine.Movie:
110
+ var _item$movie;
111
+ let movieId = (item === null || item === void 0 || (_item$movie = item.movie) === null || _item$movie === void 0 ? void 0 : _item$movie.id) || "";
112
+ try {
113
+ var _JSON$parse;
114
+ movieId = ((_JSON$parse = JSON.parse((extInfo === null || extInfo === void 0 ? void 0 : extInfo.extInfo) || "{}")) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.thirdMovieId) || "";
115
+ } catch (_unused) {}
116
+ page = getMoviePage(appConfig.domain.movie, movieId);
117
+ break;
118
+ case EBusinessLine.Strategy:
119
+ var _item$strategy, _item$common31, _item$common32;
120
+ const strategyId = (item === null || item === void 0 || (_item$strategy = item.strategy) === null || _item$strategy === void 0 ? void 0 : _item$strategy.id) || (item === null || item === void 0 || (_item$common31 = item.common) === null || _item$common31 === void 0 ? void 0 : _item$common31.spuId) || (item === null || item === void 0 || (_item$common32 = item.common) === null || _item$common32 === void 0 ? void 0 : _item$common32.id);
121
+ page = `${routePrefix.strategy}/strategy-detail/index?id=` + strategyId;
122
+ break;
123
+ case EBusinessLine.Recommend:
124
+ var _item$recommend, _item$common33, _item$common34, _item$recommend2;
125
+ const recommendId = (item === null || item === void 0 || (_item$recommend = item.recommend) === null || _item$recommend === void 0 ? void 0 : _item$recommend.id) || (item === null || item === void 0 || (_item$common33 = item.common) === null || _item$common33 === void 0 ? void 0 : _item$common33.spuId) || (item === null || item === void 0 || (_item$common34 = item.common) === null || _item$common34 === void 0 ? void 0 : _item$common34.id);
126
+ const recommendMoreParameter = (item === null || item === void 0 || (_item$recommend2 = item.recommend) === null || _item$recommend2 === void 0 ? void 0 : _item$recommend2.moreParameter) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.moreParameter) || "";
127
+ page = `${routePrefix.show}/details/index?id=${recommendId}${recommendMoreParameter}`;
128
+ break;
129
+ case EBusinessLine.SoundGuizhou:
130
+ var _item$soundGuizhou, _item$common35, _item$common36;
131
+ const soundGuizhouId = (item === null || item === void 0 || (_item$soundGuizhou = item.soundGuizhou) === null || _item$soundGuizhou === void 0 ? void 0 : _item$soundGuizhou.id) || (item === null || item === void 0 || (_item$common35 = item.common) === null || _item$common35 === void 0 ? void 0 : _item$common35.spuId) || (item === null || item === void 0 || (_item$common36 = item.common) === null || _item$common36 === void 0 ? void 0 : _item$common36.id);
132
+ page = `${routePrefix.soundGuizhou}/detail?audioLibId=${soundGuizhouId}`;
133
+ break;
134
+ case EBusinessLine.ExcitingVideo:
135
+ var _item$excitingVideo, _item$common37, _item$common38;
136
+ const excitingVideoId = (item === null || item === void 0 || (_item$excitingVideo = item.excitingVideo) === null || _item$excitingVideo === void 0 ? void 0 : _item$excitingVideo.id) || (item === null || item === void 0 || (_item$common37 = item.common) === null || _item$common37 === void 0 ? void 0 : _item$common37.spuId) || (item === null || item === void 0 || (_item$common38 = item.common) === null || _item$common38 === void 0 ? void 0 : _item$common38.id);
137
+ page = `${routePrefix.living}/wonderful-video/index?vid=${excitingVideoId}`;
138
+ break;
139
+ default: break;
140
+ }
141
+ if (!page) return;
142
+ if (configOptions.caller === ECaller.web) navigateTo({ src: page });
143
+ else if (configOptions.caller === ECaller.host) uni.navigateTo({ url: page });
144
+ }
145
+ );
146
+ this.goodsServiceConfig = config;
147
+ }
122
148
  };
123
149
 
124
150
  //#endregion
@@ -33,7 +33,7 @@ function getQueryParameters(url) {
33
33
  let value = decodeURIComponent(pair[1] || "");
34
34
  try {
35
35
  value = JSON.parse(value);
36
- } catch {}
36
+ } catch (_unused) {}
37
37
  params[key] = value;
38
38
  }
39
39
  }
@@ -62,7 +62,7 @@ const showAndroidTip = (options) => {
62
62
  const checkAndRequestNativeAppPermission = (options) => {
63
63
  const { type, success, fail } = options || {};
64
64
  if (isWeixinEnv() || isH5Env() || isHarmonyEnv() || isiOSEnv()) {
65
- success?.();
65
+ success === null || success === void 0 || success();
66
66
  return;
67
67
  }
68
68
  const ActivityCompat = plus.android.importClass("androidx.core.app.ActivityCompat");
@@ -77,19 +77,19 @@ const checkAndRequestNativeAppPermission = (options) => {
77
77
  }
78
78
  });
79
79
  if (!hasPermission) {
80
- success?.();
80
+ success === null || success === void 0 || success();
81
81
  return;
82
82
  }
83
83
  showAndroidTip(detail);
84
84
  plus.android.requestPermissions(detail.permissionId, function(resultObj) {
85
85
  if (resultObj.granted.length > 0) {
86
86
  closeAndroidTip();
87
- success?.();
87
+ success === null || success === void 0 || success();
88
88
  return;
89
89
  }
90
90
  if (resultObj.deniedPresent.length > 0) {
91
91
  closeAndroidTip();
92
- fail?.();
92
+ fail === null || fail === void 0 || fail();
93
93
  return;
94
94
  }
95
95
  if (resultObj.deniedAlways.length > 0) {
@@ -99,15 +99,15 @@ const checkAndRequestNativeAppPermission = (options) => {
99
99
  confirmText: "去设置",
100
100
  success: function(res) {
101
101
  closeAndroidTip();
102
- if (res.confirm) uni.openAppAuthorizeSetting({ success: () => fail?.() });
103
- if (res.cancel) fail?.();
102
+ if (res.confirm) uni.openAppAuthorizeSetting({ success: () => fail === null || fail === void 0 ? void 0 : fail() });
103
+ if (res.cancel) fail === null || fail === void 0 || fail();
104
104
  }
105
105
  });
106
106
  return;
107
107
  }
108
108
  }, function() {
109
109
  closeAndroidTip();
110
- fail?.();
110
+ fail === null || fail === void 0 || fail();
111
111
  });
112
112
  };
113
113
 
@@ -1,6 +1,9 @@
1
+ import { __toESM } from "../../_virtual/rolldown_runtime.js";
1
2
  import { EUniPlatform } from "../../enums/platform/index.js";
3
+ import { require_objectSpread2 } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js";
2
4
 
3
5
  //#region src/utils/uni-env/index.ts
6
+ var import_objectSpread2 = __toESM(require_objectSpread2(), 1);
4
7
  /**
5
8
  * 是否是支付宝小程序
6
9
  * @returns
@@ -54,10 +57,7 @@ const isiOSEnv = () => {
54
57
  return false;
55
58
  };
56
59
  function getSystemInfoSync() {
57
- return {
58
- ...uni.getDeviceInfo(),
59
- ...uni.getWindowInfo()
60
- };
60
+ return (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, uni.getDeviceInfo()), uni.getWindowInfo());
61
61
  }
62
62
 
63
63
  //#endregion
@@ -1,6 +1,14 @@
1
+ import { __toESM } from "../../_virtual/rolldown_runtime.js";
2
+ import { require_asyncToGenerator } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js";
3
+ import { require_objectWithoutProperties } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js";
4
+ import { require_objectSpread2 } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js";
1
5
  import wx from "weixin-js-sdk";
2
6
 
3
7
  //#region src/utils/web-view/index.ts
8
+ var import_asyncToGenerator = __toESM(require_asyncToGenerator(), 1);
9
+ var import_objectWithoutProperties = __toESM(require_objectWithoutProperties(), 1);
10
+ var import_objectSpread2 = __toESM(require_objectSpread2(), 1);
11
+ const _excluded = ["shareUrl"];
4
12
  const userAgent = navigator.userAgent.toLowerCase();
5
13
  /** 判断是否是iOS还是安卓 */
6
14
  const isIOSOrAndroid = !userAgent.includes("miniprogram") && (userAgent.includes("android") || userAgent.includes("iphone") || userAgent.includes("ipad"));
@@ -15,14 +23,25 @@ const isAndroid = !userAgent.includes("miniprogram") && userAgent.includes("andr
15
23
  /** 判断是否苹果APP */
16
24
  const isiOS = !userAgent.includes("miniprogram") && (userAgent.includes("iphone") || userAgent.includes("ipad"));
17
25
  let uni = {};
18
- async function loadWebview() {
19
- if (isIOSOrAndroid) uni = (await import("../../assets/js/webview/uni.webview.1.5.6.js")).default;
20
- else uni = (await import("../../assets/js/webview/uni.webview.1.5.5.js")).default;
21
- if (isAlipay) {
22
- const scriptTag = document.createElement("script");
23
- scriptTag.src = "https://appx/web-view.min.js";
24
- document.head.appendChild(scriptTag);
25
- }
26
+ function loadWebview() {
27
+ return _loadWebview.apply(this, arguments);
28
+ }
29
+ function _loadWebview() {
30
+ _loadWebview = (0, import_asyncToGenerator.default)(function* () {
31
+ if (isIOSOrAndroid) {
32
+ const res = yield import("../../assets/js/webview/uni.webview.1.5.6.js");
33
+ uni = res.default;
34
+ } else {
35
+ const res = yield import("../../assets/js/webview/uni.webview.1.5.5.js");
36
+ uni = res.default;
37
+ }
38
+ if (isAlipay) {
39
+ const scriptTag = document.createElement("script");
40
+ scriptTag.src = "https://appx/web-view.min.js";
41
+ document.head.appendChild(scriptTag);
42
+ }
43
+ });
44
+ return _loadWebview.apply(this, arguments);
26
45
  }
27
46
  loadWebview();
28
47
  document.addEventListener("UniAppJSBridgeReady", function() {
@@ -45,10 +64,11 @@ const navigateTo = (parameters) => {
45
64
  const { src, params } = parameters;
46
65
  const url = `${src}${params ? `?${objectToQueryString(params)}` : ""}`;
47
66
  try {
48
- uni?.webView?.navigateTo?.({ url });
67
+ var _uni$webView, _uni$webView$navigate, _my;
68
+ uni === null || uni === void 0 || (_uni$webView = uni.webView) === null || _uni$webView === void 0 || (_uni$webView$navigate = _uni$webView.navigateTo) === null || _uni$webView$navigate === void 0 || _uni$webView$navigate.call(_uni$webView, { url });
49
69
  /** 不兼容上面的方法会自动往下执行 */
50
70
  wx.miniProgram.navigateTo({ url });
51
- my?.navigateTo({ url });
71
+ (_my = my) === null || _my === void 0 || _my.navigateTo({ url });
52
72
  } catch (error) {
53
73
  console.error(error);
54
74
  }
@@ -61,10 +81,11 @@ const redirectTo = (parameters) => {
61
81
  const { src, params } = parameters;
62
82
  const url = `${src}${params ? `?${objectToQueryString(params)}` : ""}`;
63
83
  try {
64
- uni?.webView?.redirectTo?.({ url });
84
+ var _uni$webView2, _uni$webView2$redirec, _my2;
85
+ uni === null || uni === void 0 || (_uni$webView2 = uni.webView) === null || _uni$webView2 === void 0 || (_uni$webView2$redirec = _uni$webView2.redirectTo) === null || _uni$webView2$redirec === void 0 || _uni$webView2$redirec.call(_uni$webView2, { url });
65
86
  /** 不兼容上面的方法会自动往下执行 */
66
87
  wx.miniProgram.redirectTo({ url });
67
- my?.redirectTo({ url });
88
+ (_my2 = my) === null || _my2 === void 0 || _my2.redirectTo({ url });
68
89
  } catch (error) {
69
90
  console.error(error);
70
91
  }
@@ -75,10 +96,11 @@ const redirectTo = (parameters) => {
75
96
  */
76
97
  const navigateBack = (parameters) => {
77
98
  try {
78
- uni?.webView?.navigateBack?.(parameters);
99
+ var _uni$webView3, _uni$webView3$navigat, _my3;
100
+ uni === null || uni === void 0 || (_uni$webView3 = uni.webView) === null || _uni$webView3 === void 0 || (_uni$webView3$navigat = _uni$webView3.navigateBack) === null || _uni$webView3$navigat === void 0 || _uni$webView3$navigat.call(_uni$webView3, parameters);
79
101
  /** 不兼容上面的方法会自动往下执行 */
80
102
  wx.miniProgram.navigateBack(parameters);
81
- my?.navigateBack(parameters);
103
+ (_my3 = my) === null || _my3 === void 0 || _my3.navigateBack(parameters);
82
104
  } catch (error) {
83
105
  console.error(error);
84
106
  }
@@ -98,11 +120,13 @@ const postMessage = (data) => {
98
120
  }
99
121
  }
100
122
  try {
101
- uni?.webView?.postMessage({ data });
123
+ var _uni$webView4, _my4;
124
+ uni === null || uni === void 0 || (_uni$webView4 = uni.webView) === null || _uni$webView4 === void 0 || _uni$webView4.postMessage({ data });
102
125
  wx.miniProgram.postMessage({ data });
103
- my?.postMessage({ data });
126
+ (_my4 = my) === null || _my4 === void 0 || _my4.postMessage({ data });
104
127
  } catch (error) {
105
- if (error?.message?.includes("my is not defined")) return;
128
+ var _message;
129
+ if (error === null || error === void 0 || (_message = error.message) === null || _message === void 0 ? void 0 : _message.includes("my is not defined")) return;
106
130
  console.error(error);
107
131
  }
108
132
  };
@@ -111,12 +135,11 @@ const postMessage = (data) => {
111
135
  * @param data
112
136
  */
113
137
  const setShareParam = (data, businessType) => {
114
- const { shareUrl, ...res } = data;
115
- const params = { data: {
116
- ...res,
138
+ const { shareUrl } = data, res = (0, import_objectWithoutProperties.default)(data, _excluded);
139
+ const params = { data: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, res), {}, {
117
140
  businessType,
118
141
  shareUrl: encodeURIComponent(shareUrl || "")
119
- } };
142
+ }) };
120
143
  postMessage({
121
144
  type: EMessagesType.shareParam,
122
145
  params
@@ -136,10 +159,11 @@ const toPay = (data) => {
136
159
  });
137
160
  };
138
161
  function objectToQueryString(obj) {
139
- return Object.entries(obj).map(([key, value]) => {
162
+ const params = Object.entries(obj).map(([key, value]) => {
140
163
  if (Array.isArray(value)) return value.map((val) => `${encodeURI(key)}[]=${encodeURI(val)}`).join("&");
141
164
  return `${encodeURI(key)}=${encodeURI(value)}`;
142
- }).join("&");
165
+ });
166
+ return params.join("&");
143
167
  }
144
168
 
145
169
  //#endregion
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@foundbyte/uni-libs",
3
3
  "description": "FoundByte Uni Libs",
4
4
  "author": "yangshuai <704807396@qq.com>",
5
- "version": "1.0.3",
5
+ "version": "1.0.4-alpha.01",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",