@pisell/pisellos 2.3.112 → 2.3.113
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/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/BookingContext/index.js +4 -4
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +2 -2
- package/dist/solution/UnifiedBookingSales/index.js +3 -3
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/BookingContext/index.js +3 -3
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +2 -2
- package/lib/solution/UnifiedBookingSales/index.js +3 -3
- package/package.json +1 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 导出评估器
|
|
2
|
-
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
-
|
|
4
|
-
// 导出适配器
|
|
5
|
-
export { PromotionAdapter } from "./adapter";
|
|
6
|
-
export { default } from "./adapter";
|
|
7
|
-
|
|
8
|
-
// 导出策略配置示例常量
|
|
9
|
-
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
|
|
@@ -26,7 +26,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
26
26
|
import dayjs from 'dayjs';
|
|
27
27
|
import { BaseModule } from "../BaseModule";
|
|
28
28
|
import { RequestModeENUM } from "../../plugins/request";
|
|
29
|
-
import {
|
|
29
|
+
import { isCustomerUserPlatform } from "../../utils/platform";
|
|
30
30
|
import { BookingContextEvent } from "./types";
|
|
31
31
|
import { formatResourceListAndMap } from "./utils/formatResourceList";
|
|
32
32
|
export * from "./types";
|
|
@@ -158,9 +158,9 @@ export function buildBookingConfigQueryKey() {
|
|
|
158
158
|
}
|
|
159
159
|
function resolveBookingConfigRequest(platform) {
|
|
160
160
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
161
|
-
var
|
|
162
|
-
var endpoint =
|
|
163
|
-
var query =
|
|
161
|
+
var isCustomerPlatform = isCustomerUserPlatform(platform);
|
|
162
|
+
var endpoint = isCustomerPlatform ? H5_BOOKING_CONFIG_ENDPOINT : BOOKING_CONFIG_ENDPOINT;
|
|
163
|
+
var query = isCustomerPlatform ? {
|
|
164
164
|
item_type: params.item_type || DEFAULT_BOOKING_CONFIG_PARAMS.item_type
|
|
165
165
|
} : _objectSpread(_objectSpread({}, DEFAULT_BOOKING_CONFIG_PARAMS), params);
|
|
166
166
|
var keys = Object.keys(query).sort();
|
|
@@ -557,7 +557,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
557
557
|
generateIdempotencyToken(): string;
|
|
558
558
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
559
559
|
createOrder(params: CommitOrderParams['query']): {
|
|
560
|
-
type: "
|
|
560
|
+
type: "appointment_booking" | "virtual";
|
|
561
561
|
platform: string;
|
|
562
562
|
sales_channel: string;
|
|
563
563
|
order_sales_channel: string;
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 | 2 | 1 | 6 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 6 | 5 | 3 | 4;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -345,7 +345,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
345
345
|
* 获取当前的客户搜索条件
|
|
346
346
|
* @returns 当前搜索条件
|
|
347
347
|
*/
|
|
348
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
348
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
349
349
|
/**
|
|
350
350
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
351
351
|
* @returns 客户状态
|
|
@@ -127,8 +127,8 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
127
127
|
*/
|
|
128
128
|
clearSessionStorageOrderSnapshot(): void;
|
|
129
129
|
/**
|
|
130
|
-
* H5/Kiosk
|
|
131
|
-
*
|
|
130
|
+
* PC/H5/Kiosk 结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
|
|
131
|
+
* 显式传 checkoutSyncTaskEnabled: true 时仍可回退到本地同步模式。
|
|
132
132
|
*/
|
|
133
133
|
protected shouldUseCheckoutSyncTask(): boolean;
|
|
134
134
|
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|
|
@@ -1904,8 +1904,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
1904
1904
|
}
|
|
1905
1905
|
|
|
1906
1906
|
/**
|
|
1907
|
-
* H5/Kiosk
|
|
1908
|
-
*
|
|
1907
|
+
* PC/H5/Kiosk 结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
|
|
1908
|
+
* 显式传 checkoutSyncTaskEnabled: true 时仍可回退到本地同步模式。
|
|
1909
1909
|
*/
|
|
1910
1910
|
}, {
|
|
1911
1911
|
key: "shouldUseCheckoutSyncTask",
|
|
@@ -1914,7 +1914,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
1914
1914
|
var configured = (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.checkoutSyncTaskEnabled;
|
|
1915
1915
|
if (configured === true) return true;
|
|
1916
1916
|
var platform = normalizeRuntimePlatform((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.platform);
|
|
1917
|
-
return platform
|
|
1917
|
+
return !isCustomerUserPlatform(platform) && platform !== 'kiosk';
|
|
1918
1918
|
}
|
|
1919
1919
|
|
|
1920
1920
|
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _examples.BUY_X_GET_Y_FREE_STRATEGY;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _examples.ITEM_REWARD_STRATEGY;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "PromotionAdapter", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _adapter.PromotionAdapter;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "PromotionEvaluator", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _evaluator.PromotionEvaluator;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "default", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _adapter.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var _evaluator = require("./evaluator");
|
|
43
|
+
var _adapter = _interopRequireWildcard(require("./adapter"));
|
|
44
|
+
var _examples = require("./examples");
|
|
45
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
46
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -171,9 +171,9 @@ function buildBookingConfigQueryKey(params = {}) {
|
|
|
171
171
|
return JSON.stringify(sorted);
|
|
172
172
|
}
|
|
173
173
|
function resolveBookingConfigRequest(platform, params = {}) {
|
|
174
|
-
const
|
|
175
|
-
const endpoint =
|
|
176
|
-
const query =
|
|
174
|
+
const isCustomerPlatform = (0, _platform.isCustomerUserPlatform)(platform);
|
|
175
|
+
const endpoint = isCustomerPlatform ? H5_BOOKING_CONFIG_ENDPOINT : BOOKING_CONFIG_ENDPOINT;
|
|
176
|
+
const query = isCustomerPlatform ? {
|
|
177
177
|
item_type: params.item_type || DEFAULT_BOOKING_CONFIG_PARAMS.item_type
|
|
178
178
|
} : {
|
|
179
179
|
...DEFAULT_BOOKING_CONFIG_PARAMS,
|
|
@@ -557,7 +557,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
557
557
|
generateIdempotencyToken(): string;
|
|
558
558
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
559
559
|
createOrder(params: CommitOrderParams['query']): {
|
|
560
|
-
type: "
|
|
560
|
+
type: "appointment_booking" | "virtual";
|
|
561
561
|
platform: string;
|
|
562
562
|
sales_channel: string;
|
|
563
563
|
order_sales_channel: string;
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 | 2 | 1 | 6 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 6 | 5 | 3 | 4;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -345,7 +345,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
345
345
|
* 获取当前的客户搜索条件
|
|
346
346
|
* @returns 当前搜索条件
|
|
347
347
|
*/
|
|
348
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
348
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
349
349
|
/**
|
|
350
350
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
351
351
|
* @returns 客户状态
|
|
@@ -127,8 +127,8 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
127
127
|
*/
|
|
128
128
|
clearSessionStorageOrderSnapshot(): void;
|
|
129
129
|
/**
|
|
130
|
-
* H5/Kiosk
|
|
131
|
-
*
|
|
130
|
+
* PC/H5/Kiosk 结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
|
|
131
|
+
* 显式传 checkoutSyncTaskEnabled: true 时仍可回退到本地同步模式。
|
|
132
132
|
*/
|
|
133
133
|
protected shouldUseCheckoutSyncTask(): boolean;
|
|
134
134
|
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|
|
@@ -1581,14 +1581,14 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
1581
1581
|
}
|
|
1582
1582
|
|
|
1583
1583
|
/**
|
|
1584
|
-
* H5/Kiosk
|
|
1585
|
-
*
|
|
1584
|
+
* PC/H5/Kiosk 结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
|
|
1585
|
+
* 显式传 checkoutSyncTaskEnabled: true 时仍可回退到本地同步模式。
|
|
1586
1586
|
*/
|
|
1587
1587
|
shouldUseCheckoutSyncTask() {
|
|
1588
1588
|
const configured = this.otherParams?.checkoutSyncTaskEnabled;
|
|
1589
1589
|
if (configured === true) return true;
|
|
1590
1590
|
const platform = (0, _platform.normalizeRuntimePlatform)(this.otherParams?.platform);
|
|
1591
|
-
return platform
|
|
1591
|
+
return !(0, _platform.isCustomerUserPlatform)(platform) && platform !== 'kiosk';
|
|
1592
1592
|
}
|
|
1593
1593
|
|
|
1594
1594
|
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|