@pisell/pisellos 2.2.152 → 2.2.153
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/Discount/index.d.ts +6 -2
- package/dist/modules/Discount/index.js +14 -8
- package/dist/modules/Order/index.js +3 -1
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/ShopDiscount/index.d.ts +2 -1
- package/dist/solution/ShopDiscount/index.js +32 -20
- package/dist/solution/ShopDiscount/types.d.ts +1 -0
- package/lib/modules/Discount/index.d.ts +6 -2
- package/lib/modules/Discount/index.js +3 -1
- package/lib/modules/Order/index.js +1 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/ShopDiscount/index.d.ts +2 -1
- package/lib/solution/ShopDiscount/index.js +10 -4
- package/lib/solution/ShopDiscount/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -17,14 +17,18 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
17
17
|
setOriginalDiscountList(originalDiscountList: Discount[]): Promise<void>;
|
|
18
18
|
getOriginalDiscountList(): Discount[];
|
|
19
19
|
loadPrepareConfig(params: {
|
|
20
|
-
action?: 'create';
|
|
20
|
+
action?: 'create' | 'edit';
|
|
21
21
|
with_good_pass: 0 | 1;
|
|
22
22
|
with_discount_card: 0 | 1;
|
|
23
23
|
customer_id: number;
|
|
24
24
|
with_wallet_pass_holder: 0 | 1;
|
|
25
25
|
request_timezone: string;
|
|
26
|
+
order_id?: number;
|
|
27
|
+
}): Promise<Discount[]>;
|
|
28
|
+
batchSearch(code: string, options?: {
|
|
29
|
+
customerId?: number;
|
|
30
|
+
orderId?: number;
|
|
26
31
|
}): Promise<Discount[]>;
|
|
27
|
-
batchSearch(code: string, customerId?: number): Promise<Discount[]>;
|
|
28
32
|
filterEnabledDiscountList(discountList: Discount[]): Discount[];
|
|
29
33
|
private checkUsageCreditsLimit;
|
|
30
34
|
uniqueByProductId(discountList: Discount[]): Discount[];
|
|
@@ -1,4 +1,6 @@
|
|
|
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
|
+
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
|
+
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; }
|
|
2
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
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."); }
|
|
4
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); }
|
|
@@ -176,13 +178,14 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
176
178
|
}, {
|
|
177
179
|
key: "batchSearch",
|
|
178
180
|
value: function () {
|
|
179
|
-
var _batchSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code,
|
|
180
|
-
var result, resultDiscountList;
|
|
181
|
+
var _batchSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code, options) {
|
|
182
|
+
var _ref, customerId, orderId, result, resultDiscountList;
|
|
181
183
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
182
184
|
while (1) switch (_context5.prev = _context5.next) {
|
|
183
185
|
case 0:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
_ref = options || {}, customerId = _ref.customerId, orderId = _ref.orderId;
|
|
187
|
+
_context5.next = 3;
|
|
188
|
+
return this.request.get("/machinecode/batch-search", _objectSpread(_objectSpread({
|
|
186
189
|
code: code,
|
|
187
190
|
translate_flag: 1,
|
|
188
191
|
tags: ['good_pass', 'product_discount_card'],
|
|
@@ -190,14 +193,17 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
190
193
|
relation_product: 1,
|
|
191
194
|
with: ['extensionData', 'customScheduleSnapshot', 'holder.detail'],
|
|
192
195
|
order_behavior_count: 1,
|
|
193
|
-
order_behavior_count_customer_id: customerId || 1
|
|
196
|
+
order_behavior_count_customer_id: customerId || 1
|
|
197
|
+
}, orderId ? {
|
|
198
|
+
order_behavior_count_order_id: orderId
|
|
199
|
+
} : {}), {}, {
|
|
194
200
|
request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
195
|
-
});
|
|
196
|
-
case
|
|
201
|
+
}));
|
|
202
|
+
case 3:
|
|
197
203
|
result = _context5.sent;
|
|
198
204
|
resultDiscountList = this.filterEnabledDiscountList((result === null || result === void 0 ? void 0 : result.data) || []) || [];
|
|
199
205
|
return _context5.abrupt("return", resultDiscountList);
|
|
200
|
-
case
|
|
206
|
+
case 6:
|
|
201
207
|
case "end":
|
|
202
208
|
return _context5.stop();
|
|
203
209
|
}
|
|
@@ -243,7 +243,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
243
243
|
while (1) switch (_context3.prev = _context3.next) {
|
|
244
244
|
case 0:
|
|
245
245
|
_context3.next = 2;
|
|
246
|
-
return (_this$store$discount4 = this.store.discount) === null || _this$store$discount4 === void 0 ? void 0 : _this$store$discount4.batchSearch(code,
|
|
246
|
+
return (_this$store$discount4 = this.store.discount) === null || _this$store$discount4 === void 0 ? void 0 : _this$store$discount4.batchSearch(code, {
|
|
247
|
+
customerId: customerId
|
|
248
|
+
});
|
|
247
249
|
case 2:
|
|
248
250
|
_context3.t0 = _context3.sent;
|
|
249
251
|
if (_context3.t0) {
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 | 1 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 5 | 3 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -30,6 +30,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
30
30
|
type?: 'form' | 'customer';
|
|
31
31
|
[key: string]: any;
|
|
32
32
|
}): void;
|
|
33
|
+
setOrderId(id?: number): void;
|
|
33
34
|
calcDiscount(productList: Record<string, any>[], options?: SetDiscountSelectedParams): {
|
|
34
35
|
productList: Record<string, any>[];
|
|
35
36
|
discountList: Discount[];
|
|
@@ -56,7 +57,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
56
57
|
private bestDiscount;
|
|
57
58
|
loadPrepareConfig(params: {
|
|
58
59
|
customerId: number;
|
|
59
|
-
action?: 'create' | '
|
|
60
|
+
action?: 'create' | 'edit';
|
|
60
61
|
with_good_pass?: 0 | 1;
|
|
61
62
|
with_discount_card?: 0 | 1;
|
|
62
63
|
}): Promise<void>;
|
|
@@ -57,7 +57,8 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
57
57
|
currentBookingTime: "",
|
|
58
58
|
filteredDiscountList: [],
|
|
59
59
|
bookingSubject: undefined,
|
|
60
|
-
orderTotalAmount: 0
|
|
60
|
+
orderTotalAmount: 0,
|
|
61
|
+
orderId: undefined
|
|
61
62
|
};
|
|
62
63
|
return _this;
|
|
63
64
|
}
|
|
@@ -307,6 +308,11 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
307
308
|
value: function setBookingSubject(bookingSubject) {
|
|
308
309
|
this.store.bookingSubject = bookingSubject;
|
|
309
310
|
}
|
|
311
|
+
}, {
|
|
312
|
+
key: "setOrderId",
|
|
313
|
+
value: function setOrderId(id) {
|
|
314
|
+
this.store.orderId = id;
|
|
315
|
+
}
|
|
310
316
|
|
|
311
317
|
// 计算优惠券
|
|
312
318
|
}, {
|
|
@@ -406,7 +412,10 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
406
412
|
case 0:
|
|
407
413
|
_context5.prev = 0;
|
|
408
414
|
_context5.next = 3;
|
|
409
|
-
return (_this$store$discount3 = this.store.discount) === null || _this$store$discount3 === void 0 ? void 0 : _this$store$discount3.batchSearch(code,
|
|
415
|
+
return (_this$store$discount3 = this.store.discount) === null || _this$store$discount3 === void 0 ? void 0 : _this$store$discount3.batchSearch(code, {
|
|
416
|
+
customerId: customerId,
|
|
417
|
+
orderId: this.store.orderId
|
|
418
|
+
});
|
|
410
419
|
case 3:
|
|
411
420
|
_context5.t0 = _context5.sent;
|
|
412
421
|
if (_context5.t0) {
|
|
@@ -742,24 +751,27 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
742
751
|
key: "loadPrepareConfig",
|
|
743
752
|
value: function () {
|
|
744
753
|
var _loadPrepareConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params) {
|
|
745
|
-
var _this$getCustomer2, _this$store$discount7, _this$getDiscountList, _this$store$discount8, _this$store$productLi2, customerId, goodPassList, scanDiscount, scanDiscountIds, newGoodPassList, newDiscountList, filteredDiscountList, _result3;
|
|
754
|
+
var _this$getCustomer2, _this$store$discount7, _this$getDiscountList, _this$store$discount8, _this$store$productLi2, orderId, customerId, goodPassList, scanDiscount, scanDiscountIds, newGoodPassList, newDiscountList, filteredDiscountList, _result3;
|
|
746
755
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
747
756
|
while (1) switch (_context9.prev = _context9.next) {
|
|
748
757
|
case 0:
|
|
749
758
|
_context9.prev = 0;
|
|
759
|
+
orderId = this.store.orderId;
|
|
750
760
|
customerId = params.customerId || ((_this$getCustomer2 = this.getCustomer()) === null || _this$getCustomer2 === void 0 ? void 0 : _this$getCustomer2.id); // if (customerId === 1 || !customerId) {
|
|
751
761
|
// return
|
|
752
762
|
// }
|
|
753
|
-
_context9.next =
|
|
754
|
-
return (_this$store$discount7 = this.store.discount) === null || _this$store$discount7 === void 0 ? void 0 : _this$store$discount7.loadPrepareConfig({
|
|
763
|
+
_context9.next = 5;
|
|
764
|
+
return (_this$store$discount7 = this.store.discount) === null || _this$store$discount7 === void 0 ? void 0 : _this$store$discount7.loadPrepareConfig(_objectSpread({
|
|
755
765
|
customer_id: customerId,
|
|
756
|
-
action: 'create',
|
|
766
|
+
action: orderId ? 'edit' : 'create',
|
|
757
767
|
with_good_pass: 1,
|
|
758
768
|
with_discount_card: 1,
|
|
759
769
|
with_wallet_pass_holder: 1,
|
|
760
770
|
request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
761
|
-
}
|
|
762
|
-
|
|
771
|
+
}, orderId ? {
|
|
772
|
+
order_id: orderId
|
|
773
|
+
} : {}));
|
|
774
|
+
case 5:
|
|
763
775
|
goodPassList = _context9.sent;
|
|
764
776
|
scanDiscount = (_this$getDiscountList = this.getDiscountList()) === null || _this$getDiscountList === void 0 ? void 0 : _this$getDiscountList.filter(function (item) {
|
|
765
777
|
return item.isScan;
|
|
@@ -772,35 +784,35 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
772
784
|
});
|
|
773
785
|
newDiscountList = [].concat(_toConsumableArray(scanDiscount), _toConsumableArray(newGoodPassList || [])); // 存储原始优惠券列表
|
|
774
786
|
this.store.originalDiscountList = newDiscountList;
|
|
775
|
-
_context9.next =
|
|
787
|
+
_context9.next = 13;
|
|
776
788
|
return (_this$store$discount8 = this.store.discount) === null || _this$store$discount8 === void 0 ? void 0 : _this$store$discount8.setOriginalDiscountList(newDiscountList);
|
|
777
|
-
case
|
|
789
|
+
case 13:
|
|
778
790
|
// 根据当前预约时间过滤优惠券列表
|
|
779
791
|
filteredDiscountList = this.filterDiscountListByBookingTime(newDiscountList, this.store.currentBookingTime);
|
|
780
792
|
this.store.filteredDiscountList = filteredDiscountList;
|
|
781
793
|
this.setDiscountList(filteredDiscountList || []);
|
|
782
794
|
if (!((_this$store$productLi2 = this.store.productList) !== null && _this$store$productLi2 !== void 0 && _this$store$productLi2.length)) {
|
|
783
|
-
_context9.next =
|
|
795
|
+
_context9.next = 20;
|
|
784
796
|
break;
|
|
785
797
|
}
|
|
786
798
|
_result3 = this.calcDiscount(this.store.productList);
|
|
787
|
-
_context9.next =
|
|
799
|
+
_context9.next = 20;
|
|
788
800
|
return this.core.effects.emit("".concat(this.name, ":onLoadPrepareCalcResult"), _result3);
|
|
789
|
-
case
|
|
790
|
-
_context9.next =
|
|
801
|
+
case 20:
|
|
802
|
+
_context9.next = 22;
|
|
791
803
|
return this.core.effects.emit("".concat(this.name, ":onLoadDiscountList"), filteredDiscountList);
|
|
792
|
-
case
|
|
793
|
-
_context9.next =
|
|
804
|
+
case 22:
|
|
805
|
+
_context9.next = 27;
|
|
794
806
|
break;
|
|
795
|
-
case
|
|
796
|
-
_context9.prev =
|
|
807
|
+
case 24:
|
|
808
|
+
_context9.prev = 24;
|
|
797
809
|
_context9.t0 = _context9["catch"](0);
|
|
798
810
|
console.error('[ShopDiscount] 加载准备配置出错:', _context9.t0);
|
|
799
|
-
case
|
|
811
|
+
case 27:
|
|
800
812
|
case "end":
|
|
801
813
|
return _context9.stop();
|
|
802
814
|
}
|
|
803
|
-
}, _callee9, this, [[0,
|
|
815
|
+
}, _callee9, this, [[0, 24]]);
|
|
804
816
|
}));
|
|
805
817
|
function loadPrepareConfig(_x9) {
|
|
806
818
|
return _loadPrepareConfig.apply(this, arguments);
|
|
@@ -17,14 +17,18 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
17
17
|
setOriginalDiscountList(originalDiscountList: Discount[]): Promise<void>;
|
|
18
18
|
getOriginalDiscountList(): Discount[];
|
|
19
19
|
loadPrepareConfig(params: {
|
|
20
|
-
action?: 'create';
|
|
20
|
+
action?: 'create' | 'edit';
|
|
21
21
|
with_good_pass: 0 | 1;
|
|
22
22
|
with_discount_card: 0 | 1;
|
|
23
23
|
customer_id: number;
|
|
24
24
|
with_wallet_pass_holder: 0 | 1;
|
|
25
25
|
request_timezone: string;
|
|
26
|
+
order_id?: number;
|
|
27
|
+
}): Promise<Discount[]>;
|
|
28
|
+
batchSearch(code: string, options?: {
|
|
29
|
+
customerId?: number;
|
|
30
|
+
orderId?: number;
|
|
26
31
|
}): Promise<Discount[]>;
|
|
27
|
-
batchSearch(code: string, customerId?: number): Promise<Discount[]>;
|
|
28
32
|
filterEnabledDiscountList(discountList: Discount[]): Discount[];
|
|
29
33
|
private checkUsageCreditsLimit;
|
|
30
34
|
uniqueByProductId(discountList: Discount[]): Discount[];
|
|
@@ -102,7 +102,8 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
|
|
|
102
102
|
) || [];
|
|
103
103
|
return goodPassList;
|
|
104
104
|
}
|
|
105
|
-
async batchSearch(code,
|
|
105
|
+
async batchSearch(code, options) {
|
|
106
|
+
const { customerId, orderId } = options || {};
|
|
106
107
|
const result = await this.request.get(`/machinecode/batch-search`, {
|
|
107
108
|
code,
|
|
108
109
|
translate_flag: 1,
|
|
@@ -112,6 +113,7 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
|
|
|
112
113
|
with: ["extensionData", "customScheduleSnapshot", "holder.detail"],
|
|
113
114
|
order_behavior_count: 1,
|
|
114
115
|
order_behavior_count_customer_id: customerId || 1,
|
|
116
|
+
...orderId ? { order_behavior_count_order_id: orderId } : {},
|
|
115
117
|
request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
116
118
|
});
|
|
117
119
|
const resultDiscountList = this.filterEnabledDiscountList((result == null ? void 0 : result.data) || []) || [];
|
|
@@ -195,7 +195,7 @@ var OrderModule = class extends import_BaseModule.BaseModule {
|
|
|
195
195
|
}
|
|
196
196
|
async scanCode(code, customerId) {
|
|
197
197
|
var _a, _b, _c, _d, _e;
|
|
198
|
-
const resultDiscountList = await ((_a = this.store.discount) == null ? void 0 : _a.batchSearch(code, customerId)) || [];
|
|
198
|
+
const resultDiscountList = await ((_a = this.store.discount) == null ? void 0 : _a.batchSearch(code, { customerId })) || [];
|
|
199
199
|
const rulesModule = this.store.rules;
|
|
200
200
|
if (!rulesModule) {
|
|
201
201
|
return {
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 | 1 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 5 | 3 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -30,6 +30,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
30
30
|
type?: 'form' | 'customer';
|
|
31
31
|
[key: string]: any;
|
|
32
32
|
}): void;
|
|
33
|
+
setOrderId(id?: number): void;
|
|
33
34
|
calcDiscount(productList: Record<string, any>[], options?: SetDiscountSelectedParams): {
|
|
34
35
|
productList: Record<string, any>[];
|
|
35
36
|
discountList: Discount[];
|
|
@@ -56,7 +57,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
56
57
|
private bestDiscount;
|
|
57
58
|
loadPrepareConfig(params: {
|
|
58
59
|
customerId: number;
|
|
59
|
-
action?: 'create' | '
|
|
60
|
+
action?: 'create' | 'edit';
|
|
60
61
|
with_good_pass?: 0 | 1;
|
|
61
62
|
with_discount_card?: 0 | 1;
|
|
62
63
|
}): Promise<void>;
|
|
@@ -57,7 +57,8 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
57
57
|
currentBookingTime: "",
|
|
58
58
|
filteredDiscountList: [],
|
|
59
59
|
bookingSubject: void 0,
|
|
60
|
-
orderTotalAmount: 0
|
|
60
|
+
orderTotalAmount: 0,
|
|
61
|
+
orderId: void 0
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
// =========== 生命周期方法 ===========
|
|
@@ -205,6 +206,9 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
205
206
|
setBookingSubject(bookingSubject) {
|
|
206
207
|
this.store.bookingSubject = bookingSubject;
|
|
207
208
|
}
|
|
209
|
+
setOrderId(id) {
|
|
210
|
+
this.store.orderId = id;
|
|
211
|
+
}
|
|
208
212
|
// 计算优惠券
|
|
209
213
|
calcDiscount(productList, options) {
|
|
210
214
|
var _a;
|
|
@@ -270,7 +274,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
270
274
|
async scanCode(code, customerId) {
|
|
271
275
|
var _a, _b, _c;
|
|
272
276
|
try {
|
|
273
|
-
const resultDiscountList = await ((_a = this.store.discount) == null ? void 0 : _a.batchSearch(code, customerId)) || [];
|
|
277
|
+
const resultDiscountList = await ((_a = this.store.discount) == null ? void 0 : _a.batchSearch(code, { customerId, orderId: this.store.orderId })) || [];
|
|
274
278
|
const rulesModule = this.store.rules;
|
|
275
279
|
if (!rulesModule) {
|
|
276
280
|
return {
|
|
@@ -497,14 +501,16 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
497
501
|
async loadPrepareConfig(params) {
|
|
498
502
|
var _a, _b, _c, _d, _e;
|
|
499
503
|
try {
|
|
504
|
+
const orderId = this.store.orderId;
|
|
500
505
|
const customerId = params.customerId || ((_a = this.getCustomer()) == null ? void 0 : _a.id);
|
|
501
506
|
const goodPassList = await ((_b = this.store.discount) == null ? void 0 : _b.loadPrepareConfig({
|
|
502
507
|
customer_id: customerId,
|
|
503
|
-
action: "create",
|
|
508
|
+
action: orderId ? "edit" : "create",
|
|
504
509
|
with_good_pass: 1,
|
|
505
510
|
with_discount_card: 1,
|
|
506
511
|
with_wallet_pass_holder: 1,
|
|
507
|
-
request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
512
|
+
request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
513
|
+
...orderId ? { order_id: orderId } : {}
|
|
508
514
|
}));
|
|
509
515
|
const scanDiscount = (_c = this.getDiscountList()) == null ? void 0 : _c.filter(
|
|
510
516
|
(item) => item.isScan
|