@pisell/pisellos 2.2.234 → 2.2.235
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/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +4 -1
- package/dist/solution/BookingTicket/index.js +39 -8
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +4 -1
- package/lib/solution/BookingTicket/index.js +7 -1
- package/package.json +1 -1
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 1 | 2 | 3 | 6 | 5 | 4;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -322,7 +322,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
322
322
|
* 获取当前的客户搜索条件
|
|
323
323
|
* @returns 当前搜索条件
|
|
324
324
|
*/
|
|
325
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
325
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
326
326
|
/**
|
|
327
327
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
328
328
|
* @returns 客户状态
|
|
@@ -548,6 +548,9 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
548
548
|
* });
|
|
549
549
|
*/
|
|
550
550
|
addAddTimeProductsToBooking(input: AddAddTimeProductsToBookingInput): Promise<OrderProduct[]>;
|
|
551
|
+
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
552
|
+
cover?: boolean;
|
|
553
|
+
}): Promise<void>;
|
|
551
554
|
/**
|
|
552
555
|
* 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
|
|
553
556
|
* 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
|
|
@@ -282,7 +282,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
282
282
|
_context2.next = 6;
|
|
283
283
|
break;
|
|
284
284
|
}
|
|
285
|
-
console.warn('[BookingTicket] businessCode 缺失,跳过 OpenData
|
|
285
|
+
console.warn('[BookingTicket] businessCode 缺失,跳过 OpenData 配置加载,当前 module name: ', this.name);
|
|
286
286
|
return _context2.abrupt("return", null);
|
|
287
287
|
case 6:
|
|
288
288
|
lastFetchedAt = this.store.openData.getLastFetchedAt();
|
|
@@ -2546,21 +2546,52 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2546
2546
|
return _addAddTimeProductsToBooking.apply(this, arguments);
|
|
2547
2547
|
}
|
|
2548
2548
|
return addAddTimeProductsToBooking;
|
|
2549
|
+
}())
|
|
2550
|
+
}, {
|
|
2551
|
+
key: "setOtherParams",
|
|
2552
|
+
value: function () {
|
|
2553
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
|
|
2554
|
+
var _ref19,
|
|
2555
|
+
_ref19$cover,
|
|
2556
|
+
cover,
|
|
2557
|
+
_args31 = arguments;
|
|
2558
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2559
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2560
|
+
case 0:
|
|
2561
|
+
_ref19 = _args31.length > 1 && _args31[1] !== undefined ? _args31[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
|
|
2562
|
+
_get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
|
|
2563
|
+
cover: cover
|
|
2564
|
+
});
|
|
2565
|
+
if (!(params !== null && params !== void 0 && params.businessCode)) {
|
|
2566
|
+
_context31.next = 5;
|
|
2567
|
+
break;
|
|
2568
|
+
}
|
|
2569
|
+
_context31.next = 5;
|
|
2570
|
+
return this.configureIdGeneratorFromOpenData();
|
|
2571
|
+
case 5:
|
|
2572
|
+
case "end":
|
|
2573
|
+
return _context31.stop();
|
|
2574
|
+
}
|
|
2575
|
+
}, _callee31, this);
|
|
2576
|
+
}));
|
|
2577
|
+
function setOtherParams(_x22) {
|
|
2578
|
+
return _setOtherParams.apply(this, arguments);
|
|
2579
|
+
}
|
|
2580
|
+
return setOtherParams;
|
|
2549
2581
|
}()
|
|
2550
2582
|
/**
|
|
2551
2583
|
* 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
|
|
2552
2584
|
* 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
|
|
2553
2585
|
*/
|
|
2554
|
-
)
|
|
2555
2586
|
}, {
|
|
2556
2587
|
key: "destroy",
|
|
2557
2588
|
value: (function () {
|
|
2558
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2589
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
|
|
2559
2590
|
var _this$scan;
|
|
2560
|
-
return _regeneratorRuntime().wrap(function
|
|
2561
|
-
while (1) switch (
|
|
2591
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2592
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2562
2593
|
case 0:
|
|
2563
|
-
|
|
2594
|
+
_context32.next = 2;
|
|
2564
2595
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
|
|
2565
2596
|
case 2:
|
|
2566
2597
|
try {
|
|
@@ -2571,9 +2602,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2571
2602
|
scanCache.clear();
|
|
2572
2603
|
case 4:
|
|
2573
2604
|
case "end":
|
|
2574
|
-
return
|
|
2605
|
+
return _context32.stop();
|
|
2575
2606
|
}
|
|
2576
|
-
},
|
|
2607
|
+
}, _callee32, this);
|
|
2577
2608
|
}));
|
|
2578
2609
|
function destroy() {
|
|
2579
2610
|
return _destroy.apply(this, arguments);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/model/strategy/adapter/promotion/index.ts
|
|
30
|
+
var promotion_exports = {};
|
|
31
|
+
__export(promotion_exports, {
|
|
32
|
+
BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
|
|
33
|
+
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
34
|
+
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
35
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
36
|
+
default: () => import_adapter2.default
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(promotion_exports);
|
|
39
|
+
var import_evaluator = require("./evaluator");
|
|
40
|
+
var import_adapter = require("./adapter");
|
|
41
|
+
var import_adapter2 = __toESM(require("./adapter"));
|
|
42
|
+
var import_examples = require("./examples");
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
BUY_X_GET_Y_FREE_STRATEGY,
|
|
46
|
+
PromotionAdapter,
|
|
47
|
+
PromotionEvaluator,
|
|
48
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
49
|
+
});
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 1 | 2 | 3 | 6 | 5 | 4;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -322,7 +322,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
322
322
|
* 获取当前的客户搜索条件
|
|
323
323
|
* @returns 当前搜索条件
|
|
324
324
|
*/
|
|
325
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
325
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
326
326
|
/**
|
|
327
327
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
328
328
|
* @returns 客户状态
|
|
@@ -548,6 +548,9 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
548
548
|
* });
|
|
549
549
|
*/
|
|
550
550
|
addAddTimeProductsToBooking(input: AddAddTimeProductsToBookingInput): Promise<OrderProduct[]>;
|
|
551
|
+
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
552
|
+
cover?: boolean;
|
|
553
|
+
}): Promise<void>;
|
|
551
554
|
/**
|
|
552
555
|
* 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
|
|
553
556
|
* 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
|
|
@@ -191,7 +191,7 @@ var BookingTicketImpl = class extends import_BaseSales.BaseSalesImpl {
|
|
|
191
191
|
throw new Error("openData 模块未初始化");
|
|
192
192
|
const businessCode = this.getBookingTicketBusinessCode();
|
|
193
193
|
if (!businessCode) {
|
|
194
|
-
console.warn("[BookingTicket] businessCode 缺失,跳过 OpenData
|
|
194
|
+
console.warn("[BookingTicket] businessCode 缺失,跳过 OpenData 配置加载,当前 module name: ", this.name);
|
|
195
195
|
return null;
|
|
196
196
|
}
|
|
197
197
|
const lastFetchedAt = this.store.openData.getLastFetchedAt();
|
|
@@ -1495,6 +1495,12 @@ var BookingTicketImpl = class extends import_BaseSales.BaseSalesImpl {
|
|
|
1495
1495
|
}
|
|
1496
1496
|
return result;
|
|
1497
1497
|
}
|
|
1498
|
+
async setOtherParams(params, { cover = false } = {}) {
|
|
1499
|
+
super.setOtherParams(params, { cover });
|
|
1500
|
+
if (params == null ? void 0 : params.businessCode) {
|
|
1501
|
+
await this.configureIdGeneratorFromOpenData();
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1498
1504
|
/**
|
|
1499
1505
|
* 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
|
|
1500
1506
|
* 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
|