@foundbyte/uni-libs 0.0.6 → 0.0.8
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/entry.d.ts +6 -5
- package/es/entry.js +11 -11
- package/es/index.d.ts +2 -3
- package/es/index.js +1 -2
- package/es/services/goods/service.js +128 -0
- package/es/types/one-travel-service/index.d.ts +3 -4
- package/package.json +2 -3
- package/es/enums/storage/index.d.ts +0 -9
- package/es/enums/storage/index.js +0 -11
- package/es/services/config/index.js +0 -12
- package/es/services/goods/util.js +0 -123
package/es/entry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IOneTravelSDKConfig } from "./types/one-travel-service/index.js";
|
|
2
2
|
import { IJumpGoodsDetailItem } from "./services/goods/type.js";
|
|
3
3
|
import { IAppConfig } from "./configs/app/app.type.js";
|
|
4
4
|
|
|
@@ -8,12 +8,13 @@ import { IAppConfig } from "./configs/app/app.type.js";
|
|
|
8
8
|
* 一码游SDK
|
|
9
9
|
*/
|
|
10
10
|
declare class OneTravelSDK {
|
|
11
|
-
private
|
|
12
|
-
|
|
11
|
+
private sdkConfig;
|
|
12
|
+
private goodsService;
|
|
13
|
+
constructor(config?: Partial<IOneTravelSDKConfig>);
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* 获取App配置信息
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
getAppConfig(): IAppConfig;
|
|
17
18
|
/**
|
|
18
19
|
* 跳转商品详情页
|
|
19
20
|
* @param goodsItem 商品数据
|
package/es/entry.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { EAppEnv } from "./enums/environment/index.js";
|
|
2
2
|
import { ECaller } from "./enums/sdk/index.js";
|
|
3
|
-
import { EStorageKey } from "./enums/storage/index.js";
|
|
4
3
|
import { getAppConfig } from "./configs/app/index.js";
|
|
5
|
-
import {
|
|
4
|
+
import { GoodsService } from "./services/goods/service.js";
|
|
6
5
|
|
|
7
6
|
//#region src/entry.ts
|
|
8
7
|
/**
|
|
9
8
|
* 一码游SDK
|
|
10
9
|
*/
|
|
11
10
|
var OneTravelSDK = class {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
sdkConfig;
|
|
12
|
+
goodsService;
|
|
13
|
+
constructor(config) {
|
|
14
14
|
const value = {
|
|
15
15
|
appEnv: EAppEnv.prod,
|
|
16
16
|
caller: ECaller.web,
|
|
17
|
-
...
|
|
17
|
+
...config || {}
|
|
18
18
|
};
|
|
19
|
-
this.
|
|
20
|
-
|
|
19
|
+
this.sdkConfig = value;
|
|
20
|
+
this.goodsService = new GoodsService({ sdkConfig: value });
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* 获取App配置信息
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
return getAppConfig(this.
|
|
25
|
+
getAppConfig() {
|
|
26
|
+
return getAppConfig(this.sdkConfig.appEnv);
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* 跳转商品详情页
|
|
30
30
|
* @param goodsItem 商品数据
|
|
31
31
|
*/
|
|
32
32
|
jumpToGoodsDetailPage(goodsItem) {
|
|
33
|
-
jumpToGoodsDetailPage(goodsItem);
|
|
33
|
+
this.goodsService.jumpToGoodsDetailPage(goodsItem);
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
|
package/es/index.d.ts
CHANGED
|
@@ -2,15 +2,14 @@ import { routePrefix, routes } from "./constants/routes/index.js";
|
|
|
2
2
|
import { BusinessLineDict, EBusinessLine, ESubBizType } from "./enums/business-line/index.js";
|
|
3
3
|
import { EAppEnv } from "./enums/environment/index.js";
|
|
4
4
|
import { ECaller } from "./enums/sdk/index.js";
|
|
5
|
-
import { EStorageKey } from "./enums/storage/index.js";
|
|
6
5
|
import { EVenueTypes, EVenueTypesDes } from "./enums/sub/enjoy/index.js";
|
|
7
6
|
import { EFoodsModuleType } from "./enums/sub/foods/index.js";
|
|
8
7
|
import { EHotelType } from "./enums/sub/hotel/index.js";
|
|
9
|
-
import {
|
|
8
|
+
import { IOneTravelSDKConfig } from "./types/one-travel-service/index.js";
|
|
10
9
|
import { getQueryParameters, isEmpty, query2url } from "./utils/common/index.js";
|
|
11
10
|
import { ActivityCalendarDetailPageParams, getActivityCalendarDetailPage } from "./utils/pages/activity-calendar/index.js";
|
|
12
11
|
import { WebviewPageParams, getWebviewPage } from "./utils/pages/webview/index.js";
|
|
13
12
|
import { getFoodPackagePage, getFoodStorePage } from "./utils/pages/food/index.js";
|
|
14
13
|
import { EMessagesType, getWebViewEnv, navigateBack, navigateTo, postMessage, redirectTo } from "./utils/web-view/index.js";
|
|
15
14
|
import { OneTravelSDK } from "./entry.js";
|
|
16
|
-
export { ActivityCalendarDetailPageParams, BusinessLineDict, EAppEnv, EBusinessLine, ECaller, EFoodsModuleType, EHotelType, EMessagesType,
|
|
15
|
+
export { ActivityCalendarDetailPageParams, BusinessLineDict, EAppEnv, EBusinessLine, ECaller, EFoodsModuleType, EHotelType, EMessagesType, ESubBizType, EVenueTypes, EVenueTypesDes, IOneTravelSDKConfig, OneTravelSDK, WebviewPageParams, getActivityCalendarDetailPage, getFoodPackagePage, getFoodStorePage, getQueryParameters, getWebViewEnv, getWebviewPage, isEmpty, navigateBack, navigateTo, postMessage, query2url, redirectTo, routePrefix, routes };
|
package/es/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import { routePrefix, routes } from "./constants/routes/index.js";
|
|
|
2
2
|
import { BusinessLineDict, EBusinessLine, ESubBizType } from "./enums/business-line/index.js";
|
|
3
3
|
import { EAppEnv } from "./enums/environment/index.js";
|
|
4
4
|
import { ECaller } from "./enums/sdk/index.js";
|
|
5
|
-
import { EStorageKey } from "./enums/storage/index.js";
|
|
6
5
|
import { EVenueTypes, EVenueTypesDes } from "./enums/sub/enjoy/index.js";
|
|
7
6
|
import { EFoodsModuleType } from "./enums/sub/foods/index.js";
|
|
8
7
|
import { EHotelType } from "./enums/sub/hotel/index.js";
|
|
@@ -13,4 +12,4 @@ import { getFoodPackagePage, getFoodStorePage } from "./utils/pages/food/index.j
|
|
|
13
12
|
import { EMessagesType, getWebViewEnv, navigateBack, navigateTo, postMessage, redirectTo } from "./utils/web-view/index.js";
|
|
14
13
|
import { OneTravelSDK } from "./entry.js";
|
|
15
14
|
|
|
16
|
-
export { BusinessLineDict, EAppEnv, EBusinessLine, ECaller, EFoodsModuleType, EHotelType, EMessagesType,
|
|
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 };
|
|
@@ -2,15 +2,14 @@ import { EAppEnv } from "../../enums/environment/index.js";
|
|
|
2
2
|
import { ECaller } from "../../enums/sdk/index.js";
|
|
3
3
|
|
|
4
4
|
//#region src/types/one-travel-service/index.d.ts
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
|
-
* 一码游SDK
|
|
6
|
+
* 一码游SDK配置信息
|
|
8
7
|
*/
|
|
9
|
-
type
|
|
8
|
+
type IOneTravelSDKConfig = {
|
|
10
9
|
/** 环境变量, 默认生产环境 */
|
|
11
10
|
appEnv: EAppEnv;
|
|
12
11
|
/** 调用者 */
|
|
13
12
|
caller: ECaller;
|
|
14
13
|
};
|
|
15
14
|
//#endregion
|
|
16
|
-
export {
|
|
15
|
+
export { IOneTravelSDKConfig };
|
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": "0.0.
|
|
5
|
+
"version": "0.0.8",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "es/index.js",
|
|
@@ -29,8 +29,7 @@
|
|
|
29
29
|
"tsdown": "^0.12.8"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "
|
|
33
|
-
"build:tsdown": "tsdown",
|
|
32
|
+
"build": "tsdown",
|
|
34
33
|
"publish:npm": "pnpm publish --no-git-checks"
|
|
35
34
|
},
|
|
36
35
|
"typings": "es/index.d.ts"
|
|
@@ -1,12 +0,0 @@
|
|
|
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) || "{}");
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { getSDKConfig };
|
|
@@ -1,123 +0,0 @@
|
|
|
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
|
-
}
|
|
99
|
-
};
|
|
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();
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
//#endregion
|
|
123
|
-
export { jumpToGoodsDetailPage };
|