@pisell/pisellos 2.3.66 → 2.3.68

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.
Files changed (47) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  2. package/dist/modules/BaseModule.d.ts +1 -0
  3. package/dist/modules/BaseModule.js +24 -28
  4. package/dist/modules/Order/index.d.ts +22 -2
  5. package/dist/modules/Order/index.js +313 -142
  6. package/dist/modules/Order/types.d.ts +13 -1
  7. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  8. package/dist/modules/Order/utils/orderCollectionIdentity.js +75 -0
  9. package/dist/modules/Order/utils.js +0 -1
  10. package/dist/modules/Payment/index.d.ts +4 -0
  11. package/dist/modules/Payment/index.js +14 -4
  12. package/dist/modules/Payment/walletpass.js +21 -7
  13. package/dist/modules/Rules/index.js +46 -31
  14. package/dist/solution/BaseSales/index.d.ts +3 -1
  15. package/dist/solution/BaseSales/index.js +99 -82
  16. package/dist/solution/BaseSales/utils.js +31 -20
  17. package/dist/solution/BookingByStep/index.d.ts +1 -1
  18. package/dist/solution/BookingTicket/index.d.ts +4 -2
  19. package/dist/solution/BookingTicket/index.js +89 -65
  20. package/dist/solution/ScanOrder/utils.js +31 -20
  21. package/dist/solution/UnifiedBookingSales/index.d.ts +25 -0
  22. package/dist/solution/UnifiedBookingSales/index.js +640 -321
  23. package/dist/solution/UnifiedBookingSales/types.d.ts +7 -0
  24. package/lib/model/strategy/adapter/promotion/index.js +0 -51
  25. package/lib/modules/BaseModule.d.ts +1 -0
  26. package/lib/modules/BaseModule.js +24 -37
  27. package/lib/modules/Order/index.d.ts +22 -2
  28. package/lib/modules/Order/index.js +212 -54
  29. package/lib/modules/Order/types.d.ts +13 -1
  30. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  31. package/lib/modules/Order/utils/orderCollectionIdentity.js +70 -0
  32. package/lib/modules/Order/utils.js +0 -1
  33. package/lib/modules/Payment/index.d.ts +4 -0
  34. package/lib/modules/Payment/index.js +7 -0
  35. package/lib/modules/Payment/walletpass.js +12 -0
  36. package/lib/modules/Rules/index.js +17 -1
  37. package/lib/solution/BaseSales/index.d.ts +3 -1
  38. package/lib/solution/BaseSales/index.js +29 -16
  39. package/lib/solution/BaseSales/utils.js +29 -18
  40. package/lib/solution/BookingByStep/index.d.ts +1 -1
  41. package/lib/solution/BookingTicket/index.d.ts +4 -2
  42. package/lib/solution/BookingTicket/index.js +35 -12
  43. package/lib/solution/ScanOrder/utils.js +29 -18
  44. package/lib/solution/UnifiedBookingSales/index.d.ts +25 -0
  45. package/lib/solution/UnifiedBookingSales/index.js +188 -0
  46. package/lib/solution/UnifiedBookingSales/types.d.ts +7 -0
  47. package/package.json +1 -1
@@ -669,7 +669,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
669
669
  }, {
670
670
  key: "hydrateLatestLoadedSalesDetail",
671
671
  value: function () {
672
- var _hydrateLatestLoadedSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(record, loadSequence) {
672
+ var _hydrateLatestLoadedSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(record, loadSequence, hydrateSource) {
673
673
  var _this4 = this;
674
674
  var hydratedSales, skippedBeforeHydrate, hydrateTask, queuedTask;
675
675
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
@@ -697,7 +697,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
697
697
  throw new Error('order 模块未初始化');
698
698
  case 5:
699
699
  _context4.next = 7;
700
- return _this4.store.order.hydrateTempOrderFromRecord(record, {
700
+ return _this4.store.order.hydrateTempOrderFromRecord(record, hydrateSource === 'sessionStorage' ? {
701
+ recalcOnHydrate: true,
702
+ source: 'sessionStorage'
703
+ } : {
701
704
  recalcOnHydrate: false
702
705
  });
703
706
  case 7:
@@ -748,7 +751,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
748
751
  }
749
752
  }, _callee5, this);
750
753
  }));
751
- function hydrateLatestLoadedSalesDetail(_x2, _x3) {
754
+ function hydrateLatestLoadedSalesDetail(_x2, _x3, _x4) {
752
755
  return _hydrateLatestLoadedSalesDetail.apply(this, arguments);
753
756
  }
754
757
  return hydrateLatestLoadedSalesDetail;
@@ -851,7 +854,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
851
854
  }
852
855
  }, _callee6, this);
853
856
  }));
854
- function loadQuotationForPriceQuery(_x4) {
857
+ function loadQuotationForPriceQuery(_x5) {
855
858
  return _loadQuotationForPriceQuery.apply(this, arguments);
856
859
  }
857
860
  return loadQuotationForPriceQuery;
@@ -994,7 +997,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
994
997
  }
995
998
  }, _callee7, this, [[6, 17]]);
996
999
  }));
997
- function loadProductsForPriceQuery(_x5) {
1000
+ function loadProductsForPriceQuery(_x6) {
998
1001
  return _loadProductsForPriceQuery.apply(this, arguments);
999
1002
  }
1000
1003
  return loadProductsForPriceQuery;
@@ -1032,7 +1035,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1032
1035
  }
1033
1036
  }, _callee8, this);
1034
1037
  }));
1035
- function loadProductForPriceQuery(_x6, _x7) {
1038
+ function loadProductForPriceQuery(_x7, _x8) {
1036
1039
  return _loadProductForPriceQuery.apply(this, arguments);
1037
1040
  }
1038
1041
  return loadProductForPriceQuery;
@@ -1170,13 +1173,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1170
1173
  * const params = this.buildSubModuleOtherParams();
1171
1174
  * this.core.registerModule(orderModule, { otherParams: params });
1172
1175
  */
1176
+ }, {
1177
+ key: "isSessionStoragePersistEnabled",
1178
+ value: function isSessionStoragePersistEnabled() {
1179
+ return Boolean(this.cacheId);
1180
+ }
1181
+ }, {
1182
+ key: "shouldUseSessionStorageForSubModule",
1183
+ value: function shouldUseSessionStorageForSubModule(_moduleName) {
1184
+ return this.isSessionStoragePersistEnabled();
1185
+ }
1173
1186
  }, {
1174
1187
  key: "buildSubModuleOtherParams",
1175
- value: function buildSubModuleOtherParams() {
1188
+ value: function buildSubModuleOtherParams(moduleName) {
1176
1189
  return _objectSpread(_objectSpread({}, this.otherParams), {}, {
1177
1190
  salesSummaryModuleName: "".concat(this.name, "_salesSummary"),
1178
1191
  fatherModule: this.name,
1179
- openCache: this.cacheId ? true : false,
1192
+ openCache: this.shouldUseSessionStorageForSubModule(moduleName),
1180
1193
  cacheId: this.cacheId
1181
1194
  });
1182
1195
  }
@@ -1195,17 +1208,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1195
1208
  var _ref23,
1196
1209
  _ref23$cover,
1197
1210
  cover,
1198
- nextSubModuleOtherParams,
1199
1211
  _args10 = arguments;
1200
1212
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
1201
1213
  while (1) switch (_context10.prev = _context10.next) {
1202
1214
  case 0:
1203
1215
  _ref23 = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {}, _ref23$cover = _ref23.cover, cover = _ref23$cover === void 0 ? false : _ref23$cover;
1204
- nextSubModuleOtherParams = this.buildSubModuleOtherParams();
1205
- _context10.next = 4;
1216
+ _context10.next = 3;
1206
1217
  return Promise.all(Object.entries(this.store).map( /*#__PURE__*/function () {
1207
1218
  var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_ref24) {
1208
- var _ref26, moduleName, subModule, targetModule;
1219
+ var _ref26, moduleName, subModule, targetModule, nextSubModuleOtherParams;
1209
1220
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1210
1221
  while (1) switch (_context9.prev = _context9.next) {
1211
1222
  case 0:
@@ -1223,28 +1234,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1223
1234
  }
1224
1235
  return _context9.abrupt("return");
1225
1236
  case 6:
1226
- _context9.next = 8;
1237
+ nextSubModuleOtherParams = _this6.buildSubModuleOtherParams(moduleName);
1238
+ _context9.next = 9;
1227
1239
  return targetModule.updateOtherParams(nextSubModuleOtherParams, {
1228
1240
  changedParams: changedParams,
1229
1241
  cover: cover
1230
1242
  });
1231
- case 8:
1243
+ case 9:
1232
1244
  case "end":
1233
1245
  return _context9.stop();
1234
1246
  }
1235
1247
  }, _callee9);
1236
1248
  }));
1237
- return function (_x9) {
1249
+ return function (_x10) {
1238
1250
  return _ref25.apply(this, arguments);
1239
1251
  };
1240
1252
  }()));
1241
- case 4:
1253
+ case 3:
1242
1254
  case "end":
1243
1255
  return _context10.stop();
1244
1256
  }
1245
1257
  }, _callee10, this);
1246
1258
  }));
1247
- function syncOtherParamsToSubModules(_x8) {
1259
+ function syncOtherParamsToSubModules(_x9) {
1248
1260
  return _syncOtherParamsToSubModules.apply(this, arguments);
1249
1261
  }
1250
1262
  return syncOtherParamsToSubModules;
@@ -1257,12 +1269,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1257
1269
  }, {
1258
1270
  key: "readSessionCacheData",
1259
1271
  value: function readSessionCacheData() {
1260
- if (!this.cacheId || !this.window) return {};
1272
+ var cacheId = this.cacheId;
1273
+ if (!cacheId || !this.isSessionStoragePersistEnabled() || !this.window) {
1274
+ return {};
1275
+ }
1261
1276
  try {
1262
1277
  var sessionData = this.window.sessionStorage.getItem(this.name);
1263
1278
  if (!sessionData) return {};
1264
1279
  var data = JSON.parse(sessionData);
1265
- return data && data[this.cacheId] || {};
1280
+ return data && data[cacheId] || {};
1266
1281
  } catch (_unused3) {
1267
1282
  return {};
1268
1283
  }
@@ -1398,11 +1413,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1398
1413
  var hooks = _this9.getSubModuleHooks(step);
1399
1414
  _this9.store[step] = targetModule;
1400
1415
  _this9.core.registerModule(targetModule, _objectSpread(_objectSpread({
1401
- initialState: (targetCacheData === null || targetCacheData === void 0 ? void 0 : targetCacheData[targetModule.name]) || {}
1416
+ initialState: _this9.shouldUseSessionStorageForSubModule(step) ? (targetCacheData === null || targetCacheData === void 0 ? void 0 : targetCacheData[targetModule.name]) || {} : {}
1402
1417
  }, hooks ? {
1403
1418
  hooks: hooks
1404
1419
  } : {}), {}, {
1405
- otherParams: _this9.buildSubModuleOtherParams()
1420
+ otherParams: _this9.buildSubModuleOtherParams(step)
1406
1421
  }));
1407
1422
  });
1408
1423
  if (!(this.store.schedule && !this.isScheduleListLoaded(this.store.schedule))) {
@@ -1426,7 +1441,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1426
1441
  }
1427
1442
  }, _callee11, this);
1428
1443
  }));
1429
- function initialize(_x10) {
1444
+ function initialize(_x11) {
1430
1445
  return _initialize.apply(this, arguments);
1431
1446
  }
1432
1447
  return initialize;
@@ -1484,7 +1499,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1484
1499
  key: "loadSalesDetail",
1485
1500
  value: (function () {
1486
1501
  var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(orderIdOrParams) {
1487
- var loadSequence, _ref27, _ref28, _ref29, _ref30, _params$orderId, params, externalSaleNumber, preloadedSalesDetail, lookup, loadedRecord, message, remoteRecord, currentTempOrder, mergedRecord, record;
1502
+ var loadSequence, _ref27, _ref28, _ref29, _ref30, _params$orderId, params, externalSaleNumber, preloadedSalesDetail, lookup, loadedRecord, message, loadedSalesDetail, shouldFilterPendingPayments, remoteRecord, currentTempOrder, mergedRecord, record;
1488
1503
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1489
1504
  while (1) switch (_context13.prev = _context13.next) {
1490
1505
  case 0:
@@ -1533,42 +1548,44 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1533
1548
  message = loadedRecord && (loadedRecord.message || loadedRecord.msg) || "\u52A0\u8F7D\u9500\u552E\u8BE6\u60C5\u5931\u8D25: ".concat(lookup);
1534
1549
  throw new Error(message);
1535
1550
  case 22:
1536
- remoteRecord = filterPendingPaymentsFromLoadedSalesDetail(preloadedSalesDetail !== null && preloadedSalesDetail !== void 0 ? preloadedSalesDetail : loadedRecord.data);
1551
+ loadedSalesDetail = preloadedSalesDetail !== null && preloadedSalesDetail !== void 0 ? preloadedSalesDetail : loadedRecord.data; // payment_pending 只存在于本地;远端详情需过滤,但会话快照必须完整恢复。
1552
+ shouldFilterPendingPayments = params.hydrateSource !== 'sessionStorage';
1553
+ remoteRecord = shouldFilterPendingPayments ? filterPendingPaymentsFromLoadedSalesDetail(loadedSalesDetail) : loadedSalesDetail;
1537
1554
  currentTempOrder = params.merge ? this.store.order.getTempOrder() : null;
1538
1555
  mergedRecord = params.merge ? mergeSalesDetailRecordWithTempOrder(currentTempOrder, remoteRecord, 'preserve-local') : remoteRecord;
1539
- record = filterPendingPaymentsFromLoadedSalesDetail(mergedRecord);
1540
- _context13.next = 28;
1541
- return this.hydrateLatestLoadedSalesDetail(record, loadSequence);
1542
- case 28:
1556
+ record = shouldFilterPendingPayments ? filterPendingPaymentsFromLoadedSalesDetail(mergedRecord) : mergedRecord;
1557
+ _context13.next = 30;
1558
+ return this.hydrateLatestLoadedSalesDetail(record, loadSequence, params.hydrateSource);
1559
+ case 30:
1543
1560
  return _context13.abrupt("return", _context13.sent);
1544
- case 29:
1545
- _context13.prev = 29;
1561
+ case 31:
1562
+ _context13.prev = 31;
1546
1563
  this.salesDetailLoadInFlightCount = Math.max(0, this.salesDetailLoadInFlightCount - 1);
1547
1564
  if (!(this.salesDetailLoadInFlightCount === 0)) {
1548
- _context13.next = 40;
1565
+ _context13.next = 42;
1549
1566
  break;
1550
1567
  }
1551
- _context13.prev = 32;
1552
- _context13.next = 35;
1568
+ _context13.prev = 34;
1569
+ _context13.next = 37;
1553
1570
  return this.drainQueuedServerOrderChanges();
1554
- case 35:
1555
- _context13.next = 40;
1556
- break;
1557
1571
  case 37:
1558
- _context13.prev = 37;
1559
- _context13.t1 = _context13["catch"](32);
1572
+ _context13.next = 42;
1573
+ break;
1574
+ case 39:
1575
+ _context13.prev = 39;
1576
+ _context13.t1 = _context13["catch"](34);
1560
1577
  this.logError('drain queued server order changes failed', {
1561
1578
  error: _context13.t1 instanceof Error ? _context13.t1.message : String(_context13.t1)
1562
1579
  });
1563
- case 40:
1564
- return _context13.finish(29);
1565
- case 41:
1580
+ case 42:
1581
+ return _context13.finish(31);
1582
+ case 43:
1566
1583
  case "end":
1567
1584
  return _context13.stop();
1568
1585
  }
1569
- }, _callee13, this, [[4,, 29, 41], [32, 37]]);
1586
+ }, _callee13, this, [[4,, 31, 43], [34, 39]]);
1570
1587
  }));
1571
- function loadSalesDetail(_x11) {
1588
+ function loadSalesDetail(_x12) {
1572
1589
  return _loadSalesDetail.apply(this, arguments);
1573
1590
  }
1574
1591
  return loadSalesDetail;
@@ -1675,7 +1692,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1675
1692
  }
1676
1693
  }, _callee14, this);
1677
1694
  }));
1678
- function replaceTempOrder(_x12, _x13) {
1695
+ function replaceTempOrder(_x13, _x14) {
1679
1696
  return _replaceTempOrder.apply(this, arguments);
1680
1697
  }
1681
1698
  return replaceTempOrder;
@@ -2315,7 +2332,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2315
2332
  }
2316
2333
  }, _callee20, this, [[46, 65, 68, 71]]);
2317
2334
  }));
2318
- function loadDiscountConfig(_x14) {
2335
+ function loadDiscountConfig(_x15) {
2319
2336
  return _loadDiscountConfig.apply(this, arguments);
2320
2337
  }
2321
2338
  return loadDiscountConfig;
@@ -2413,7 +2430,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2413
2430
  }
2414
2431
  }, _callee21, this);
2415
2432
  }));
2416
- function bestDiscount(_x15) {
2433
+ function bestDiscount(_x16) {
2417
2434
  return _bestDiscount.apply(this, arguments);
2418
2435
  }
2419
2436
  return bestDiscount;
@@ -2476,7 +2493,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2476
2493
  }
2477
2494
  }, _callee22, this);
2478
2495
  }));
2479
- function replaceDiscountStoreLists(_x16) {
2496
+ function replaceDiscountStoreLists(_x17) {
2480
2497
  return _replaceDiscountStoreLists.apply(this, arguments);
2481
2498
  }
2482
2499
  return replaceDiscountStoreLists;
@@ -2538,7 +2555,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2538
2555
  }
2539
2556
  }, _callee23, this, [[0, 16]]);
2540
2557
  }));
2541
- function scanPromotionCode(_x17, _x18) {
2558
+ function scanPromotionCode(_x18, _x19) {
2542
2559
  return _scanPromotionCode.apply(this, arguments);
2543
2560
  }
2544
2561
  return scanPromotionCode;
@@ -2729,7 +2746,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2729
2746
  }
2730
2747
  }, _callee24, this, [[0, 54], [17, 38, 41, 44]]);
2731
2748
  }));
2732
- function setDiscountSelected(_x19) {
2749
+ function setDiscountSelected(_x20) {
2733
2750
  return _setDiscountSelected.apply(this, arguments);
2734
2751
  }
2735
2752
  return setDiscountSelected;
@@ -2799,7 +2816,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2799
2816
  }
2800
2817
  }, _callee25, this, [[0, 21]]);
2801
2818
  }));
2802
- function applyDiscountCalculationResult(_x20) {
2819
+ function applyDiscountCalculationResult(_x21) {
2803
2820
  return _applyDiscountCalculationResult.apply(this, arguments);
2804
2821
  }
2805
2822
  return applyDiscountCalculationResult;
@@ -2818,7 +2835,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2818
2835
  }
2819
2836
  }, _callee26, this);
2820
2837
  }));
2821
- function submitScanOrder(_x21) {
2838
+ function submitScanOrder(_x22) {
2822
2839
  return _submitScanOrder.apply(this, arguments);
2823
2840
  }
2824
2841
  return submitScanOrder;
@@ -2872,7 +2889,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2872
2889
  }
2873
2890
  }, _callee27, this);
2874
2891
  }));
2875
- function submitSalesOrder(_x22) {
2892
+ function submitSalesOrder(_x23) {
2876
2893
  return _submitSalesOrder.apply(this, arguments);
2877
2894
  }
2878
2895
  return submitSalesOrder;
@@ -2906,7 +2923,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2906
2923
  }
2907
2924
  }, _callee28, this);
2908
2925
  }));
2909
- function saveSalesOrderDraft(_x23) {
2926
+ function saveSalesOrderDraft(_x24) {
2910
2927
  return _saveSalesOrderDraft.apply(this, arguments);
2911
2928
  }
2912
2929
  return saveSalesOrderDraft;
@@ -2953,7 +2970,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2953
2970
  }
2954
2971
  }, _callee29, this);
2955
2972
  }));
2956
- function submitTempOrderAsync(_x24) {
2973
+ function submitTempOrderAsync(_x25) {
2957
2974
  return _submitTempOrderAsync.apply(this, arguments);
2958
2975
  }
2959
2976
  return submitTempOrderAsync;
@@ -3038,7 +3055,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3038
3055
  }
3039
3056
  }, _callee30, this);
3040
3057
  }));
3041
- function printLocalOrderReceipt(_x25) {
3058
+ function printLocalOrderReceipt(_x26) {
3042
3059
  return _printLocalOrderReceipt.apply(this, arguments);
3043
3060
  }
3044
3061
  return printLocalOrderReceipt;
@@ -3152,7 +3169,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3152
3169
  }
3153
3170
  }, _callee31, this, [[12, 29]]);
3154
3171
  }));
3155
- function syncPaymentsToOrder(_x26) {
3172
+ function syncPaymentsToOrder(_x27) {
3156
3173
  return _syncPaymentsToOrder.apply(this, arguments);
3157
3174
  }
3158
3175
  return syncPaymentsToOrder;
@@ -3322,7 +3339,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3322
3339
  }
3323
3340
  }, _callee33, this);
3324
3341
  }));
3325
- function addOrderPaymentAsync(_x27) {
3342
+ function addOrderPaymentAsync(_x28) {
3326
3343
  return _addOrderPaymentAsync.apply(this, arguments);
3327
3344
  }
3328
3345
  return addOrderPaymentAsync;
@@ -3510,7 +3527,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3510
3527
  }
3511
3528
  }, _callee34, this, [[17, 23]]);
3512
3529
  }));
3513
- function updateOrderPayment(_x28, _x29) {
3530
+ function updateOrderPayment(_x29, _x30) {
3514
3531
  return _updateOrderPayment.apply(this, arguments);
3515
3532
  }
3516
3533
  return updateOrderPayment;
@@ -3549,7 +3566,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3549
3566
  }
3550
3567
  }, _callee35, this);
3551
3568
  }));
3552
- function updateVoucherOrderPaymentsAsync(_x30, _x31) {
3569
+ function updateVoucherOrderPaymentsAsync(_x31, _x32) {
3553
3570
  return _updateVoucherOrderPaymentsAsync.apply(this, arguments);
3554
3571
  }
3555
3572
  return updateVoucherOrderPaymentsAsync;
@@ -3715,7 +3732,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3715
3732
  }
3716
3733
  }, _callee36, this);
3717
3734
  }));
3718
- function initWalletData(_x32) {
3735
+ function initWalletData(_x33) {
3719
3736
  return _initWalletData.apply(this, arguments);
3720
3737
  }
3721
3738
  return initWalletData;
@@ -3782,7 +3799,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3782
3799
  }
3783
3800
  }, _callee37, this);
3784
3801
  }));
3785
- function publishWalletAssetsState(_x33) {
3802
+ function publishWalletAssetsState(_x34) {
3786
3803
  return _publishWalletAssetsState.apply(this, arguments);
3787
3804
  }
3788
3805
  return publishWalletAssetsState;
@@ -3863,7 +3880,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3863
3880
  }
3864
3881
  }, _callee38, this);
3865
3882
  }));
3866
- function syncSelectedWalletAssets(_x34) {
3883
+ function syncSelectedWalletAssets(_x35) {
3867
3884
  return _syncSelectedWalletAssets.apply(this, arguments);
3868
3885
  }
3869
3886
  return syncSelectedWalletAssets;
@@ -3919,7 +3936,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3919
3936
  }
3920
3937
  }, _callee39, this);
3921
3938
  }));
3922
- function importWalletAssetsSnapshot(_x35) {
3939
+ function importWalletAssetsSnapshot(_x36) {
3923
3940
  return _importWalletAssetsSnapshot.apply(this, arguments);
3924
3941
  }
3925
3942
  return importWalletAssetsSnapshot;
@@ -4007,7 +4024,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4007
4024
  }
4008
4025
  }, _callee40, this);
4009
4026
  }));
4010
- function refreshWalletAssets(_x36) {
4027
+ function refreshWalletAssets(_x37) {
4011
4028
  return _refreshWalletAssets.apply(this, arguments);
4012
4029
  }
4013
4030
  return refreshWalletAssets;
@@ -4040,7 +4057,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4040
4057
  }
4041
4058
  }, _callee41, this);
4042
4059
  }));
4043
- function selectWalletAsset(_x37) {
4060
+ function selectWalletAsset(_x38) {
4044
4061
  return _selectWalletAsset.apply(this, arguments);
4045
4062
  }
4046
4063
  return selectWalletAsset;
@@ -4070,7 +4087,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4070
4087
  }
4071
4088
  }, _callee42, this);
4072
4089
  }));
4073
- function updateWalletAssetAmount(_x38) {
4090
+ function updateWalletAssetAmount(_x39) {
4074
4091
  return _updateWalletAssetAmount.apply(this, arguments);
4075
4092
  }
4076
4093
  return updateWalletAssetAmount;
@@ -4115,7 +4132,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4115
4132
  }
4116
4133
  }, _callee43, this);
4117
4134
  }));
4118
- function scanWalletAsset(_x39) {
4135
+ function scanWalletAsset(_x40) {
4119
4136
  return _scanWalletAsset.apply(this, arguments);
4120
4137
  }
4121
4138
  return scanWalletAsset;
@@ -4544,7 +4561,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4544
4561
  }
4545
4562
  }, _callee48, this, [[29, 43]]);
4546
4563
  }));
4547
- function payCash(_x40) {
4564
+ function payCash(_x41) {
4548
4565
  return _payCash.apply(this, arguments);
4549
4566
  }
4550
4567
  return payCash;
@@ -4706,7 +4723,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4706
4723
  }
4707
4724
  }, _callee49, this, [[30, 44]]);
4708
4725
  }));
4709
- function commitPaymentMethodPayment(_x41) {
4726
+ function commitPaymentMethodPayment(_x42) {
4710
4727
  return _commitPaymentMethodPayment.apply(this, arguments);
4711
4728
  }
4712
4729
  return commitPaymentMethodPayment;
@@ -4754,7 +4771,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4754
4771
  }
4755
4772
  }, _callee50, this);
4756
4773
  }));
4757
- function roundAmount(_x42) {
4774
+ function roundAmount(_x43) {
4758
4775
  return _roundAmount.apply(this, arguments);
4759
4776
  }
4760
4777
  return roundAmount;
@@ -4811,7 +4828,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4811
4828
  }
4812
4829
  }, _callee51, this);
4813
4830
  }));
4814
- function sendCustomerPayLink(_x43) {
4831
+ function sendCustomerPayLink(_x44) {
4815
4832
  return _sendCustomerPayLink.apply(this, arguments);
4816
4833
  }
4817
4834
  return sendCustomerPayLink;
@@ -4856,7 +4873,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4856
4873
  }
4857
4874
  }, _callee52, this);
4858
4875
  }));
4859
- function calculateProductBookingPrice(_x44) {
4876
+ function calculateProductBookingPrice(_x45) {
4860
4877
  return _calculateProductBookingPrice.apply(this, arguments);
4861
4878
  }
4862
4879
  return calculateProductBookingPrice;
@@ -4985,7 +5002,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4985
5002
  }
4986
5003
  }, _callee53);
4987
5004
  }));
4988
- return function (_x46) {
5005
+ return function (_x47) {
4989
5006
  return _ref40.apply(this, arguments);
4990
5007
  };
4991
5008
  }()));
@@ -5019,7 +5036,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5019
5036
  }
5020
5037
  }, _callee54, this);
5021
5038
  }));
5022
- function calculateProductBookingPrices(_x45) {
5039
+ function calculateProductBookingPrices(_x46) {
5023
5040
  return _calculateProductBookingPrices.apply(this, arguments);
5024
5041
  }
5025
5042
  return calculateProductBookingPrices;
@@ -5054,7 +5071,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5054
5071
  }
5055
5072
  }, _callee55, this, [[0, 9]]);
5056
5073
  }));
5057
- function addProductToOrder(_x47, _x48, _x49) {
5074
+ function addProductToOrder(_x48, _x49, _x50) {
5058
5075
  return _addProductToOrder.apply(this, arguments);
5059
5076
  }
5060
5077
  return addProductToOrder;
@@ -5089,7 +5106,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5089
5106
  }
5090
5107
  }, _callee56, this, [[0, 9]]);
5091
5108
  }));
5092
- function updateOrderProduct(_x50) {
5109
+ function updateOrderProduct(_x51) {
5093
5110
  return _updateOrderProduct.apply(this, arguments);
5094
5111
  }
5095
5112
  return updateOrderProduct;
@@ -5124,7 +5141,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5124
5141
  }
5125
5142
  }, _callee57, this, [[0, 9]]);
5126
5143
  }));
5127
- function updateOrderProducts(_x51) {
5144
+ function updateOrderProducts(_x52) {
5128
5145
  return _updateOrderProducts.apply(this, arguments);
5129
5146
  }
5130
5147
  return updateOrderProducts;
@@ -5159,7 +5176,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5159
5176
  }
5160
5177
  }, _callee58, this, [[0, 9]]);
5161
5178
  }));
5162
- function updateOrderProductQuantity(_x52) {
5179
+ function updateOrderProductQuantity(_x53) {
5163
5180
  return _updateOrderProductQuantity.apply(this, arguments);
5164
5181
  }
5165
5182
  return updateOrderProductQuantity;
@@ -5217,7 +5234,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5217
5234
  }
5218
5235
  }, _callee59, this, [[0, 11]]);
5219
5236
  }));
5220
- function setOrderProductLineNote(_x53, _x54) {
5237
+ function setOrderProductLineNote(_x54, _x55) {
5221
5238
  return _setOrderProductLineNote.apply(this, arguments);
5222
5239
  }
5223
5240
  return setOrderProductLineNote;
@@ -5257,7 +5274,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5257
5274
  }
5258
5275
  }, _callee60, this, [[0, 8]]);
5259
5276
  }));
5260
- function removeProductsFromOrder(_x55, _x56) {
5277
+ function removeProductsFromOrder(_x56, _x57) {
5261
5278
  return _removeProductsFromOrder.apply(this, arguments);
5262
5279
  }
5263
5280
  return removeProductsFromOrder;
@@ -5276,7 +5293,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5276
5293
  }
5277
5294
  }, _callee61, this);
5278
5295
  }));
5279
- function removeProductFromOrder(_x57, _x58) {
5296
+ function removeProductFromOrder(_x58, _x59) {
5280
5297
  return _removeProductFromOrder.apply(this, arguments);
5281
5298
  }
5282
5299
  return removeProductFromOrder;
@@ -5439,7 +5456,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5439
5456
  }
5440
5457
  }, _callee64, this);
5441
5458
  }));
5442
- function setOtherParams(_x59) {
5459
+ function setOtherParams(_x60) {
5443
5460
  return _setOtherParams.apply(this, arguments);
5444
5461
  }
5445
5462
  return setOtherParams;
@@ -37,35 +37,46 @@ export function createEmptySummary() {
37
37
  * 数组元素先按主键排序再序列化,避免顺序差异导致误判为不同行。
38
38
  */
39
39
  export function buildProductLineFingerprint(productOptionItem, productBundle) {
40
- var optArr = Array.isArray(productOptionItem) ? productOptionItem : [];
41
- var normalizedOpts = optArr.map(function (item) {
42
- var _ref, _item$add_price;
43
- return {
44
- option_group_item_id: Number(item === null || item === void 0 ? void 0 : item.option_group_item_id) || 0,
45
- option_group_id: Number(item === null || item === void 0 ? void 0 : item.option_group_id) || 0,
46
- num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
47
- price: String((_ref = (_item$add_price = item === null || item === void 0 ? void 0 : item.add_price) !== null && _item$add_price !== void 0 ? _item$add_price : item === null || item === void 0 ? void 0 : item.price) !== null && _ref !== void 0 ? _ref : '')
48
- };
49
- }).sort(function (p, q) {
50
- if (p.option_group_item_id !== q.option_group_item_id) {
51
- return p.option_group_item_id - q.option_group_item_id;
52
- }
53
- if (p.option_group_id !== q.option_group_id) return p.option_group_id - q.option_group_id;
54
- if (p.num !== q.num) return p.num - q.num;
55
- return p.price.localeCompare(q.price);
56
- });
40
+ var normalizeOptions = function normalizeOptions(options) {
41
+ var optionArr = Array.isArray(options) ? options : [];
42
+ return optionArr.map(function (item) {
43
+ var _ref, _item$add_price;
44
+ return {
45
+ option_group_item_id: Number(item === null || item === void 0 ? void 0 : item.option_group_item_id) || 0,
46
+ option_group_id: Number(item === null || item === void 0 ? void 0 : item.option_group_id) || 0,
47
+ num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
48
+ price: String((_ref = (_item$add_price = item === null || item === void 0 ? void 0 : item.add_price) !== null && _item$add_price !== void 0 ? _item$add_price : item === null || item === void 0 ? void 0 : item.price) !== null && _ref !== void 0 ? _ref : '')
49
+ };
50
+ }).sort(function (p, q) {
51
+ if (p.option_group_item_id !== q.option_group_item_id) {
52
+ return p.option_group_item_id - q.option_group_item_id;
53
+ }
54
+ if (p.option_group_id !== q.option_group_id) {
55
+ return p.option_group_id - q.option_group_id;
56
+ }
57
+ if (p.num !== q.num) return p.num - q.num;
58
+ return p.price.localeCompare(q.price);
59
+ });
60
+ };
61
+ var normalizedOpts = normalizeOptions(productOptionItem);
57
62
  var bundleArr = Array.isArray(productBundle) ? productBundle : [];
58
63
  var normalizedBundles = bundleArr.map(function (item) {
59
- var _ref2, _item$bundle_id;
64
+ var _ref2, _item$bundle_id, _item$bundle_variant_;
60
65
  return {
61
66
  bundle_id: Number((_ref2 = (_item$bundle_id = item === null || item === void 0 ? void 0 : item.bundle_id) !== null && _item$bundle_id !== void 0 ? _item$bundle_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref2 !== void 0 ? _ref2 : 0) || 0,
62
67
  product_id: Number(item === null || item === void 0 ? void 0 : item.product_id) || 0,
63
- num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1
68
+ product_variant_id: Number((_item$bundle_variant_ = item === null || item === void 0 ? void 0 : item.bundle_variant_id) !== null && _item$bundle_variant_ !== void 0 ? _item$bundle_variant_ : item === null || item === void 0 ? void 0 : item.product_variant_id) || 0,
69
+ num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
70
+ option: normalizeOptions(item === null || item === void 0 ? void 0 : item.option)
64
71
  };
65
72
  }).sort(function (p, q) {
66
73
  if (p.bundle_id !== q.bundle_id) return p.bundle_id - q.bundle_id;
67
74
  if (p.product_id !== q.product_id) return p.product_id - q.product_id;
68
- return p.num - q.num;
75
+ if (p.product_variant_id !== q.product_variant_id) {
76
+ return p.product_variant_id - q.product_variant_id;
77
+ }
78
+ if (p.num !== q.num) return p.num - q.num;
79
+ return JSON.stringify(p.option).localeCompare(JSON.stringify(q.option));
69
80
  });
70
81
  return JSON.stringify([normalizedOpts, normalizedBundles]);
71
82
  }
@@ -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 | 1 | 2 | 3 | 4 | 5 | 6;
329
+ weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;