@pisell/pisellos 2.3.66 → 2.3.67
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/core/index.d.ts +7 -0
- package/dist/core/index.js +109 -65
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/walletPass/evaluator.js +1 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +2 -0
- package/dist/modules/Customer/index.d.ts +0 -4
- package/dist/modules/Customer/index.js +59 -91
- package/dist/modules/Customer/types.d.ts +0 -2
- package/dist/modules/Payment/walletpass.js +11 -31
- package/dist/modules/Quotation/index.d.ts +6 -0
- package/dist/modules/Quotation/index.js +75 -19
- package/dist/plugins/request.d.ts +1 -0
- package/dist/server/index.d.ts +8 -2
- package/dist/server/index.js +212 -143
- package/dist/server/modules/floor-plan/index.d.ts +4 -0
- package/dist/server/modules/floor-plan/index.js +240 -98
- package/dist/server/modules/menu/index.js +48 -23
- package/dist/server/modules/order/index.d.ts +17 -8
- package/dist/server/modules/order/index.js +506 -453
- package/dist/server/modules/products/index.d.ts +8 -2
- package/dist/server/modules/products/index.js +167 -75
- package/dist/server/modules/resource/index.js +21 -13
- package/dist/server/utils/small-ticket.js +1 -2
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +0 -2
- package/dist/solution/BookingTicket/index.js +10 -34
- package/lib/core/index.d.ts +7 -0
- package/lib/core/index.js +20 -2
- package/lib/model/strategy/adapter/promotion/index.js +0 -51
- package/lib/model/strategy/adapter/walletPass/evaluator.js +1 -0
- package/lib/model/strategy/adapter/walletPass/utils.js +1 -0
- package/lib/modules/Customer/index.d.ts +0 -4
- package/lib/modules/Customer/index.js +0 -11
- package/lib/modules/Customer/types.d.ts +0 -2
- package/lib/modules/Payment/walletpass.js +2 -15
- package/lib/modules/Quotation/index.d.ts +6 -0
- package/lib/modules/Quotation/index.js +49 -5
- package/lib/plugins/request.d.ts +1 -0
- package/lib/server/index.d.ts +8 -2
- package/lib/server/index.js +58 -20
- package/lib/server/modules/floor-plan/index.d.ts +4 -0
- package/lib/server/modules/floor-plan/index.js +54 -6
- package/lib/server/modules/menu/index.js +31 -5
- package/lib/server/modules/order/index.d.ts +17 -8
- package/lib/server/modules/order/index.js +199 -106
- package/lib/server/modules/products/index.d.ts +8 -2
- package/lib/server/modules/products/index.js +97 -24
- package/lib/server/modules/resource/index.js +7 -2
- package/lib/server/utils/small-ticket.js +1 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +0 -2
- package/lib/solution/BookingTicket/index.js +2 -18
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var _excluded = ["skip", "num", "search"],
|
|
2
2
|
_excluded2 = ["skip", "num"];
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
6
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
7
8
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
12
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -322,38 +322,6 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
322
322
|
}
|
|
323
323
|
return queryCustomerList;
|
|
324
324
|
}()
|
|
325
|
-
/**
|
|
326
|
-
* 查询单个客户详情,不写入 customerList / pagination 状态。
|
|
327
|
-
*/
|
|
328
|
-
)
|
|
329
|
-
}, {
|
|
330
|
-
key: "queryCustomerDetail",
|
|
331
|
-
value: (function () {
|
|
332
|
-
var _queryCustomerDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(id) {
|
|
333
|
-
var _result$data;
|
|
334
|
-
var result, customer;
|
|
335
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
336
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
337
|
-
case 0:
|
|
338
|
-
_context5.next = 2;
|
|
339
|
-
return this.request.get("/customer/info/".concat(id), {
|
|
340
|
-
with_trashed: 1
|
|
341
|
-
});
|
|
342
|
-
case 2:
|
|
343
|
-
result = _context5.sent;
|
|
344
|
-
customer = (result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.customer) || (result === null || result === void 0 ? void 0 : result.data) || (result === null || result === void 0 ? void 0 : result.customer) || null;
|
|
345
|
-
return _context5.abrupt("return", customer && _typeof(customer) === 'object' ? customer : null);
|
|
346
|
-
case 5:
|
|
347
|
-
case "end":
|
|
348
|
-
return _context5.stop();
|
|
349
|
-
}
|
|
350
|
-
}, _callee5, this);
|
|
351
|
-
}));
|
|
352
|
-
function queryCustomerDetail(_x5) {
|
|
353
|
-
return _queryCustomerDetail.apply(this, arguments);
|
|
354
|
-
}
|
|
355
|
-
return queryCustomerDetail;
|
|
356
|
-
}()
|
|
357
325
|
/**
|
|
358
326
|
* 获取客户列表
|
|
359
327
|
* @param params 查询参数
|
|
@@ -363,7 +331,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
363
331
|
}, {
|
|
364
332
|
key: "getCustomerList",
|
|
365
333
|
value: (function () {
|
|
366
|
-
var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
334
|
+
var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
367
335
|
var params,
|
|
368
336
|
_yield$this$fetchCust2,
|
|
369
337
|
customerList,
|
|
@@ -374,18 +342,18 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
374
342
|
num,
|
|
375
343
|
searchParams,
|
|
376
344
|
response,
|
|
377
|
-
|
|
378
|
-
return _regeneratorRuntime().wrap(function
|
|
379
|
-
while (1) switch (
|
|
345
|
+
_args5 = arguments;
|
|
346
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
347
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
380
348
|
case 0:
|
|
381
|
-
params =
|
|
382
|
-
|
|
349
|
+
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
|
350
|
+
_context5.prev = 1;
|
|
383
351
|
this.store.loading = true;
|
|
384
352
|
this.store.error = null;
|
|
385
|
-
|
|
353
|
+
_context5.next = 6;
|
|
386
354
|
return this.fetchCustomerListData(params);
|
|
387
355
|
case 6:
|
|
388
|
-
_yield$this$fetchCust2 =
|
|
356
|
+
_yield$this$fetchCust2 = _context5.sent;
|
|
389
357
|
customerList = _yield$this$fetchCust2.customerList;
|
|
390
358
|
total = _yield$this$fetchCust2.total;
|
|
391
359
|
page = _yield$this$fetchCust2.page;
|
|
@@ -418,27 +386,27 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
418
386
|
page: page,
|
|
419
387
|
pageSize: pageSize
|
|
420
388
|
};
|
|
421
|
-
return
|
|
389
|
+
return _context5.abrupt("return", response);
|
|
422
390
|
case 23:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
return this.handleCustomerListError(
|
|
391
|
+
_context5.prev = 23;
|
|
392
|
+
_context5.t0 = _context5["catch"](1);
|
|
393
|
+
_context5.next = 27;
|
|
394
|
+
return this.handleCustomerListError(_context5.t0, 'fetch customer list');
|
|
427
395
|
case 27:
|
|
428
|
-
throw
|
|
396
|
+
throw _context5.t0;
|
|
429
397
|
case 28:
|
|
430
|
-
|
|
398
|
+
_context5.prev = 28;
|
|
431
399
|
this.store.loading = false;
|
|
432
400
|
this.storeChange();
|
|
433
|
-
|
|
401
|
+
_context5.next = 33;
|
|
434
402
|
return this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
|
|
435
403
|
case 33:
|
|
436
|
-
return
|
|
404
|
+
return _context5.finish(28);
|
|
437
405
|
case 34:
|
|
438
406
|
case "end":
|
|
439
|
-
return
|
|
407
|
+
return _context5.stop();
|
|
440
408
|
}
|
|
441
|
-
},
|
|
409
|
+
}, _callee5, this, [[1, 23, 28, 34]]);
|
|
442
410
|
}));
|
|
443
411
|
function getCustomerList() {
|
|
444
412
|
return _getCustomerList.apply(this, arguments);
|
|
@@ -615,10 +583,10 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
615
583
|
}, {
|
|
616
584
|
key: "changeCustomerPage",
|
|
617
585
|
value: (function () {
|
|
618
|
-
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
586
|
+
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(page, pageSize) {
|
|
619
587
|
var targetPageSize, skip, num;
|
|
620
|
-
return _regeneratorRuntime().wrap(function
|
|
621
|
-
while (1) switch (
|
|
588
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
589
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
622
590
|
case 0:
|
|
623
591
|
targetPageSize = pageSize || this.store.pageSize; // 先更新分页状态
|
|
624
592
|
this.setPaginationInfo(page, targetPageSize);
|
|
@@ -626,20 +594,20 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
626
594
|
// skip直接使用page,num使用pageSize
|
|
627
595
|
skip = page;
|
|
628
596
|
num = targetPageSize; // 自动调用获取客户列表,使用存储的搜索条件
|
|
629
|
-
|
|
597
|
+
_context6.next = 6;
|
|
630
598
|
return this.getCustomerList(_objectSpread({
|
|
631
599
|
skip: skip,
|
|
632
600
|
num: num
|
|
633
601
|
}, this.store.searchParams));
|
|
634
602
|
case 6:
|
|
635
|
-
return
|
|
603
|
+
return _context6.abrupt("return", _context6.sent);
|
|
636
604
|
case 7:
|
|
637
605
|
case "end":
|
|
638
|
-
return
|
|
606
|
+
return _context6.stop();
|
|
639
607
|
}
|
|
640
|
-
},
|
|
608
|
+
}, _callee6, this);
|
|
641
609
|
}));
|
|
642
|
-
function changeCustomerPage(
|
|
610
|
+
function changeCustomerPage(_x5, _x6) {
|
|
643
611
|
return _changeCustomerPage.apply(this, arguments);
|
|
644
612
|
}
|
|
645
613
|
return changeCustomerPage;
|
|
@@ -652,16 +620,16 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
652
620
|
}, {
|
|
653
621
|
key: "loadMoreCustomers",
|
|
654
622
|
value: (function () {
|
|
655
|
-
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
623
|
+
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
656
624
|
var nextPage, loadMoreParams, _yield$this$fetchCust3, newCustomers, total, page, pageSize, updatedCustomerList, response;
|
|
657
|
-
return _regeneratorRuntime().wrap(function
|
|
658
|
-
while (1) switch (
|
|
625
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
626
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
659
627
|
case 0:
|
|
660
628
|
if (!(!this.store.hasMore || this.store.loadingMore)) {
|
|
661
|
-
|
|
629
|
+
_context7.next = 2;
|
|
662
630
|
break;
|
|
663
631
|
}
|
|
664
|
-
return
|
|
632
|
+
return _context7.abrupt("return", {
|
|
665
633
|
list: [],
|
|
666
634
|
total: this.store.total,
|
|
667
635
|
page: this.store.currentPage,
|
|
@@ -670,17 +638,17 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
670
638
|
case 2:
|
|
671
639
|
// 计算下一页
|
|
672
640
|
nextPage = this.store.currentPage + 1;
|
|
673
|
-
|
|
641
|
+
_context7.prev = 3;
|
|
674
642
|
this.store.loadingMore = true;
|
|
675
643
|
this.store.error = null;
|
|
676
644
|
loadMoreParams = _objectSpread({
|
|
677
645
|
skip: nextPage,
|
|
678
646
|
num: this.store.pageSize
|
|
679
647
|
}, this.store.searchParams); // 使用公共方法获取数据,传入存储的搜索条件
|
|
680
|
-
|
|
648
|
+
_context7.next = 9;
|
|
681
649
|
return this.fetchCustomerListData(loadMoreParams);
|
|
682
650
|
case 9:
|
|
683
|
-
_yield$this$fetchCust3 =
|
|
651
|
+
_yield$this$fetchCust3 = _context7.sent;
|
|
684
652
|
newCustomers = _yield$this$fetchCust3.customerList;
|
|
685
653
|
total = _yield$this$fetchCust3.total;
|
|
686
654
|
page = _yield$this$fetchCust3.page;
|
|
@@ -693,7 +661,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
693
661
|
this.store.hasMore = page * pageSize < total;
|
|
694
662
|
|
|
695
663
|
// 触发滚动加载特定事件
|
|
696
|
-
|
|
664
|
+
_context7.next = 21;
|
|
697
665
|
return this.core.effects.emit("".concat(this.name, ":onScrollLoadMore"), {
|
|
698
666
|
newCustomers: newCustomers,
|
|
699
667
|
allCustomers: this.store.customerList,
|
|
@@ -715,27 +683,27 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
715
683
|
page: page,
|
|
716
684
|
pageSize: pageSize
|
|
717
685
|
};
|
|
718
|
-
return
|
|
686
|
+
return _context7.abrupt("return", response);
|
|
719
687
|
case 26:
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
return this.handleCustomerListError(
|
|
688
|
+
_context7.prev = 26;
|
|
689
|
+
_context7.t0 = _context7["catch"](3);
|
|
690
|
+
_context7.next = 30;
|
|
691
|
+
return this.handleCustomerListError(_context7.t0, 'load more customers');
|
|
724
692
|
case 30:
|
|
725
|
-
throw
|
|
693
|
+
throw _context7.t0;
|
|
726
694
|
case 31:
|
|
727
|
-
|
|
695
|
+
_context7.prev = 31;
|
|
728
696
|
this.store.loadingMore = false;
|
|
729
697
|
this.storeChange();
|
|
730
|
-
|
|
698
|
+
_context7.next = 36;
|
|
731
699
|
return this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
|
|
732
700
|
case 36:
|
|
733
|
-
return
|
|
701
|
+
return _context7.finish(31);
|
|
734
702
|
case 37:
|
|
735
703
|
case "end":
|
|
736
|
-
return
|
|
704
|
+
return _context7.stop();
|
|
737
705
|
}
|
|
738
|
-
},
|
|
706
|
+
}, _callee7, this, [[3, 26, 31, 37]]);
|
|
739
707
|
}));
|
|
740
708
|
function loadMoreCustomers() {
|
|
741
709
|
return _loadMoreCustomers.apply(this, arguments);
|
|
@@ -751,15 +719,15 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
751
719
|
}, {
|
|
752
720
|
key: "resetAndLoadCustomers",
|
|
753
721
|
value: (function () {
|
|
754
|
-
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
722
|
+
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
755
723
|
var params,
|
|
756
724
|
resetParams,
|
|
757
725
|
response,
|
|
758
|
-
|
|
759
|
-
return _regeneratorRuntime().wrap(function
|
|
760
|
-
while (1) switch (
|
|
726
|
+
_args8 = arguments;
|
|
727
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
728
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
761
729
|
case 0:
|
|
762
|
-
params =
|
|
730
|
+
params = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
|
763
731
|
// 重置状态
|
|
764
732
|
this.store.customerList = [];
|
|
765
733
|
this.store.currentPage = 1;
|
|
@@ -771,23 +739,23 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
771
739
|
skip: 1,
|
|
772
740
|
num: params.num || this.store.pageSize
|
|
773
741
|
}); // 调用普通的获取列表方法
|
|
774
|
-
|
|
742
|
+
_context8.next = 8;
|
|
775
743
|
return this.getCustomerList(resetParams);
|
|
776
744
|
case 8:
|
|
777
|
-
response =
|
|
778
|
-
|
|
745
|
+
response = _context8.sent;
|
|
746
|
+
_context8.next = 11;
|
|
779
747
|
return this.core.effects.emit("".concat(this.name, ":onScrollLoadComplete"), {
|
|
780
748
|
customers: this.store.customerList,
|
|
781
749
|
total: this.store.total,
|
|
782
750
|
hasMore: this.store.hasMore
|
|
783
751
|
});
|
|
784
752
|
case 11:
|
|
785
|
-
return
|
|
753
|
+
return _context8.abrupt("return", response);
|
|
786
754
|
case 12:
|
|
787
755
|
case "end":
|
|
788
|
-
return
|
|
756
|
+
return _context8.stop();
|
|
789
757
|
}
|
|
790
|
-
},
|
|
758
|
+
}, _callee8, this);
|
|
791
759
|
}));
|
|
792
760
|
function resetAndLoadCustomers() {
|
|
793
761
|
return _resetAndLoadCustomers.apply(this, arguments);
|
|
@@ -112,8 +112,6 @@ export interface CustomerModuleAPI {
|
|
|
112
112
|
getCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
113
113
|
/** 查询客户列表但不更新列表分页状态 */
|
|
114
114
|
queryCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
115
|
-
/** 查询单个客户详情但不修改客户列表状态 */
|
|
116
|
-
queryCustomerDetail: (id: string | number) => Promise<ShopCustomer | null>;
|
|
117
115
|
/** 设置客户列表 */
|
|
118
116
|
setCustomerList: (customers: ShopCustomer[], total?: number) => void;
|
|
119
117
|
/** 设置当前选择的客户 */
|
|
@@ -5,15 +5,15 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
5
5
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
6
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
9
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
11
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
15
12
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
16
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
16
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
17
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
19
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -104,26 +104,6 @@ function mergeWalletAssets() {
|
|
|
104
104
|
});
|
|
105
105
|
return merged;
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 聚合接口不保证 recalculate_list 顺序;派生抵扣额依赖选择顺序,
|
|
110
|
-
* 因此已选资产必须先恢复为 selectedIds 的顺序再进入策略计算。
|
|
111
|
-
*/
|
|
112
|
-
function orderWalletAssetsByIds(assets, orderedIds) {
|
|
113
|
-
var assetByKey = new Map(assets.map(function (asset) {
|
|
114
|
-
return [getWalletAssetKey(asset), asset];
|
|
115
|
-
}));
|
|
116
|
-
var orderedKeys = new Set(orderedIds.map(function (id) {
|
|
117
|
-
return String(id);
|
|
118
|
-
}));
|
|
119
|
-
return [].concat(_toConsumableArray(orderedIds.map(function (id) {
|
|
120
|
-
return assetByKey.get(String(id));
|
|
121
|
-
}).filter(function (asset) {
|
|
122
|
-
return asset !== undefined;
|
|
123
|
-
})), _toConsumableArray(assets.filter(function (asset) {
|
|
124
|
-
return !orderedKeys.has(getWalletAssetKey(asset));
|
|
125
|
-
})));
|
|
126
|
-
}
|
|
127
107
|
function createInitialWalletAssetsState() {
|
|
128
108
|
return {
|
|
129
109
|
status: 'idle',
|
|
@@ -640,6 +620,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
640
620
|
vouchers: allList
|
|
641
621
|
});
|
|
642
622
|
recommended = res.recommended, transformList = res.transformList, noApplicableVoucher = res.noApplicableVoucher, recommendedAmount = res.recommendedAmount;
|
|
623
|
+
console.log(res, 'resres12');
|
|
643
624
|
this.walletRecommendList = recommended;
|
|
644
625
|
|
|
645
626
|
// 存储初始化数据到内存中,供 useWalletPass 使用
|
|
@@ -659,19 +640,19 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
659
640
|
noApplicableVoucher: noApplicableVoucher,
|
|
660
641
|
products: products || []
|
|
661
642
|
});
|
|
662
|
-
case
|
|
663
|
-
_context3.prev =
|
|
643
|
+
case 20:
|
|
644
|
+
_context3.prev = 20;
|
|
664
645
|
_context3.t0 = _context3["catch"](0);
|
|
665
646
|
this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context3.t0, {
|
|
666
647
|
customer_id: baseParams.customer_id,
|
|
667
648
|
order_expect_amount: baseParams.order_expect_amount
|
|
668
649
|
});
|
|
669
650
|
throw _context3.t0;
|
|
670
|
-
case
|
|
651
|
+
case 24:
|
|
671
652
|
case "end":
|
|
672
653
|
return _context3.stop();
|
|
673
654
|
}
|
|
674
|
-
}, _callee3, this, [[0,
|
|
655
|
+
}, _callee3, this, [[0, 20]]);
|
|
675
656
|
}));
|
|
676
657
|
function initializeWalletDataAsync(_x3) {
|
|
677
658
|
return _initializeWalletDataAsync.apply(this, arguments);
|
|
@@ -688,7 +669,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
688
669
|
value: (function () {
|
|
689
670
|
var _aggregateRecalculateWalletAssetsAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(businessData, selectedIds) {
|
|
690
671
|
var _this$paymentModule$w7, _this$paymentModule$w8;
|
|
691
|
-
var walletParams, customerId, requestParams, response, responseData, hasAggregateLists, recalculateList, customerWalletPassList,
|
|
672
|
+
var walletParams, customerId, requestParams, response, responseData, hasAggregateLists, recalculateList, customerWalletPassList, allList, walletPassEvaluator, evaluated, returnedSelectedKeys, authoritativeSelectedIds;
|
|
692
673
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
693
674
|
while (1) switch (_context4.prev = _context4.next) {
|
|
694
675
|
case 0:
|
|
@@ -724,8 +705,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
724
705
|
case 11:
|
|
725
706
|
recalculateList = Array.isArray(responseData === null || responseData === void 0 ? void 0 : responseData.recalculate_list) ? responseData.recalculate_list : [];
|
|
726
707
|
customerWalletPassList = Array.isArray(responseData === null || responseData === void 0 ? void 0 : responseData.customer_wallet_pass_list) ? responseData.customer_wallet_pass_list : [];
|
|
727
|
-
|
|
728
|
-
allList = mergeWalletAssets(orderedRecalculateList, customerWalletPassList);
|
|
708
|
+
allList = mergeWalletAssets(recalculateList, customerWalletPassList);
|
|
729
709
|
walletPassEvaluator = (_this$paymentModule$w7 = this.paymentModule.window) === null || _this$paymentModule$w7 === void 0 || (_this$paymentModule$w8 = _this$paymentModule$w7.getWalletPassEvaluator) === null || _this$paymentModule$w8 === void 0 ? void 0 : _this$paymentModule$w8.call(_this$paymentModule$w7);
|
|
730
710
|
evaluated = walletPassEvaluator !== null && walletPassEvaluator !== void 0 && walletPassEvaluator.getRecommendedVouchers ? walletPassEvaluator.getRecommendedVouchers({
|
|
731
711
|
orderTotalAmount: walletParams.order_wait_pay_amount,
|
|
@@ -769,7 +749,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
769
749
|
products: walletParams.products || [],
|
|
770
750
|
authoritativeSelectedIds: authoritativeSelectedIds
|
|
771
751
|
});
|
|
772
|
-
case
|
|
752
|
+
case 24:
|
|
773
753
|
case "end":
|
|
774
754
|
return _context4.stop();
|
|
775
755
|
}
|
|
@@ -9,6 +9,8 @@ export declare class QuotationModule extends BaseModule implements Module {
|
|
|
9
9
|
private request;
|
|
10
10
|
private store;
|
|
11
11
|
private scheduleResolver?;
|
|
12
|
+
private app;
|
|
13
|
+
private quotationListUpdatedListener?;
|
|
12
14
|
constructor(name?: string, version?: string);
|
|
13
15
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
14
16
|
loadQuotations(params?: {
|
|
@@ -16,6 +18,7 @@ export declare class QuotationModule extends BaseModule implements Module {
|
|
|
16
18
|
customer_id?: number | string;
|
|
17
19
|
}): Promise<void>;
|
|
18
20
|
getQuotationList(): QuotationItem[];
|
|
21
|
+
setQuotationListUpdatedListener(listener?: () => void): void;
|
|
19
22
|
getQuotationCustomerScopeInfo(): QuotationCustomerScopeInfo;
|
|
20
23
|
/**
|
|
21
24
|
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
@@ -60,6 +63,9 @@ export declare class QuotationModule extends BaseModule implements Module {
|
|
|
60
63
|
customer_id?: number | string;
|
|
61
64
|
}): Map<string, string | null>;
|
|
62
65
|
setScheduleResolver(resolver: (id: number) => ScheduleItem | undefined): void;
|
|
66
|
+
private applyQuotationResponse;
|
|
67
|
+
private notifyQuotationListUpdated;
|
|
68
|
+
private getQuotationCacheKeyData;
|
|
63
69
|
private isQuotationVisibleForCustomer;
|
|
64
70
|
private hasValidCustomerId;
|
|
65
71
|
private normalizeCustomerId;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
4
8
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
5
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
@@ -36,12 +40,15 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
36
40
|
list: []
|
|
37
41
|
});
|
|
38
42
|
_defineProperty(_assertThisInitialized(_this), "scheduleResolver", void 0);
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "app", void 0);
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "quotationListUpdatedListener", void 0);
|
|
39
45
|
return _this;
|
|
40
46
|
}
|
|
41
47
|
_createClass(QuotationModule, [{
|
|
42
48
|
key: "initialize",
|
|
43
49
|
value: function () {
|
|
44
50
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
51
|
+
var _core$getPlugin, _core$getPlugin$getAp;
|
|
45
52
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
46
53
|
while (1) switch (_context.prev = _context.next) {
|
|
47
54
|
case 0:
|
|
@@ -53,10 +60,11 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
53
60
|
}
|
|
54
61
|
throw new Error('QuotationModule 需要 request 插件支持');
|
|
55
62
|
case 4:
|
|
63
|
+
this.app = (_core$getPlugin = core.getPlugin('app')) === null || _core$getPlugin === void 0 || (_core$getPlugin$getAp = _core$getPlugin.getApp) === null || _core$getPlugin$getAp === void 0 ? void 0 : _core$getPlugin$getAp.call(_core$getPlugin);
|
|
56
64
|
this.store = {
|
|
57
65
|
list: []
|
|
58
66
|
};
|
|
59
|
-
case
|
|
67
|
+
case 6:
|
|
60
68
|
case "end":
|
|
61
69
|
return _context.stop();
|
|
62
70
|
}
|
|
@@ -71,8 +79,8 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
71
79
|
key: "loadQuotations",
|
|
72
80
|
value: function () {
|
|
73
81
|
var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
74
|
-
var
|
|
75
|
-
var query,
|
|
82
|
+
var _this2 = this;
|
|
83
|
+
var query, initialResultApplied, applyRemoteUpdate, res;
|
|
76
84
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
77
85
|
while (1) switch (_context2.prev = _context2.next) {
|
|
78
86
|
case 0:
|
|
@@ -81,19 +89,27 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
81
89
|
if ((params === null || params === void 0 ? void 0 : params.channel) === 'online_store') {
|
|
82
90
|
query.channel = 'online-store';
|
|
83
91
|
}
|
|
84
|
-
|
|
92
|
+
initialResultApplied = false;
|
|
93
|
+
applyRemoteUpdate = function applyRemoteUpdate(response) {
|
|
94
|
+
_this2.applyQuotationResponse(response);
|
|
95
|
+
if (initialResultApplied) {
|
|
96
|
+
_this2.notifyQuotationListUpdated();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
_context2.next = 7;
|
|
85
100
|
return this.request.get('/quotation/available', query, {
|
|
86
|
-
|
|
87
|
-
|
|
101
|
+
cache: {
|
|
102
|
+
type: 'indexDB',
|
|
103
|
+
updateCache: true,
|
|
104
|
+
cacheKeyData: this.getQuotationCacheKeyData(query)
|
|
105
|
+
},
|
|
106
|
+
cacheUpdateChange: applyRemoteUpdate
|
|
88
107
|
});
|
|
89
|
-
case
|
|
108
|
+
case 7:
|
|
90
109
|
res = _context2.sent;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
});
|
|
95
|
-
this.store.list = list;
|
|
96
|
-
case 9:
|
|
110
|
+
this.applyQuotationResponse(res);
|
|
111
|
+
initialResultApplied = true;
|
|
112
|
+
case 10:
|
|
97
113
|
case "end":
|
|
98
114
|
return _context2.stop();
|
|
99
115
|
}
|
|
@@ -109,10 +125,15 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
109
125
|
value: function getQuotationList() {
|
|
110
126
|
return this.store.list;
|
|
111
127
|
}
|
|
128
|
+
}, {
|
|
129
|
+
key: "setQuotationListUpdatedListener",
|
|
130
|
+
value: function setQuotationListUpdatedListener(listener) {
|
|
131
|
+
this.quotationListUpdatedListener = listener;
|
|
132
|
+
}
|
|
112
133
|
}, {
|
|
113
134
|
key: "getQuotationCustomerScopeInfo",
|
|
114
135
|
value: function getQuotationCustomerScopeInfo() {
|
|
115
|
-
var
|
|
136
|
+
var _this3 = this;
|
|
116
137
|
var customerById = new Map();
|
|
117
138
|
var quotationScopes = this.store.list.filter(function (quotation) {
|
|
118
139
|
return Array.isArray(quotation.customer) && quotation.customer.length > 0;
|
|
@@ -122,7 +143,7 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
122
143
|
var localSeen = new Set();
|
|
123
144
|
var quotationCustomers = quotation.customer || [];
|
|
124
145
|
quotationCustomers.forEach(function (customer) {
|
|
125
|
-
var customerId =
|
|
146
|
+
var customerId = _this3.normalizeCustomerId(customer === null || customer === void 0 ? void 0 : customer.id);
|
|
126
147
|
if (!customerId || localSeen.has(customerId)) return;
|
|
127
148
|
localSeen.add(customerId);
|
|
128
149
|
customerIds.push(customerId);
|
|
@@ -247,6 +268,41 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
247
268
|
value: function setScheduleResolver(resolver) {
|
|
248
269
|
this.scheduleResolver = resolver;
|
|
249
270
|
}
|
|
271
|
+
}, {
|
|
272
|
+
key: "applyQuotationResponse",
|
|
273
|
+
value: function applyQuotationResponse(response) {
|
|
274
|
+
var _data;
|
|
275
|
+
var source = (response === null || response === void 0 || (_data = response.data) === null || _data === void 0 ? void 0 : _data.list) || (response === null || response === void 0 ? void 0 : response.list) || [];
|
|
276
|
+
this.store.list = _toConsumableArray(source).sort(function (a, b) {
|
|
277
|
+
return Number(b.sort || 0) - Number(a.sort || 0);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}, {
|
|
281
|
+
key: "notifyQuotationListUpdated",
|
|
282
|
+
value: function notifyQuotationListUpdated() {
|
|
283
|
+
try {
|
|
284
|
+
var _this$quotationListUp;
|
|
285
|
+
(_this$quotationListUp = this.quotationListUpdatedListener) === null || _this$quotationListUp === void 0 || _this$quotationListUp.call(this);
|
|
286
|
+
} catch (error) {
|
|
287
|
+
console.warn('[QuotationModule] 报价单后台更新回调失败', error);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
key: "getQuotationCacheKeyData",
|
|
292
|
+
value: function getQuotationCacheKeyData(query) {
|
|
293
|
+
var shopId = '';
|
|
294
|
+
try {
|
|
295
|
+
var _this$app, _this$app$getStorage;
|
|
296
|
+
var storedCore = (_this$app = this.app) === null || _this$app === void 0 || (_this$app = _this$app.storage) === null || _this$app === void 0 || (_this$app$getStorage = _this$app.getStorage) === null || _this$app$getStorage === void 0 ? void 0 : _this$app$getStorage.call(_this$app, 'core');
|
|
297
|
+
var coreInfo = typeof storedCore === 'string' ? JSON.parse(storedCore || '{}') : storedCore || {};
|
|
298
|
+
shopId = String((coreInfo === null || coreInfo === void 0 ? void 0 : coreInfo.id) || '');
|
|
299
|
+
} catch (_unused) {
|
|
300
|
+
// 缓存隔离信息读取失败时仍按请求参数缓存。
|
|
301
|
+
}
|
|
302
|
+
return _objectSpread(_objectSpread({}, query), {}, {
|
|
303
|
+
shop_id: shopId
|
|
304
|
+
});
|
|
305
|
+
}
|
|
250
306
|
}, {
|
|
251
307
|
key: "isQuotationVisibleForCustomer",
|
|
252
308
|
value: function isQuotationVisibleForCustomer(quotation, customerId) {
|
|
@@ -273,17 +329,17 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
273
329
|
key: "isQuotationActiveAt",
|
|
274
330
|
value: function isQuotationActiveAt(quotation, datetime) {
|
|
275
331
|
var _quotation$schedule,
|
|
276
|
-
|
|
332
|
+
_this4 = this;
|
|
277
333
|
if (!((_quotation$schedule = quotation.schedule) !== null && _quotation$schedule !== void 0 && _quotation$schedule.length)) return false;
|
|
278
334
|
var scheduleItems = [];
|
|
279
335
|
quotation.schedule.forEach(function (s) {
|
|
280
|
-
var
|
|
281
|
-
var full = (
|
|
336
|
+
var _this4$scheduleResolv;
|
|
337
|
+
var full = (_this4$scheduleResolv = _this4.scheduleResolver) === null || _this4$scheduleResolv === void 0 ? void 0 : _this4$scheduleResolv.call(_this4, s.id);
|
|
282
338
|
if (full) {
|
|
283
339
|
scheduleItems.push(full);
|
|
284
340
|
return;
|
|
285
341
|
}
|
|
286
|
-
if (
|
|
342
|
+
if (_this4.scheduleResolver) {
|
|
287
343
|
return;
|
|
288
344
|
}
|
|
289
345
|
var fallbackSchedule = _objectSpread(_objectSpread({}, s), {}, {
|