@foundbyte/uni-libs 0.0.5 → 0.0.7
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.
- package/es/assets/js/webview/uni.webview.1.5.5.js +171 -0
- package/es/assets/js/webview/uni.webview.1.5.6.js +1 -0
- package/es/configs/app/app.hwtest.js +10 -14
- package/es/configs/app/app.prod.js +10 -14
- package/es/configs/app/app.type.d.ts +13 -10
- package/es/configs/app/index.js +30 -24
- package/es/constants/routes/index.d.ts +77 -74
- package/es/constants/routes/index.js +45 -78
- package/es/entry.d.ts +20 -15
- package/es/entry.js +37 -35
- package/es/enums/business-line/index.d.ts +74 -71
- package/es/enums/business-line/index.js +114 -36
- package/es/enums/environment/index.d.ts +8 -5
- package/es/enums/environment/index.js +14 -4
- package/es/enums/sdk/index.d.ts +8 -5
- package/es/enums/sdk/index.js +14 -4
- package/es/enums/sub/enjoy/index.d.ts +17 -14
- package/es/enums/sub/enjoy/index.js +18 -12
- package/es/enums/sub/foods/index.d.ts +6 -3
- package/es/enums/sub/foods/index.js +10 -4
- package/es/enums/sub/hotel/index.d.ts +5 -2
- package/es/enums/sub/hotel/index.js +11 -4
- package/es/index.d.ts +15 -5
- package/es/index.js +15 -43
- package/es/services/goods/service.js +128 -0
- package/es/services/goods/type.d.ts +25 -20
- package/es/types/one-travel-service/index.d.ts +12 -8
- package/es/utils/common/index.d.ts +7 -4
- package/es/utils/common/index.js +41 -25
- package/es/utils/pages/activity-calendar/index.d.ts +6 -4
- package/es/utils/pages/activity-calendar/index.js +10 -8
- package/es/utils/pages/food/index.d.ts +5 -2
- package/es/utils/pages/food/index.js +31 -5
- package/es/utils/pages/webview/index.d.ts +10 -7
- package/es/utils/pages/webview/index.js +9 -7
- package/es/utils/web-view/index.d.ts +23 -18
- package/es/utils/web-view/index.js +84 -47
- package/package.json +3 -6
- package/es/configs/app/app.hwtest.d.ts +0 -3
- package/es/configs/app/app.prod.d.ts +0 -3
- package/es/configs/app/index.d.ts +0 -7
- package/es/configs/index.d.ts +0 -1
- package/es/constants/index.d.ts +0 -1
- package/es/enums/index.d.ts +0 -5
- package/es/enums/storage/index.d.ts +0 -6
- package/es/enums/storage/index.js +0 -4
- package/es/enums/sub/index.d.ts +0 -3
- package/es/libs/webview/uni.webview.1.5.5.js +0 -126
- package/es/services/config/index.d.ts +0 -5
- package/es/services/config/index.js +0 -7
- package/es/services/goods/index.d.ts +0 -2
- package/es/services/goods/util.d.ts +0 -6
- package/es/services/goods/util.js +0 -76
- package/es/services/index.d.ts +0 -2
- package/es/types/index.d.ts +0 -1
- package/es/utils/index.d.ts +0 -3
- package/es/utils/pages/index.d.ts +0 -3
package/es/index.js
CHANGED
|
@@ -1,43 +1,15 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
m as BusinessLineDict,
|
|
18
|
-
E as EAppEnv,
|
|
19
|
-
g as EBusinessLine,
|
|
20
|
-
u as ECaller,
|
|
21
|
-
c as EFoodsModuleType,
|
|
22
|
-
D as EHotelType,
|
|
23
|
-
q as EMessagesType,
|
|
24
|
-
T as EStorageKey,
|
|
25
|
-
f as ESubBizType,
|
|
26
|
-
v as EVenueTypes,
|
|
27
|
-
P as EVenueTypesDes,
|
|
28
|
-
t as OneTravelSDK,
|
|
29
|
-
k as getActivityCalendarDetailPage,
|
|
30
|
-
K as getFoodPackagePage,
|
|
31
|
-
L as getFoodStorePage,
|
|
32
|
-
b as getQueryParameters,
|
|
33
|
-
z as getWebViewEnv,
|
|
34
|
-
A as getWebviewPage,
|
|
35
|
-
F as isEmpty,
|
|
36
|
-
H as navigateBack,
|
|
37
|
-
O as navigateTo,
|
|
38
|
-
Q as postMessage,
|
|
39
|
-
M as query2url,
|
|
40
|
-
h as redirectTo,
|
|
41
|
-
a as routePrefix,
|
|
42
|
-
s as routes
|
|
43
|
-
};
|
|
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 { EVenueTypes, EVenueTypesDes } from "./enums/sub/enjoy/index.js";
|
|
6
|
+
import { EFoodsModuleType } from "./enums/sub/foods/index.js";
|
|
7
|
+
import { EHotelType } from "./enums/sub/hotel/index.js";
|
|
8
|
+
import { getQueryParameters, isEmpty, query2url } from "./utils/common/index.js";
|
|
9
|
+
import { getActivityCalendarDetailPage } from "./utils/pages/activity-calendar/index.js";
|
|
10
|
+
import { getWebviewPage } from "./utils/pages/webview/index.js";
|
|
11
|
+
import { getFoodPackagePage, getFoodStorePage } from "./utils/pages/food/index.js";
|
|
12
|
+
import { EMessagesType, getWebViewEnv, navigateBack, navigateTo, postMessage, redirectTo } from "./utils/web-view/index.js";
|
|
13
|
+
import { OneTravelSDK } from "./entry.js";
|
|
14
|
+
|
|
15
|
+
export { BusinessLineDict, EAppEnv, EBusinessLine, ECaller, EFoodsModuleType, EHotelType, EMessagesType, ESubBizType, EVenueTypes, EVenueTypesDes, OneTravelSDK, getActivityCalendarDetailPage, getFoodPackagePage, getFoodStorePage, getQueryParameters, getWebViewEnv, getWebviewPage, isEmpty, navigateBack, navigateTo, postMessage, query2url, redirectTo, routePrefix, routes };
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
|
|
13
|
+
//#region src/services/goods/service.ts
|
|
14
|
+
var GoodsService = class {
|
|
15
|
+
goodsServiceConfig;
|
|
16
|
+
constructor(config) {
|
|
17
|
+
this.goodsServiceConfig = config;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 跳转到各商品详情
|
|
21
|
+
* @param options 可选项
|
|
22
|
+
*/
|
|
23
|
+
jumpToGoodsDetail = async (options) => {
|
|
24
|
+
const configOptions = this.goodsServiceConfig.sdkConfig;
|
|
25
|
+
const appConfig = getAppConfig(configOptions.appEnv);
|
|
26
|
+
const { skuId, linkBusinessLine, type = "", item } = options || {};
|
|
27
|
+
let page = "";
|
|
28
|
+
switch (linkBusinessLine) {
|
|
29
|
+
case EBusinessLine.Scenic:
|
|
30
|
+
/** 景区/门票 */
|
|
31
|
+
page = `${routePrefix.ticket}/detail/index?scenicId=${skuId}&reservationId=${item.reservationId}&isOld=${item.isOld}`;
|
|
32
|
+
break;
|
|
33
|
+
case EBusinessLine.Hotel:
|
|
34
|
+
/** 酒店 */
|
|
35
|
+
page = `${routePrefix.hotel}/home/details/index?id=${skuId}`;
|
|
36
|
+
break;
|
|
37
|
+
case EBusinessLine.Homestay:
|
|
38
|
+
/** 民宿 */
|
|
39
|
+
if (type === EHotelType.hotel)
|
|
40
|
+
/** 酒店 (天下房仓酒店详情页)*/
|
|
41
|
+
page = `${routePrefix.hotel}/home/details/index?id=${skuId}`;
|
|
42
|
+
else if (`${item.subBizType}` === `${ESubBizType.HomestayHotel}`) page = `${routePrefix.hotel}/home/details/index?id=${skuId}`;
|
|
43
|
+
else page = `${routePrefix.hotel}/home/hot-sale-details/index?id=${skuId}`;
|
|
44
|
+
break;
|
|
45
|
+
case EBusinessLine.Route:
|
|
46
|
+
/** 路线/定制 */
|
|
47
|
+
page = `${routePrefix.road}/product-detail/index?id=${skuId}`;
|
|
48
|
+
break;
|
|
49
|
+
case EBusinessLine.Travel:
|
|
50
|
+
/** 出行 */
|
|
51
|
+
break;
|
|
52
|
+
case EBusinessLine.Foods:
|
|
53
|
+
/** 美食 */
|
|
54
|
+
if (item?.moduleType === EFoodsModuleType.store)
|
|
55
|
+
/** 收藏跳店铺 */
|
|
56
|
+
page = getWebviewPage({ url: getFoodStorePage(appConfig.domain.food, item.storeId || item.id) });
|
|
57
|
+
else
|
|
58
|
+
/** 跳转套餐 */
|
|
59
|
+
page = getWebviewPage({ url: getFoodPackagePage(appConfig.domain.food, item.storeId || item.id, skuId) });
|
|
60
|
+
break;
|
|
61
|
+
case EBusinessLine.Buy:
|
|
62
|
+
/** 购物 */
|
|
63
|
+
page = getWebviewPage({ url: appConfig.domain.shopping + `goods?itemId=${item.id || item.spuId}` });
|
|
64
|
+
break;
|
|
65
|
+
case EBusinessLine.Onebuygz:
|
|
66
|
+
/** 新购物 */
|
|
67
|
+
page = getWebviewPage({ url: appConfig.domain.onebuygz + `pages/commodity-detail/index?itemId=${item.spuId || item.id}&skuId=${item.skuId}` });
|
|
68
|
+
break;
|
|
69
|
+
case EBusinessLine.Entertainment:
|
|
70
|
+
/** 文娱 */
|
|
71
|
+
if (`${item.type}` === EVenueTypesDes[EVenueTypes.Activity] || `${item.subBizType}` === `${ESubBizType.EntertainmentPerform}`) page = `${routePrefix.enjoy}/g-activity/detail?id=` + skuId + "&mchId=" + (item.storeId || "");
|
|
72
|
+
else page = `${routePrefix.enjoy}/g-venue/detail?id=${skuId}&reservationId=${item.reservationId}`;
|
|
73
|
+
break;
|
|
74
|
+
case EBusinessLine.Strategy:
|
|
75
|
+
/** 攻略 */
|
|
76
|
+
page = `${routePrefix.strategy}/strategy-detail/index?id=` + skuId;
|
|
77
|
+
break;
|
|
78
|
+
case EBusinessLine.Recommend:
|
|
79
|
+
/** 种草 */
|
|
80
|
+
page = `${routePrefix.show}/details/index?id=${skuId}${item?.moreParameter ? item.moreParameter : ""}`;
|
|
81
|
+
break;
|
|
82
|
+
case EBusinessLine.Activity:
|
|
83
|
+
/** 活动 */
|
|
84
|
+
page = getActivityCalendarDetailPage({
|
|
85
|
+
id: skuId,
|
|
86
|
+
date: item.collectTime
|
|
87
|
+
});
|
|
88
|
+
break;
|
|
89
|
+
case EBusinessLine.SoundGuizhou:
|
|
90
|
+
/** 声入贵州 */
|
|
91
|
+
page = `${routePrefix.soundGuizhou}/detail?audioLibId=${skuId}`;
|
|
92
|
+
break;
|
|
93
|
+
case EBusinessLine.ExcitingVideo:
|
|
94
|
+
/** 精彩视频 */
|
|
95
|
+
page = `${routePrefix.living}/wonderful-video/index?vid=${skuId}`;
|
|
96
|
+
break;
|
|
97
|
+
default: break;
|
|
98
|
+
}
|
|
99
|
+
if (page) {
|
|
100
|
+
if (configOptions.caller === ECaller.web) navigateTo({ src: page });
|
|
101
|
+
else if (configOptions.caller === ECaller.host) {}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* 跳转商品详情页
|
|
106
|
+
* @param item
|
|
107
|
+
*/
|
|
108
|
+
jumpToGoodsDetailPage = (item) => {
|
|
109
|
+
let extInfo = item?.extInfoMap || item?.extInfo || {};
|
|
110
|
+
try {
|
|
111
|
+
extInfo = typeof extInfo === "string" ? JSON.parse(extInfo) : extInfo;
|
|
112
|
+
} catch {}
|
|
113
|
+
const obj = item?.extInfoMap || item?.extInfo ? {
|
|
114
|
+
...item,
|
|
115
|
+
...extInfo
|
|
116
|
+
} : item;
|
|
117
|
+
if (obj?.type === EHotelType.hotel) item.skuId = obj?.storeId;
|
|
118
|
+
this.jumpToGoodsDetail({
|
|
119
|
+
skuId: item?.skuId || item?.spuId || item?.id || "",
|
|
120
|
+
linkBusinessLine: obj.linkBusinessLine || obj.bizType || obj.businessType,
|
|
121
|
+
type: obj.type,
|
|
122
|
+
item: obj
|
|
123
|
+
}).then().catch();
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
export { GoodsService };
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { EBusinessLine
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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;
|
|
21
24
|
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { IJumpGoodsDetailItem };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { EAppEnv } from
|
|
2
|
-
import { ECaller } from
|
|
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
|
|
3
5
|
/**
|
|
4
|
-
* 一码游SDK
|
|
6
|
+
* 一码游SDK配置信息
|
|
5
7
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
type IOneTravelSDKConfig = {
|
|
9
|
+
/** 环境变量, 默认生产环境 */
|
|
10
|
+
appEnv: EAppEnv;
|
|
11
|
+
/** 调用者 */
|
|
12
|
+
caller: ECaller;
|
|
11
13
|
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { IOneTravelSDKConfig };
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
+
//#region src/utils/common/index.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* 是否是空值
|
|
3
4
|
* @param value
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
declare function isEmpty(value: any): boolean;
|
|
6
7
|
/**
|
|
7
8
|
* 查询参数转url
|
|
8
9
|
* @param {Object} query 查询参数
|
|
9
10
|
* @param {Object} options 可选参数
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
declare function query2url(query: Record<string, any>, options?: {
|
|
13
|
+
encode?: boolean;
|
|
13
14
|
}): string;
|
|
14
15
|
/**
|
|
15
16
|
* 解析URL查询参数
|
|
16
17
|
* @param {String} url
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
+
declare function getQueryParameters<T = any>(url: string): T;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { getQueryParameters, isEmpty, query2url };
|
package/es/utils/common/index.js
CHANGED
|
@@ -1,28 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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;
|
|
3
8
|
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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}` : "";
|
|
7
20
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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;
|
|
23
41
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
l as query2url
|
|
28
|
-
};
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { getQueryParameters, isEmpty, query2url };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/utils/pages/activity-calendar/index.d.ts
|
|
2
|
+
type ActivityCalendarDetailPageParams = {
|
|
3
|
+
id: number | string;
|
|
4
|
+
date?: string;
|
|
4
5
|
};
|
|
5
6
|
declare function getActivityCalendarDetailPage(params: ActivityCalendarDetailPageParams): string;
|
|
6
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ActivityCalendarDetailPageParams, getActivityCalendarDetailPage };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { routePrefix } from "../../../constants/routes/index.js";
|
|
2
|
+
import { query2url } from "../../common/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/pages/activity-calendar/index.ts
|
|
5
|
+
const rootPage = routePrefix.activityCalendar;
|
|
6
|
+
function getActivityCalendarDetailPage(params) {
|
|
7
|
+
return `${rootPage}/detail/index${query2url(params, { encode: false })}`;
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { getActivityCalendarDetailPage };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/utils/pages/food/index.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* 店铺
|
|
3
4
|
* @param domain 域名
|
|
@@ -5,7 +6,7 @@
|
|
|
5
6
|
* @param isDiamondLevel
|
|
6
7
|
* @returns
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
declare const getFoodStorePage: (domain: string, storeId: string, isDiamondLevel?: boolean) => string;
|
|
9
10
|
/**
|
|
10
11
|
* 套餐
|
|
11
12
|
* @param domain
|
|
@@ -13,4 +14,6 @@ export declare const getFoodStorePage: (domain: string, storeId: string, isDiamo
|
|
|
13
14
|
* @param packageId
|
|
14
15
|
* @returns
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
declare const getFoodPackagePage: (domain: string, storeId: string, packageId: string) => string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { getFoodPackagePage, getFoodStorePage };
|
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
import { query2url
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { query2url } from "../../common/index.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/pages/food/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* 店铺
|
|
6
|
+
* @param domain 域名
|
|
7
|
+
* @param storeId
|
|
8
|
+
* @param isDiamondLevel
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
const getFoodStorePage = (domain, storeId, isDiamondLevel) => {
|
|
12
|
+
return `${domain}store/arrive/index${query2url({
|
|
13
|
+
storeId,
|
|
14
|
+
isDiamondLevel
|
|
15
|
+
}, { encode: false })}`;
|
|
6
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* 套餐
|
|
19
|
+
* @param domain
|
|
20
|
+
* @param storeId
|
|
21
|
+
* @param packageId
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
const getFoodPackagePage = (domain, storeId, packageId) => {
|
|
25
|
+
return `${domain}store/arrive/package-detail/index${query2url({
|
|
26
|
+
storeId,
|
|
27
|
+
packageId
|
|
28
|
+
}, { encode: false })}`;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { getFoodPackagePage, getFoodStorePage };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { EBusinessLine } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { EBusinessLine } from "../../../enums/business-line/index.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/pages/webview/index.d.ts
|
|
4
|
+
type WebviewPageParams = {
|
|
5
|
+
url: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
businessLine?: EBusinessLine;
|
|
8
|
+
scene?: any;
|
|
7
9
|
};
|
|
8
10
|
declare function getWebviewPage(params: WebviewPageParams): string;
|
|
9
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
export { WebviewPageParams, getWebviewPage };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { routes } from "../../../constants/routes/index.js";
|
|
2
|
+
import { query2url } from "../../common/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/pages/webview/index.ts
|
|
5
|
+
function getWebviewPage(params) {
|
|
6
|
+
return `${routes.webView}${query2url(params)}`;
|
|
5
7
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { getWebviewPage };
|
|
@@ -1,43 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import "../../assets/js/webview/uni.webview.1.5.5.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/web-view/index.d.ts
|
|
4
|
+
declare enum EMessagesType {
|
|
5
|
+
pay = "pay",
|
|
3
6
|
}
|
|
4
7
|
/**
|
|
5
8
|
* 当前环境
|
|
6
9
|
* @returns
|
|
7
10
|
*/
|
|
8
|
-
|
|
11
|
+
declare const getWebViewEnv: () => {};
|
|
9
12
|
/**
|
|
10
13
|
* 原生路由跳转
|
|
11
14
|
* @param parameters
|
|
12
15
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
declare const navigateTo: (parameters: {
|
|
17
|
+
/** 跳转路径 */
|
|
18
|
+
src: string;
|
|
19
|
+
/** 路径参数(会拼接到url上面) */
|
|
20
|
+
params?: Record<string, any>;
|
|
18
21
|
}) => void;
|
|
19
22
|
/**
|
|
20
23
|
* 原生路由重定向
|
|
21
24
|
* @param parameters
|
|
22
25
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
declare const redirectTo: (parameters: {
|
|
27
|
+
/** 跳转路径 */
|
|
28
|
+
src: string;
|
|
29
|
+
/** 路径参数(会拼接到url上面) */
|
|
30
|
+
params?: Record<string, any>;
|
|
28
31
|
}) => void;
|
|
29
32
|
/**
|
|
30
33
|
* 原生路由返回
|
|
31
34
|
* @param parameters
|
|
32
35
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
declare const navigateBack: (parameters?: {
|
|
37
|
+
delta?: number;
|
|
35
38
|
}) => void;
|
|
36
39
|
/**
|
|
37
40
|
* 发送消息
|
|
38
41
|
* @param data
|
|
39
42
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
declare const postMessage: (data: {
|
|
44
|
+
type?: EMessagesType;
|
|
45
|
+
params: Record<string, any>;
|
|
43
46
|
}) => void;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { EMessagesType, getWebViewEnv, navigateBack, navigateTo, postMessage, redirectTo };
|