@pisell/pisellos 2.2.230 → 2.2.231

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 (33) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/modules/Order/index.js +44 -29
  3. package/dist/modules/Order/types.d.ts +14 -2
  4. package/dist/modules/Order/types.js +8 -1
  5. package/dist/modules/ProductList/index.d.ts +9 -12
  6. package/dist/modules/ProductList/index.js +122 -59
  7. package/dist/modules/ProductList/types.d.ts +14 -0
  8. package/dist/server/index.d.ts +21 -0
  9. package/dist/server/index.js +154 -34
  10. package/dist/server/utils/small-ticket.js +113 -29
  11. package/dist/solution/BookingByStep/index.d.ts +1 -1
  12. package/dist/solution/BookingTicket/index.d.ts +8 -0
  13. package/dist/solution/BookingTicket/index.js +191 -154
  14. package/dist/solution/BookingTicket/types.d.ts +4 -0
  15. package/dist/solution/BookingTicket/utils/cartView.js +20 -6
  16. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +189 -0
  17. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +429 -0
  18. package/lib/modules/Order/index.js +18 -5
  19. package/lib/modules/Order/types.d.ts +14 -2
  20. package/lib/modules/ProductList/index.d.ts +9 -12
  21. package/lib/modules/ProductList/index.js +32 -4
  22. package/lib/modules/ProductList/types.d.ts +14 -0
  23. package/lib/server/index.d.ts +21 -0
  24. package/lib/server/index.js +107 -9
  25. package/lib/server/utils/small-ticket.js +78 -1
  26. package/lib/solution/BookingByStep/index.d.ts +1 -1
  27. package/lib/solution/BookingTicket/index.d.ts +8 -0
  28. package/lib/solution/BookingTicket/index.js +16 -0
  29. package/lib/solution/BookingTicket/types.d.ts +4 -0
  30. package/lib/solution/BookingTicket/utils/cartView.js +14 -7
  31. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +189 -0
  32. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +241 -0
  33. package/package.json +1 -1
@@ -46,6 +46,7 @@ import { buildSessionCatalogStaleInfo, isSessionCatalogDateStale } from "./utils
46
46
  import { buildNormalProductCacheItemFromOrderLine as buildNormalProductCacheItemFromOrderLineUtil } from "../../modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine";
47
47
  import { buildProductOptionStringFromOrderLine } from "../../modules/BookingContext/utils/orderLineDisplay";
48
48
  import { applyBookingsStatus, applyChildBookingStatus, resolveScheduleId, resolveStatusAfterTransition, restoreBookingsStatus, restoreChildBookingStatus } from "./utils/bookingStatus";
49
+ import { resolveBestAddTimePlan as _resolveBestAddTimePlan } from "./utils/resolveBestAddTimePlan";
49
50
  var OPEN_DATA_SECTION_CODES = ['sale', 'reservation', 'fulfillment', 'menu', 'workflow'];
50
51
  var OPEN_DATA_CACHE_TTL = 5 * 60 * 1000;
51
52
  function withProductOptionString(cacheItem) {
@@ -884,6 +885,37 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
884
885
  }
885
886
  return loadProducts;
886
887
  }()
888
+ /**
889
+ * 获取加时商品列表。
890
+ *
891
+ * @example
892
+ * const products = await bookingTicket.getAddTimeProducts({ schedule_date: '2026-06-16' });
893
+ */
894
+ )
895
+ }, {
896
+ key: "getAddTimeProducts",
897
+ value: (function () {
898
+ var _getAddTimeProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
899
+ var params,
900
+ _args13 = arguments;
901
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
902
+ while (1) switch (_context13.prev = _context13.next) {
903
+ case 0:
904
+ params = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
905
+ return _context13.abrupt("return", this.store.products.getAddTimeProducts(_objectSpread(_objectSpread({}, params), {}, {
906
+ cacheId: this.cacheId
907
+ })));
908
+ case 2:
909
+ case "end":
910
+ return _context13.stop();
911
+ }
912
+ }, _callee13, this);
913
+ }));
914
+ function getAddTimeProducts() {
915
+ return _getAddTimeProducts.apply(this, arguments);
916
+ }
917
+ return getAddTimeProducts;
918
+ }()
887
919
  /**
888
920
  * 只读查询单商品详情:走 ProductList 报价查询,但不写 productCatalog、
889
921
  * 不 emit onProductsLoaded、不修改 BookingDate。
@@ -902,14 +934,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
902
934
  }, {
903
935
  key: "queryProductDetail",
904
936
  value: (function () {
905
- var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(params, options) {
937
+ var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params, options) {
906
938
  var product_id, queryParams, _result2, list;
907
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
908
- while (1) switch (_context13.prev = _context13.next) {
939
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
940
+ while (1) switch (_context14.prev = _context14.next) {
909
941
  case 0:
910
942
  product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded2);
911
- _context13.prev = 1;
912
- _context13.next = 4;
943
+ _context14.prev = 1;
944
+ _context14.next = 4;
913
945
  return this.store.products.loadProducts(_objectSpread(_objectSpread({
914
946
  with_count: ['bundleGroup', 'optionGroup'],
915
947
  with_schedule: 1
@@ -918,21 +950,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
918
950
  cacheId: this.cacheId
919
951
  }), options);
920
952
  case 4:
921
- _result2 = _context13.sent;
953
+ _result2 = _context14.sent;
922
954
  list = Array.isArray(_result2) ? _result2 : [];
923
- return _context13.abrupt("return", list.find(function (product) {
955
+ return _context14.abrupt("return", list.find(function (product) {
924
956
  return Number(product.id) === Number(product_id);
925
957
  }));
926
958
  case 9:
927
- _context13.prev = 9;
928
- _context13.t0 = _context13["catch"](1);
929
- console.error('Failed to query product detail:', _context13.t0);
930
- throw _context13.t0;
959
+ _context14.prev = 9;
960
+ _context14.t0 = _context14["catch"](1);
961
+ console.error('Failed to query product detail:', _context14.t0);
962
+ throw _context14.t0;
931
963
  case 13:
932
964
  case "end":
933
- return _context13.stop();
965
+ return _context14.stop();
934
966
  }
935
- }, _callee13, this, [[1, 9]]);
967
+ }, _callee14, this, [[1, 9]]);
936
968
  }));
937
969
  function queryProductDetail(_x9, _x10) {
938
970
  return _queryProductDetail.apply(this, arguments);
@@ -947,26 +979,26 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
947
979
  }, {
948
980
  key: "loadProductDetail",
949
981
  value: (function () {
950
- var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params, options) {
982
+ var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params, options) {
951
983
  var product_id, queryParams, products;
952
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
953
- while (1) switch (_context14.prev = _context14.next) {
984
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
985
+ while (1) switch (_context15.prev = _context15.next) {
954
986
  case 0:
955
987
  product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded3);
956
- _context14.next = 3;
988
+ _context15.next = 3;
957
989
  return this.loadProducts(_objectSpread(_objectSpread({}, queryParams), {}, {
958
990
  product_ids: [product_id]
959
991
  }), options);
960
992
  case 3:
961
- products = _context14.sent;
962
- return _context14.abrupt("return", products.find(function (product) {
993
+ products = _context15.sent;
994
+ return _context15.abrupt("return", products.find(function (product) {
963
995
  return Number(product.id) === Number(product_id);
964
996
  }));
965
997
  case 5:
966
998
  case "end":
967
- return _context14.stop();
999
+ return _context15.stop();
968
1000
  }
969
- }, _callee14, this);
1001
+ }, _callee15, this);
970
1002
  }));
971
1003
  function loadProductDetail(_x11, _x12) {
972
1004
  return _loadProductDetail.apply(this, arguments);
@@ -1001,16 +1033,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1001
1033
  }, {
1002
1034
  key: "getProducts",
1003
1035
  value: (function () {
1004
- var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
1005
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1006
- while (1) switch (_context15.prev = _context15.next) {
1036
+ var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1037
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1038
+ while (1) switch (_context16.prev = _context16.next) {
1007
1039
  case 0:
1008
- return _context15.abrupt("return", this.store.products.getProducts());
1040
+ return _context16.abrupt("return", this.store.products.getProducts());
1009
1041
  case 1:
1010
1042
  case "end":
1011
- return _context15.stop();
1043
+ return _context16.stop();
1012
1044
  }
1013
- }, _callee15, this);
1045
+ }, _callee16, this);
1014
1046
  }));
1015
1047
  function getProducts() {
1016
1048
  return _getProducts.apply(this, arguments);
@@ -1063,16 +1095,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1063
1095
  }, {
1064
1096
  key: "getProductByIds",
1065
1097
  value: (function () {
1066
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(ids) {
1067
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1068
- while (1) switch (_context16.prev = _context16.next) {
1098
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(ids) {
1099
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1100
+ while (1) switch (_context17.prev = _context17.next) {
1069
1101
  case 0:
1070
- return _context16.abrupt("return", this.store.products.getProductByIds(ids));
1102
+ return _context17.abrupt("return", this.store.products.getProductByIds(ids));
1071
1103
  case 1:
1072
1104
  case "end":
1073
- return _context16.stop();
1105
+ return _context17.stop();
1074
1106
  }
1075
- }, _callee16, this);
1107
+ }, _callee17, this);
1076
1108
  }));
1077
1109
  function getProductByIds(_x13) {
1078
1110
  return _getProductByIds.apply(this, arguments);
@@ -1088,25 +1120,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1088
1120
  }, {
1089
1121
  key: "getScheduleTimePoints",
1090
1122
  value: (function () {
1091
- var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params) {
1123
+ var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params) {
1092
1124
  var result;
1093
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1094
- while (1) switch (_context17.prev = _context17.next) {
1125
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1126
+ while (1) switch (_context18.prev = _context18.next) {
1095
1127
  case 0:
1096
- _context17.next = 2;
1128
+ _context18.next = 2;
1097
1129
  return this.request.post('/menu/schedule-time-points', {
1098
1130
  menu_list_ids: params.menu_list_ids
1099
1131
  }, {
1100
1132
  osServer: true
1101
1133
  });
1102
1134
  case 2:
1103
- result = _context17.sent;
1104
- return _context17.abrupt("return", result.data || []);
1135
+ result = _context18.sent;
1136
+ return _context18.abrupt("return", result.data || []);
1105
1137
  case 4:
1106
1138
  case "end":
1107
- return _context17.stop();
1139
+ return _context18.stop();
1108
1140
  }
1109
- }, _callee17, this);
1141
+ }, _callee18, this);
1110
1142
  }));
1111
1143
  function getScheduleTimePoints(_x14) {
1112
1144
  return _getScheduleTimePoints.apply(this, arguments);
@@ -1122,30 +1154,30 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1122
1154
  }, {
1123
1155
  key: "getCustomerList",
1124
1156
  value: (function () {
1125
- var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1157
+ var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1126
1158
  var params,
1127
1159
  _result3,
1128
- _args18 = arguments;
1129
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1130
- while (1) switch (_context18.prev = _context18.next) {
1160
+ _args19 = arguments;
1161
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1162
+ while (1) switch (_context19.prev = _context19.next) {
1131
1163
  case 0:
1132
- params = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
1133
- _context18.prev = 1;
1134
- _context18.next = 4;
1164
+ params = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : {};
1165
+ _context19.prev = 1;
1166
+ _context19.next = 4;
1135
1167
  return this.store.customer.getCustomerList(params);
1136
1168
  case 4:
1137
- _result3 = _context18.sent;
1138
- return _context18.abrupt("return", _result3);
1169
+ _result3 = _context19.sent;
1170
+ return _context19.abrupt("return", _result3);
1139
1171
  case 8:
1140
- _context18.prev = 8;
1141
- _context18.t0 = _context18["catch"](1);
1142
- console.error('Failed to get customer list:', _context18.t0);
1143
- throw _context18.t0;
1172
+ _context19.prev = 8;
1173
+ _context19.t0 = _context19["catch"](1);
1174
+ console.error('Failed to get customer list:', _context19.t0);
1175
+ throw _context19.t0;
1144
1176
  case 12:
1145
1177
  case "end":
1146
- return _context18.stop();
1178
+ return _context19.stop();
1147
1179
  }
1148
- }, _callee18, this, [[1, 8]]);
1180
+ }, _callee19, this, [[1, 8]]);
1149
1181
  }));
1150
1182
  function getCustomerList() {
1151
1183
  return _getCustomerList.apply(this, arguments);
@@ -1343,24 +1375,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1343
1375
  }, {
1344
1376
  key: "restoreOrder",
1345
1377
  value: (function () {
1346
- var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1378
+ var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1347
1379
  var _this$store$customer;
1348
1380
  var tempOrder;
1349
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1350
- while (1) switch (_context19.prev = _context19.next) {
1381
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1382
+ while (1) switch (_context20.prev = _context20.next) {
1351
1383
  case 0:
1352
- _context19.next = 2;
1384
+ _context20.next = 2;
1353
1385
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "restoreOrder", this).call(this);
1354
1386
  case 2:
1355
- tempOrder = _context19.sent;
1387
+ tempOrder = _context20.sent;
1356
1388
  this.clearOrderCustomer();
1357
1389
  (_this$store$customer = this.store.customer) === null || _this$store$customer === void 0 || _this$store$customer.setSelectedCustomer(null);
1358
- return _context19.abrupt("return", tempOrder);
1390
+ return _context20.abrupt("return", tempOrder);
1359
1391
  case 6:
1360
1392
  case "end":
1361
- return _context19.stop();
1393
+ return _context20.stop();
1362
1394
  }
1363
- }, _callee19, this);
1395
+ }, _callee20, this);
1364
1396
  }));
1365
1397
  function restoreOrder() {
1366
1398
  return _restoreOrder.apply(this, arguments);
@@ -1386,36 +1418,36 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1386
1418
  return;
1387
1419
  }
1388
1420
  var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
1389
- var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1421
+ var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1390
1422
  var currentCustomer;
1391
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1392
- while (1) switch (_context20.prev = _context20.next) {
1423
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1424
+ while (1) switch (_context21.prev = _context21.next) {
1393
1425
  case 0:
1394
1426
  if (!previousRefresh) {
1395
- _context20.next = 3;
1427
+ _context21.next = 3;
1396
1428
  break;
1397
1429
  }
1398
- _context20.next = 3;
1430
+ _context21.next = 3;
1399
1431
  return previousRefresh.catch(function () {
1400
1432
  return undefined;
1401
1433
  });
1402
1434
  case 3:
1403
1435
  currentCustomer = _this4.store.order.getOrderCustomer();
1404
1436
  if (!(!currentCustomer || Number(currentCustomer.customer_id) !== customerId)) {
1405
- _context20.next = 6;
1437
+ _context21.next = 6;
1406
1438
  break;
1407
1439
  }
1408
- return _context20.abrupt("return");
1440
+ return _context21.abrupt("return");
1409
1441
  case 6:
1410
- _context20.next = 8;
1442
+ _context21.next = 8;
1411
1443
  return _this4.loadDiscountConfig({
1412
1444
  customerId: customerId
1413
1445
  });
1414
1446
  case 8:
1415
1447
  case "end":
1416
- return _context20.stop();
1448
+ return _context21.stop();
1417
1449
  }
1418
- }, _callee20);
1450
+ }, _callee21);
1419
1451
  }))();
1420
1452
  this.orderCustomerDiscountRefreshInFlight = refreshTask;
1421
1453
  this.orderCustomerDiscountRefreshCustomerId = customerId;
@@ -1468,27 +1500,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1468
1500
  }, {
1469
1501
  key: "changeCustomerPage",
1470
1502
  value: (function () {
1471
- var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(page, pageSize) {
1503
+ var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(page, pageSize) {
1472
1504
  var _result4;
1473
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1474
- while (1) switch (_context21.prev = _context21.next) {
1505
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1506
+ while (1) switch (_context22.prev = _context22.next) {
1475
1507
  case 0:
1476
- _context21.prev = 0;
1477
- _context21.next = 3;
1508
+ _context22.prev = 0;
1509
+ _context22.next = 3;
1478
1510
  return this.store.customer.changeCustomerPage(page, pageSize);
1479
1511
  case 3:
1480
- _result4 = _context21.sent;
1481
- return _context21.abrupt("return", _result4);
1512
+ _result4 = _context22.sent;
1513
+ return _context22.abrupt("return", _result4);
1482
1514
  case 7:
1483
- _context21.prev = 7;
1484
- _context21.t0 = _context21["catch"](0);
1485
- console.error('Failed to change customer page:', _context21.t0);
1486
- throw _context21.t0;
1515
+ _context22.prev = 7;
1516
+ _context22.t0 = _context22["catch"](0);
1517
+ console.error('Failed to change customer page:', _context22.t0);
1518
+ throw _context22.t0;
1487
1519
  case 11:
1488
1520
  case "end":
1489
- return _context21.stop();
1521
+ return _context22.stop();
1490
1522
  }
1491
- }, _callee21, this, [[0, 7]]);
1523
+ }, _callee22, this, [[0, 7]]);
1492
1524
  }));
1493
1525
  function changeCustomerPage(_x15, _x16) {
1494
1526
  return _changeCustomerPage.apply(this, arguments);
@@ -1503,28 +1535,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1503
1535
  }, {
1504
1536
  key: "loadMoreCustomers",
1505
1537
  value: (function () {
1506
- var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1538
+ var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
1507
1539
  var _result5;
1508
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1509
- while (1) switch (_context22.prev = _context22.next) {
1540
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1541
+ while (1) switch (_context23.prev = _context23.next) {
1510
1542
  case 0:
1511
- _context22.prev = 0;
1512
- _context22.next = 3;
1543
+ _context23.prev = 0;
1544
+ _context23.next = 3;
1513
1545
  return this.store.customer.loadMoreCustomers();
1514
1546
  case 3:
1515
- _result5 = _context22.sent;
1547
+ _result5 = _context23.sent;
1516
1548
  this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result5);
1517
- return _context22.abrupt("return", _result5);
1549
+ return _context23.abrupt("return", _result5);
1518
1550
  case 8:
1519
- _context22.prev = 8;
1520
- _context22.t0 = _context22["catch"](0);
1521
- console.error('Failed to load more customers:', _context22.t0);
1522
- throw _context22.t0;
1551
+ _context23.prev = 8;
1552
+ _context23.t0 = _context23["catch"](0);
1553
+ console.error('Failed to load more customers:', _context23.t0);
1554
+ throw _context23.t0;
1523
1555
  case 12:
1524
1556
  case "end":
1525
- return _context22.stop();
1557
+ return _context23.stop();
1526
1558
  }
1527
- }, _callee22, this, [[0, 8]]);
1559
+ }, _callee23, this, [[0, 8]]);
1528
1560
  }));
1529
1561
  function loadMoreCustomers() {
1530
1562
  return _loadMoreCustomers.apply(this, arguments);
@@ -1540,31 +1572,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1540
1572
  }, {
1541
1573
  key: "resetAndLoadCustomers",
1542
1574
  value: (function () {
1543
- var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
1575
+ var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1544
1576
  var params,
1545
1577
  _result6,
1546
- _args23 = arguments;
1547
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1548
- while (1) switch (_context23.prev = _context23.next) {
1578
+ _args24 = arguments;
1579
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1580
+ while (1) switch (_context24.prev = _context24.next) {
1549
1581
  case 0:
1550
- params = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
1551
- _context23.prev = 1;
1552
- _context23.next = 4;
1582
+ params = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
1583
+ _context24.prev = 1;
1584
+ _context24.next = 4;
1553
1585
  return this.store.customer.resetAndLoadCustomers(params);
1554
1586
  case 4:
1555
- _result6 = _context23.sent;
1587
+ _result6 = _context24.sent;
1556
1588
  this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result6);
1557
- return _context23.abrupt("return", _result6);
1589
+ return _context24.abrupt("return", _result6);
1558
1590
  case 9:
1559
- _context23.prev = 9;
1560
- _context23.t0 = _context23["catch"](1);
1561
- console.error('Failed to reset and load customers:', _context23.t0);
1562
- throw _context23.t0;
1591
+ _context24.prev = 9;
1592
+ _context24.t0 = _context24["catch"](1);
1593
+ console.error('Failed to reset and load customers:', _context24.t0);
1594
+ throw _context24.t0;
1563
1595
  case 13:
1564
1596
  case "end":
1565
- return _context23.stop();
1597
+ return _context24.stop();
1566
1598
  }
1567
- }, _callee23, this, [[1, 9]]);
1599
+ }, _callee24, this, [[1, 9]]);
1568
1600
  }));
1569
1601
  function resetAndLoadCustomers() {
1570
1602
  return _resetAndLoadCustomers.apply(this, arguments);
@@ -1725,16 +1757,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1725
1757
  }, {
1726
1758
  key: "getOtherParams",
1727
1759
  value: (function () {
1728
- var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1729
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1730
- while (1) switch (_context24.prev = _context24.next) {
1760
+ var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1761
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1762
+ while (1) switch (_context25.prev = _context25.next) {
1731
1763
  case 0:
1732
- return _context24.abrupt("return", this.otherParams);
1764
+ return _context25.abrupt("return", this.otherParams);
1733
1765
  case 1:
1734
1766
  case "end":
1735
- return _context24.stop();
1767
+ return _context25.stop();
1736
1768
  }
1737
- }, _callee24, this);
1769
+ }, _callee25, this);
1738
1770
  }));
1739
1771
  function getOtherParams() {
1740
1772
  return _getOtherParams.apply(this, arguments);
@@ -2052,16 +2084,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2052
2084
  }, {
2053
2085
  key: "updateProductInOrder",
2054
2086
  value: (function () {
2055
- var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(params) {
2056
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2057
- while (1) switch (_context25.prev = _context25.next) {
2087
+ var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(params) {
2088
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2089
+ while (1) switch (_context26.prev = _context26.next) {
2058
2090
  case 0:
2059
- return _context25.abrupt("return", this.updateOrderProduct(params));
2091
+ return _context26.abrupt("return", this.updateOrderProduct(params));
2060
2092
  case 1:
2061
2093
  case "end":
2062
- return _context25.stop();
2094
+ return _context26.stop();
2063
2095
  }
2064
- }, _callee25, this);
2096
+ }, _callee26, this);
2065
2097
  }));
2066
2098
  function updateProductInOrder(_x17) {
2067
2099
  return _updateProductInOrder.apply(this, arguments);
@@ -2085,47 +2117,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2085
2117
  }, {
2086
2118
  key: "handleGlobalScanCode",
2087
2119
  value: (function () {
2088
- var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(code, bridge) {
2120
+ var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(code, bridge) {
2089
2121
  var _this6 = this;
2090
2122
  var trimmed, _bridge$onNotify, _bridge$refresh, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
2091
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2092
- while (1) switch (_context26.prev = _context26.next) {
2123
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2124
+ while (1) switch (_context27.prev = _context27.next) {
2093
2125
  case 0:
2094
2126
  trimmed = typeof code === 'string' ? code.trim() : '';
2095
2127
  if (trimmed) {
2096
- _context26.next = 4;
2128
+ _context27.next = 4;
2097
2129
  break;
2098
2130
  }
2099
2131
  bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2100
- return _context26.abrupt("return", {
2132
+ return _context27.abrupt("return", {
2101
2133
  status: 'failed',
2102
2134
  reason: 'empty_code'
2103
2135
  });
2104
2136
  case 4:
2105
- _context26.prev = 4;
2137
+ _context27.prev = 4;
2106
2138
  localSearch = function localSearch(v) {
2107
2139
  return _this6.store.products.findProductsByCodeOrBarcode(v);
2108
2140
  };
2109
2141
  scanCallback = handleGlobalScan(this.request, localSearch);
2110
- _context26.next = 9;
2142
+ _context27.next = 9;
2111
2143
  return scanCallback({
2112
2144
  type: 'nativeScanner',
2113
2145
  value: trimmed
2114
2146
  });
2115
2147
  case 9:
2116
- raw = _context26.sent;
2148
+ raw = _context27.sent;
2117
2149
  formatted = formatGlobalScanResult(raw, trimmed);
2118
2150
  if (formatted) {
2119
- _context26.next = 14;
2151
+ _context27.next = 14;
2120
2152
  break;
2121
2153
  }
2122
2154
  bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2123
- return _context26.abrupt("return", {
2155
+ return _context27.abrupt("return", {
2124
2156
  status: 'failed',
2125
2157
  reason: 'not_found'
2126
2158
  });
2127
2159
  case 14:
2128
- _context26.next = 16;
2160
+ _context27.next = 16;
2129
2161
  return applyGlobalScan({
2130
2162
  setOrderCustomer: function setOrderCustomer(customer) {
2131
2163
  return _this6.setOrderCustomer(customer);
@@ -2154,43 +2186,48 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2154
2186
  }
2155
2187
  }, formatted, bridge);
2156
2188
  case 16:
2157
- _result7 = _context26.sent;
2189
+ _result7 = _context27.sent;
2158
2190
  bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
2159
- return _context26.abrupt("return", _result7);
2191
+ return _context27.abrupt("return", _result7);
2160
2192
  case 21:
2161
- _context26.prev = 21;
2162
- _context26.t0 = _context26["catch"](4);
2163
- console.error('[BookingTicket] handleGlobalScanCode failed', _context26.t0);
2193
+ _context27.prev = 21;
2194
+ _context27.t0 = _context27["catch"](4);
2195
+ console.error('[BookingTicket] handleGlobalScanCode failed', _context27.t0);
2164
2196
  bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2165
- return _context26.abrupt("return", {
2197
+ return _context27.abrupt("return", {
2166
2198
  status: 'failed',
2167
2199
  reason: 'not_found'
2168
2200
  });
2169
2201
  case 26:
2170
2202
  case "end":
2171
- return _context26.stop();
2203
+ return _context27.stop();
2172
2204
  }
2173
- }, _callee26, this, [[4, 21]]);
2205
+ }, _callee27, this, [[4, 21]]);
2174
2206
  }));
2175
2207
  function handleGlobalScanCode(_x18, _x19) {
2176
2208
  return _handleGlobalScanCode.apply(this, arguments);
2177
2209
  }
2178
2210
  return handleGlobalScanCode;
2179
- }()
2211
+ }())
2212
+ }, {
2213
+ key: "resolveBestAddTimePlan",
2214
+ value: function resolveBestAddTimePlan(addTimeProducts, targetMinutes) {
2215
+ return _resolveBestAddTimePlan(addTimeProducts, targetMinutes);
2216
+ }
2217
+
2180
2218
  /**
2181
2219
  * 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
2182
2220
  * 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。
2183
2221
  */
2184
- )
2185
2222
  }, {
2186
2223
  key: "destroy",
2187
2224
  value: (function () {
2188
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
2225
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
2189
2226
  var _this$scan;
2190
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2191
- while (1) switch (_context27.prev = _context27.next) {
2227
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2228
+ while (1) switch (_context28.prev = _context28.next) {
2192
2229
  case 0:
2193
- _context27.next = 2;
2230
+ _context28.next = 2;
2194
2231
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
2195
2232
  case 2:
2196
2233
  try {
@@ -2201,9 +2238,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2201
2238
  scanCache.clear();
2202
2239
  case 4:
2203
2240
  case "end":
2204
- return _context27.stop();
2241
+ return _context28.stop();
2205
2242
  }
2206
- }, _callee27, this);
2243
+ }, _callee28, this);
2207
2244
  }));
2208
2245
  function destroy() {
2209
2246
  return _destroy.apply(this, arguments);
@@ -79,6 +79,10 @@ export interface ILoadProductsParams {
79
79
  with_count?: string[];
80
80
  /** 是否返回日程信息 */
81
81
  with_schedule?: number;
82
+ /** 扩展商品类型过滤 */
83
+ extension_type?: string[];
84
+ /** 商品发布状态 */
85
+ status?: string;
82
86
  }
83
87
  /**
84
88
  * 加载商品详情的参数