@foundbyte/uni-libs 0.0.2 → 0.0.4

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.
Files changed (90) hide show
  1. package/es/configs/app/app.hwtest.d.ts +3 -0
  2. package/es/configs/app/app.hwtest.js +14 -11
  3. package/es/configs/app/app.prod.d.ts +3 -0
  4. package/es/configs/app/app.prod.js +14 -11
  5. package/es/configs/app/app.type.d.ts +10 -15
  6. package/es/configs/app/index.d.ts +7 -0
  7. package/es/configs/app/index.js +24 -31
  8. package/es/configs/index.d.ts +1 -0
  9. package/es/constants/index.d.ts +1 -0
  10. package/es/constants/routes/index.d.ts +74 -79
  11. package/es/constants/routes/index.js +78 -46
  12. package/es/entry.d.ts +14 -19
  13. package/es/entry.js +35 -38
  14. package/es/enums/business-line/index.d.ts +71 -76
  15. package/es/enums/business-line/index.js +36 -115
  16. package/es/enums/environment/index.d.ts +5 -10
  17. package/es/enums/environment/index.js +4 -15
  18. package/es/enums/index.d.ts +5 -0
  19. package/es/enums/sdk/index.d.ts +5 -10
  20. package/es/enums/sdk/index.js +4 -15
  21. package/es/enums/storage/index.d.ts +2 -7
  22. package/es/enums/storage/index.js +4 -12
  23. package/es/enums/sub/enjoy/index.d.ts +14 -19
  24. package/es/enums/sub/enjoy/index.js +12 -19
  25. package/es/enums/sub/foods/index.d.ts +3 -8
  26. package/es/enums/sub/foods/index.js +4 -11
  27. package/es/enums/sub/hotel/index.d.ts +2 -7
  28. package/es/enums/sub/hotel/index.js +4 -12
  29. package/es/enums/sub/index.d.ts +3 -0
  30. package/es/index.d.ts +5 -16
  31. package/es/index.js +42 -16
  32. package/es/libs/webview/uni.webview.1.5.5.js +126 -0
  33. package/es/services/config/index.d.ts +5 -0
  34. package/es/services/config/index.js +6 -12
  35. package/es/services/goods/index.d.ts +2 -0
  36. package/es/services/goods/type.d.ts +20 -27
  37. package/es/services/goods/util.d.ts +6 -0
  38. package/es/services/goods/util.js +74 -122
  39. package/es/services/index.d.ts +2 -0
  40. package/es/types/index.d.ts +1 -0
  41. package/es/types/one-travel-service/index.d.ts +7 -14
  42. package/es/utils/common/index.d.ts +4 -9
  43. package/es/utils/common/index.js +25 -42
  44. package/es/utils/index.d.ts +3 -0
  45. package/es/utils/pages/activity-calendar/index.d.ts +4 -7
  46. package/es/utils/pages/activity-calendar/index.js +8 -11
  47. package/es/utils/pages/food/index.d.ts +2 -7
  48. package/es/utils/pages/food/index.js +5 -32
  49. package/es/utils/pages/index.d.ts +3 -0
  50. package/es/utils/pages/webview/index.d.ts +7 -11
  51. package/es/utils/pages/webview/index.js +7 -10
  52. package/es/utils/web-view/index.d.ts +18 -23
  53. package/es/utils/web-view/index.js +47 -84
  54. package/package.json +4 -2
  55. package/es/configs/app/app.hwtest.js.map +0 -1
  56. package/es/configs/app/app.prod.js.map +0 -1
  57. package/es/configs/app/app.type.d.ts.map +0 -1
  58. package/es/configs/app/index.js.map +0 -1
  59. package/es/constants/routes/index.d.ts.map +0 -1
  60. package/es/constants/routes/index.js.map +0 -1
  61. package/es/entry.d.ts.map +0 -1
  62. package/es/entry.js.map +0 -1
  63. package/es/enums/business-line/index.d.ts.map +0 -1
  64. package/es/enums/business-line/index.js.map +0 -1
  65. package/es/enums/environment/index.d.ts.map +0 -1
  66. package/es/enums/environment/index.js.map +0 -1
  67. package/es/enums/sdk/index.d.ts.map +0 -1
  68. package/es/enums/sdk/index.js.map +0 -1
  69. package/es/enums/storage/index.d.ts.map +0 -1
  70. package/es/enums/storage/index.js.map +0 -1
  71. package/es/enums/sub/enjoy/index.d.ts.map +0 -1
  72. package/es/enums/sub/enjoy/index.js.map +0 -1
  73. package/es/enums/sub/foods/index.d.ts.map +0 -1
  74. package/es/enums/sub/foods/index.js.map +0 -1
  75. package/es/enums/sub/hotel/index.d.ts.map +0 -1
  76. package/es/enums/sub/hotel/index.js.map +0 -1
  77. package/es/services/config/index.js.map +0 -1
  78. package/es/services/goods/type.d.ts.map +0 -1
  79. package/es/services/goods/util.js.map +0 -1
  80. package/es/types/one-travel-service/index.d.ts.map +0 -1
  81. package/es/utils/common/index.d.ts.map +0 -1
  82. package/es/utils/common/index.js.map +0 -1
  83. package/es/utils/pages/activity-calendar/index.d.ts.map +0 -1
  84. package/es/utils/pages/activity-calendar/index.js.map +0 -1
  85. package/es/utils/pages/food/index.d.ts.map +0 -1
  86. package/es/utils/pages/food/index.js.map +0 -1
  87. package/es/utils/pages/webview/index.d.ts.map +0 -1
  88. package/es/utils/pages/webview/index.js.map +0 -1
  89. package/es/utils/web-view/index.d.ts.map +0 -1
  90. package/es/utils/web-view/index.js.map +0 -1
package/es/index.js CHANGED
@@ -1,16 +1,42 @@
1
- import { routePrefix, routes } from "./constants/routes/index.js";
2
- import { BusinessLineDict, EBusinessLine, ESubBizType } from "./enums/business-line/index.js";
3
- import { EAppEnv } from "./enums/environment/index.js";
4
- import { ECaller } from "./enums/sdk/index.js";
5
- import { EStorageKey } from "./enums/storage/index.js";
6
- import { EVenueTypes, EVenueTypesDes } from "./enums/sub/enjoy/index.js";
7
- import { EFoodsModuleType } from "./enums/sub/foods/index.js";
8
- import { EHotelType } from "./enums/sub/hotel/index.js";
9
- import { getQueryParameters, isEmpty, query2url } from "./utils/common/index.js";
10
- import { getActivityCalendarDetailPage } from "./utils/pages/activity-calendar/index.js";
11
- import { getWebviewPage } from "./utils/pages/webview/index.js";
12
- import { getFoodPackagePage, getFoodStorePage } from "./utils/pages/food/index.js";
13
- import { EMessagesType, getWebViewEnv, navigateBack, navigateTo, postMessage, redirectTo } from "./utils/web-view/index.js";
14
- import { OneTravelSDK } from "./entry.js";
15
-
16
- export { BusinessLineDict, EAppEnv, EBusinessLine, ECaller, EFoodsModuleType, EHotelType, EMessagesType, EStorageKey, ESubBizType, EVenueTypes, EVenueTypesDes, OneTravelSDK, getActivityCalendarDetailPage, getFoodPackagePage, getFoodStorePage, getQueryParameters, getWebViewEnv, getWebviewPage, isEmpty, navigateBack, navigateTo, postMessage, query2url, redirectTo, routePrefix, routes };
1
+ import { OneTravelSDK as r } from "./entry.js";
2
+ import { routePrefix as p, routes as a } from "./constants/routes/index.js";
3
+ import { BusinessLineDict as g, EBusinessLine as i, ESubBizType as m } from "./enums/business-line/index.js";
4
+ import { EAppEnv as x } from "./enums/environment/index.js";
5
+ import { ECaller as n } from "./enums/sdk/index.js";
6
+ import { EStorageKey as y } from "./enums/storage/index.js";
7
+ import { EVenueTypes as l, EVenueTypesDes as v } from "./enums/sub/enjoy/index.js";
8
+ import { EFoodsModuleType as d } from "./enums/sub/foods/index.js";
9
+ import { EHotelType as B } from "./enums/sub/hotel/index.js";
10
+ import { getQueryParameters as S, isEmpty as b, query2url as F } from "./utils/common/index.js";
11
+ import { getActivityCalendarDetailPage as V } from "./utils/pages/activity-calendar/index.js";
12
+ import { getWebviewPage as w } from "./utils/pages/webview/index.js";
13
+ import { getFoodPackagePage as C, getFoodStorePage as K } from "./utils/pages/food/index.js";
14
+ import { EMessagesType as W, getWebViewEnv as q, navigateBack as z, navigateTo as H, postMessage as O, redirectTo as Q } from "./utils/web-view/index.js";
15
+ export {
16
+ g as BusinessLineDict,
17
+ x as EAppEnv,
18
+ i as EBusinessLine,
19
+ n as ECaller,
20
+ d as EFoodsModuleType,
21
+ B as EHotelType,
22
+ W as EMessagesType,
23
+ y as EStorageKey,
24
+ m as ESubBizType,
25
+ l as EVenueTypes,
26
+ v as EVenueTypesDes,
27
+ r as OneTravelSDK,
28
+ V as getActivityCalendarDetailPage,
29
+ C as getFoodPackagePage,
30
+ K as getFoodStorePage,
31
+ S as getQueryParameters,
32
+ q as getWebViewEnv,
33
+ w as getWebviewPage,
34
+ b as isEmpty,
35
+ z as navigateBack,
36
+ H as navigateTo,
37
+ O as postMessage,
38
+ F as query2url,
39
+ Q as redirectTo,
40
+ p as routePrefix,
41
+ a as routes
42
+ };
@@ -0,0 +1,126 @@
1
+ var C = (i, t) => () => (t || i((t = { exports: {} }).exports, t), t.exports);
2
+ var Q = C((E, w) => {
3
+ (function(i, t) {
4
+ typeof E == "object" && typeof w < "u" ? w.exports = t() : typeof define == "function" && define.amd ? define(t) : (i = i || self).uni = t();
5
+ })(void 0, function() {
6
+ try {
7
+ var i = {};
8
+ Object.defineProperty(i, "passive", {
9
+ get: function() {
10
+ }
11
+ }), window.addEventListener("test-passive", null, i);
12
+ } catch {
13
+ }
14
+ var t = Object.prototype.hasOwnProperty;
15
+ function M(e, n) {
16
+ return t.call(e, n);
17
+ }
18
+ var g = [];
19
+ function v() {
20
+ return window.__dcloud_weex_postMessage || window.__dcloud_weex_;
21
+ }
22
+ function c() {
23
+ return window.__uniapp_x_postMessage || window.__uniapp_x_;
24
+ }
25
+ for (var o = function(e, n) {
26
+ var u = { options: { timestamp: +/* @__PURE__ */ new Date() }, name: e, arg: n };
27
+ if (c()) {
28
+ if (e === "postMessage") {
29
+ var p = { data: n };
30
+ return window.__uniapp_x_postMessage ? window.__uniapp_x_postMessage(p) : window.__uniapp_x_.postMessage(JSON.stringify(p));
31
+ }
32
+ var f = { type: "WEB_INVOKE_APPSERVICE", args: { data: u, webviewIds: g } };
33
+ window.__uniapp_x_postMessage ? window.__uniapp_x_postMessageToService(f) : window.__uniapp_x_.postMessageToService(JSON.stringify(f));
34
+ } else if (v()) {
35
+ if (e === "postMessage") {
36
+ var l = { data: [n] };
37
+ return window.__dcloud_weex_postMessage ? window.__dcloud_weex_postMessage(l) : window.__dcloud_weex_.postMessage(JSON.stringify(l));
38
+ }
39
+ var x = { type: "WEB_INVOKE_APPSERVICE", args: { data: u, webviewIds: g } };
40
+ window.__dcloud_weex_postMessage ? window.__dcloud_weex_postMessageToService(x) : window.__dcloud_weex_.postMessageToService(JSON.stringify(x));
41
+ } else
42
+ return console.log("window.plus:", window.plus), window.parent.postMessage({ type: "WEB_INVOKE_APPSERVICE", data: u, pageId: "" }, "*");
43
+ }, m = {
44
+ navigateTo: function() {
45
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.url;
46
+ o("navigateTo", { url: encodeURI(n) });
47
+ },
48
+ navigateBack: function() {
49
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.delta;
50
+ o("navigateBack", { delta: parseInt(n) || 1 });
51
+ },
52
+ switchTab: function() {
53
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.url;
54
+ o("switchTab", { url: encodeURI(n) });
55
+ },
56
+ reLaunch: function() {
57
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.url;
58
+ o("reLaunch", { url: encodeURI(n) });
59
+ },
60
+ redirectTo: function() {
61
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.url;
62
+ o("redirectTo", { url: encodeURI(n) });
63
+ },
64
+ getEnv: function(e) {
65
+ c() ? e({ uvue: !0 }) : v() ? e({ nvue: !0 }) : window.plus ? e({ plus: !0 }) : e({ h5: !0 });
66
+ },
67
+ postMessage: function() {
68
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
69
+ o("postMessage", e.data || {});
70
+ }
71
+ }, T = /uni-app/i.test(navigator.userAgent), h = /Html5Plus/i.test(navigator.userAgent), P = /complete|loaded|interactive/, y = window.my && navigator.userAgent.indexOf(["t", "n", "e", "i", "l", "C", "y", "a", "p", "i", "l", "A"].reverse().join("")) > -1, B = window.swan && window.swan.webView && /swan/i.test(navigator.userAgent), L = window.qq && window.qq.miniProgram && /QQ/i.test(navigator.userAgent) && /miniProgram/i.test(navigator.userAgent), J = window.tt && window.tt.miniProgram && /toutiaomicroapp/i.test(navigator.userAgent), S = window.wx && window.wx.miniProgram && /micromessenger/i.test(navigator.userAgent) && /miniProgram/i.test(navigator.userAgent), A = window.qa && /quickapp/i.test(navigator.userAgent), O = window.ks && window.ks.miniProgram && /micromessenger/i.test(navigator.userAgent) && /miniProgram/i.test(navigator.userAgent), b = window.tt && window.tt.miniProgram && /Lark|Feishu/i.test(navigator.userAgent), k = window.jd && window.jd.miniProgram && /micromessenger/i.test(navigator.userAgent) && /miniProgram/i.test(navigator.userAgent), R = window.xhs && window.xhs.miniProgram && /xhsminiapp/i.test(navigator.userAgent), a, I = function() {
72
+ window.UniAppJSBridge = !0, document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady", { bubbles: !0, cancelable: !0 }));
73
+ }, _ = [
74
+ function(e) {
75
+ if (T || h)
76
+ return window.__uniapp_x_postMessage || window.__uniapp_x_ || window.__dcloud_weex_postMessage || window.__dcloud_weex_ ? document.addEventListener("DOMContentLoaded", e) : window.plus && P.test(document.readyState) ? setTimeout(e, 0) : document.addEventListener("plusready", e), m;
77
+ },
78
+ function(e) {
79
+ if (S) return window.WeixinJSBridge && window.WeixinJSBridge.invoke ? setTimeout(e, 0) : document.addEventListener("WeixinJSBridgeReady", e), window.wx.miniProgram;
80
+ },
81
+ function(e) {
82
+ if (L) return window.QQJSBridge && window.QQJSBridge.invoke ? setTimeout(e, 0) : document.addEventListener("QQJSBridgeReady", e), window.qq.miniProgram;
83
+ },
84
+ function(e) {
85
+ if (y) {
86
+ document.addEventListener("DOMContentLoaded", e);
87
+ var n = window.my;
88
+ return { navigateTo: n.navigateTo, navigateBack: n.navigateBack, switchTab: n.switchTab, reLaunch: n.reLaunch, redirectTo: n.redirectTo, postMessage: n.postMessage, getEnv: n.getEnv };
89
+ }
90
+ },
91
+ function(e) {
92
+ if (B) return document.addEventListener("DOMContentLoaded", e), window.swan.webView;
93
+ },
94
+ function(e) {
95
+ if (J) return document.addEventListener("DOMContentLoaded", e), window.tt.miniProgram;
96
+ },
97
+ function(e) {
98
+ if (A) {
99
+ window.QaJSBridge && window.QaJSBridge.invoke ? setTimeout(e, 0) : document.addEventListener("QaJSBridgeReady", e);
100
+ var n = window.qa;
101
+ return { navigateTo: n.navigateTo, navigateBack: n.navigateBack, switchTab: n.switchTab, reLaunch: n.reLaunch, redirectTo: n.redirectTo, postMessage: n.postMessage, getEnv: n.getEnv };
102
+ }
103
+ },
104
+ function(e) {
105
+ if (O) return window.WeixinJSBridge && window.WeixinJSBridge.invoke ? setTimeout(e, 0) : document.addEventListener("WeixinJSBridgeReady", e), window.ks.miniProgram;
106
+ },
107
+ function(e) {
108
+ if (b) return document.addEventListener("DOMContentLoaded", e), window.tt.miniProgram;
109
+ },
110
+ function(e) {
111
+ if (k) return window.JDJSBridgeReady && window.JDJSBridgeReady.invoke ? setTimeout(e, 0) : document.addEventListener("JDJSBridgeReady", e), window.jd.miniProgram;
112
+ },
113
+ function(e) {
114
+ if (R) return window.xhs.miniProgram;
115
+ },
116
+ function(e) {
117
+ return document.addEventListener("DOMContentLoaded", e), m;
118
+ }
119
+ ], d = 0; d < _.length && !(a = _[d](I)); d++) ;
120
+ a || (a = {});
121
+ var r = typeof uni < "u" ? uni : {};
122
+ if (!r.navigateTo) for (var s in a) M(a, s) && (r[s] = a[s]);
123
+ return r.webView = a, r;
124
+ });
125
+ });
126
+ export default Q();
@@ -0,0 +1,5 @@
1
+ import { IOneTravelSDKOptions } from '../../types';
2
+ /**
3
+ * 获取SDK配置信息
4
+ */
5
+ export declare function getSDKConfig(): IOneTravelSDKOptions;
@@ -1,13 +1,7 @@
1
- import { EStorageKey } from "../../enums/storage/index.js";
2
-
3
- //#region src/services/config/index.ts
4
- /**
5
- * 获取SDK配置信息
6
- */
7
- function getSDKConfig() {
8
- return JSON.parse(localStorage.getItem(EStorageKey.configOptions) || "{}");
1
+ import { EStorageKey as o } from "../../enums/storage/index.js";
2
+ function e() {
3
+ return JSON.parse(localStorage.getItem(o.configOptions) || "{}");
9
4
  }
10
-
11
- //#endregion
12
- export { getSDKConfig };
13
- //# sourceMappingURL=index.js.map
5
+ export {
6
+ e as getSDKConfig
7
+ };
@@ -0,0 +1,2 @@
1
+ export * from './type';
2
+ export * from './util';
@@ -1,28 +1,21 @@
1
- import { EBusinessLine } from "../../enums/business-line/index.js";
2
- import { EHotelType } from "../../enums/sub/hotel/index.js";
3
-
4
- //#region src/services/goods/type.d.ts
5
- type IJumpGoodsDetailItem = {
6
- /** 扩展参数(JSON数据) */
7
- extInfoMap?: string;
8
- /** 扩展参数(JSON数据) */
9
- extInfo?: string;
10
- /** 商品skuId */
11
- skuId?: string;
12
- /** 商品spuId */
13
- spuId?: string;
14
- /** 商品id */
15
- id?: string;
16
- /** 类型 (只有linkBusinessLine === EBusinessType.Homestay 才有用, 有就是酒店商品,没有就是爆款商品) */
17
- type?: EHotelType;
18
- /** 酒店或名宿 */
19
- storeId?: string;
20
- /** 业务线(不同的字段) */
21
- linkBusinessLine?: EBusinessLine;
22
- bizType?: EBusinessLine;
23
- businessType?: EBusinessLine;
1
+ import { EBusinessLine, EHotelType } from '../../enums';
2
+ export type IJumpGoodsDetailItem = {
3
+ /** 扩展参数(JSON数据) */
4
+ extInfoMap?: string;
5
+ /** 扩展参数(JSON数据) */
6
+ extInfo?: string;
7
+ /** 商品skuId */
8
+ skuId?: string;
9
+ /** 商品spuId */
10
+ spuId?: string;
11
+ /** 商品id */
12
+ id?: string;
13
+ /** 类型 (只有linkBusinessLine === EBusinessType.Homestay 才有用, 有就是酒店商品,没有就是爆款商品) */
14
+ type?: EHotelType;
15
+ /** 酒店或名宿 */
16
+ storeId?: string;
17
+ /** 业务线(不同的字段) */
18
+ linkBusinessLine?: EBusinessLine;
19
+ bizType?: EBusinessLine;
20
+ businessType?: EBusinessLine;
24
21
  };
25
- //# sourceMappingURL=type.d.ts.map
26
- //#endregion
27
- export { IJumpGoodsDetailItem };
28
- //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { IJumpGoodsDetailItem } from './type';
2
+ /**
3
+ * 跳转商品详情页
4
+ * @param item
5
+ */
6
+ export declare const jumpToGoodsDetailPage: (item: IJumpGoodsDetailItem) => void;
@@ -1,124 +1,76 @@
1
- import { routePrefix } from "../../constants/routes/index.js";
2
- import { EBusinessLine, ESubBizType } from "../../enums/business-line/index.js";
3
- import { ECaller } from "../../enums/sdk/index.js";
4
- import { EVenueTypes, EVenueTypesDes } from "../../enums/sub/enjoy/index.js";
5
- import { EFoodsModuleType } from "../../enums/sub/foods/index.js";
6
- import { EHotelType } from "../../enums/sub/hotel/index.js";
7
- import { getActivityCalendarDetailPage } from "../../utils/pages/activity-calendar/index.js";
8
- import { getWebviewPage } from "../../utils/pages/webview/index.js";
9
- import { getFoodPackagePage, getFoodStorePage } from "../../utils/pages/food/index.js";
10
- import { navigateTo } from "../../utils/web-view/index.js";
11
- import { getAppConfig } from "../../configs/app/index.js";
12
- import { getSDKConfig } from "../config/index.js";
13
-
14
- //#region src/services/goods/util.ts
15
- /**
16
- * 跳转到各商品详情
17
- * @param options 可选项
18
- */
19
- const jumpToGoodsDetail = async (options) => {
20
- const configOptions = getSDKConfig();
21
- const appConfig = getAppConfig(configOptions.appEnv);
22
- const { skuId, linkBusinessLine, type = "", item } = options || {};
23
- let page = "";
24
- switch (linkBusinessLine) {
25
- case EBusinessLine.Scenic:
26
- /** 景区/门票 */
27
- page = `${routePrefix.ticket}/detail/index?scenicId=${skuId}&reservationId=${item.reservationId}&isOld=${item.isOld}`;
28
- break;
29
- case EBusinessLine.Hotel:
30
- /** 酒店 */
31
- page = `${routePrefix.hotel}/home/details/index?id=${skuId}`;
32
- break;
33
- case EBusinessLine.Homestay:
34
- /** 民宿 */
35
- if (type === EHotelType.hotel)
36
- /** 酒店 (天下房仓酒店详情页)*/
37
- page = `${routePrefix.hotel}/home/details/index?id=${skuId}`;
38
- else if (`${item.subBizType}` === `${ESubBizType.HomestayHotel}`) page = `${routePrefix.hotel}/home/details/index?id=${skuId}`;
39
- else page = `${routePrefix.hotel}/home/hot-sale-details/index?id=${skuId}`;
40
- break;
41
- case EBusinessLine.Route:
42
- /** 路线/定制 */
43
- page = `${routePrefix.road}/product-detail/index?id=${skuId}`;
44
- break;
45
- case EBusinessLine.Travel:
46
- /** 出行 */
47
- break;
48
- case EBusinessLine.Foods:
49
- /** 美食 */
50
- if (item?.moduleType === EFoodsModuleType.store)
51
- /** 收藏跳店铺 */
52
- page = getWebviewPage({ url: getFoodStorePage(appConfig.domain.food, item.storeId || item.id) });
53
- else
54
- /** 跳转套餐 */
55
- page = getWebviewPage({ url: getFoodPackagePage(appConfig.domain.food, item.storeId || item.id, skuId) });
56
- break;
57
- case EBusinessLine.Buy:
58
- /** 购物 */
59
- page = getWebviewPage({ url: appConfig.domain.shopping + `goods?itemId=${item.id || item.spuId}` });
60
- break;
61
- case EBusinessLine.Onebuygz:
62
- /** 新购物 */
63
- page = getWebviewPage({ url: appConfig.domain.onebuygz + `pages/commodity-detail/index?itemId=${item.spuId || item.id}&skuId=${item.skuId}` });
64
- break;
65
- case EBusinessLine.Entertainment:
66
- /** 文娱 */
67
- if (`${item.type}` === EVenueTypesDes[EVenueTypes.Activity] || `${item.subBizType}` === `${ESubBizType.EntertainmentPerform}`) page = `${routePrefix.enjoy}/g-activity/detail?id=` + skuId + "&mchId=" + (item.storeId || "");
68
- else page = `${routePrefix.enjoy}/g-venue/detail?id=${skuId}&reservationId=${item.reservationId}`;
69
- break;
70
- case EBusinessLine.Strategy:
71
- /** 攻略 */
72
- page = `${routePrefix.strategy}/strategy-detail/index?id=` + skuId;
73
- break;
74
- case EBusinessLine.Recommend:
75
- /** 种草 */
76
- page = `${routePrefix.show}/details/index?id=${skuId}${item?.moreParameter ? item.moreParameter : ""}`;
77
- break;
78
- case EBusinessLine.Activity:
79
- /** 活动 */
80
- page = getActivityCalendarDetailPage({
81
- id: skuId,
82
- date: item.collectTime
83
- });
84
- break;
85
- case EBusinessLine.SoundGuizhou:
86
- /** 声入贵州 */
87
- page = `${routePrefix.soundGuizhou}/detail?audioLibId=${skuId}`;
88
- break;
89
- case EBusinessLine.ExcitingVideo:
90
- /** 精彩视频 */
91
- page = `${routePrefix.living}/wonderful-video/index?vid=${skuId}`;
92
- break;
93
- default: break;
94
- }
95
- if (page) {
96
- if (configOptions.caller === ECaller.web) navigateTo({ src: page });
97
- else if (configOptions.caller === ECaller.host) {}
98
- }
1
+ import { getSDKConfig as $ } from "../config/index.js";
2
+ import { EHotelType as c } from "../../enums/sub/hotel/index.js";
3
+ import { getAppConfig as y } from "../../configs/app/index.js";
4
+ import { EBusinessLine as i, ESubBizType as l } from "../../enums/business-line/index.js";
5
+ import { getActivityCalendarDetailPage as g } from "../../utils/pages/activity-calendar/index.js";
6
+ import { EVenueTypesDes as I, EVenueTypes as k } from "../../enums/sub/enjoy/index.js";
7
+ import { getWebviewPage as n } from "../../utils/pages/webview/index.js";
8
+ import { EFoodsModuleType as b } from "../../enums/sub/foods/index.js";
9
+ import { getFoodStorePage as h, getFoodPackagePage as x } from "../../utils/pages/food/index.js";
10
+ import { ECaller as p } from "../../enums/sdk/index.js";
11
+ import { navigateTo as v } from "../../utils/web-view/index.js";
12
+ import { routePrefix as r } from "../../constants/routes/index.js";
13
+ const T = async (e) => {
14
+ const t = $(), s = y(t.appEnv), { skuId: d, linkBusinessLine: u, type: f = "", item: o } = e || {};
15
+ let a = "";
16
+ switch (u) {
17
+ case i.Scenic:
18
+ a = `${r.ticket}/detail/index?scenicId=${d}&reservationId=${o.reservationId}&isOld=${o.isOld}`;
19
+ break;
20
+ case i.Hotel:
21
+ a = `${r.hotel}/home/details/index?id=${d}`;
22
+ break;
23
+ case i.Homestay:
24
+ f === c.hotel ? a = `${r.hotel}/home/details/index?id=${d}` : `${o.subBizType}` == `${l.HomestayHotel}` ? a = `${r.hotel}/home/details/index?id=${d}` : a = `${r.hotel}/home/hot-sale-details/index?id=${d}`;
25
+ break;
26
+ case i.Route:
27
+ a = `${r.road}/product-detail/index?id=${d}`;
28
+ break;
29
+ case i.Travel:
30
+ break;
31
+ case i.Foods:
32
+ (o == null ? void 0 : o.moduleType) === b.store ? a = n({ url: h(s.domain.food, o.storeId || o.id) }) : a = n({ url: x(s.domain.food, o.storeId || o.id, d) });
33
+ break;
34
+ case i.Buy:
35
+ a = n({ url: s.domain.shopping + `goods?itemId=${o.id || o.spuId}` });
36
+ break;
37
+ case i.Onebuygz:
38
+ a = n({ url: s.domain.onebuygz + `pages/commodity-detail/index?itemId=${o.spuId || o.id}&skuId=${o.skuId}` });
39
+ break;
40
+ case i.Entertainment:
41
+ `${o.type}` === I[k.Activity] || `${o.subBizType}` == `${l.EntertainmentPerform}` ? a = `${r.enjoy}/g-activity/detail?id=` + d + "&mchId=" + (o.storeId || "") : a = `${r.enjoy}/g-venue/detail?id=${d}&reservationId=${o.reservationId}`;
42
+ break;
43
+ case i.Strategy:
44
+ a = `${r.strategy}/strategy-detail/index?id=` + d;
45
+ break;
46
+ case i.Recommend:
47
+ a = `${r.show}/details/index?id=${d}${o != null && o.moreParameter ? o.moreParameter : ""}`;
48
+ break;
49
+ case i.Activity:
50
+ a = g({ id: d, date: o.collectTime });
51
+ break;
52
+ case i.SoundGuizhou:
53
+ a = `${r.soundGuizhou}/detail?audioLibId=${d}`;
54
+ break;
55
+ case i.ExcitingVideo:
56
+ a = `${r.living}/wonderful-video/index?vid=${d}`;
57
+ break;
58
+ }
59
+ a && (t.caller === p.web ? v({ src: a }) : (t.caller, p.host));
60
+ }, A = (e) => {
61
+ let t = (e == null ? void 0 : e.extInfoMap) || (e == null ? void 0 : e.extInfo) || {};
62
+ try {
63
+ t = typeof t == "string" ? JSON.parse(t) : t;
64
+ } catch {
65
+ }
66
+ const s = e != null && e.extInfoMap || e != null && e.extInfo ? { ...e, ...t } : e;
67
+ (s == null ? void 0 : s.type) === c.hotel && (e.skuId = s == null ? void 0 : s.storeId), T({
68
+ skuId: (e == null ? void 0 : e.skuId) || (e == null ? void 0 : e.spuId) || (e == null ? void 0 : e.id) || "",
69
+ linkBusinessLine: s.linkBusinessLine || s.bizType || s.businessType,
70
+ type: s.type,
71
+ item: s
72
+ }).then().catch();
99
73
  };
100
- /**
101
- * 跳转商品详情页
102
- * @param item
103
- */
104
- const jumpToGoodsDetailPage = (item) => {
105
- let extInfo = item?.extInfoMap || item?.extInfo || {};
106
- try {
107
- extInfo = typeof extInfo === "string" ? JSON.parse(extInfo) : extInfo;
108
- } catch {}
109
- const obj = item?.extInfoMap || item?.extInfo ? {
110
- ...item,
111
- ...extInfo
112
- } : item;
113
- if (obj?.type === EHotelType.hotel) item.skuId = obj?.storeId;
114
- jumpToGoodsDetail({
115
- skuId: item?.skuId || item?.spuId || item?.id || "",
116
- linkBusinessLine: obj.linkBusinessLine || obj.bizType || obj.businessType,
117
- type: obj.type,
118
- item: obj
119
- }).then().catch();
74
+ export {
75
+ A as jumpToGoodsDetailPage
120
76
  };
121
-
122
- //#endregion
123
- export { jumpToGoodsDetailPage };
124
- //# sourceMappingURL=util.js.map
@@ -0,0 +1,2 @@
1
+ export * from './goods';
2
+ export * from './config';
@@ -0,0 +1 @@
1
+ export * from './one-travel-service';
@@ -1,18 +1,11 @@
1
- import { EAppEnv } from "../../enums/environment/index.js";
2
- import { ECaller } from "../../enums/sdk/index.js";
3
-
4
- //#region src/types/one-travel-service/index.d.ts
5
-
1
+ import { EAppEnv } from '../../enums';
2
+ import { ECaller } from '../../enums/sdk';
6
3
  /**
7
4
  * 一码游SDK可选项
8
5
  */
9
- type IOneTravelSDKOptions = {
10
- /** 环境变量, 默认生产环境 */
11
- appEnv: EAppEnv;
12
- /** 调用者 */
13
- caller: ECaller;
6
+ export type IOneTravelSDKOptions = {
7
+ /** 环境变量, 默认生产环境 */
8
+ appEnv: EAppEnv;
9
+ /** 调用者 */
10
+ caller: ECaller;
14
11
  };
15
- //# sourceMappingURL=index.d.ts.map
16
- //#endregion
17
- export { IOneTravelSDKOptions };
18
- //# sourceMappingURL=index.d.ts.map
@@ -1,23 +1,18 @@
1
- //#region src/utils/common/index.d.ts
2
1
  /**
3
2
  * 是否是空值
4
3
  * @param value
5
4
  */
6
- declare function isEmpty(value: any): boolean;
5
+ export declare function isEmpty(value: any): boolean;
7
6
  /**
8
7
  * 查询参数转url
9
8
  * @param {Object} query 查询参数
10
9
  * @param {Object} options 可选参数
11
10
  */
12
- declare function query2url(query: Record<string, any>, options?: {
13
- encode?: boolean;
11
+ export declare function query2url(query: Record<string, any>, options?: {
12
+ encode?: boolean;
14
13
  }): string;
15
14
  /**
16
15
  * 解析URL查询参数
17
16
  * @param {String} url
18
17
  */
19
- declare function getQueryParameters<T = any>(url: string): T;
20
- //# sourceMappingURL=index.d.ts.map
21
- //#endregion
22
- export { getQueryParameters, isEmpty, query2url };
23
- //# sourceMappingURL=index.d.ts.map
18
+ export declare function getQueryParameters<T = any>(url: string): T;
@@ -1,45 +1,28 @@
1
- //#region src/utils/common/index.ts
2
- /**
3
- * 是否是空值
4
- * @param value
5
- */
6
- function isEmpty(value) {
7
- return value === "" || value === void 0 || value === null;
1
+ function u(t) {
2
+ return t === "" || t === void 0 || t === null;
8
3
  }
9
- /**
10
- * 查询参数转url
11
- * @param {Object} query 查询参数
12
- * @param {Object} options 可选参数
13
- */
14
- function query2url(query, options) {
15
- const { encode = true } = options || {};
16
- const url = Object.entries(query || {}).filter(([key, val]) => val !== void 0 && val !== null).map(([key, val]) => {
17
- return encode ? `${encodeURIComponent(key)}=${encodeURIComponent(val)}` : `${key}=${val}`;
18
- }).join("&");
19
- return url ? `?${url}` : "";
4
+ function l(t, r) {
5
+ const { encode: c = !0 } = r || {}, o = Object.entries(t || {}).filter(([n, e]) => e != null).map(([n, e]) => c ? `${encodeURIComponent(n)}=${encodeURIComponent(e)}` : `${n}=${e}`).join("&");
6
+ return o ? `?${o}` : "";
20
7
  }
21
- /**
22
- * 解析URL查询参数
23
- * @param {String} url
24
- */
25
- function getQueryParameters(url) {
26
- const params = {};
27
- const queryString = url.split("?")[1];
28
- if (queryString) {
29
- const pairs = queryString.split("&");
30
- for (let i = 0; i < pairs.length; i++) {
31
- const pair = pairs[i].split("=");
32
- const key = decodeURIComponent(pair[0]);
33
- let value = decodeURIComponent(pair[1] || "");
34
- try {
35
- value = JSON.parse(value);
36
- } catch (error) {}
37
- params[key] = value;
38
- }
39
- }
40
- return params;
8
+ function d(t) {
9
+ const r = {}, c = t.split("?")[1];
10
+ if (c) {
11
+ const o = c.split("&");
12
+ for (let n = 0; n < o.length; n++) {
13
+ const e = o[n].split("="), s = decodeURIComponent(e[0]);
14
+ let i = decodeURIComponent(e[1] || "");
15
+ try {
16
+ i = JSON.parse(i);
17
+ } catch {
18
+ }
19
+ r[s] = i;
20
+ }
21
+ }
22
+ return r;
41
23
  }
42
-
43
- //#endregion
44
- export { getQueryParameters, isEmpty, query2url };
45
- //# sourceMappingURL=index.js.map
24
+ export {
25
+ d as getQueryParameters,
26
+ u as isEmpty,
27
+ l as query2url
28
+ };
@@ -0,0 +1,3 @@
1
+ export * from './common';
2
+ export * from './pages';
3
+ export * from './web-view';
@@ -1,9 +1,6 @@
1
- //#region src/utils/pages/activity-calendar/index.d.ts
2
- type ActivityCalendarDetailPageParams = {
3
- id: number | string;
4
- date?: string;
1
+ export type ActivityCalendarDetailPageParams = {
2
+ id: number | string;
3
+ date?: string;
5
4
  };
6
5
  declare function getActivityCalendarDetailPage(params: ActivityCalendarDetailPageParams): string;
7
- //#endregion
8
- export { ActivityCalendarDetailPageParams, getActivityCalendarDetailPage };
9
- //# sourceMappingURL=index.d.ts.map
6
+ export { getActivityCalendarDetailPage };