@pisell/pisellos 2.3.44 → 2.3.45
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/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +11 -40
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +2 -4
- package/dist/modules/Order/index.js +25 -54
- package/dist/modules/Order/types.d.ts +0 -9
- package/dist/modules/Order/utils.d.ts +0 -10
- package/dist/modules/Order/utils.js +3 -35
- package/dist/modules/Product/types.d.ts +0 -1
- package/dist/modules/ProductList/index.js +14 -33
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/Rules/index.js +13 -47
- package/dist/modules/SalesSummary/index.js +13 -12
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/index.js +2 -15
- package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
- package/dist/modules/Schedule/index.d.ts +1 -3
- package/dist/modules/Schedule/index.js +16 -21
- package/dist/modules/Summary/utils.js +13 -38
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/window.d.ts +0 -1
- package/dist/server/index.d.ts +0 -14
- package/dist/server/index.js +657 -772
- package/dist/solution/BaseSales/index.d.ts +0 -7
- package/dist/solution/BaseSales/index.js +42 -64
- package/dist/solution/BookingByStep/index.d.ts +1 -16
- package/dist/solution/BookingByStep/index.js +215 -294
- package/dist/solution/BookingByStep/types.d.ts +1 -2
- package/dist/solution/BookingByStep/types.js +1 -3
- package/dist/solution/BookingByStep/utils/capacity.js +1 -17
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/BookingTicket/index.d.ts +2 -14
- package/dist/solution/BookingTicket/index.js +2 -2
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +14 -26
- package/dist/solution/ScanOrder/index.js +739 -1142
- package/dist/solution/ScanOrder/types.d.ts +1 -21
- package/dist/solution/ScanOrder/utils.d.ts +0 -8
- package/dist/solution/ScanOrder/utils.js +25 -66
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +87 -125
- package/dist/solution/VenueBooking/index.d.ts +11 -39
- package/dist/solution/VenueBooking/index.js +841 -1167
- package/dist/solution/VenueBooking/types.d.ts +0 -3
- package/dist/solution/VenueBooking/utils/resource.js +0 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
- package/dist/solution/index.d.ts +0 -1
- package/dist/solution/index.js +1 -2
- package/dist/types/index.d.ts +0 -1
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +0 -9
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +2 -4
- package/lib/modules/Order/index.js +10 -26
- package/lib/modules/Order/types.d.ts +0 -9
- package/lib/modules/Order/utils.d.ts +0 -10
- package/lib/modules/Order/utils.js +5 -36
- package/lib/modules/Product/types.d.ts +0 -1
- package/lib/modules/ProductList/index.js +31 -40
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/Rules/index.js +16 -33
- package/lib/modules/SalesSummary/index.js +7 -6
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/index.js +1 -13
- package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
- package/lib/modules/Schedule/index.d.ts +1 -3
- package/lib/modules/Schedule/index.js +8 -10
- package/lib/modules/Summary/utils.js +1 -21
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/window.d.ts +0 -1
- package/lib/server/index.d.ts +0 -14
- package/lib/server/index.js +5 -65
- package/lib/solution/BaseSales/index.d.ts +0 -7
- package/lib/solution/BaseSales/index.js +8 -24
- package/lib/solution/BookingByStep/index.d.ts +1 -16
- package/lib/solution/BookingByStep/index.js +18 -60
- package/lib/solution/BookingByStep/types.d.ts +1 -2
- package/lib/solution/BookingByStep/types.js +0 -5
- package/lib/solution/BookingByStep/utils/capacity.js +1 -20
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/BookingTicket/index.d.ts +2 -14
- package/lib/solution/BookingTicket/index.js +2 -10
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/ScanOrder/index.d.ts +14 -26
- package/lib/solution/ScanOrder/index.js +182 -449
- package/lib/solution/ScanOrder/types.d.ts +1 -21
- package/lib/solution/ScanOrder/utils.d.ts +0 -8
- package/lib/solution/ScanOrder/utils.js +0 -31
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +0 -14
- package/lib/solution/VenueBooking/index.d.ts +11 -39
- package/lib/solution/VenueBooking/index.js +110 -322
- package/lib/solution/VenueBooking/types.d.ts +0 -3
- package/lib/solution/VenueBooking/utils/resource.js +0 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
- package/lib/solution/index.d.ts +0 -1
- package/lib/solution/index.js +1 -3
- package/lib/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/modules/Holder/index.d.ts +0 -48
- package/dist/modules/Holder/index.js +0 -640
- package/dist/modules/Holder/types.d.ts +0 -123
- package/dist/modules/Holder/types.js +0 -1
- package/dist/modules/Holder/utils.d.ts +0 -13
- package/dist/modules/Holder/utils.js +0 -34
- package/dist/modules/ResourcePlanner/index.d.ts +0 -24
- package/dist/modules/ResourcePlanner/index.js +0 -181
- package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
- package/dist/modules/ResourcePlanner/planner.js +0 -1069
- package/dist/modules/ResourcePlanner/types.d.ts +0 -227
- package/dist/modules/ResourcePlanner/types.js +0 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/dist/solution/UnifiedBookingSales/index.js +0 -1891
- package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/dist/solution/UnifiedBookingSales/types.js +0 -11
- package/lib/modules/Holder/index.d.ts +0 -48
- package/lib/modules/Holder/index.js +0 -402
- package/lib/modules/Holder/types.d.ts +0 -123
- package/lib/modules/Holder/types.js +0 -17
- package/lib/modules/Holder/utils.d.ts +0 -13
- package/lib/modules/Holder/utils.js +0 -71
- package/lib/modules/ResourcePlanner/index.d.ts +0 -24
- package/lib/modules/ResourcePlanner/index.js +0 -148
- package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
- package/lib/modules/ResourcePlanner/planner.js +0 -933
- package/lib/modules/ResourcePlanner/types.d.ts +0 -227
- package/lib/modules/ResourcePlanner/types.js +0 -17
- package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/lib/solution/UnifiedBookingSales/index.js +0 -1084
- package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/lib/solution/UnifiedBookingSales/types.js +0 -33
|
@@ -400,79 +400,41 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
400
400
|
value: function setProductList(productList) {
|
|
401
401
|
this.store.productList = productList;
|
|
402
402
|
}
|
|
403
|
+
|
|
404
|
+
// 扫码输入code
|
|
403
405
|
}, {
|
|
404
|
-
key: "
|
|
406
|
+
key: "scanCode",
|
|
405
407
|
value: function () {
|
|
406
|
-
var
|
|
407
|
-
var _this$store$discount3;
|
|
408
|
-
var resultDiscountList, currentDiscountList, newDiscountList;
|
|
408
|
+
var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code, customerId) {
|
|
409
|
+
var _this$store$discount3, _this$store$bookingSu2, resultDiscountWithReason, resultDiscountList, unavailableReasonKey, rulesModule, withScanList, currentSelectedDiscountList, _ref2, newProductList, newDiscountList, isAvailable, unavailableReason, _this$options$otherPa6;
|
|
409
410
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
410
411
|
while (1) switch (_context5.prev = _context5.next) {
|
|
411
412
|
case 0:
|
|
412
|
-
_context5.
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
_context5.t0 = _context5.sent;
|
|
416
|
-
if (_context5.t0) {
|
|
417
|
-
_context5.next = 5;
|
|
418
|
-
break;
|
|
419
|
-
}
|
|
420
|
-
_context5.t0 = [];
|
|
421
|
-
case 5:
|
|
422
|
-
resultDiscountList = _context5.t0;
|
|
423
|
-
resultDiscountList = resultDiscountList.map(function (item) {
|
|
424
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
425
|
-
discount_rule_uncheck_flag: true
|
|
426
|
-
});
|
|
427
|
-
});
|
|
428
|
-
currentDiscountList = this.getDiscountList() || [];
|
|
429
|
-
newDiscountList = [].concat(_toConsumableArray(currentDiscountList), _toConsumableArray(resultDiscountList));
|
|
430
|
-
this.setDiscountList(newDiscountList);
|
|
431
|
-
return _context5.abrupt("return", newDiscountList);
|
|
432
|
-
case 11:
|
|
433
|
-
case "end":
|
|
434
|
-
return _context5.stop();
|
|
435
|
-
}
|
|
436
|
-
}, _callee5, this);
|
|
437
|
-
}));
|
|
438
|
-
function batchSearchByProductIds(_x4) {
|
|
439
|
-
return _batchSearchByProductIds.apply(this, arguments);
|
|
440
|
-
}
|
|
441
|
-
return batchSearchByProductIds;
|
|
442
|
-
}() // 扫码输入code
|
|
443
|
-
}, {
|
|
444
|
-
key: "scanCode",
|
|
445
|
-
value: function () {
|
|
446
|
-
var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(code, customerId) {
|
|
447
|
-
var _this$store$discount4, _this$store$bookingSu2, resultDiscountWithReason, resultDiscountList, unavailableReasonKey, rulesModule, withScanList, currentSelectedDiscountList, _ref2, newProductList, newDiscountList, isAvailable, unavailableReason, _this$options$otherPa6;
|
|
448
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
449
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
450
|
-
case 0:
|
|
451
|
-
_context6.prev = 0;
|
|
452
|
-
_context6.next = 3;
|
|
453
|
-
return (_this$store$discount4 = this.store.discount) === null || _this$store$discount4 === void 0 ? void 0 : _this$store$discount4.batchSearch(code, {
|
|
413
|
+
_context5.prev = 0;
|
|
414
|
+
_context5.next = 3;
|
|
415
|
+
return (_this$store$discount3 = this.store.discount) === null || _this$store$discount3 === void 0 ? void 0 : _this$store$discount3.batchSearch(code, {
|
|
454
416
|
customerId: customerId,
|
|
455
417
|
orderId: this.store.orderId
|
|
456
418
|
});
|
|
457
419
|
case 3:
|
|
458
|
-
|
|
459
|
-
if (
|
|
460
|
-
|
|
420
|
+
_context5.t0 = _context5.sent;
|
|
421
|
+
if (_context5.t0) {
|
|
422
|
+
_context5.next = 6;
|
|
461
423
|
break;
|
|
462
424
|
}
|
|
463
|
-
|
|
425
|
+
_context5.t0 = {
|
|
464
426
|
discountList: [],
|
|
465
427
|
unavailableReasonKey: null
|
|
466
428
|
};
|
|
467
429
|
case 6:
|
|
468
|
-
resultDiscountWithReason =
|
|
430
|
+
resultDiscountWithReason = _context5.t0;
|
|
469
431
|
resultDiscountList = resultDiscountWithReason.discountList, unavailableReasonKey = resultDiscountWithReason.unavailableReasonKey;
|
|
470
432
|
rulesModule = this.store.rules;
|
|
471
433
|
if (rulesModule) {
|
|
472
|
-
|
|
434
|
+
_context5.next = 11;
|
|
473
435
|
break;
|
|
474
436
|
}
|
|
475
|
-
return
|
|
437
|
+
return _context5.abrupt("return", {
|
|
476
438
|
type: "clientCalc",
|
|
477
439
|
isAvailable: false,
|
|
478
440
|
productList: this.store.productList || [],
|
|
@@ -481,10 +443,10 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
481
443
|
});
|
|
482
444
|
case 11:
|
|
483
445
|
if (resultDiscountList.length) {
|
|
484
|
-
|
|
446
|
+
_context5.next = 13;
|
|
485
447
|
break;
|
|
486
448
|
}
|
|
487
|
-
return
|
|
449
|
+
return _context5.abrupt("return", {
|
|
488
450
|
type: "server",
|
|
489
451
|
isAvailable: false,
|
|
490
452
|
productList: this.store.productList || [],
|
|
@@ -505,10 +467,10 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
505
467
|
return m.id === n.id;
|
|
506
468
|
});
|
|
507
469
|
}))) {
|
|
508
|
-
|
|
470
|
+
_context5.next = 17;
|
|
509
471
|
break;
|
|
510
472
|
}
|
|
511
|
-
return
|
|
473
|
+
return _context5.abrupt("return", {
|
|
512
474
|
type: "clientCalc",
|
|
513
475
|
isAvailable: true,
|
|
514
476
|
productList: this.store.productList || [],
|
|
@@ -528,20 +490,20 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
528
490
|
discountList: this.getDiscountList()
|
|
529
491
|
}, newProductList = _ref2.productList, newDiscountList = _ref2.discountList, isAvailable = _ref2.isAvailable, unavailableReason = _ref2.unavailableReason;
|
|
530
492
|
if (!isAvailable) {
|
|
531
|
-
|
|
493
|
+
_context5.next = 25;
|
|
532
494
|
break;
|
|
533
495
|
}
|
|
534
496
|
this.setDiscountList(newDiscountList || []);
|
|
535
497
|
this.store.originalDiscountList = newDiscountList || [];
|
|
536
498
|
this.setProductList(newProductList || []);
|
|
537
499
|
if (!(this.isWalkIn() && resultDiscountList.length && ((_this$options$otherPa6 = this.options.otherParams) === null || _this$options$otherPa6 === void 0 ? void 0 : _this$options$otherPa6.platform) === 'shop' && !((resultDiscountList[0].customer_id || 1) === 1))) {
|
|
538
|
-
|
|
500
|
+
_context5.next = 25;
|
|
539
501
|
break;
|
|
540
502
|
}
|
|
541
|
-
|
|
503
|
+
_context5.next = 25;
|
|
542
504
|
return this.getCustomerWallet(resultDiscountList[0].customer_id);
|
|
543
505
|
case 25:
|
|
544
|
-
return
|
|
506
|
+
return _context5.abrupt("return", {
|
|
545
507
|
type: "clientCalc",
|
|
546
508
|
isAvailable: isAvailable || false,
|
|
547
509
|
productList: newProductList || this.store.productList || [],
|
|
@@ -549,10 +511,10 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
549
511
|
unavailableReason: unavailableReason
|
|
550
512
|
});
|
|
551
513
|
case 28:
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
console.error('[ShopDiscount] 扫码出错:',
|
|
555
|
-
return
|
|
514
|
+
_context5.prev = 28;
|
|
515
|
+
_context5.t1 = _context5["catch"](0);
|
|
516
|
+
console.error('[ShopDiscount] 扫码出错:', _context5.t1);
|
|
517
|
+
return _context5.abrupt("return", {
|
|
556
518
|
type: "clientCalc",
|
|
557
519
|
isAvailable: false,
|
|
558
520
|
productList: this.store.productList || [],
|
|
@@ -561,11 +523,11 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
561
523
|
});
|
|
562
524
|
case 32:
|
|
563
525
|
case "end":
|
|
564
|
-
return
|
|
526
|
+
return _context5.stop();
|
|
565
527
|
}
|
|
566
|
-
},
|
|
528
|
+
}, _callee5, this, [[0, 28]]);
|
|
567
529
|
}));
|
|
568
|
-
function scanCode(
|
|
530
|
+
function scanCode(_x4, _x5) {
|
|
569
531
|
return _scanCode.apply(this, arguments);
|
|
570
532
|
}
|
|
571
533
|
return scanCode;
|
|
@@ -573,8 +535,8 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
573
535
|
}, {
|
|
574
536
|
key: "calcDiscountApplicableProductTotalPrice",
|
|
575
537
|
value: function calcDiscountApplicableProductTotalPrice(discount) {
|
|
576
|
-
var _this$store$
|
|
577
|
-
return (_this$store$
|
|
538
|
+
var _this$store$discount4;
|
|
539
|
+
return (_this$store$discount4 = this.store.discount) === null || _this$store$discount4 === void 0 ? void 0 : _this$store$discount4.calcDiscountApplicableProductTotalPrice(discount);
|
|
578
540
|
}
|
|
579
541
|
|
|
580
542
|
// =========== 私有辅助方法 ===========
|
|
@@ -598,19 +560,19 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
598
560
|
}, {
|
|
599
561
|
key: "emitDiscountListChange",
|
|
600
562
|
value: function () {
|
|
601
|
-
var _emitDiscountListChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
602
|
-
return _regeneratorRuntime().wrap(function
|
|
603
|
-
while (1) switch (
|
|
563
|
+
var _emitDiscountListChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(discountList) {
|
|
564
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
565
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
604
566
|
case 0:
|
|
605
|
-
|
|
567
|
+
_context6.next = 2;
|
|
606
568
|
return this.core.effects.emit("".concat(this.name, ":onDiscountListChange"), discountList);
|
|
607
569
|
case 2:
|
|
608
570
|
case "end":
|
|
609
|
-
return
|
|
571
|
+
return _context6.stop();
|
|
610
572
|
}
|
|
611
|
-
},
|
|
573
|
+
}, _callee6, this);
|
|
612
574
|
}));
|
|
613
|
-
function emitDiscountListChange(
|
|
575
|
+
function emitDiscountListChange(_x6) {
|
|
614
576
|
return _emitDiscountListChange.apply(this, arguments);
|
|
615
577
|
}
|
|
616
578
|
return emitDiscountListChange;
|
|
@@ -619,7 +581,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
619
581
|
key: "setDiscountList",
|
|
620
582
|
value: function setDiscountList(discountList) {
|
|
621
583
|
var _this3 = this,
|
|
622
|
-
_this$store$
|
|
584
|
+
_this$store$discount5;
|
|
623
585
|
var productList = this.store.productList || [];
|
|
624
586
|
var editModeDiscountList = [];
|
|
625
587
|
productList.forEach(function (item) {
|
|
@@ -702,7 +664,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
702
664
|
item.isDisabledForProductUsed = false;
|
|
703
665
|
}
|
|
704
666
|
});
|
|
705
|
-
(_this$store$
|
|
667
|
+
(_this$store$discount5 = this.store.discount) === null || _this$store$discount5 === void 0 || _this$store$discount5.setDiscountList(newDiscountList);
|
|
706
668
|
this.emitDiscountListChange(newDiscountList);
|
|
707
669
|
return newDiscountList;
|
|
708
670
|
}
|
|
@@ -711,48 +673,48 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
711
673
|
}, {
|
|
712
674
|
key: "getDiscountList",
|
|
713
675
|
value: function getDiscountList() {
|
|
714
|
-
var _this$store$
|
|
715
|
-
return ((_this$store$
|
|
676
|
+
var _this$store$discount6;
|
|
677
|
+
return ((_this$store$discount6 = this.store.discount) === null || _this$store$discount6 === void 0 ? void 0 : _this$store$discount6.getDiscountList()) || [];
|
|
716
678
|
}
|
|
717
679
|
|
|
718
680
|
// 获取客户钱包信息
|
|
719
681
|
}, {
|
|
720
682
|
key: "getCustomerWallet",
|
|
721
683
|
value: function () {
|
|
722
|
-
var _getCustomerWallet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
684
|
+
var _getCustomerWallet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(id) {
|
|
723
685
|
var _result, customer;
|
|
724
|
-
return _regeneratorRuntime().wrap(function
|
|
725
|
-
while (1) switch (
|
|
686
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
687
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
726
688
|
case 0:
|
|
727
|
-
|
|
728
|
-
|
|
689
|
+
_context7.prev = 0;
|
|
690
|
+
_context7.next = 3;
|
|
729
691
|
return this.request.get("/customer/info/".concat(id), {
|
|
730
692
|
with_trashed: 1
|
|
731
693
|
});
|
|
732
694
|
case 3:
|
|
733
|
-
_result =
|
|
695
|
+
_result = _context7.sent;
|
|
734
696
|
if (!(_result !== null && _result !== void 0 && _result.data)) {
|
|
735
|
-
|
|
697
|
+
_context7.next = 9;
|
|
736
698
|
break;
|
|
737
699
|
}
|
|
738
700
|
customer = Object.assign({}, (_objectDestructuringEmpty(_result.data), _result.data));
|
|
739
701
|
this.setCustomer(customer);
|
|
740
|
-
|
|
702
|
+
_context7.next = 9;
|
|
741
703
|
return this.core.effects.emit("".concat(this.name, ":onScanCustomerChange"), customer);
|
|
742
704
|
case 9:
|
|
743
|
-
|
|
705
|
+
_context7.next = 14;
|
|
744
706
|
break;
|
|
745
707
|
case 11:
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
console.error('[ShopDiscount] 获取客户钱包信息出错:',
|
|
708
|
+
_context7.prev = 11;
|
|
709
|
+
_context7.t0 = _context7["catch"](0);
|
|
710
|
+
console.error('[ShopDiscount] 获取客户钱包信息出错:', _context7.t0);
|
|
749
711
|
case 14:
|
|
750
712
|
case "end":
|
|
751
|
-
return
|
|
713
|
+
return _context7.stop();
|
|
752
714
|
}
|
|
753
|
-
},
|
|
715
|
+
}, _callee7, this, [[0, 11]]);
|
|
754
716
|
}));
|
|
755
|
-
function getCustomerWallet(
|
|
717
|
+
function getCustomerWallet(_x7) {
|
|
756
718
|
return _getCustomerWallet.apply(this, arguments);
|
|
757
719
|
}
|
|
758
720
|
return getCustomerWallet;
|
|
@@ -760,32 +722,32 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
760
722
|
}, {
|
|
761
723
|
key: "bestDiscount",
|
|
762
724
|
value: function () {
|
|
763
|
-
var _bestDiscount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
725
|
+
var _bestDiscount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(cb) {
|
|
764
726
|
var _this$store$productLi;
|
|
765
727
|
var newDiscountList, _result2;
|
|
766
|
-
return _regeneratorRuntime().wrap(function
|
|
767
|
-
while (1) switch (
|
|
728
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
729
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
768
730
|
case 0:
|
|
769
731
|
newDiscountList = this.store.originalDiscountList;
|
|
770
732
|
this.setDiscountList(newDiscountList);
|
|
771
733
|
if (!((_this$store$productLi = this.store.productList) !== null && _this$store$productLi !== void 0 && _this$store$productLi.length)) {
|
|
772
|
-
|
|
734
|
+
_context8.next = 7;
|
|
773
735
|
break;
|
|
774
736
|
}
|
|
775
737
|
_result2 = this.calcDiscount(this.store.productList);
|
|
776
738
|
cb === null || cb === void 0 || cb(_result2);
|
|
777
|
-
|
|
739
|
+
_context8.next = 7;
|
|
778
740
|
return this.core.effects.emit("".concat(this.name, ":onLoadPrepareCalcResult"), _result2);
|
|
779
741
|
case 7:
|
|
780
|
-
|
|
742
|
+
_context8.next = 9;
|
|
781
743
|
return this.core.effects.emit("".concat(this.name, ":onLoadDiscountList"), newDiscountList);
|
|
782
744
|
case 9:
|
|
783
745
|
case "end":
|
|
784
|
-
return
|
|
746
|
+
return _context8.stop();
|
|
785
747
|
}
|
|
786
|
-
},
|
|
748
|
+
}, _callee8, this);
|
|
787
749
|
}));
|
|
788
|
-
function bestDiscount(
|
|
750
|
+
function bestDiscount(_x8) {
|
|
789
751
|
return _bestDiscount.apply(this, arguments);
|
|
790
752
|
}
|
|
791
753
|
return bestDiscount;
|
|
@@ -793,18 +755,18 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
793
755
|
}, {
|
|
794
756
|
key: "loadPrepareConfig",
|
|
795
757
|
value: function () {
|
|
796
|
-
var _loadPrepareConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
797
|
-
var _this$getCustomer2, _this$store$
|
|
798
|
-
return _regeneratorRuntime().wrap(function
|
|
799
|
-
while (1) switch (
|
|
758
|
+
var _loadPrepareConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params) {
|
|
759
|
+
var _this$getCustomer2, _this$store$discount7, _this$getDiscountList, _this$store$discount8, _this$store$productLi2, orderId, customerId, prepareConfigResult, goodPassList, scanDiscount, scanDiscountIds, newGoodPassList, newDiscountList, filteredDiscountList, _result3;
|
|
760
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
761
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
800
762
|
case 0:
|
|
801
|
-
|
|
763
|
+
_context9.prev = 0;
|
|
802
764
|
orderId = this.store.orderId;
|
|
803
765
|
customerId = params.customerId || ((_this$getCustomer2 = this.getCustomer()) === null || _this$getCustomer2 === void 0 ? void 0 : _this$getCustomer2.id); // if (customerId === 1 || !customerId) {
|
|
804
766
|
// return
|
|
805
767
|
// }
|
|
806
|
-
|
|
807
|
-
return (_this$store$
|
|
768
|
+
_context9.next = 5;
|
|
769
|
+
return (_this$store$discount7 = this.store.discount) === null || _this$store$discount7 === void 0 ? void 0 : _this$store$discount7.loadPrepareConfig(_objectSpread({
|
|
808
770
|
customer_id: customerId,
|
|
809
771
|
action: orderId ? 'edit' : 'create',
|
|
810
772
|
with_good_pass: 1,
|
|
@@ -815,7 +777,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
815
777
|
order_id: orderId
|
|
816
778
|
} : {}));
|
|
817
779
|
case 5:
|
|
818
|
-
prepareConfigResult =
|
|
780
|
+
prepareConfigResult = _context9.sent;
|
|
819
781
|
goodPassList = (prepareConfigResult === null || prepareConfigResult === void 0 ? void 0 : prepareConfigResult.discountList) || [];
|
|
820
782
|
scanDiscount = (_this$getDiscountList = this.getDiscountList()) === null || _this$getDiscountList === void 0 ? void 0 : _this$getDiscountList.filter(function (item) {
|
|
821
783
|
return item.isScan;
|
|
@@ -828,37 +790,37 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
828
790
|
});
|
|
829
791
|
newDiscountList = [].concat(_toConsumableArray(scanDiscount), _toConsumableArray(newGoodPassList || [])); // 存储原始优惠券列表
|
|
830
792
|
this.store.originalDiscountList = newDiscountList;
|
|
831
|
-
|
|
832
|
-
return (_this$store$
|
|
793
|
+
_context9.next = 14;
|
|
794
|
+
return (_this$store$discount8 = this.store.discount) === null || _this$store$discount8 === void 0 ? void 0 : _this$store$discount8.setOriginalDiscountList(newDiscountList);
|
|
833
795
|
case 14:
|
|
834
796
|
// 根据当前预约时间过滤优惠券列表
|
|
835
797
|
filteredDiscountList = this.filterDiscountListByBookingTime(newDiscountList, this.store.currentBookingTime);
|
|
836
798
|
this.store.filteredDiscountList = filteredDiscountList;
|
|
837
799
|
this.setDiscountList(filteredDiscountList || []);
|
|
838
800
|
if (!((_this$store$productLi2 = this.store.productList) !== null && _this$store$productLi2 !== void 0 && _this$store$productLi2.length)) {
|
|
839
|
-
|
|
801
|
+
_context9.next = 21;
|
|
840
802
|
break;
|
|
841
803
|
}
|
|
842
804
|
_result3 = this.calcDiscount(this.store.productList);
|
|
843
|
-
|
|
805
|
+
_context9.next = 21;
|
|
844
806
|
return this.core.effects.emit("".concat(this.name, ":onLoadPrepareCalcResult"), _result3);
|
|
845
807
|
case 21:
|
|
846
|
-
|
|
808
|
+
_context9.next = 23;
|
|
847
809
|
return this.core.effects.emit("".concat(this.name, ":onLoadDiscountList"), filteredDiscountList);
|
|
848
810
|
case 23:
|
|
849
|
-
|
|
811
|
+
_context9.next = 28;
|
|
850
812
|
break;
|
|
851
813
|
case 25:
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
console.error('[ShopDiscount] 加载准备配置出错:',
|
|
814
|
+
_context9.prev = 25;
|
|
815
|
+
_context9.t0 = _context9["catch"](0);
|
|
816
|
+
console.error('[ShopDiscount] 加载准备配置出错:', _context9.t0);
|
|
855
817
|
case 28:
|
|
856
818
|
case "end":
|
|
857
|
-
return
|
|
819
|
+
return _context9.stop();
|
|
858
820
|
}
|
|
859
|
-
},
|
|
821
|
+
}, _callee9, this, [[0, 25]]);
|
|
860
822
|
}));
|
|
861
|
-
function loadPrepareConfig(
|
|
823
|
+
function loadPrepareConfig(_x9) {
|
|
862
824
|
return _loadPrepareConfig.apply(this, arguments);
|
|
863
825
|
}
|
|
864
826
|
return loadPrepareConfig;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
|
-
import {
|
|
3
|
-
import { VenueBookingAddLogParams, VenueBookingSlotConfig,
|
|
2
|
+
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { VenueBookingAddLogParams, VenueBookingSlotConfig, VenueDateSummaryItem, VenueSlotSelection, VenueTimeSlotGrid } from './types';
|
|
4
4
|
import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity } from '../ScanOrder/types';
|
|
5
5
|
import type { UpdateOrderProductParams } from '../../modules/Order/types';
|
|
6
6
|
import type { OpenDataAvailabilityResult } from '../../modules/OpenData';
|
|
7
|
-
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
8
7
|
import type { ProductData } from '../../modules/Product/types';
|
|
9
8
|
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
10
9
|
import type { StrategyConfig } from '../../model/strategy/type';
|
|
11
|
-
import type { IAppendFormRecordParams, IRefreshAllFormRecordsParams } from '../../modules/Holder/types';
|
|
12
10
|
export * from './types';
|
|
13
11
|
interface VenueBookingItemRuleRuntimeConfig {
|
|
14
12
|
strategyConfigs?: StrategyConfig[];
|
|
@@ -18,16 +16,16 @@ interface VenueBookingItemRuleRuntimeConfig {
|
|
|
18
16
|
submissionIndex?: number;
|
|
19
17
|
custom?: Record<string, any>;
|
|
20
18
|
}
|
|
21
|
-
export declare class VenueBookingImpl extends
|
|
19
|
+
export declare class VenueBookingImpl extends BaseModule implements Module {
|
|
22
20
|
protected defaultName: string;
|
|
23
21
|
protected defaultVersion: string;
|
|
24
22
|
isSolution: boolean;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
window
|
|
30
|
-
request
|
|
23
|
+
private initializeOptions;
|
|
24
|
+
private store;
|
|
25
|
+
private otherParams;
|
|
26
|
+
private cacheId;
|
|
27
|
+
private window;
|
|
28
|
+
private request;
|
|
31
29
|
private baseSlotConfig;
|
|
32
30
|
private itemRuleEvaluator;
|
|
33
31
|
private itemRuleConfigs;
|
|
@@ -52,19 +50,8 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
52
50
|
private logMethodError;
|
|
53
51
|
addLog(params: VenueBookingAddLogParams): Promise<void>;
|
|
54
52
|
constructor(name?: string, version?: string);
|
|
55
|
-
protected getRegisteredModuleNames(): readonly string[];
|
|
56
|
-
protected createSubModule(moduleName: string): Module | null;
|
|
57
|
-
private attachProductOriginToTempOrder;
|
|
58
|
-
private readProductOriginFromTempOrder;
|
|
59
|
-
private normalizeVenueProductTitle;
|
|
60
53
|
private normalizeCustomerId;
|
|
61
54
|
private resolveCustomerIdFromLoginPayload;
|
|
62
|
-
private resolveHolderCustomerId;
|
|
63
|
-
/**
|
|
64
|
-
* 按商品 holder_config 预加载表单数据到 holderMap。
|
|
65
|
-
* appointment_booking 在加购时触发;venueBooking 在商品加载后预加载,避免 getHolderFormMap 为空。
|
|
66
|
-
*/
|
|
67
|
-
private preloadHolderForms;
|
|
68
55
|
private clearLoginEffectListeners;
|
|
69
56
|
private registerLoginEffect;
|
|
70
57
|
private registerCustomerLoginListeners;
|
|
@@ -157,10 +144,8 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
157
144
|
getScheduleListByIds(ids: number[]): import("../../server").ScheduleItem[];
|
|
158
145
|
getTempOrder(): import("../../modules/Order/types").OrderTempOrder | null;
|
|
159
146
|
updateTempOrderNote(note: string): string;
|
|
160
|
-
updateTempOrderNote(note: string, sync: true): Promise<string>;
|
|
161
|
-
updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
|
|
162
147
|
updateTempOrderContactsInfo(contactsInfo: any[]): Record<string, any> | null;
|
|
163
|
-
private
|
|
148
|
+
private ensureTempOrder;
|
|
164
149
|
onCustomerLogin(params: {
|
|
165
150
|
customerId: number;
|
|
166
151
|
}): Promise<void>;
|
|
@@ -180,7 +165,7 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
180
165
|
setDiscountSelected(params: {
|
|
181
166
|
discountId: number;
|
|
182
167
|
isSelected: boolean;
|
|
183
|
-
}): Promise<
|
|
168
|
+
}): Promise<import("../../modules/Discount").Discount[]>;
|
|
184
169
|
addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
185
170
|
getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
|
|
186
171
|
getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
|
|
@@ -210,19 +195,6 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
210
195
|
setUIState(key: string, value: any): void;
|
|
211
196
|
getUIState<T = any>(key: string): T | undefined;
|
|
212
197
|
deleteUIState(key: string): void;
|
|
213
|
-
setBookingHolder(bookingUid: string, holder: any): void;
|
|
214
|
-
/**
|
|
215
|
-
* 获取 holder 表单 map
|
|
216
|
-
*/
|
|
217
|
-
getHolderFormMap(): import("../../modules/Holder").HolderFormMap;
|
|
218
|
-
/**
|
|
219
|
-
* UI 层触发:按当前 holderMap 批量刷新所有表单的 records
|
|
220
|
-
*/
|
|
221
|
-
refreshAllHolderFormRecords(params?: Pick<IRefreshAllFormRecordsParams, 'customer_id' | 'useCache' | 'recordsUrl' | 'num' | 'skip'>): Promise<import("../../modules/Holder").HolderFormMap>;
|
|
222
|
-
/**
|
|
223
|
-
* 添加表单记录
|
|
224
|
-
*/
|
|
225
|
-
appendFormRecord(params: IAppendFormRecordParams): import("../../modules/Holder").IFormRecord;
|
|
226
198
|
checkOpenDataAvailability(): Promise<OpenDataAvailabilityResult>;
|
|
227
199
|
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
228
200
|
cover?: boolean;
|