@pisell/pisellos 2.3.196 → 2.3.197
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/modules/Order/index.d.ts +3 -0
- package/dist/modules/Order/index.js +127 -46
- package/dist/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/dist/modules/Order/unpaidAmountGap.js +72 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/server/index.js +180 -176
- package/dist/server/modules/order/index.js +2 -1
- package/dist/shared/receipt/small-ticket.d.ts +3 -0
- package/dist/shared/receipt/small-ticket.js +26 -3
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -13
- package/dist/solution/OrderInvoicePreview/index.js +13 -8
- package/dist/solution/UnifiedBookingSales/index.d.ts +2 -0
- package/dist/solution/UnifiedBookingSales/index.js +66 -57
- package/dist/solution/UnifiedBookingSales/types.d.ts +1 -0
- package/dist/solution/UnifiedBookingSales/venueCatalogSession.js +11 -5
- package/lib/modules/Order/index.d.ts +3 -0
- package/lib/modules/Order/index.js +85 -16
- package/lib/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/lib/modules/Order/unpaidAmountGap.js +60 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/server/index.js +16 -4
- package/lib/server/modules/order/index.js +2 -1
- package/lib/shared/receipt/small-ticket.d.ts +3 -0
- package/lib/shared/receipt/small-ticket.js +24 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -13
- package/lib/solution/OrderInvoicePreview/index.js +6 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +2 -0
- package/lib/solution/UnifiedBookingSales/index.js +37 -33
- package/lib/solution/UnifiedBookingSales/types.d.ts +1 -0
- package/lib/solution/UnifiedBookingSales/venueCatalogSession.js +9 -5
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -308,12 +308,12 @@ var Server = /*#__PURE__*/function () {
|
|
|
308
308
|
*/
|
|
309
309
|
_defineProperty(this, "handleProductQuery", /*#__PURE__*/function () {
|
|
310
310
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref5) {
|
|
311
|
-
var url, method, data, config, menu_list_ids, customer_id, ids, extension_type, strategy_context, _this$resolveProductQ, schedule_date, schedule_datetime, _ref7, callback, subscriberId, result;
|
|
311
|
+
var url, method, data, config, menu_list_ids, customer_id, ids, extension_type, application_code, strategy_context, _this$resolveProductQ, schedule_date, schedule_datetime, _ref7, callback, subscriberId, result;
|
|
312
312
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
313
313
|
while (1) switch (_context3.prev = _context3.next) {
|
|
314
314
|
case 0:
|
|
315
315
|
url = _ref5.url, method = _ref5.method, data = _ref5.data, config = _ref5.config;
|
|
316
|
-
menu_list_ids = data.menu_list_ids, customer_id = data.customer_id, ids = data.ids, extension_type = data.extension_type, strategy_context = data.strategy_context;
|
|
316
|
+
menu_list_ids = data.menu_list_ids, customer_id = data.customer_id, ids = data.ids, extension_type = data.extension_type, application_code = data.application_code, strategy_context = data.strategy_context;
|
|
317
317
|
_this$resolveProductQ = _this.resolveProductQueryScheduleContext({
|
|
318
318
|
schedule_date: data.schedule_date,
|
|
319
319
|
schedule_datetime: data.schedule_datetime
|
|
@@ -340,6 +340,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
340
340
|
schedule_datetime: schedule_datetime,
|
|
341
341
|
customer_id: customer_id,
|
|
342
342
|
extension_type: extension_type,
|
|
343
|
+
application_code: application_code,
|
|
343
344
|
strategy_context: strategy_context
|
|
344
345
|
}
|
|
345
346
|
});
|
|
@@ -356,6 +357,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
356
357
|
schedule_datetime: schedule_datetime,
|
|
357
358
|
customer_id: customer_id,
|
|
358
359
|
extension_type: extension_type,
|
|
360
|
+
application_code: application_code,
|
|
359
361
|
strategy_context: strategy_context
|
|
360
362
|
});
|
|
361
363
|
case 8:
|
|
@@ -384,6 +386,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
384
386
|
*/
|
|
385
387
|
_defineProperty(this, "handleProductQueryById", /*#__PURE__*/function () {
|
|
386
388
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref8) {
|
|
389
|
+
var _ref10, _data$application_cod;
|
|
387
390
|
var path, method, data, url, pathname, idMatch, productId, scheduleDateFromData, schedule_date, scheduleDtFromData, scheduleDtFromUrl, scheduleDatetime;
|
|
388
391
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
389
392
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -435,7 +438,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
435
438
|
return _context4.abrupt("return", _this.computeProductQueryResult(_objectSpread({
|
|
436
439
|
schedule_date: schedule_date,
|
|
437
440
|
schedule_datetime: scheduleDatetime,
|
|
438
|
-
product_id: productId
|
|
441
|
+
product_id: productId,
|
|
442
|
+
application_code: (_ref10 = (_data$application_cod = data === null || data === void 0 ? void 0 : data.application_code) !== null && _data$application_cod !== void 0 ? _data$application_cod : _this.extractQueryParam(url || '', 'application_code')) !== null && _ref10 !== void 0 ? _ref10 : undefined
|
|
439
443
|
}, data && _typeof(data) === 'object' ? {
|
|
440
444
|
customer_id: data.customer_id,
|
|
441
445
|
strategy_context: data.strategy_context
|
|
@@ -454,13 +458,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
454
458
|
* 取消商品查询订阅(HTTP 路由入口)
|
|
455
459
|
*/
|
|
456
460
|
_defineProperty(this, "handleUnsubscribeProductQuery", /*#__PURE__*/function () {
|
|
457
|
-
var
|
|
458
|
-
var data,
|
|
461
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref11) {
|
|
462
|
+
var data, _ref13, subscriberId;
|
|
459
463
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
460
464
|
while (1) switch (_context5.prev = _context5.next) {
|
|
461
465
|
case 0:
|
|
462
|
-
data =
|
|
463
|
-
|
|
466
|
+
data = _ref11.data;
|
|
467
|
+
_ref13 = data || {}, subscriberId = _ref13.subscriberId;
|
|
464
468
|
_this.removeProductQuerySubscriber(subscriberId);
|
|
465
469
|
return _context5.abrupt("return", {
|
|
466
470
|
code: 200,
|
|
@@ -474,7 +478,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
474
478
|
}, _callee5);
|
|
475
479
|
}));
|
|
476
480
|
return function (_x5) {
|
|
477
|
-
return
|
|
481
|
+
return _ref12.apply(this, arguments);
|
|
478
482
|
};
|
|
479
483
|
}());
|
|
480
484
|
/**
|
|
@@ -482,14 +486,14 @@ var Server = /*#__PURE__*/function () {
|
|
|
482
486
|
* 存储订阅者信息,本地计算结果;数据变更时通过 callback 推送
|
|
483
487
|
*/
|
|
484
488
|
_defineProperty(this, "handleOrderList", /*#__PURE__*/function () {
|
|
485
|
-
var
|
|
486
|
-
var url, method, data, config, queryPayload,
|
|
489
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref14) {
|
|
490
|
+
var url, method, data, config, queryPayload, _ref16, callback, subscriberId, useLocal;
|
|
487
491
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
488
492
|
while (1) switch (_context6.prev = _context6.next) {
|
|
489
493
|
case 0:
|
|
490
|
-
url =
|
|
494
|
+
url = _ref14.url, method = _ref14.method, data = _ref14.data, config = _ref14.config;
|
|
491
495
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
492
|
-
|
|
496
|
+
_ref16 = config || {}, callback = _ref16.callback, subscriberId = _ref16.subscriberId;
|
|
493
497
|
useLocal = _this.shouldUseLocalOrderQuery(queryPayload);
|
|
494
498
|
_this.logInfo('handleOrderList: 开始处理订单列表请求', {
|
|
495
499
|
data: queryPayload,
|
|
@@ -526,20 +530,20 @@ var Server = /*#__PURE__*/function () {
|
|
|
526
530
|
}, _callee6);
|
|
527
531
|
}));
|
|
528
532
|
return function (_x6) {
|
|
529
|
-
return
|
|
533
|
+
return _ref15.apply(this, arguments);
|
|
530
534
|
};
|
|
531
535
|
}());
|
|
532
536
|
/**
|
|
533
537
|
* 取消订单列表查询订阅(HTTP 路由入口)
|
|
534
538
|
*/
|
|
535
539
|
_defineProperty(this, "handleUnsubscribeOrderQuery", /*#__PURE__*/function () {
|
|
536
|
-
var
|
|
537
|
-
var data,
|
|
540
|
+
var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_ref17) {
|
|
541
|
+
var data, _ref19, subscriberId;
|
|
538
542
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
539
543
|
while (1) switch (_context7.prev = _context7.next) {
|
|
540
544
|
case 0:
|
|
541
|
-
data =
|
|
542
|
-
|
|
545
|
+
data = _ref17.data;
|
|
546
|
+
_ref19 = data || {}, subscriberId = _ref19.subscriberId;
|
|
543
547
|
if (subscriberId) {
|
|
544
548
|
_this.orderQuerySubscribers.delete(subscriberId);
|
|
545
549
|
_this.logInfo('handleUnsubscribeOrderQuery: 已移除订阅者', {
|
|
@@ -559,7 +563,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
559
563
|
}, _callee7);
|
|
560
564
|
}));
|
|
561
565
|
return function (_x7) {
|
|
562
|
-
return
|
|
566
|
+
return _ref18.apply(this, arguments);
|
|
563
567
|
};
|
|
564
568
|
}());
|
|
565
569
|
/**
|
|
@@ -569,12 +573,12 @@ var Server = /*#__PURE__*/function () {
|
|
|
569
573
|
* await this.handleSalesSearchModule({ url: '/shop/es/search/sales', method: 'post', data: { keyword: 'A' } })
|
|
570
574
|
*/
|
|
571
575
|
_defineProperty(this, "handleSalesSearchModule", /*#__PURE__*/function () {
|
|
572
|
-
var
|
|
576
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_ref20) {
|
|
573
577
|
var data, config;
|
|
574
578
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
575
579
|
while (1) switch (_context8.prev = _context8.next) {
|
|
576
580
|
case 0:
|
|
577
|
-
data =
|
|
581
|
+
data = _ref20.data, config = _ref20.config;
|
|
578
582
|
return _context8.abrupt("return", _this.handleSalesSearchRequest('single', '/shop/es/search/sales', data, config));
|
|
579
583
|
case 2:
|
|
580
584
|
case "end":
|
|
@@ -583,7 +587,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
583
587
|
}, _callee8);
|
|
584
588
|
}));
|
|
585
589
|
return function (_x8) {
|
|
586
|
-
return
|
|
590
|
+
return _ref21.apply(this, arguments);
|
|
587
591
|
};
|
|
588
592
|
}());
|
|
589
593
|
/**
|
|
@@ -593,12 +597,12 @@ var Server = /*#__PURE__*/function () {
|
|
|
593
597
|
* await this.handleSalesSearchAggregate({ url: '/shop/es/search', method: 'post', data: { modules: [] } })
|
|
594
598
|
*/
|
|
595
599
|
_defineProperty(this, "handleSalesSearchAggregate", /*#__PURE__*/function () {
|
|
596
|
-
var
|
|
600
|
+
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_ref22) {
|
|
597
601
|
var data, config;
|
|
598
602
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
599
603
|
while (1) switch (_context9.prev = _context9.next) {
|
|
600
604
|
case 0:
|
|
601
|
-
data =
|
|
605
|
+
data = _ref22.data, config = _ref22.config;
|
|
602
606
|
return _context9.abrupt("return", _this.handleSalesSearchRequest('aggregate', '/shop/es/search', data, config));
|
|
603
607
|
case 2:
|
|
604
608
|
case "end":
|
|
@@ -607,7 +611,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
607
611
|
}, _callee9);
|
|
608
612
|
}));
|
|
609
613
|
return function (_x9) {
|
|
610
|
-
return
|
|
614
|
+
return _ref23.apply(this, arguments);
|
|
611
615
|
};
|
|
612
616
|
}());
|
|
613
617
|
/**
|
|
@@ -617,13 +621,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
617
621
|
* await this.handleUnsubscribeSalesSearch({ data: { subscriberId: 'global-search-order' } } as any)
|
|
618
622
|
*/
|
|
619
623
|
_defineProperty(this, "handleUnsubscribeSalesSearch", /*#__PURE__*/function () {
|
|
620
|
-
var
|
|
621
|
-
var data,
|
|
624
|
+
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_ref24) {
|
|
625
|
+
var data, _ref26, subscriberId;
|
|
622
626
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
623
627
|
while (1) switch (_context10.prev = _context10.next) {
|
|
624
628
|
case 0:
|
|
625
|
-
data =
|
|
626
|
-
|
|
629
|
+
data = _ref24.data;
|
|
630
|
+
_ref26 = data || {}, subscriberId = _ref26.subscriberId;
|
|
627
631
|
if (subscriberId) {
|
|
628
632
|
_this.salesSearchSubscribers.delete(subscriberId);
|
|
629
633
|
_this.logInfo('handleUnsubscribeSalesSearch: 已移除订阅者', {
|
|
@@ -643,7 +647,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
643
647
|
}, _callee10);
|
|
644
648
|
}));
|
|
645
649
|
return function (_x10) {
|
|
646
|
-
return
|
|
650
|
+
return _ref25.apply(this, arguments);
|
|
647
651
|
};
|
|
648
652
|
}());
|
|
649
653
|
/**
|
|
@@ -656,14 +660,14 @@ var Server = /*#__PURE__*/function () {
|
|
|
656
660
|
* 今天:注册订阅者 + 本地数据筛选;非今天:清理订阅者 + 走真实 API
|
|
657
661
|
*/
|
|
658
662
|
_defineProperty(this, "handleBookingList", /*#__PURE__*/function () {
|
|
659
|
-
var
|
|
660
|
-
var url, method, data, config, queryPayload,
|
|
663
|
+
var _ref28 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref27) {
|
|
664
|
+
var url, method, data, config, queryPayload, _ref29, callback, subscriberId, useLocal, withFields, requestPayload, cacheKey;
|
|
661
665
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
662
666
|
while (1) switch (_context11.prev = _context11.next) {
|
|
663
667
|
case 0:
|
|
664
|
-
url =
|
|
668
|
+
url = _ref27.url, method = _ref27.method, data = _ref27.data, config = _ref27.config;
|
|
665
669
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
666
|
-
|
|
670
|
+
_ref29 = config || {}, callback = _ref29.callback, subscriberId = _ref29.subscriberId;
|
|
667
671
|
useLocal = _this.shouldUseLocalBookingQuery(queryPayload);
|
|
668
672
|
_this.logInfo('handleBookingList: 开始处理预约列表请求', {
|
|
669
673
|
data: queryPayload,
|
|
@@ -720,7 +724,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
720
724
|
}, _callee11);
|
|
721
725
|
}));
|
|
722
726
|
return function (_x11) {
|
|
723
|
-
return
|
|
727
|
+
return _ref28.apply(this, arguments);
|
|
724
728
|
};
|
|
725
729
|
}());
|
|
726
730
|
/**
|
|
@@ -728,13 +732,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
728
732
|
* 转发到资源模块去
|
|
729
733
|
*/
|
|
730
734
|
_defineProperty(this, "handleResourceList", /*#__PURE__*/function () {
|
|
731
|
-
var
|
|
735
|
+
var _ref31 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_ref30) {
|
|
732
736
|
var _this$resource;
|
|
733
737
|
var url, method, data, config, list;
|
|
734
738
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
735
739
|
while (1) switch (_context12.prev = _context12.next) {
|
|
736
740
|
case 0:
|
|
737
|
-
url =
|
|
741
|
+
url = _ref30.url, method = _ref30.method, data = _ref30.data, config = _ref30.config;
|
|
738
742
|
list = (_this$resource = _this.resource) === null || _this$resource === void 0 ? void 0 : _this$resource.getResources({
|
|
739
743
|
skip: (data === null || data === void 0 ? void 0 : data.skip) || 1,
|
|
740
744
|
num: (data === null || data === void 0 ? void 0 : data.num) || 10
|
|
@@ -758,7 +762,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
758
762
|
}, _callee12);
|
|
759
763
|
}));
|
|
760
764
|
return function (_x12) {
|
|
761
|
-
return
|
|
765
|
+
return _ref31.apply(this, arguments);
|
|
762
766
|
};
|
|
763
767
|
}());
|
|
764
768
|
/**
|
|
@@ -776,13 +780,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
776
780
|
* @example 批量:GET /update/localOrder?order_ids=96971,96972,96973
|
|
777
781
|
*/
|
|
778
782
|
_defineProperty(this, "handleUpdateLocalOrder", /*#__PURE__*/function () {
|
|
779
|
-
var
|
|
780
|
-
var _data$order_id,
|
|
783
|
+
var _ref33 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(_ref32) {
|
|
784
|
+
var _data$order_id, _ref34, _this$app;
|
|
781
785
|
var url, data, batchIds, rawOrderId, orderId, backendPath, _response$data, response, fresh, exists, _yield$_this$order$ov, overwritten, errorMessage;
|
|
782
786
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
783
787
|
while (1) switch (_context13.prev = _context13.next) {
|
|
784
788
|
case 0:
|
|
785
|
-
url =
|
|
789
|
+
url = _ref32.url, data = _ref32.data;
|
|
786
790
|
if (!(typeof (data === null || data === void 0 ? void 0 : data.order_id) === 'string' && data !== null && data !== void 0 && (_data$order_id = data.order_id) !== null && _data$order_id !== void 0 && _data$order_id.startsWith('LOCAL_'))) {
|
|
787
791
|
_context13.next = 3;
|
|
788
792
|
break;
|
|
@@ -799,7 +803,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
799
803
|
}
|
|
800
804
|
return _context13.abrupt("return", _this.handleUpdateLocalOrdersBatch(batchIds));
|
|
801
805
|
case 6:
|
|
802
|
-
rawOrderId = (
|
|
806
|
+
rawOrderId = (_ref34 = data && _typeof(data) === 'object' ? data.order_id : undefined) !== null && _ref34 !== void 0 ? _ref34 : _this.extractQueryParam(url, 'order_id');
|
|
803
807
|
orderId = rawOrderId === undefined || rawOrderId === null || rawOrderId === '' ? null : String(rawOrderId).trim();
|
|
804
808
|
_this.logInfo('handleUpdateLocalOrder: 开始处理', {
|
|
805
809
|
url: url,
|
|
@@ -931,16 +935,16 @@ var Server = /*#__PURE__*/function () {
|
|
|
931
935
|
}, _callee13, null, [[19, 41]]);
|
|
932
936
|
}));
|
|
933
937
|
return function (_x13) {
|
|
934
|
-
return
|
|
938
|
+
return _ref33.apply(this, arguments);
|
|
935
939
|
};
|
|
936
940
|
}());
|
|
937
941
|
_defineProperty(this, "handleOrderSalesCheckout", /*#__PURE__*/function () {
|
|
938
|
-
var
|
|
942
|
+
var _ref36 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_ref35) {
|
|
939
943
|
var data;
|
|
940
944
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
941
945
|
while (1) switch (_context14.prev = _context14.next) {
|
|
942
946
|
case 0:
|
|
943
|
-
data =
|
|
947
|
+
data = _ref35.data;
|
|
944
948
|
return _context14.abrupt("return", _this.handleOrderCheckoutSubmit({
|
|
945
949
|
backendPath: '/shop/order/sales/checkout',
|
|
946
950
|
data: data,
|
|
@@ -953,16 +957,16 @@ var Server = /*#__PURE__*/function () {
|
|
|
953
957
|
}, _callee14);
|
|
954
958
|
}));
|
|
955
959
|
return function (_x14) {
|
|
956
|
-
return
|
|
960
|
+
return _ref36.apply(this, arguments);
|
|
957
961
|
};
|
|
958
962
|
}());
|
|
959
963
|
_defineProperty(this, "handleOrderSalesDraft", /*#__PURE__*/function () {
|
|
960
|
-
var
|
|
964
|
+
var _ref38 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(_ref37) {
|
|
961
965
|
var data;
|
|
962
966
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
963
967
|
while (1) switch (_context15.prev = _context15.next) {
|
|
964
968
|
case 0:
|
|
965
|
-
data =
|
|
969
|
+
data = _ref37.data;
|
|
966
970
|
return _context15.abrupt("return", _this.handleOrderDraftSubmit({
|
|
967
971
|
data: data,
|
|
968
972
|
title: 'handleOrderSalesDraft'
|
|
@@ -974,16 +978,16 @@ var Server = /*#__PURE__*/function () {
|
|
|
974
978
|
}, _callee15);
|
|
975
979
|
}));
|
|
976
980
|
return function (_x15) {
|
|
977
|
-
return
|
|
981
|
+
return _ref38.apply(this, arguments);
|
|
978
982
|
};
|
|
979
983
|
}());
|
|
980
984
|
_defineProperty(this, "handleGetLocalPayment", /*#__PURE__*/function () {
|
|
981
|
-
var
|
|
985
|
+
var _ref40 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_ref39) {
|
|
982
986
|
var data, saleId, paymentNumber, operationId, requestContext, startedAt, found;
|
|
983
987
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
984
988
|
while (1) switch (_context16.prev = _context16.next) {
|
|
985
989
|
case 0:
|
|
986
|
-
data =
|
|
990
|
+
data = _ref39.data;
|
|
987
991
|
saleId = data === null || data === void 0 ? void 0 : data.sale_id;
|
|
988
992
|
paymentNumber = data === null || data === void 0 ? void 0 : data.payment_number;
|
|
989
993
|
operationId = _this.createLocalPaymentOperationId('get');
|
|
@@ -1073,16 +1077,16 @@ var Server = /*#__PURE__*/function () {
|
|
|
1073
1077
|
}, _callee16, null, [[13, 25]]);
|
|
1074
1078
|
}));
|
|
1075
1079
|
return function (_x16) {
|
|
1076
|
-
return
|
|
1080
|
+
return _ref40.apply(this, arguments);
|
|
1077
1081
|
};
|
|
1078
1082
|
}());
|
|
1079
1083
|
_defineProperty(this, "handleUpdateLocalPayment", /*#__PURE__*/function () {
|
|
1080
|
-
var
|
|
1084
|
+
var _ref42 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref41) {
|
|
1081
1085
|
var data, saleId, paymentNumber, number, status, serviceCharge, cardReaderSurcharge, hasSurchargeInput, invalidSurchargeFields, operationId, requestContext, queueKey;
|
|
1082
1086
|
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1083
1087
|
while (1) switch (_context17.prev = _context17.next) {
|
|
1084
1088
|
case 0:
|
|
1085
|
-
data =
|
|
1089
|
+
data = _ref41.data;
|
|
1086
1090
|
saleId = data === null || data === void 0 ? void 0 : data.sale_id;
|
|
1087
1091
|
paymentNumber = data === null || data === void 0 ? void 0 : data.payment_number;
|
|
1088
1092
|
number = data === null || data === void 0 ? void 0 : data.number;
|
|
@@ -1136,17 +1140,17 @@ var Server = /*#__PURE__*/function () {
|
|
|
1136
1140
|
}, _callee17);
|
|
1137
1141
|
}));
|
|
1138
1142
|
return function (_x17) {
|
|
1139
|
-
return
|
|
1143
|
+
return _ref42.apply(this, arguments);
|
|
1140
1144
|
};
|
|
1141
1145
|
}());
|
|
1142
1146
|
_defineProperty(this, "handleFinalizeLocalEftposPayment", /*#__PURE__*/function () {
|
|
1143
|
-
var
|
|
1144
|
-
var data,
|
|
1147
|
+
var _ref44 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(_ref43) {
|
|
1148
|
+
var data, _ref45, saleId, paymentNumber, result, _ref45$failed_transac, numbers;
|
|
1145
1149
|
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1146
1150
|
while (1) switch (_context19.prev = _context19.next) {
|
|
1147
1151
|
case 0:
|
|
1148
|
-
data =
|
|
1149
|
-
|
|
1152
|
+
data = _ref43.data;
|
|
1153
|
+
_ref45 = data || {}, saleId = _ref45.sale_id, paymentNumber = _ref45.payment_number, result = _ref45.result, _ref45$failed_transac = _ref45.failed_transaction_numbers, numbers = _ref45$failed_transac === void 0 ? [] : _ref45$failed_transac;
|
|
1150
1154
|
if (!(!saleId || !paymentNumber || !Array.isArray(numbers) || numbers.some(function (number) {
|
|
1151
1155
|
return typeof number !== 'string' || !number.trim();
|
|
1152
1156
|
}) || result !== 'failed' && result !== 'not_started' || result === 'failed' && numbers.length === 0 || result === 'not_started' && numbers.length !== 0)) {
|
|
@@ -1202,16 +1206,16 @@ var Server = /*#__PURE__*/function () {
|
|
|
1202
1206
|
}, _callee19);
|
|
1203
1207
|
}));
|
|
1204
1208
|
return function (_x18) {
|
|
1205
|
-
return
|
|
1209
|
+
return _ref44.apply(this, arguments);
|
|
1206
1210
|
};
|
|
1207
1211
|
}());
|
|
1208
1212
|
_defineProperty(this, "handleOrderCheckout", /*#__PURE__*/function () {
|
|
1209
|
-
var
|
|
1213
|
+
var _ref48 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(_ref47) {
|
|
1210
1214
|
var data;
|
|
1211
1215
|
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
1212
1216
|
while (1) switch (_context20.prev = _context20.next) {
|
|
1213
1217
|
case 0:
|
|
1214
|
-
data =
|
|
1218
|
+
data = _ref47.data;
|
|
1215
1219
|
return _context20.abrupt("return", _this.handleOrderCheckoutSubmit({
|
|
1216
1220
|
backendPath: '/order/checkout',
|
|
1217
1221
|
data: data,
|
|
@@ -1224,16 +1228,16 @@ var Server = /*#__PURE__*/function () {
|
|
|
1224
1228
|
}, _callee20);
|
|
1225
1229
|
}));
|
|
1226
1230
|
return function (_x19) {
|
|
1227
|
-
return
|
|
1231
|
+
return _ref48.apply(this, arguments);
|
|
1228
1232
|
};
|
|
1229
1233
|
}());
|
|
1230
1234
|
_defineProperty(this, "handleLocalPrintOrder", /*#__PURE__*/function () {
|
|
1231
|
-
var
|
|
1235
|
+
var _ref50 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(_ref49) {
|
|
1232
1236
|
var data, _extractedRequestTemp, _nestedOrderTemplateS, _extractedRequest$inv, _extractedRequestTemp2, _this$getLocalPrintOr, _need_sync, extractedRequest, extractedRequestTemplateSettings, requestOrder, nestedOrder, nestedOrderTemplateSettings, inputOrder, invoiceLayoutConfig, invoiceTemplateSettings, shouldLookup, lookup, sourceOrder, _this$order, localOrder, remoteResult, checkoutData, printableOrder, printResult, message;
|
|
1233
1237
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1234
1238
|
while (1) switch (_context21.prev = _context21.next) {
|
|
1235
1239
|
case 0:
|
|
1236
|
-
data =
|
|
1240
|
+
data = _ref49.data;
|
|
1237
1241
|
_context21.prev = 1;
|
|
1238
1242
|
extractedRequest = _this.extractInvoiceLayoutConfig(data, {
|
|
1239
1243
|
includePublicInvoice: true
|
|
@@ -1394,17 +1398,17 @@ var Server = /*#__PURE__*/function () {
|
|
|
1394
1398
|
}, _callee21, null, [[1, 43]]);
|
|
1395
1399
|
}));
|
|
1396
1400
|
return function (_x20) {
|
|
1397
|
-
return
|
|
1401
|
+
return _ref50.apply(this, arguments);
|
|
1398
1402
|
};
|
|
1399
1403
|
}());
|
|
1400
1404
|
_defineProperty(this, "handleLocalOrderReceiptSnapshot", /*#__PURE__*/function () {
|
|
1401
|
-
var
|
|
1405
|
+
var _ref52 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(_ref51) {
|
|
1402
1406
|
var _this$order2;
|
|
1403
1407
|
var data, input, lookup, _payment_info, sourceOrder, remoteResult, paymentInfo, rebuiltOrder, smallTicketData, message;
|
|
1404
1408
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
1405
1409
|
while (1) switch (_context22.prev = _context22.next) {
|
|
1406
1410
|
case 0:
|
|
1407
|
-
data =
|
|
1411
|
+
data = _ref51.data;
|
|
1408
1412
|
input = data && _typeof(data) === 'object' && !Array.isArray(data) ? data : {};
|
|
1409
1413
|
lookup = _this.getLocalPrintOrderLookup(input);
|
|
1410
1414
|
if (!(lookup === undefined)) {
|
|
@@ -1530,17 +1534,17 @@ var Server = /*#__PURE__*/function () {
|
|
|
1530
1534
|
}, _callee22, null, [[7, 29]]);
|
|
1531
1535
|
}));
|
|
1532
1536
|
return function (_x21) {
|
|
1533
|
-
return
|
|
1537
|
+
return _ref52.apply(this, arguments);
|
|
1534
1538
|
};
|
|
1535
1539
|
}());
|
|
1536
1540
|
_defineProperty(this, "handleMachinecodeBatchMeta", /*#__PURE__*/function () {
|
|
1537
|
-
var
|
|
1541
|
+
var _ref54 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(_ref53) {
|
|
1538
1542
|
var _this$resolveMachinec, _this$app2;
|
|
1539
1543
|
var data, title, backendPath, ids, status, message, _response$code, _response$status, _response$message, _response$data2, response, backendError, _backendError$code, _backendError$status, _backendError$message, _backendError$data, _message;
|
|
1540
1544
|
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
1541
1545
|
while (1) switch (_context23.prev = _context23.next) {
|
|
1542
1546
|
case 0:
|
|
1543
|
-
data =
|
|
1547
|
+
data = _ref53.data;
|
|
1544
1548
|
title = 'handleMachinecodeBatchMeta';
|
|
1545
1549
|
backendPath = '/shop/machinecode/batch';
|
|
1546
1550
|
ids = Array.isArray(data === null || data === void 0 ? void 0 : data.ids) ? data.ids : [];
|
|
@@ -1659,16 +1663,16 @@ var Server = /*#__PURE__*/function () {
|
|
|
1659
1663
|
}, _callee23, null, [[10, 15], [23, 30]]);
|
|
1660
1664
|
}));
|
|
1661
1665
|
return function (_x22) {
|
|
1662
|
-
return
|
|
1666
|
+
return _ref54.apply(this, arguments);
|
|
1663
1667
|
};
|
|
1664
1668
|
}());
|
|
1665
1669
|
_defineProperty(this, "handleOrderSalesDetail", /*#__PURE__*/function () {
|
|
1666
|
-
var
|
|
1670
|
+
var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(_ref55) {
|
|
1667
1671
|
var url, data, path, requestPath, lookup, localOrder, refreshedOrder, _enrichedOrder, remoteResult, enrichedOrder;
|
|
1668
1672
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
1669
1673
|
while (1) switch (_context24.prev = _context24.next) {
|
|
1670
1674
|
case 0:
|
|
1671
|
-
url =
|
|
1675
|
+
url = _ref55.url, data = _ref55.data, path = _ref55.path;
|
|
1672
1676
|
requestPath = _this.parseRequestPath(url, path);
|
|
1673
1677
|
lookup = _this.extractOrderSalesDetailLookup(requestPath);
|
|
1674
1678
|
_this.logInfo('handleOrderSalesDetail: 开始处理', {
|
|
@@ -1765,19 +1769,19 @@ var Server = /*#__PURE__*/function () {
|
|
|
1765
1769
|
}, _callee24);
|
|
1766
1770
|
}));
|
|
1767
1771
|
return function (_x23) {
|
|
1768
|
-
return
|
|
1772
|
+
return _ref56.apply(this, arguments);
|
|
1769
1773
|
};
|
|
1770
1774
|
}());
|
|
1771
1775
|
/**
|
|
1772
1776
|
* GET /shop/schedule/floor-plan* 前缀路由:读本地 store;支持 subscriberId + callback 订阅更新
|
|
1773
1777
|
*/
|
|
1774
1778
|
_defineProperty(this, "handleFloorPlanGet", /*#__PURE__*/function () {
|
|
1775
|
-
var
|
|
1776
|
-
var url, data, config, routePath, base, path, _subscriberId,
|
|
1779
|
+
var _ref58 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(_ref57) {
|
|
1780
|
+
var url, data, config, routePath, base, path, _subscriberId, _ref59, callback, subscriberId, ctx;
|
|
1777
1781
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1778
1782
|
while (1) switch (_context25.prev = _context25.next) {
|
|
1779
1783
|
case 0:
|
|
1780
|
-
url =
|
|
1784
|
+
url = _ref57.url, data = _ref57.data, config = _ref57.config, routePath = _ref57.path;
|
|
1781
1785
|
base = '/shop/schedule/floor-plan';
|
|
1782
1786
|
path = _this.parseRequestPath(url, routePath);
|
|
1783
1787
|
if (!(path === "".concat(base, "/unsubscribe") || path === "".concat(base, "/code/unsubscribe"))) {
|
|
@@ -1798,7 +1802,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1798
1802
|
status: true
|
|
1799
1803
|
});
|
|
1800
1804
|
case 7:
|
|
1801
|
-
|
|
1805
|
+
_ref59 = config || {}, callback = _ref59.callback, subscriberId = _ref59.subscriberId;
|
|
1802
1806
|
ctx = _this.resolveFloorPlanQueryContext(path, base);
|
|
1803
1807
|
if (ctx) {
|
|
1804
1808
|
_context25.next = 11;
|
|
@@ -1830,20 +1834,20 @@ var Server = /*#__PURE__*/function () {
|
|
|
1830
1834
|
}, _callee25);
|
|
1831
1835
|
}));
|
|
1832
1836
|
return function (_x24) {
|
|
1833
|
-
return
|
|
1837
|
+
return _ref58.apply(this, arguments);
|
|
1834
1838
|
};
|
|
1835
1839
|
}());
|
|
1836
1840
|
/**
|
|
1837
1841
|
* 取消预约列表查询订阅(HTTP 路由入口)
|
|
1838
1842
|
*/
|
|
1839
1843
|
_defineProperty(this, "handleUnsubscribeBookingQuery", /*#__PURE__*/function () {
|
|
1840
|
-
var
|
|
1841
|
-
var data,
|
|
1844
|
+
var _ref61 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(_ref60) {
|
|
1845
|
+
var data, _ref62, subscriberId;
|
|
1842
1846
|
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
1843
1847
|
while (1) switch (_context26.prev = _context26.next) {
|
|
1844
1848
|
case 0:
|
|
1845
|
-
data =
|
|
1846
|
-
|
|
1849
|
+
data = _ref60.data;
|
|
1850
|
+
_ref62 = data || {}, subscriberId = _ref62.subscriberId;
|
|
1847
1851
|
if (subscriberId) {
|
|
1848
1852
|
_this.bookingQuerySubscribers.delete(subscriberId);
|
|
1849
1853
|
_this.bookingRemoteQuerySubscribers.delete(subscriberId);
|
|
@@ -1865,7 +1869,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1865
1869
|
}, _callee26);
|
|
1866
1870
|
}));
|
|
1867
1871
|
return function (_x25) {
|
|
1868
|
-
return
|
|
1872
|
+
return _ref61.apply(this, arguments);
|
|
1869
1873
|
};
|
|
1870
1874
|
}());
|
|
1871
1875
|
/**
|
|
@@ -1873,13 +1877,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
1873
1877
|
* 通过餐牌ID列表获取所有相关日程的时间段点
|
|
1874
1878
|
*/
|
|
1875
1879
|
_defineProperty(this, "handleGetScheduleTimePoints", /*#__PURE__*/function () {
|
|
1876
|
-
var
|
|
1880
|
+
var _ref64 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(_ref63) {
|
|
1877
1881
|
var _menu_list_ids$length;
|
|
1878
1882
|
var url, method, data, config, menu_list_ids, _menu_list_ids$length2, _this$getMenuSchedule, menuList, scheduleIds, scheduleList, timePoints, errorMessage;
|
|
1879
1883
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
1880
1884
|
while (1) switch (_context27.prev = _context27.next) {
|
|
1881
1885
|
case 0:
|
|
1882
|
-
url =
|
|
1886
|
+
url = _ref63.url, method = _ref63.method, data = _ref63.data, config = _ref63.config;
|
|
1883
1887
|
menu_list_ids = data.menu_list_ids;
|
|
1884
1888
|
_this.logInfo('handleGetScheduleTimePoints 开始处理', {
|
|
1885
1889
|
menuListIdsCount: (_menu_list_ids$length = menu_list_ids === null || menu_list_ids === void 0 ? void 0 : menu_list_ids.length) !== null && _menu_list_ids$length !== void 0 ? _menu_list_ids$length : 0,
|
|
@@ -1992,7 +1996,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1992
1996
|
}, _callee27, null, [[15, 27]]);
|
|
1993
1997
|
}));
|
|
1994
1998
|
return function (_x26) {
|
|
1995
|
-
return
|
|
1999
|
+
return _ref64.apply(this, arguments);
|
|
1996
2000
|
};
|
|
1997
2001
|
}());
|
|
1998
2002
|
this.core = core;
|
|
@@ -3768,13 +3772,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
3768
3772
|
method: 'post',
|
|
3769
3773
|
path: '/shop/local/orderPaymentReadiness',
|
|
3770
3774
|
handler: function () {
|
|
3771
|
-
var _handler = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(
|
|
3775
|
+
var _handler = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(_ref65) {
|
|
3772
3776
|
var _this9$order;
|
|
3773
3777
|
var data;
|
|
3774
3778
|
return _regeneratorRuntime().wrap(function _callee44$(_context44) {
|
|
3775
3779
|
while (1) switch (_context44.prev = _context44.next) {
|
|
3776
3780
|
case 0:
|
|
3777
|
-
data =
|
|
3781
|
+
data = _ref65.data;
|
|
3778
3782
|
_context44.next = 3;
|
|
3779
3783
|
return (_this9$order = _this9.order) === null || _this9$order === void 0 ? void 0 : _this9$order.getLocalOrderForPaymentReadiness(data === null || data === void 0 ? void 0 : data.sale_id);
|
|
3780
3784
|
case 3:
|
|
@@ -4180,11 +4184,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
4180
4184
|
*/
|
|
4181
4185
|
}, {
|
|
4182
4186
|
key: "syncProductQueryScheduleTimers",
|
|
4183
|
-
value: function syncProductQueryScheduleTimers(
|
|
4187
|
+
value: function syncProductQueryScheduleTimers(_ref67) {
|
|
4184
4188
|
var _this$products$getLas3, _this$products2, _this$products2$getLa;
|
|
4185
|
-
var subscriberId =
|
|
4186
|
-
menu_list_ids =
|
|
4187
|
-
strategy_context =
|
|
4189
|
+
var subscriberId = _ref67.subscriberId,
|
|
4190
|
+
menu_list_ids = _ref67.menu_list_ids,
|
|
4191
|
+
strategy_context = _ref67.strategy_context;
|
|
4188
4192
|
this.clearSubscriberScheduleTimers(subscriberId);
|
|
4189
4193
|
if (!this.shouldScheduleProductQueryReload(strategy_context)) {
|
|
4190
4194
|
return;
|
|
@@ -4283,7 +4287,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
4283
4287
|
*/
|
|
4284
4288
|
function () {
|
|
4285
4289
|
var _handleSalesSearchRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(kind, backendPath, data, config) {
|
|
4286
|
-
var queryPayload, result,
|
|
4290
|
+
var queryPayload, result, _ref68, callback, subscriberId, resetVisibleOrderIds, contextSignature, existing, shouldReset, visibleOrderIds, _iterator5, _step5, orderId;
|
|
4287
4291
|
return _regeneratorRuntime().wrap(function _callee51$(_context51) {
|
|
4288
4292
|
while (1) switch (_context51.prev = _context51.next) {
|
|
4289
4293
|
case 0:
|
|
@@ -4292,7 +4296,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
4292
4296
|
return this.fetchSalesSearchFromAPI(backendPath, queryPayload);
|
|
4293
4297
|
case 3:
|
|
4294
4298
|
result = _context51.sent;
|
|
4295
|
-
|
|
4299
|
+
_ref68 = config || {}, callback = _ref68.callback, subscriberId = _ref68.subscriberId, resetVisibleOrderIds = _ref68.resetVisibleOrderIds;
|
|
4296
4300
|
if (subscriberId && typeof callback === 'function') {
|
|
4297
4301
|
contextSignature = this.buildSalesSearchSignature(kind, queryPayload);
|
|
4298
4302
|
existing = this.salesSearchSubscribers.get(subscriberId);
|
|
@@ -5698,9 +5702,14 @@ var Server = /*#__PURE__*/function () {
|
|
|
5698
5702
|
}, {
|
|
5699
5703
|
key: "getSmallTicketShopInfo",
|
|
5700
5704
|
value: function getSmallTicketShopInfo() {
|
|
5701
|
-
var _shopInfo$is_price_in;
|
|
5705
|
+
var _this$app15, _this$app15$getStore, _this$app15$getStore$, _this$app15$getStore$2, _this$app16, _this$app16$getStore, _this$app16$getStore$, _this$app16$getStore$2, _shopInfo$is_price_in;
|
|
5702
5706
|
var shopInfo = this.getAppData('shop_info') || {};
|
|
5707
|
+
// WebPOS getData does not expose core/default_domain; read the business
|
|
5708
|
+
// shop model directly when the expanded shop_info has not loaded it yet.
|
|
5709
|
+
var shopCore = ((_this$app15 = this.app) === null || _this$app15 === void 0 || (_this$app15 = _this$app15.models) === null || _this$app15 === void 0 || (_this$app15$getStore = _this$app15.getStore) === null || _this$app15$getStore === void 0 || (_this$app15$getStore$ = (_this$app15$getStore$2 = _this$app15$getStore.call(_this$app15)).getDataByModel) === null || _this$app15$getStore$ === void 0 ? void 0 : _this$app15$getStore$.call(_this$app15$getStore$2, 'core', 'core')) || ((_this$app16 = this.app) === null || _this$app16 === void 0 || (_this$app16 = _this$app16.data) === null || _this$app16 === void 0 || (_this$app16 = _this$app16.store) === null || _this$app16 === void 0 || (_this$app16$getStore = _this$app16.getStore) === null || _this$app16$getStore === void 0 || (_this$app16$getStore$ = (_this$app16$getStore$2 = _this$app16$getStore.call(_this$app16)).getDataByModel) === null || _this$app16$getStore$ === void 0 ? void 0 : _this$app16$getStore$.call(_this$app16$getStore$2, 'core', 'core')) || {};
|
|
5703
5710
|
return _objectSpread(_objectSpread({}, shopInfo), {}, {
|
|
5711
|
+
default_domain: shopInfo.default_domain || shopCore.default_domain,
|
|
5712
|
+
private_domain_protocol: shopInfo.private_domain_protocol || shopCore.private_domain_protocol,
|
|
5704
5713
|
currency_symbol: shopInfo.currency_symbol || this.getAppData('shop_symbol') || this.getAppData('currency_symbol'),
|
|
5705
5714
|
currency_code: shopInfo.currency_code || this.getAppData('shop_currency_code') || this.getAppData('currency_code'),
|
|
5706
5715
|
tax_title: shopInfo.tax_title || this.getAppData('tax_title'),
|
|
@@ -6427,15 +6436,15 @@ var Server = /*#__PURE__*/function () {
|
|
|
6427
6436
|
}, {
|
|
6428
6437
|
key: "mergeLocalPrintOrderInput",
|
|
6429
6438
|
value: function mergeLocalPrintOrderInput(localOrder, inputOrder) {
|
|
6430
|
-
var
|
|
6431
|
-
var definedInput = Object.fromEntries(Object.entries(inputOrder || {}).filter(function (
|
|
6432
|
-
var
|
|
6433
|
-
value =
|
|
6439
|
+
var _ref72, _localOrder$order_id, _ref73, _external_sale_number4;
|
|
6440
|
+
var definedInput = Object.fromEntries(Object.entries(inputOrder || {}).filter(function (_ref70) {
|
|
6441
|
+
var _ref71 = _slicedToArray(_ref70, 2),
|
|
6442
|
+
value = _ref71[1];
|
|
6434
6443
|
return value !== undefined;
|
|
6435
6444
|
}));
|
|
6436
6445
|
return _objectSpread(_objectSpread(_objectSpread({}, localOrder), definedInput), {}, {
|
|
6437
|
-
order_id: (
|
|
6438
|
-
external_sale_number: (
|
|
6446
|
+
order_id: (_ref72 = (_localOrder$order_id = localOrder.order_id) !== null && _localOrder$order_id !== void 0 ? _localOrder$order_id : definedInput.order_id) !== null && _ref72 !== void 0 ? _ref72 : definedInput.orderId,
|
|
6447
|
+
external_sale_number: (_ref73 = (_external_sale_number4 = localOrder.external_sale_number) !== null && _external_sale_number4 !== void 0 ? _external_sale_number4 : definedInput.external_sale_number) !== null && _ref73 !== void 0 ? _ref73 : definedInput.externalSaleNumber
|
|
6439
6448
|
});
|
|
6440
6449
|
}
|
|
6441
6450
|
}, {
|
|
@@ -6746,13 +6755,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
6746
6755
|
key: "handleSyncCheckoutSubmit",
|
|
6747
6756
|
value: function () {
|
|
6748
6757
|
var _handleSyncCheckoutSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(params) {
|
|
6749
|
-
var _this$
|
|
6758
|
+
var _this$app17;
|
|
6750
6759
|
var backendPath, data, title, invoiceLayoutConfig, invoiceTemplateSettings, receiptAutoPrintPaymentStatuses, syncResult, _normalized$data, normalized, response, syncedOrder, backendError, _normalized$data2, _normalized, message;
|
|
6751
6760
|
return _regeneratorRuntime().wrap(function _callee67$(_context67) {
|
|
6752
6761
|
while (1) switch (_context67.prev = _context67.next) {
|
|
6753
6762
|
case 0:
|
|
6754
6763
|
backendPath = params.backendPath, data = params.data, title = params.title, invoiceLayoutConfig = params.invoiceLayoutConfig, invoiceTemplateSettings = params.invoiceTemplateSettings, receiptAutoPrintPaymentStatuses = params.receiptAutoPrintPaymentStatuses;
|
|
6755
|
-
if ((_this$
|
|
6764
|
+
if ((_this$app17 = this.app) !== null && _this$app17 !== void 0 && (_this$app17 = _this$app17.request) !== null && _this$app17 !== void 0 && _this$app17.post) {
|
|
6756
6765
|
_context67.next = 4;
|
|
6757
6766
|
break;
|
|
6758
6767
|
}
|
|
@@ -7110,9 +7119,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
7110
7119
|
}, {
|
|
7111
7120
|
key: "shouldAutoPrintCheckoutReceipt",
|
|
7112
7121
|
value: function shouldAutoPrintCheckoutReceipt() {
|
|
7113
|
-
var _this$core$context2, _this$core$context2$g, _this$
|
|
7122
|
+
var _this$core$context2, _this$core$context2$g, _this$app18, _this$app18$getStorag;
|
|
7114
7123
|
if (((_this$core$context2 = this.core.context) === null || _this$core$context2 === void 0 || (_this$core$context2$g = _this$core$context2.getPlatform) === null || _this$core$context2$g === void 0 ? void 0 : _this$core$context2$g.call(_this$core$context2)) !== 'android') return true;
|
|
7115
|
-
return ((_this$
|
|
7124
|
+
return ((_this$app18 = this.app) === null || _this$app18 === void 0 || (_this$app18 = _this$app18.storage) === null || _this$app18 === void 0 || (_this$app18$getStorag = _this$app18.getStorage) === null || _this$app18$getStorag === void 0 ? void 0 : _this$app18$getStorag.call(_this$app18, AUTO_PRINT_STORAGE_KEY)) !== 'false';
|
|
7116
7125
|
}
|
|
7117
7126
|
|
|
7118
7127
|
/** Only receipt auto-printing uses this policy; vouchers retain their paid-order gate. */
|
|
@@ -7152,7 +7161,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7152
7161
|
}, {
|
|
7153
7162
|
key: "isSalesOrderFullyPaid",
|
|
7154
7163
|
value: function isSalesOrderFullyPaid(order) {
|
|
7155
|
-
var _order$summary$amount, _order$summary,
|
|
7164
|
+
var _order$summary$amount, _order$summary, _ref74, _ref75, _order$summary$expect, _order$summary2, _order$summary3;
|
|
7156
7165
|
if (!order || _typeof(order) !== 'object') return false;
|
|
7157
7166
|
var paymentStatus = String(order.payment_status || '').toLowerCase();
|
|
7158
7167
|
if (paymentStatus === 'paid' || paymentStatus === 'finished') return true;
|
|
@@ -7164,7 +7173,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7164
7173
|
return this.toAmountNumber(amountGap) <= 0;
|
|
7165
7174
|
}
|
|
7166
7175
|
var paidAmount = this.sumPaidOrderPayments(order.payments);
|
|
7167
|
-
var targetAmount = this.toAmountNumber((
|
|
7176
|
+
var targetAmount = this.toAmountNumber((_ref74 = (_ref75 = (_order$summary$expect = (_order$summary2 = order.summary) === null || _order$summary2 === void 0 ? void 0 : _order$summary2.expect_amount) !== null && _order$summary$expect !== void 0 ? _order$summary$expect : (_order$summary3 = order.summary) === null || _order$summary3 === void 0 ? void 0 : _order$summary3.total_amount) !== null && _ref75 !== void 0 ? _ref75 : order.expect_amount) !== null && _ref74 !== void 0 ? _ref74 : order.total_amount);
|
|
7168
7177
|
if (targetAmount <= 0) return paidAmount > 0;
|
|
7169
7178
|
return paidAmount >= targetAmount;
|
|
7170
7179
|
}
|
|
@@ -7208,8 +7217,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
7208
7217
|
}
|
|
7209
7218
|
if (Array.isArray(product === null || product === void 0 ? void 0 : product.product_bundle)) {
|
|
7210
7219
|
product.product_bundle.forEach(function (bundle) {
|
|
7211
|
-
var
|
|
7212
|
-
var bundleProductId = (
|
|
7220
|
+
var _ref76, _bundle$bundle_produc;
|
|
7221
|
+
var bundleProductId = (_ref76 = (_bundle$bundle_produc = bundle === null || bundle === void 0 ? void 0 : bundle.bundle_product_id) !== null && _bundle$bundle_produc !== void 0 ? _bundle$bundle_produc : bundle === null || bundle === void 0 ? void 0 : bundle._bundle_product_id) !== null && _ref76 !== void 0 ? _ref76 : bundle === null || bundle === void 0 ? void 0 : bundle.product_id;
|
|
7213
7222
|
if (bundleProductId !== undefined && bundleProductId !== null && bundleProductId !== '') {
|
|
7214
7223
|
productIdSet.add(bundleProductId);
|
|
7215
7224
|
}
|
|
@@ -7225,7 +7234,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7225
7234
|
case 6:
|
|
7226
7235
|
_context72.next = 8;
|
|
7227
7236
|
return Promise.all(productIds.map( /*#__PURE__*/function () {
|
|
7228
|
-
var
|
|
7237
|
+
var _ref77 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(id) {
|
|
7229
7238
|
var _this21$products, _this21$products$getP, product;
|
|
7230
7239
|
return _regeneratorRuntime().wrap(function _callee71$(_context71) {
|
|
7231
7240
|
while (1) switch (_context71.prev = _context71.next) {
|
|
@@ -7251,7 +7260,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7251
7260
|
}, _callee71, null, [[0, 7]]);
|
|
7252
7261
|
}));
|
|
7253
7262
|
return function (_x80) {
|
|
7254
|
-
return
|
|
7263
|
+
return _ref77.apply(this, arguments);
|
|
7255
7264
|
};
|
|
7256
7265
|
}()));
|
|
7257
7266
|
case 8:
|
|
@@ -7290,8 +7299,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
7290
7299
|
addProductId((_product$product_id2 = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id2 !== void 0 ? _product$product_id2 : product === null || product === void 0 ? void 0 : product.id);
|
|
7291
7300
|
if (Array.isArray(product === null || product === void 0 ? void 0 : product.product_bundle)) {
|
|
7292
7301
|
product.product_bundle.forEach(function (bundle) {
|
|
7293
|
-
var
|
|
7294
|
-
addProductId((
|
|
7302
|
+
var _ref78, _bundle$bundle_produc2;
|
|
7303
|
+
addProductId((_ref78 = (_bundle$bundle_produc2 = bundle === null || bundle === void 0 ? void 0 : bundle.bundle_product_id) !== null && _bundle$bundle_produc2 !== void 0 ? _bundle$bundle_produc2 : bundle === null || bundle === void 0 ? void 0 : bundle._bundle_product_id) !== null && _ref78 !== void 0 ? _ref78 : bundle === null || bundle === void 0 ? void 0 : bundle.product_id);
|
|
7295
7304
|
});
|
|
7296
7305
|
}
|
|
7297
7306
|
});
|
|
@@ -7367,9 +7376,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
7367
7376
|
if (!Array.isArray(product === null || product === void 0 ? void 0 : product.product_bundle)) return product;
|
|
7368
7377
|
var hasChanged = false;
|
|
7369
7378
|
var productBundle = product.product_bundle.map(function (bundle) {
|
|
7370
|
-
var
|
|
7379
|
+
var _ref79, _bundle$bundle_produc3;
|
|
7371
7380
|
if (!bundle || _typeof(bundle) !== 'object') return bundle;
|
|
7372
|
-
var rawProductId = (
|
|
7381
|
+
var rawProductId = (_ref79 = (_bundle$bundle_produc3 = bundle === null || bundle === void 0 ? void 0 : bundle.bundle_product_id) !== null && _bundle$bundle_produc3 !== void 0 ? _bundle$bundle_produc3 : bundle === null || bundle === void 0 ? void 0 : bundle._bundle_product_id) !== null && _ref79 !== void 0 ? _ref79 : bundle === null || bundle === void 0 ? void 0 : bundle.product_id;
|
|
7373
7382
|
if (rawProductId === undefined || rawProductId === null || rawProductId === '') return bundle;
|
|
7374
7383
|
var productId = Number(rawProductId);
|
|
7375
7384
|
if (!Number.isFinite(productId)) return bundle;
|
|
@@ -7493,7 +7502,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7493
7502
|
}, {
|
|
7494
7503
|
key: "resolveProductTitleValue",
|
|
7495
7504
|
value: function resolveProductTitleValue(value, key, currentLocale) {
|
|
7496
|
-
var
|
|
7505
|
+
var _ref80, _ref81, _value$key;
|
|
7497
7506
|
if (value === undefined || value === null || value === '') return null;
|
|
7498
7507
|
if (_typeof(value) !== 'object') {
|
|
7499
7508
|
var title = String(value);
|
|
@@ -7503,7 +7512,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7503
7512
|
}
|
|
7504
7513
|
var normalizedKey = key.replace('-', '_');
|
|
7505
7514
|
var dashedKey = key.replace('_', '-');
|
|
7506
|
-
var rawValue = (
|
|
7515
|
+
var rawValue = (_ref80 = (_ref81 = (_value$key = value[key]) !== null && _value$key !== void 0 ? _value$key : value[normalizedKey]) !== null && _ref81 !== void 0 ? _ref81 : value[dashedKey]) !== null && _ref80 !== void 0 ? _ref80 : key === 'auto' ? value.default : undefined;
|
|
7507
7516
|
if (rawValue === undefined || rawValue === null || rawValue === '') return null;
|
|
7508
7517
|
if (_typeof(rawValue) === 'object') return this.resolveFirstProductTitleValue(rawValue);
|
|
7509
7518
|
return String(rawValue);
|
|
@@ -7647,7 +7656,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7647
7656
|
key: "withLocalSmallTicketData",
|
|
7648
7657
|
value: function () {
|
|
7649
7658
|
var _withLocalSmallTicketData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(order, options) {
|
|
7650
|
-
var mustApplyVisibility, _options$productMap, normalizedCollections, normalizedOrder, collapsedDuplicateCounts,
|
|
7659
|
+
var mustApplyVisibility, _options$productMap, normalizedCollections, normalizedOrder, collapsedDuplicateCounts, _ref82, _ref83, _order_id, enrichedOrder, productMap, smallTicketData;
|
|
7651
7660
|
return _regeneratorRuntime().wrap(function _callee76$(_context76) {
|
|
7652
7661
|
while (1) switch (_context76.prev = _context76.next) {
|
|
7653
7662
|
case 0:
|
|
@@ -7678,7 +7687,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7678
7687
|
return count > 0;
|
|
7679
7688
|
})) {
|
|
7680
7689
|
this.logWarning('withLocalSmallTicketData: 折叠重复订单子项', {
|
|
7681
|
-
order_identifier: (
|
|
7690
|
+
order_identifier: (_ref82 = (_ref83 = (_order_id = normalizedOrder.order_id) !== null && _order_id !== void 0 ? _order_id : normalizedOrder.external_sale_number) !== null && _ref83 !== void 0 ? _ref83 : normalizedOrder.shop_order_number) !== null && _ref82 !== void 0 ? _ref82 : null,
|
|
7682
7691
|
collapsed_duplicate_counts: collapsedDuplicateCounts
|
|
7683
7692
|
});
|
|
7684
7693
|
}
|
|
@@ -7748,8 +7757,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
7748
7757
|
key: "fetchAndPersistSalesOrderByLookup",
|
|
7749
7758
|
value: function () {
|
|
7750
7759
|
var _fetchAndPersistSalesOrderByLookup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(lookup, data, title, paymentIdentityOrder) {
|
|
7751
|
-
var _this$order7, _this$order8, _this$
|
|
7752
|
-
var backendPath, _this$order$getLocalO, _this$order9, response, _response$code3, responseStatusCode, code, message, fresh, localBeforeRefresh, orderToPersist, remotePayments, paidPayments, paymentIdsComplete, savedOrder, _errorRecord$response, backendError, errorRecord, _responseStatusCode,
|
|
7760
|
+
var _this$order7, _this$order8, _this$app19;
|
|
7761
|
+
var backendPath, _this$order$getLocalO, _this$order9, response, _response$code3, responseStatusCode, code, message, fresh, localBeforeRefresh, orderToPersist, remotePayments, paidPayments, paymentIdsComplete, savedOrder, _errorRecord$response, backendError, errorRecord, _responseStatusCode, _ref84, _backendError$code2, backendStatusCode, _code, _message2, _message3;
|
|
7753
7762
|
return _regeneratorRuntime().wrap(function _callee77$(_context77) {
|
|
7754
7763
|
while (1) switch (_context77.prev = _context77.next) {
|
|
7755
7764
|
case 0:
|
|
@@ -7764,7 +7773,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7764
7773
|
order: null
|
|
7765
7774
|
});
|
|
7766
7775
|
case 3:
|
|
7767
|
-
if ((_this$
|
|
7776
|
+
if ((_this$app19 = this.app) !== null && _this$app19 !== void 0 && (_this$app19 = _this$app19.request) !== null && _this$app19 !== void 0 && _this$app19.get) {
|
|
7768
7777
|
_context77.next = 6;
|
|
7769
7778
|
break;
|
|
7770
7779
|
}
|
|
@@ -7955,7 +7964,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7955
7964
|
break;
|
|
7956
7965
|
}
|
|
7957
7966
|
backendStatusCode = typeof (backendError === null || backendError === void 0 ? void 0 : backendError.status) === 'number' ? backendError.status : undefined;
|
|
7958
|
-
_code = this.normalizeRemoteSalesOrderErrorCode((
|
|
7967
|
+
_code = this.normalizeRemoteSalesOrderErrorCode((_ref84 = (_backendError$code2 = backendError === null || backendError === void 0 ? void 0 : backendError.code) !== null && _backendError$code2 !== void 0 ? _backendError$code2 : backendStatusCode) !== null && _ref84 !== void 0 ? _ref84 : _responseStatusCode);
|
|
7959
7968
|
_message2 = (backendError === null || backendError === void 0 ? void 0 : backendError.message) || this.getUnknownErrorMessage(_context77.t2);
|
|
7960
7969
|
this.logInfo("".concat(title, ": \u540E\u7AEF\u8BA2\u5355\u67E5\u8BE2\u5931\u8D25"), {
|
|
7961
7970
|
lookup: lookup,
|
|
@@ -8049,7 +8058,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
8049
8058
|
key: "handleUpdateLocalOrdersBatch",
|
|
8050
8059
|
value: (function () {
|
|
8051
8060
|
var _handleUpdateLocalOrdersBatch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(orderIds) {
|
|
8052
|
-
var _this$
|
|
8061
|
+
var _this$app20;
|
|
8053
8062
|
var existedBefore, _iterator13, _step13, id, fetched, message, fetchedMap, _iterator14, _step14, order, oid, freshOrders, succeedIds, failed, _iterator15, _step15, _id, fresh, _message4, overwritten, inserted;
|
|
8054
8063
|
return _regeneratorRuntime().wrap(function _callee78$(_context78) {
|
|
8055
8064
|
while (1) switch (_context78.prev = _context78.next) {
|
|
@@ -8070,7 +8079,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
8070
8079
|
data: null
|
|
8071
8080
|
});
|
|
8072
8081
|
case 4:
|
|
8073
|
-
if ((_this$
|
|
8082
|
+
if ((_this$app20 = this.app) !== null && _this$app20 !== void 0 && _this$app20.request) {
|
|
8074
8083
|
_context78.next = 7;
|
|
8075
8084
|
break;
|
|
8076
8085
|
}
|
|
@@ -8841,12 +8850,15 @@ var Server = /*#__PURE__*/function () {
|
|
|
8841
8850
|
var _computeProductQueryResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee82(context, options) {
|
|
8842
8851
|
var _menu_list_ids$length3,
|
|
8843
8852
|
_this27 = this;
|
|
8844
|
-
var tTotal, menu_list_ids, ids, schedule_date, schedule_datetime, customer_id, extension_type, product_id, strategy_context, queryIds, startupPreloadTask, formatterContext, uniqueIds, _tPrice, productsWithPrice, _filteredProducts, extensionFilteredProducts, _published$find, pid, _tPrice2, allProductsWithPrice, published, item, _tPrice3, _filteredProducts2, _tStatus, _beforeStatusCount, _tExtensionType, _beforeExtensionTypeCount, _tSort, activeMenuList, tMenu, getActiveMenus, tFilter, productScope, scopedProductIds, tPrice, filteredProducts, tStatus, beforeStatusCount, tExtensionType, beforeExtensionTypeCount, tSort;
|
|
8853
|
+
var tTotal, menu_list_ids, ids, schedule_date, schedule_datetime, customer_id, extension_type, product_id, application_code, strategy_context, isVisibleProduct, queryIds, startupPreloadTask, formatterContext, uniqueIds, _tPrice, productsWithPrice, _filteredProducts, extensionFilteredProducts, _published$find, pid, _tPrice2, allProductsWithPrice, published, item, _tPrice3, _filteredProducts2, _tStatus, _beforeStatusCount, _tExtensionType, _beforeExtensionTypeCount, _tSort, activeMenuList, tMenu, getActiveMenus, tFilter, productScope, scopedProductIds, tPrice, filteredProducts, tStatus, beforeStatusCount, tExtensionType, beforeExtensionTypeCount, tSort;
|
|
8845
8854
|
return _regeneratorRuntime().wrap(function _callee82$(_context82) {
|
|
8846
8855
|
while (1) switch (_context82.prev = _context82.next) {
|
|
8847
8856
|
case 0:
|
|
8848
8857
|
tTotal = performance.now();
|
|
8849
|
-
menu_list_ids = context.menu_list_ids, ids = context.ids, schedule_date = context.schedule_date, schedule_datetime = context.schedule_datetime, customer_id = context.customer_id, extension_type = context.extension_type, product_id = context.product_id, strategy_context = context.strategy_context;
|
|
8858
|
+
menu_list_ids = context.menu_list_ids, ids = context.ids, schedule_date = context.schedule_date, schedule_datetime = context.schedule_datetime, customer_id = context.customer_id, extension_type = context.extension_type, product_id = context.product_id, application_code = context.application_code, strategy_context = context.strategy_context; // 仅 Kiosk 查询额外按商品销售渠道过滤。
|
|
8859
|
+
isVisibleProduct = function isVisibleProduct(product) {
|
|
8860
|
+
return ((product === null || product === void 0 ? void 0 : product.status) || 'published') === 'published' && (application_code !== 'kiosk' || Array.isArray(product === null || product === void 0 ? void 0 : product.channel_application) && product.channel_application.includes('kiosk'));
|
|
8861
|
+
};
|
|
8850
8862
|
queryIds = Array.isArray(ids) ? ids.map(function (id) {
|
|
8851
8863
|
return Number(id);
|
|
8852
8864
|
}).filter(function (id) {
|
|
@@ -8869,12 +8881,12 @@ var Server = /*#__PURE__*/function () {
|
|
|
8869
8881
|
// SQLite/IndexDB,造成 preload 读到空数据并重复请求。正常运行期该字段为 null,不增加等待。
|
|
8870
8882
|
startupPreloadTask = this.startupModulePreloadInFlight;
|
|
8871
8883
|
if (!startupPreloadTask) {
|
|
8872
|
-
_context82.next =
|
|
8884
|
+
_context82.next = 9;
|
|
8873
8885
|
break;
|
|
8874
8886
|
}
|
|
8875
|
-
_context82.next =
|
|
8887
|
+
_context82.next = 9;
|
|
8876
8888
|
return startupPreloadTask;
|
|
8877
|
-
case
|
|
8889
|
+
case 9:
|
|
8878
8890
|
// Menu/Schedule preload 会替换 store 中的数组;必须在等待完成后再读取,
|
|
8879
8891
|
// 避免 formatterContext 持有预加载前的空数组快照。
|
|
8880
8892
|
formatterContext = this.buildProductFormatterContext({
|
|
@@ -8884,7 +8896,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
8884
8896
|
strategy_context: strategy_context
|
|
8885
8897
|
});
|
|
8886
8898
|
if (this.products) {
|
|
8887
|
-
_context82.next =
|
|
8899
|
+
_context82.next = 13;
|
|
8888
8900
|
break;
|
|
8889
8901
|
}
|
|
8890
8902
|
this.logError('computeProductQueryResult: Products 模块未注册');
|
|
@@ -8892,19 +8904,19 @@ var Server = /*#__PURE__*/function () {
|
|
|
8892
8904
|
message: 'Products 模块未注册',
|
|
8893
8905
|
data: this.buildProductQueryResultPayload([], 0)
|
|
8894
8906
|
});
|
|
8895
|
-
case
|
|
8907
|
+
case 13:
|
|
8896
8908
|
if (!(queryIds.length > 0)) {
|
|
8897
|
-
_context82.next =
|
|
8909
|
+
_context82.next = 25;
|
|
8898
8910
|
break;
|
|
8899
8911
|
}
|
|
8900
8912
|
uniqueIds = Array.from(new Set(queryIds));
|
|
8901
8913
|
_tPrice = performance.now();
|
|
8902
|
-
_context82.next =
|
|
8914
|
+
_context82.next = 18;
|
|
8903
8915
|
return this.products.getProductsWithPrice(schedule_date, formatterContext, {
|
|
8904
8916
|
changedIds: options === null || options === void 0 ? void 0 : options.changedIds,
|
|
8905
8917
|
productIds: uniqueIds
|
|
8906
8918
|
});
|
|
8907
|
-
case
|
|
8919
|
+
case 18:
|
|
8908
8920
|
productsWithPrice = _context82.sent;
|
|
8909
8921
|
perfMark('computeQuery.getProductsWithPrice(ids)', performance.now() - _tPrice, {
|
|
8910
8922
|
count: productsWithPrice.length,
|
|
@@ -8912,9 +8924,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
8912
8924
|
});
|
|
8913
8925
|
_filteredProducts = productsWithPrice.filter(function (p) {
|
|
8914
8926
|
return uniqueIds.includes(Number(p === null || p === void 0 ? void 0 : p.id));
|
|
8915
|
-
}).filter(
|
|
8916
|
-
return ((p === null || p === void 0 ? void 0 : p.status) || 'published') === 'published';
|
|
8917
|
-
});
|
|
8927
|
+
}).filter(isVisibleProduct);
|
|
8918
8928
|
extensionFilteredProducts = this.filterProductsByExtensionTypes(_filteredProducts, extension_type);
|
|
8919
8929
|
perfMark('computeProductQueryResult', performance.now() - tTotal, {
|
|
8920
8930
|
mode: 'ids',
|
|
@@ -8931,26 +8941,24 @@ var Server = /*#__PURE__*/function () {
|
|
|
8931
8941
|
message: '',
|
|
8932
8942
|
status: true
|
|
8933
8943
|
});
|
|
8934
|
-
case
|
|
8944
|
+
case 25:
|
|
8935
8945
|
if (!(product_id != null && Number.isFinite(Number(product_id)))) {
|
|
8936
|
-
_context82.next =
|
|
8946
|
+
_context82.next = 37;
|
|
8937
8947
|
break;
|
|
8938
8948
|
}
|
|
8939
8949
|
pid = Number(product_id);
|
|
8940
8950
|
_tPrice2 = performance.now();
|
|
8941
|
-
_context82.next =
|
|
8951
|
+
_context82.next = 30;
|
|
8942
8952
|
return this.products.getProductsWithPrice(schedule_date, formatterContext, {
|
|
8943
8953
|
changedIds: options === null || options === void 0 ? void 0 : options.changedIds
|
|
8944
8954
|
});
|
|
8945
|
-
case
|
|
8955
|
+
case 30:
|
|
8946
8956
|
allProductsWithPrice = _context82.sent;
|
|
8947
8957
|
perfMark('computeQuery.getProductsWithPrice(single)', performance.now() - _tPrice2, {
|
|
8948
8958
|
count: allProductsWithPrice.length,
|
|
8949
8959
|
productId: pid
|
|
8950
8960
|
});
|
|
8951
|
-
published = this.filterProductsByExtensionTypes(allProductsWithPrice.filter(
|
|
8952
|
-
return ((p === null || p === void 0 ? void 0 : p.status) || 'published') === 'published';
|
|
8953
|
-
}), extension_type);
|
|
8961
|
+
published = this.filterProductsByExtensionTypes(allProductsWithPrice.filter(isVisibleProduct), extension_type);
|
|
8954
8962
|
item = (_published$find = published.find(function (p) {
|
|
8955
8963
|
return Number(p.id) === pid;
|
|
8956
8964
|
})) !== null && _published$find !== void 0 ? _published$find : null;
|
|
@@ -8969,17 +8977,17 @@ var Server = /*#__PURE__*/function () {
|
|
|
8969
8977
|
message: item ? '' : '商品不存在或未发布',
|
|
8970
8978
|
status: true
|
|
8971
8979
|
});
|
|
8972
|
-
case
|
|
8980
|
+
case 37:
|
|
8973
8981
|
if (!this.shouldQueryProductsByExtensionTypes(extension_type)) {
|
|
8974
|
-
_context82.next =
|
|
8982
|
+
_context82.next = 57;
|
|
8975
8983
|
break;
|
|
8976
8984
|
}
|
|
8977
8985
|
_tPrice3 = performance.now();
|
|
8978
|
-
_context82.next =
|
|
8986
|
+
_context82.next = 41;
|
|
8979
8987
|
return this.products.getProductsWithPrice(schedule_date, formatterContext, {
|
|
8980
8988
|
changedIds: options === null || options === void 0 ? void 0 : options.changedIds
|
|
8981
8989
|
});
|
|
8982
|
-
case
|
|
8990
|
+
case 41:
|
|
8983
8991
|
_filteredProducts2 = _context82.sent;
|
|
8984
8992
|
perfMark('computeQuery.getProductsWithPrice(extensionType)', performance.now() - _tPrice3, {
|
|
8985
8993
|
count: _filteredProducts2.length,
|
|
@@ -8987,9 +8995,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
8987
8995
|
});
|
|
8988
8996
|
_tStatus = performance.now();
|
|
8989
8997
|
_beforeStatusCount = _filteredProducts2.length;
|
|
8990
|
-
_filteredProducts2 = _filteredProducts2.filter(
|
|
8991
|
-
return ((p === null || p === void 0 ? void 0 : p.status) || 'published') === 'published';
|
|
8992
|
-
});
|
|
8998
|
+
_filteredProducts2 = _filteredProducts2.filter(isVisibleProduct);
|
|
8993
8999
|
perfMark('computeQuery.filterByStatus(extensionType)', performance.now() - _tStatus, {
|
|
8994
9000
|
before: _beforeStatusCount,
|
|
8995
9001
|
after: _filteredProducts2.length
|
|
@@ -9025,9 +9031,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
9025
9031
|
message: '',
|
|
9026
9032
|
status: true
|
|
9027
9033
|
});
|
|
9028
|
-
case
|
|
9034
|
+
case 57:
|
|
9029
9035
|
if (this.menu) {
|
|
9030
|
-
_context82.next =
|
|
9036
|
+
_context82.next = 60;
|
|
9031
9037
|
break;
|
|
9032
9038
|
}
|
|
9033
9039
|
this.logError('computeProductQueryResult: Menu 模块未注册');
|
|
@@ -9035,9 +9041,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
9035
9041
|
message: 'Menu 模块未注册',
|
|
9036
9042
|
data: this.buildProductQueryResultPayload([], 0)
|
|
9037
9043
|
});
|
|
9038
|
-
case
|
|
9044
|
+
case 60:
|
|
9039
9045
|
if (this.schedule) {
|
|
9040
|
-
_context82.next =
|
|
9046
|
+
_context82.next = 63;
|
|
9041
9047
|
break;
|
|
9042
9048
|
}
|
|
9043
9049
|
this.logError('computeProductQueryResult: Schedule 模块未注册');
|
|
@@ -9045,10 +9051,10 @@ var Server = /*#__PURE__*/function () {
|
|
|
9045
9051
|
message: 'Schedule 模块未注册',
|
|
9046
9052
|
data: this.buildProductQueryResultPayload([], 0)
|
|
9047
9053
|
});
|
|
9048
|
-
case
|
|
9054
|
+
case 63:
|
|
9049
9055
|
activeMenuList = [];
|
|
9050
9056
|
if (!(menu_list_ids && Array.isArray(menu_list_ids) && menu_list_ids.length > 0)) {
|
|
9051
|
-
_context82.next =
|
|
9057
|
+
_context82.next = 76;
|
|
9052
9058
|
break;
|
|
9053
9059
|
}
|
|
9054
9060
|
tMenu = performance.now();
|
|
@@ -9061,25 +9067,25 @@ var Server = /*#__PURE__*/function () {
|
|
|
9061
9067
|
activeMenuList = getActiveMenus();
|
|
9062
9068
|
_context82.t0 = !activeMenuList.length;
|
|
9063
9069
|
if (!_context82.t0) {
|
|
9064
|
-
_context82.next =
|
|
9070
|
+
_context82.next = 73;
|
|
9065
9071
|
break;
|
|
9066
9072
|
}
|
|
9067
|
-
_context82.next =
|
|
9073
|
+
_context82.next = 72;
|
|
9068
9074
|
return this.refreshMenuScheduleCacheAfterEmptyResult();
|
|
9069
|
-
case 71:
|
|
9070
|
-
_context82.t0 = _context82.sent;
|
|
9071
9075
|
case 72:
|
|
9076
|
+
_context82.t0 = _context82.sent;
|
|
9077
|
+
case 73:
|
|
9072
9078
|
if (!_context82.t0) {
|
|
9073
|
-
_context82.next =
|
|
9079
|
+
_context82.next = 75;
|
|
9074
9080
|
break;
|
|
9075
9081
|
}
|
|
9076
9082
|
activeMenuList = getActiveMenus();
|
|
9077
|
-
case
|
|
9083
|
+
case 75:
|
|
9078
9084
|
perfMark('computeQuery.filterActiveMenu', performance.now() - tMenu, {
|
|
9079
9085
|
totalMenu: menu_list_ids.length,
|
|
9080
9086
|
activeMenu: activeMenuList.length
|
|
9081
9087
|
});
|
|
9082
|
-
case
|
|
9088
|
+
case 76:
|
|
9083
9089
|
tFilter = performance.now();
|
|
9084
9090
|
productScope = this.getProductScopeByMenuConfig(activeMenuList);
|
|
9085
9091
|
scopedProductIds = this.products.getProductIdsByScope(productScope);
|
|
@@ -9090,21 +9096,21 @@ var Server = /*#__PURE__*/function () {
|
|
|
9090
9096
|
});
|
|
9091
9097
|
tPrice = performance.now();
|
|
9092
9098
|
if (!(scopedProductIds.length > 0)) {
|
|
9093
|
-
_context82.next =
|
|
9099
|
+
_context82.next = 87;
|
|
9094
9100
|
break;
|
|
9095
9101
|
}
|
|
9096
|
-
_context82.next =
|
|
9102
|
+
_context82.next = 84;
|
|
9097
9103
|
return this.products.getProductsWithPrice(schedule_date, formatterContext, {
|
|
9098
9104
|
changedIds: options === null || options === void 0 ? void 0 : options.changedIds,
|
|
9099
9105
|
productIds: productScope.isAllProducts ? undefined : scopedProductIds
|
|
9100
9106
|
});
|
|
9101
|
-
case
|
|
9107
|
+
case 84:
|
|
9102
9108
|
_context82.t1 = _context82.sent;
|
|
9103
|
-
_context82.next =
|
|
9109
|
+
_context82.next = 88;
|
|
9104
9110
|
break;
|
|
9105
|
-
case 86:
|
|
9106
|
-
_context82.t1 = [];
|
|
9107
9111
|
case 87:
|
|
9112
|
+
_context82.t1 = [];
|
|
9113
|
+
case 88:
|
|
9108
9114
|
filteredProducts = _context82.t1;
|
|
9109
9115
|
perfMark('computeQuery.getProductsWithPrice', performance.now() - tPrice, {
|
|
9110
9116
|
count: filteredProducts.length,
|
|
@@ -9112,9 +9118,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
9112
9118
|
});
|
|
9113
9119
|
tStatus = performance.now();
|
|
9114
9120
|
beforeStatusCount = filteredProducts.length;
|
|
9115
|
-
filteredProducts = filteredProducts.filter(
|
|
9116
|
-
return ((p === null || p === void 0 ? void 0 : p.status) || "published") === 'published';
|
|
9117
|
-
});
|
|
9121
|
+
filteredProducts = filteredProducts.filter(isVisibleProduct);
|
|
9118
9122
|
perfMark('computeQuery.filterByStatus', performance.now() - tStatus, {
|
|
9119
9123
|
before: beforeStatusCount,
|
|
9120
9124
|
after: filteredProducts.length
|
|
@@ -9152,7 +9156,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
9152
9156
|
message: '',
|
|
9153
9157
|
status: true
|
|
9154
9158
|
});
|
|
9155
|
-
case
|
|
9159
|
+
case 104:
|
|
9156
9160
|
case "end":
|
|
9157
9161
|
return _context82.stop();
|
|
9158
9162
|
}
|