@foundbyte/uni-libs 1.0.6 → 1.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/_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js +27 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.js +12 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js +25 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js +13 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutPropertiesLoose.js +12 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.js +14 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.js +9 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.js +11 -0
- package/es/configs/app/app.hwtest.js +2 -4
- package/es/configs/app/app.prod.js +1 -3
- package/es/configs/app/index.js +13 -17
- package/es/constants/permission/index.js +1 -2
- package/es/constants/routes/index.d.ts +0 -2
- package/es/constants/routes/index.js +1 -3
- package/es/entry.js +8 -9
- package/es/enums/business-line/index.d.ts +64 -2
- package/es/enums/business-line/index.js +75 -44
- package/es/enums/environment/index.js +5 -6
- package/es/enums/platform/index.js +6 -7
- package/es/enums/sdk/index.js +5 -6
- package/es/enums/sub/enjoy/index.js +13 -14
- package/es/enums/sub/foods/index.js +8 -9
- package/es/enums/sub/hotel/index.js +4 -5
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -3
- package/es/services/goods/service.js +123 -107
- package/es/services/goods/type.d.ts +70 -70
- package/es/utils/common/index.js +3 -4
- package/es/utils/native-app/index.js +8 -10
- package/es/utils/pages/activity-calendar/index.js +1 -3
- package/es/utils/pages/food/index.js +1 -3
- package/es/utils/pages/movie/index.js +1 -3
- package/es/utils/pages/webview/index.js +1 -3
- package/es/utils/uni-env/index.d.ts +3 -53
- package/es/utils/uni-env/index.js +10 -62
- package/es/utils/web-view/index.js +45 -33
- package/package.json +1 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
//#region src/enums/sub/foods/index.ts
|
|
2
2
|
/** 美食跳转 */
|
|
3
|
-
let EFoodsModuleType = /* @__PURE__ */ function(EFoodsModuleType
|
|
3
|
+
let EFoodsModuleType = /* @__PURE__ */ function(EFoodsModuleType) {
|
|
4
4
|
/** 搜藏 */
|
|
5
|
-
EFoodsModuleType
|
|
6
|
-
return EFoodsModuleType
|
|
5
|
+
EFoodsModuleType["store"] = "store";
|
|
6
|
+
return EFoodsModuleType;
|
|
7
7
|
}({});
|
|
8
|
-
let EFoodPackageType = /* @__PURE__ */ function(EFoodPackageType
|
|
8
|
+
let EFoodPackageType = /* @__PURE__ */ function(EFoodPackageType) {
|
|
9
9
|
/** 特色美食 */
|
|
10
|
-
EFoodPackageType
|
|
10
|
+
EFoodPackageType[EFoodPackageType["Normal"] = 1] = "Normal";
|
|
11
11
|
/** 休闲娱乐套餐 */
|
|
12
|
-
EFoodPackageType
|
|
13
|
-
return EFoodPackageType
|
|
12
|
+
EFoodPackageType[EFoodPackageType["Enjoy"] = 2] = "Enjoy";
|
|
13
|
+
return EFoodPackageType;
|
|
14
14
|
}({});
|
|
15
|
-
|
|
16
15
|
//#endregion
|
|
17
|
-
export { EFoodPackageType, EFoodsModuleType };
|
|
16
|
+
export { EFoodPackageType, EFoodsModuleType };
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 酒店类型
|
|
4
4
|
*/
|
|
5
|
-
let EHotelType = /* @__PURE__ */ function(EHotelType
|
|
6
|
-
EHotelType
|
|
7
|
-
return EHotelType
|
|
5
|
+
let EHotelType = /* @__PURE__ */ function(EHotelType) {
|
|
6
|
+
EHotelType["hotel"] = "hotel";
|
|
7
|
+
return EHotelType;
|
|
8
8
|
}({});
|
|
9
|
-
|
|
10
9
|
//#endregion
|
|
11
|
-
export { EHotelType };
|
|
10
|
+
export { EHotelType };
|
package/es/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { WebviewPageParams, getWebviewPage } from "./utils/pages/webview/index.j
|
|
|
14
14
|
import { getFoodPackagePage, getFoodStorePage } from "./utils/pages/food/index.js";
|
|
15
15
|
import { getMoviePage } from "./utils/pages/movie/index.js";
|
|
16
16
|
import { EMessagesType, IShareParam, isAlipay, isAndroid, isHarmony, isIOSOrAndroid, isWeixin, isiOS, navigateBack, navigateTo, postMessage, redirectTo, setShareParam, toPay } from "./utils/web-view/index.js";
|
|
17
|
-
import {
|
|
17
|
+
import { isAlipayEnv, isAndroidEnv, isAppEnv, isH5Env, isHarmonyEnv, isToutiaoEnv, isWeixinEnv, isiOSEnv } from "./utils/uni-env/index.js";
|
|
18
18
|
import { checkAndRequestNativeAppPermission } from "./utils/native-app/index.js";
|
|
19
19
|
import { OneTravelSDK } from "./entry.js";
|
|
20
|
-
export { ActivityCalendarDetailPageParams, BusinessLineDict, EAppEnv, EBusinessLine, ECaller, EFoodPackageType, EFoodsModuleType, EHotelType, EMessagesType, ESubBizType, EUniPlatform, EVenueSimpleTypes, EVenueTypes, IOneTravelSDKConfig, IShareParam, OneTravelSDK, WebviewPageParams, app_permission, checkAndRequestNativeAppPermission, getActivityCalendarDetailPage, getFoodPackagePage, getFoodStorePage, getMoviePage, getQueryParameters,
|
|
20
|
+
export { ActivityCalendarDetailPageParams, BusinessLineDict, EAppEnv, EBusinessLine, ECaller, EFoodPackageType, EFoodsModuleType, EHotelType, EMessagesType, ESubBizType, EUniPlatform, EVenueSimpleTypes, EVenueTypes, IOneTravelSDKConfig, IShareParam, OneTravelSDK, WebviewPageParams, app_permission, checkAndRequestNativeAppPermission, getActivityCalendarDetailPage, getFoodPackagePage, getFoodStorePage, getMoviePage, getQueryParameters, getWebviewPage, isAlipay, isAlipayEnv, isAndroid, isAndroidEnv, isAppEnv, isEmpty, isH5Env, isHarmony, isHarmonyEnv, isIOSOrAndroid, isToutiaoEnv, isWeixin, isWeixinEnv, isiOS, isiOSEnv, navigateBack, navigateTo, postMessage, query2url, redirectTo, routePrefix, routes, setShareParam, toPay };
|
package/es/index.js
CHANGED
|
@@ -13,8 +13,7 @@ import { getWebviewPage } from "./utils/pages/webview/index.js";
|
|
|
13
13
|
import { getFoodPackagePage, getFoodStorePage } from "./utils/pages/food/index.js";
|
|
14
14
|
import { getMoviePage } from "./utils/pages/movie/index.js";
|
|
15
15
|
import { EMessagesType, isAlipay, isAndroid, isHarmony, isIOSOrAndroid, isWeixin, isiOS, navigateBack, navigateTo, postMessage, redirectTo, setShareParam, toPay } from "./utils/web-view/index.js";
|
|
16
|
-
import {
|
|
16
|
+
import { isAlipayEnv, isAndroidEnv, isAppEnv, isH5Env, isHarmonyEnv, isToutiaoEnv, isWeixinEnv, isiOSEnv } from "./utils/uni-env/index.js";
|
|
17
17
|
import { checkAndRequestNativeAppPermission } from "./utils/native-app/index.js";
|
|
18
18
|
import { OneTravelSDK } from "./entry.js";
|
|
19
|
-
|
|
20
|
-
export { BusinessLineDict, EAppEnv, EBusinessLine, ECaller, EFoodPackageType, EFoodsModuleType, EHotelType, EMessagesType, ESubBizType, EUniPlatform, EVenueSimpleTypes, EVenueTypes, OneTravelSDK, app_permission, checkAndRequestNativeAppPermission, getActivityCalendarDetailPage, getFoodPackagePage, getFoodStorePage, getMoviePage, getQueryParameters, getSystemInfoSync, getWebviewPage, isAlipay, isAlipayEnv, isAndroid, isAndroidEnv, isAppEnv, isEmpty, isH5Env, isHarmony, isHarmonyEnv, isIOSOrAndroid, isWeixin, isWeixinEnv, isiOS, isiOSEnv, navigateBack, navigateTo, postMessage, query2url, redirectTo, routePrefix, routes, setShareParam, toPay };
|
|
19
|
+
export { BusinessLineDict, EAppEnv, EBusinessLine, ECaller, EFoodPackageType, EFoodsModuleType, EHotelType, EMessagesType, ESubBizType, EUniPlatform, EVenueSimpleTypes, EVenueTypes, OneTravelSDK, app_permission, checkAndRequestNativeAppPermission, getActivityCalendarDetailPage, getFoodPackagePage, getFoodStorePage, getMoviePage, getQueryParameters, getWebviewPage, isAlipay, isAlipayEnv, isAndroid, isAndroidEnv, isAppEnv, isEmpty, isH5Env, isHarmony, isHarmonyEnv, isIOSOrAndroid, isToutiaoEnv, isWeixin, isWeixinEnv, isiOS, isiOSEnv, navigateBack, navigateTo, postMessage, query2url, redirectTo, routePrefix, routes, setShareParam, toPay };
|
|
@@ -7,119 +7,135 @@ import { EHotelType } from "../../enums/sub/hotel/index.js";
|
|
|
7
7
|
import { getWebviewPage } from "../../utils/pages/webview/index.js";
|
|
8
8
|
import { getFoodPackagePage, getFoodStorePage } from "../../utils/pages/food/index.js";
|
|
9
9
|
import { getMoviePage } from "../../utils/pages/movie/index.js";
|
|
10
|
+
import { _defineProperty } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.js";
|
|
10
11
|
import { navigateTo } from "../../utils/web-view/index.js";
|
|
11
12
|
import { getAppConfig } from "../../configs/app/index.js";
|
|
12
|
-
|
|
13
13
|
//#region src/services/goods/service.ts
|
|
14
14
|
var GoodsService = class {
|
|
15
|
-
goodsServiceConfig;
|
|
16
15
|
constructor(config) {
|
|
17
|
-
this
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
16
|
+
_defineProperty(this, "goodsServiceConfig", void 0);
|
|
17
|
+
_defineProperty(
|
|
18
|
+
this,
|
|
19
|
+
/**
|
|
20
|
+
* 跳转商品详情页面
|
|
21
|
+
* @param item 商品数据
|
|
22
|
+
*/
|
|
23
|
+
"jumpToProductDetailPage",
|
|
24
|
+
(item) => {
|
|
25
|
+
var _item$common, _item$common2, _item$common3, _item$common4, _item$common5;
|
|
26
|
+
const configOptions = this.goodsServiceConfig.sdkConfig;
|
|
27
|
+
const appConfig = getAppConfig(configOptions.appEnv);
|
|
28
|
+
let page = "";
|
|
29
|
+
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);
|
|
30
|
+
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);
|
|
31
|
+
switch (businessLine) {
|
|
32
|
+
case EBusinessLine.Scenic:
|
|
33
|
+
var _item$scenic, _item$common6, _item$common7, _item$scenic2, _item$common8, _item$scenic3;
|
|
34
|
+
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) || "";
|
|
35
|
+
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) || "";
|
|
36
|
+
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);
|
|
37
|
+
page = `${routePrefix.ticket}/detail/index?scenicId=${scenicId}&reservationId=${scenicReservationId}&isOld=${scenicIsOld}`;
|
|
38
|
+
break;
|
|
39
|
+
case EBusinessLine.Hotel:
|
|
40
|
+
var _item$hotel, _item$common9;
|
|
41
|
+
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) || "";
|
|
42
|
+
page = `${routePrefix.hotel}/home/details/index?id=${hotelId}`;
|
|
43
|
+
break;
|
|
44
|
+
case EBusinessLine.Homestay:
|
|
45
|
+
var _item$homestay, _item$common10;
|
|
46
|
+
if (((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) || "") === EHotelType.hotel) {
|
|
47
|
+
var _item$homestay2, _item$common11;
|
|
48
|
+
/** 酒店 (天下房仓酒店详情页) */
|
|
49
|
+
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) || "";
|
|
50
|
+
page = `${routePrefix.hotel}/home/details/index?id=${id}`;
|
|
51
|
+
} else {
|
|
52
|
+
var _item$homestay3, _item$homestay4, _item$common12, _item$common13;
|
|
53
|
+
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);
|
|
54
|
+
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) || "";
|
|
55
|
+
/** 民宿 */
|
|
56
|
+
if (`${subBizType}` === `${ESubBizType.HomestayHotel}`) page = `${routePrefix.hotel}/home/details/index?id=${id}`;
|
|
57
|
+
else if (`${subBizType}` === `${ESubBizType.HomestayHot}`) page = `${routePrefix.hotel}/home/hot-sale-details/index?id=${id}`;
|
|
58
|
+
else page = `${routePrefix.hotel}/home/pms-details/index?id=${id}`;
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
case EBusinessLine.Route:
|
|
62
|
+
var _item$route, _item$common14, _item$common15;
|
|
63
|
+
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);
|
|
64
|
+
page = `${routePrefix.road}/product-detail/index?id=${routeId}`;
|
|
65
|
+
break;
|
|
66
|
+
case EBusinessLine.Travel:
|
|
67
|
+
var _item$travel, _item$common16, _item$common17;
|
|
68
|
+
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);
|
|
69
|
+
page = `${routePrefix.travel}/charter/detail?routeId=${travelId}`;
|
|
70
|
+
break;
|
|
71
|
+
case EBusinessLine.Buy:
|
|
72
|
+
var _item$buy, _item$common18, _item$common19;
|
|
73
|
+
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);
|
|
74
|
+
page = getWebviewPage({ url: appConfig.domain.shopping + `goods?itemId=${buySpuId}` });
|
|
75
|
+
break;
|
|
76
|
+
case EBusinessLine.Onebuygz:
|
|
77
|
+
var _item$onebuygz, _item$common20, _item$common21, _item$onebuygz2, _item$common22;
|
|
78
|
+
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);
|
|
79
|
+
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);
|
|
80
|
+
page = getWebviewPage({ url: appConfig.domain.onebuygz + `pages/commodity-detail/index?itemId=${onebuySpuId}&skuId=${onebuySkuId}` });
|
|
81
|
+
break;
|
|
82
|
+
case EBusinessLine.Foods:
|
|
83
|
+
var _item$food, _item$food2, _item$common23, _item$food3, _item$common24, _item$common25, _item$food4;
|
|
84
|
+
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);
|
|
85
|
+
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) || "";
|
|
86
|
+
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) || "";
|
|
87
|
+
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;
|
|
88
|
+
if (moduleType === EFoodsModuleType.store)
|
|
77
89
|
/** 收藏跳店铺 */
|
|
78
|
-
|
|
79
|
-
|
|
90
|
+
page = getWebviewPage({ url: getFoodStorePage(appConfig.domain.food, storeId) });
|
|
91
|
+
else
|
|
80
92
|
/** 跳转套餐 */
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
93
|
+
page = getWebviewPage({ url: getFoodPackagePage(appConfig.domain.food, storeId, spuId, storePrecedentType) });
|
|
94
|
+
break;
|
|
95
|
+
case EBusinessLine.Entertainment:
|
|
96
|
+
var _item$entertainment, _item$common26, _item$common27, _item$entertainment2, _item$common28, _item$entertainment3, _item$entertainment4, _item$common29, _item$entertainment5, _item$common30;
|
|
97
|
+
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);
|
|
98
|
+
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) || "";
|
|
99
|
+
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);
|
|
100
|
+
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);
|
|
101
|
+
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);
|
|
102
|
+
if (`${entertainmentType}` === EVenueSimpleTypes.Activity || `${entertainmentSubBizType}` === `${ESubBizType.EntertainmentPerform}`) page = `${routePrefix.enjoy}/g-activity/detail?id=` + entertainmentId + "&mchId=" + entertainmentStoreId;
|
|
103
|
+
else page = `${routePrefix.enjoy}/g-venue/detail?id=${entertainmentId}&reservationId=${entertainmentReservationId}`;
|
|
104
|
+
break;
|
|
105
|
+
case EBusinessLine.Movie:
|
|
106
|
+
var _item$movie;
|
|
107
|
+
let movieId = (item === null || item === void 0 || (_item$movie = item.movie) === null || _item$movie === void 0 ? void 0 : _item$movie.id) || "";
|
|
108
|
+
try {
|
|
109
|
+
var _JSON$parse;
|
|
110
|
+
movieId = ((_JSON$parse = JSON.parse((extInfo === null || extInfo === void 0 ? void 0 : extInfo.extInfo) || "{}")) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.thirdMovieId) || "";
|
|
111
|
+
} catch (_unused) {}
|
|
112
|
+
page = getMoviePage(appConfig.domain.movie, movieId);
|
|
113
|
+
break;
|
|
114
|
+
case EBusinessLine.Strategy:
|
|
115
|
+
var _item$strategy, _item$common31, _item$common32;
|
|
116
|
+
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);
|
|
117
|
+
page = `${routePrefix.strategy}/strategy-detail/index?id=` + strategyId;
|
|
118
|
+
break;
|
|
119
|
+
case EBusinessLine.Recommend:
|
|
120
|
+
var _item$recommend, _item$common33, _item$common34, _item$recommend2;
|
|
121
|
+
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);
|
|
122
|
+
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) || "";
|
|
123
|
+
page = `${routePrefix.show}/details/index?id=${recommendId}${recommendMoreParameter}`;
|
|
124
|
+
break;
|
|
125
|
+
case EBusinessLine.ExcitingVideo:
|
|
126
|
+
var _item$excitingVideo, _item$common35, _item$common36;
|
|
127
|
+
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$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);
|
|
128
|
+
page = `${routePrefix.living}/wonderful-video/index?vid=${excitingVideoId}`;
|
|
129
|
+
break;
|
|
130
|
+
default: break;
|
|
131
|
+
}
|
|
132
|
+
if (!page) return;
|
|
133
|
+
if (configOptions.caller === ECaller.web) navigateTo({ src: page });
|
|
134
|
+
else if (configOptions.caller === ECaller.host) uni.navigateTo({ url: page });
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
this.goodsServiceConfig = config;
|
|
138
|
+
}
|
|
122
139
|
};
|
|
123
|
-
|
|
124
140
|
//#endregion
|
|
125
|
-
export { GoodsService };
|
|
141
|
+
export { GoodsService };
|
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
import { EBusinessLine, ESubBizType } from
|
|
2
|
-
import { EFoodPackageType, EFoodsModuleType } from
|
|
1
|
+
import { EBusinessLine, ESubBizType } from "../../enums/business-line/index.js";
|
|
2
|
+
import { EFoodPackageType, EFoodsModuleType } from "../../enums/sub/foods/index.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
//#region src/services/goods/type.d.ts
|
|
5
5
|
type IJumpProductDetailItemCommonExtInfo = {
|
|
6
|
-
reservationId?: string
|
|
7
|
-
type?: 'hotel' | '1' | '3'
|
|
8
|
-
storeId?: string
|
|
9
|
-
subBizType?: ESubBizType
|
|
6
|
+
reservationId?: string;
|
|
7
|
+
type?: 'hotel' | '1' | '3';
|
|
8
|
+
storeId?: string;
|
|
9
|
+
subBizType?: ESubBizType;
|
|
10
10
|
/** ********** 景区相关字段 ************/
|
|
11
|
-
isOld?: number
|
|
11
|
+
isOld?: number;
|
|
12
12
|
/** ********** 景区相关字段 ************/
|
|
13
13
|
/** ********** 美食相关字段 ************/
|
|
14
|
-
storePrecedentType?: EFoodPackageType
|
|
15
|
-
moduleType?: EFoodsModuleType
|
|
14
|
+
storePrecedentType?: EFoodPackageType;
|
|
15
|
+
moduleType?: EFoodsModuleType;
|
|
16
16
|
/** ********** 美食相关字段 ************/
|
|
17
17
|
/** ********** 种草相关字段 ************/
|
|
18
|
-
moreParameter?: string
|
|
18
|
+
moreParameter?: string;
|
|
19
19
|
/** ********** 种草相关字段 ************/
|
|
20
20
|
/** ********** 电影相关字段 ************/
|
|
21
|
-
extInfo: string
|
|
22
|
-
}
|
|
21
|
+
extInfo: string;
|
|
22
|
+
};
|
|
23
23
|
/**
|
|
24
24
|
* 商品数据
|
|
25
25
|
*/
|
|
26
26
|
type IJumpProductDetailItem = {
|
|
27
27
|
/** 业务线(如果是common字段,则不用传,没有common必传) */
|
|
28
|
-
businessLine?: EBusinessLine
|
|
28
|
+
businessLine?: EBusinessLine;
|
|
29
29
|
/** 通用数据-(包含装修数据文本导航、商品组件) */
|
|
30
30
|
common?: {
|
|
31
31
|
/** 业务线字段(可能是三个中的一个) */
|
|
32
|
-
bizType?: EBusinessLine
|
|
33
|
-
linkBusinessLine?: EBusinessLine
|
|
34
|
-
businessType?: EBusinessLine
|
|
32
|
+
bizType?: EBusinessLine;
|
|
33
|
+
linkBusinessLine?: EBusinessLine;
|
|
34
|
+
businessType?: EBusinessLine;
|
|
35
35
|
/** skuId 字段 */
|
|
36
|
-
skuId: string
|
|
36
|
+
skuId: string;
|
|
37
37
|
/** spuId */
|
|
38
|
-
spuId: string
|
|
38
|
+
spuId: string;
|
|
39
39
|
/** ****** 收藏、搜索等(优先取扩展字段里面的) ********/
|
|
40
|
-
id?: string
|
|
41
|
-
storeId?: string
|
|
42
|
-
type?: 'hotel' | '1' | '3'
|
|
43
|
-
reservationId?: string
|
|
40
|
+
id?: string;
|
|
41
|
+
storeId?: string;
|
|
42
|
+
type?: 'hotel' | '1' | '3';
|
|
43
|
+
reservationId?: string;
|
|
44
44
|
/** ****** 收藏、搜索等 ********/
|
|
45
45
|
/** 扩展字段 */
|
|
46
|
-
extInfo?: IJumpProductDetailItemCommonExtInfo
|
|
46
|
+
extInfo?: IJumpProductDetailItemCommonExtInfo;
|
|
47
47
|
/** 扩展字段 */
|
|
48
|
-
extInfoMap?: IJumpProductDetailItemCommonExtInfo
|
|
49
|
-
}
|
|
48
|
+
extInfoMap?: IJumpProductDetailItemCommonExtInfo;
|
|
49
|
+
};
|
|
50
50
|
/** 景区门票 */
|
|
51
51
|
scenic?: {
|
|
52
|
-
id: string
|
|
53
|
-
reservationId?: string
|
|
54
|
-
isOld?: number
|
|
55
|
-
}
|
|
52
|
+
id: string;
|
|
53
|
+
reservationId?: string;
|
|
54
|
+
isOld?: number;
|
|
55
|
+
};
|
|
56
56
|
/** 酒店 */
|
|
57
57
|
hotel?: {
|
|
58
|
-
id: string
|
|
59
|
-
}
|
|
58
|
+
id: string;
|
|
59
|
+
};
|
|
60
60
|
/** 名宿 */
|
|
61
61
|
homestay?: {
|
|
62
|
-
id: string
|
|
63
|
-
type?: 'hotel'
|
|
64
|
-
subBizType?: ESubBizType
|
|
65
|
-
}
|
|
62
|
+
id: string;
|
|
63
|
+
type?: 'hotel';
|
|
64
|
+
subBizType?: ESubBizType;
|
|
65
|
+
};
|
|
66
66
|
/** 路线/定制 */
|
|
67
67
|
route?: {
|
|
68
|
-
id: string
|
|
69
|
-
}
|
|
68
|
+
id: string;
|
|
69
|
+
};
|
|
70
70
|
/** 出行 */
|
|
71
71
|
travel?: {
|
|
72
|
-
id: string
|
|
73
|
-
}
|
|
72
|
+
id: string;
|
|
73
|
+
};
|
|
74
74
|
/** 购物 */
|
|
75
75
|
buy?: {
|
|
76
|
-
spuId: string
|
|
77
|
-
}
|
|
76
|
+
spuId: string;
|
|
77
|
+
};
|
|
78
78
|
/** 购物(新) */
|
|
79
79
|
onebuygz?: {
|
|
80
|
-
spuId: string
|
|
81
|
-
skuId: string
|
|
82
|
-
}
|
|
80
|
+
spuId: string;
|
|
81
|
+
skuId: string;
|
|
82
|
+
};
|
|
83
83
|
/** 美食 */
|
|
84
84
|
food?: {
|
|
85
|
-
storeId: string
|
|
86
|
-
spuId?: string
|
|
87
|
-
moduleType?: EFoodsModuleType
|
|
88
|
-
storePrecedentType?: EFoodPackageType
|
|
89
|
-
}
|
|
85
|
+
storeId: string;
|
|
86
|
+
spuId?: string;
|
|
87
|
+
moduleType?: EFoodsModuleType;
|
|
88
|
+
storePrecedentType?: EFoodPackageType;
|
|
89
|
+
};
|
|
90
90
|
/** 电影 */
|
|
91
91
|
movie?: {
|
|
92
|
-
id: string
|
|
93
|
-
}
|
|
92
|
+
id: string;
|
|
93
|
+
};
|
|
94
94
|
/** 文娱 */
|
|
95
95
|
entertainment?: {
|
|
96
|
-
id: string
|
|
97
|
-
type?: string
|
|
98
|
-
subBizType?: ESubBizType
|
|
99
|
-
storeId?: string
|
|
100
|
-
reservationId?: string
|
|
101
|
-
}
|
|
96
|
+
id: string;
|
|
97
|
+
type?: string;
|
|
98
|
+
subBizType?: ESubBizType;
|
|
99
|
+
storeId?: string;
|
|
100
|
+
reservationId?: string;
|
|
101
|
+
};
|
|
102
102
|
/** 攻略 */
|
|
103
103
|
strategy?: {
|
|
104
|
-
id: string
|
|
105
|
-
}
|
|
104
|
+
id: string;
|
|
105
|
+
};
|
|
106
106
|
/** 种草 */
|
|
107
107
|
recommend?: {
|
|
108
|
-
id: string
|
|
109
|
-
moreParameter?: string
|
|
110
|
-
}
|
|
108
|
+
id: string;
|
|
109
|
+
moreParameter?: string;
|
|
110
|
+
};
|
|
111
111
|
/** 声入贵州 */
|
|
112
112
|
soundGuizhou?: {
|
|
113
|
-
id: string
|
|
114
|
-
}
|
|
113
|
+
id: string;
|
|
114
|
+
};
|
|
115
115
|
/** 精彩视频 */
|
|
116
116
|
excitingVideo?: {
|
|
117
|
-
id: string
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export { IJumpProductDetailItem }
|
|
117
|
+
id: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
export { IJumpProductDetailItem };
|
package/es/utils/common/index.js
CHANGED
|
@@ -13,7 +13,7 @@ function isEmpty(value) {
|
|
|
13
13
|
*/
|
|
14
14
|
function query2url(query, options) {
|
|
15
15
|
const { encode = true } = options || {};
|
|
16
|
-
const url = Object.entries(query || {}).filter(([
|
|
16
|
+
const url = Object.entries(query || {}).filter(([_key, val]) => val !== void 0 && val !== null).map(([key, val]) => {
|
|
17
17
|
return encode ? `${encodeURIComponent(key)}=${encodeURIComponent(val)}` : `${key}=${val}`;
|
|
18
18
|
}).join("&");
|
|
19
19
|
return url ? `?${url}` : "";
|
|
@@ -33,12 +33,11 @@ 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
|
}
|
|
40
40
|
return params;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
42
|
//#endregion
|
|
44
|
-
export { getQueryParameters, isEmpty, query2url };
|
|
43
|
+
export { getQueryParameters, isEmpty, query2url };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { app_permission } from "../../constants/permission/index.js";
|
|
2
2
|
import { isH5Env, isHarmonyEnv, isWeixinEnv, isiOSEnv } from "../uni-env/index.js";
|
|
3
|
-
|
|
4
3
|
//#region src/utils/native-app/index.ts
|
|
5
4
|
let plusNativeObjView;
|
|
6
5
|
/**
|
|
@@ -62,7 +61,7 @@ const showAndroidTip = (options) => {
|
|
|
62
61
|
const checkAndRequestNativeAppPermission = (options) => {
|
|
63
62
|
const { type, success, fail } = options || {};
|
|
64
63
|
if (isWeixinEnv() || isH5Env() || isHarmonyEnv() || isiOSEnv()) {
|
|
65
|
-
success
|
|
64
|
+
success === null || success === void 0 || success();
|
|
66
65
|
return;
|
|
67
66
|
}
|
|
68
67
|
const ActivityCompat = plus.android.importClass("androidx.core.app.ActivityCompat");
|
|
@@ -77,19 +76,19 @@ const checkAndRequestNativeAppPermission = (options) => {
|
|
|
77
76
|
}
|
|
78
77
|
});
|
|
79
78
|
if (!hasPermission) {
|
|
80
|
-
success
|
|
79
|
+
success === null || success === void 0 || success();
|
|
81
80
|
return;
|
|
82
81
|
}
|
|
83
82
|
showAndroidTip(detail);
|
|
84
83
|
plus.android.requestPermissions(detail.permissionId, function(resultObj) {
|
|
85
84
|
if (resultObj.granted.length > 0) {
|
|
86
85
|
closeAndroidTip();
|
|
87
|
-
success
|
|
86
|
+
success === null || success === void 0 || success();
|
|
88
87
|
return;
|
|
89
88
|
}
|
|
90
89
|
if (resultObj.deniedPresent.length > 0) {
|
|
91
90
|
closeAndroidTip();
|
|
92
|
-
fail
|
|
91
|
+
fail === null || fail === void 0 || fail();
|
|
93
92
|
return;
|
|
94
93
|
}
|
|
95
94
|
if (resultObj.deniedAlways.length > 0) {
|
|
@@ -99,17 +98,16 @@ const checkAndRequestNativeAppPermission = (options) => {
|
|
|
99
98
|
confirmText: "去设置",
|
|
100
99
|
success: function(res) {
|
|
101
100
|
closeAndroidTip();
|
|
102
|
-
if (res.confirm) uni.openAppAuthorizeSetting({ success: () => fail
|
|
103
|
-
if (res.cancel) fail
|
|
101
|
+
if (res.confirm) uni.openAppAuthorizeSetting({ success: () => fail === null || fail === void 0 ? void 0 : fail() });
|
|
102
|
+
if (res.cancel) fail === null || fail === void 0 || fail();
|
|
104
103
|
}
|
|
105
104
|
});
|
|
106
105
|
return;
|
|
107
106
|
}
|
|
108
107
|
}, function() {
|
|
109
108
|
closeAndroidTip();
|
|
110
|
-
fail
|
|
109
|
+
fail === null || fail === void 0 || fail();
|
|
111
110
|
});
|
|
112
111
|
};
|
|
113
|
-
|
|
114
112
|
//#endregion
|
|
115
|
-
export { checkAndRequestNativeAppPermission };
|
|
113
|
+
export { checkAndRequestNativeAppPermission };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { routePrefix } from "../../../constants/routes/index.js";
|
|
2
2
|
import { query2url } from "../../common/index.js";
|
|
3
|
-
|
|
4
3
|
//#region src/utils/pages/activity-calendar/index.ts
|
|
5
4
|
const rootPage = routePrefix.activityCalendar;
|
|
6
5
|
function getActivityCalendarDetailPage(params) {
|
|
7
6
|
return `${rootPage}/detail/index${query2url(params, { encode: false })}`;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
//#endregion
|
|
11
|
-
export { getActivityCalendarDetailPage };
|
|
9
|
+
export { getActivityCalendarDetailPage };
|