@pisell/pisellos 2.3.63 → 2.3.65
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.js +0 -1
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -1
- package/dist/model/strategy/adapter/walletPass/utils.js +0 -2
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +7 -3
- package/dist/modules/Customer/index.d.ts +4 -0
- package/dist/modules/Customer/index.js +91 -59
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Order/index.js +4 -1
- package/dist/modules/Order/utils.js +36 -30
- package/dist/modules/Payment/walletpass.js +4 -5
- package/dist/server/index.js +4 -4
- package/dist/server/modules/order/index.d.ts +1 -0
- package/dist/server/modules/order/index.js +252 -94
- package/dist/server/utils/small-ticket.js +2 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
- package/dist/solution/BookingTicket/index.d.ts +2 -0
- package/dist/solution/BookingTicket/index.js +34 -10
- package/lib/core/index.js +0 -1
- package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -1
- package/lib/model/strategy/adapter/walletPass/utils.js +0 -1
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -0
- package/lib/modules/Customer/index.d.ts +4 -0
- package/lib/modules/Customer/index.js +11 -0
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Order/index.js +3 -2
- package/lib/modules/Order/utils.js +3 -0
- package/lib/modules/Payment/walletpass.js +0 -1
- package/lib/server/index.js +4 -4
- package/lib/server/modules/order/index.d.ts +1 -0
- package/lib/server/modules/order/index.js +66 -2
- package/lib/server/utils/small-ticket.js +1 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -0
- package/lib/solution/BookingTicket/index.d.ts +2 -0
- package/lib/solution/BookingTicket/index.js +18 -2
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 导出评估器
|
|
2
|
-
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
-
|
|
4
|
-
// 导出适配器
|
|
5
|
-
export { PromotionAdapter } from "./adapter";
|
|
6
|
-
export { default } from "./adapter";
|
|
7
|
-
|
|
8
|
-
// 导出策略配置示例常量
|
|
9
|
-
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
|
|
@@ -505,7 +505,6 @@ export var WalletPassEvaluator = /*#__PURE__*/function () {
|
|
|
505
505
|
}, {
|
|
506
506
|
key: "calculateApplicableProducts",
|
|
507
507
|
value: function calculateApplicableProducts(products, applicableProductIds, deductTaxAndFee) {
|
|
508
|
-
console.log(products, 'products1234');
|
|
509
508
|
var total = 0;
|
|
510
509
|
var count = 0;
|
|
511
510
|
|
|
@@ -189,8 +189,6 @@ var getApplicableProducts = function getApplicableProducts(voucher, productsData
|
|
|
189
189
|
* @returns 返回推荐券列表和全部列表,每个券包含 _available_max_amount 和 _unified_available_status
|
|
190
190
|
*/
|
|
191
191
|
export function processVouchers(applicableVouchers, orderTotalAmount, products) {
|
|
192
|
-
console.log(products, 'products123');
|
|
193
|
-
|
|
194
192
|
// 拆分商品数据,同时维护含税和不含税两个金额池
|
|
195
193
|
// remainingAmountWithTax: 含税费的剩余可抵扣金额
|
|
196
194
|
// remainingAmountPure: 纯商品金额(不含税费)的剩余可抵扣金额
|
|
@@ -192,7 +192,7 @@ function synthesizeProductResourceFromBooking(booking) {
|
|
|
192
192
|
* 调用方须传入与该行关联的 booking(通常 bookings[].product_uid === product.metadata.unique_identification_number)。
|
|
193
193
|
*/
|
|
194
194
|
export function buildCacheItemFromOrderLine(input) {
|
|
195
|
-
var _product$product_id, _product$selling_pric, _product$original_pri, _booking$metadata$hol, _booking$metadata2, _product$product_vari, _product$num, _ref11, _product$note, _booking$detail2, _product$metadata, _product$metadata2, _ref12, _extension_type, _booking$product2, _booking$product3, _price, _product$product_sku, _product$order_detail, _ref13, _booking$id;
|
|
195
|
+
var _product$product_id, _product$selling_pric, _product$original_pri, _booking$metadata$hol, _booking$metadata2, _product$bundle_edit, _product$product_vari, _product$num, _ref11, _product$note, _booking$detail2, _product$metadata, _product$metadata2, _ref12, _extension_type, _booking$product2, _booking$product3, _price, _product$product_sku, _product$order_detail, _ref13, _booking$id;
|
|
196
196
|
var product = input.product,
|
|
197
197
|
booking = input.booking,
|
|
198
198
|
sourceProduct = input.sourceProduct;
|
|
@@ -210,12 +210,14 @@ export function buildCacheItemFromOrderLine(input) {
|
|
|
210
210
|
var productTitle = resolveProductTitle(product, booking, sourceProduct);
|
|
211
211
|
var productCover = resolveProductCover(product, booking, sourceProduct);
|
|
212
212
|
var productOptionString = buildProductOptionStringFromOrderLine(product);
|
|
213
|
+
var hasBundle = Array.isArray(product.product_bundle) && product.product_bundle.length > 0;
|
|
214
|
+
var bundleEdit = (_product$bundle_edit = product.bundle_edit) !== null && _product$bundle_edit !== void 0 ? _product$bundle_edit : hasBundle ? 0 : undefined;
|
|
213
215
|
var other = {
|
|
214
216
|
product_variant_id: (_product$product_vari = product.product_variant_id) !== null && _product$product_vari !== void 0 ? _product$product_vari : 0,
|
|
215
217
|
option: getProductSkuOptions(product),
|
|
216
218
|
bundle: mapOrderBundleToOtherBundle(Array.isArray(product.product_bundle) ? product.product_bundle : [])
|
|
217
219
|
};
|
|
218
|
-
var extend = _objectSpread({
|
|
220
|
+
var extend = _objectSpread(_objectSpread({
|
|
219
221
|
start_date: startDate ? dayjs(startDate) : undefined,
|
|
220
222
|
end_date: endDate ? dayjs(endDate) : undefined,
|
|
221
223
|
startDate: startDate ? dayjs(startDate) : undefined,
|
|
@@ -237,7 +239,9 @@ export function buildCacheItemFromOrderLine(input) {
|
|
|
237
239
|
other: other,
|
|
238
240
|
like_status: booking.like_status || 'common',
|
|
239
241
|
discount_reason: resolveManualDiscountMessage(product.discount_list, (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.product_discount_reason) || undefined
|
|
240
|
-
},
|
|
242
|
+
}, bundleEdit !== undefined ? {
|
|
243
|
+
bundle_edit: bundleEdit
|
|
244
|
+
} : {}), productOptionString ? {
|
|
241
245
|
product_option_string: productOptionString
|
|
242
246
|
} : {});
|
|
243
247
|
var manualDiscount = (product.discount_list || []).find(function (d) {
|
|
@@ -44,6 +44,10 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
|
|
|
44
44
|
* 用于按 ID 补齐客户等内部查询,避免把临时的 num/searchParams 污染到滚动列表。
|
|
45
45
|
*/
|
|
46
46
|
queryCustomerList(params?: ShopGetCustomerListParams): Promise<ICustomerListResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* 查询单个客户详情,不写入 customerList / pagination 状态。
|
|
49
|
+
*/
|
|
50
|
+
queryCustomerDetail(id: string | number): Promise<ShopCustomer | null>;
|
|
47
51
|
/**
|
|
48
52
|
* 获取客户列表
|
|
49
53
|
* @param params 查询参数
|
|
@@ -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); }
|
|
4
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
4
|
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
5
|
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); }
|
|
7
6
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
7
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
8
|
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,6 +322,38 @@ 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
|
+
}()
|
|
325
357
|
/**
|
|
326
358
|
* 获取客户列表
|
|
327
359
|
* @param params 查询参数
|
|
@@ -331,7 +363,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
331
363
|
}, {
|
|
332
364
|
key: "getCustomerList",
|
|
333
365
|
value: (function () {
|
|
334
|
-
var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
366
|
+
var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
335
367
|
var params,
|
|
336
368
|
_yield$this$fetchCust2,
|
|
337
369
|
customerList,
|
|
@@ -342,18 +374,18 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
342
374
|
num,
|
|
343
375
|
searchParams,
|
|
344
376
|
response,
|
|
345
|
-
|
|
346
|
-
return _regeneratorRuntime().wrap(function
|
|
347
|
-
while (1) switch (
|
|
377
|
+
_args6 = arguments;
|
|
378
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
379
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
348
380
|
case 0:
|
|
349
|
-
params =
|
|
350
|
-
|
|
381
|
+
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
|
382
|
+
_context6.prev = 1;
|
|
351
383
|
this.store.loading = true;
|
|
352
384
|
this.store.error = null;
|
|
353
|
-
|
|
385
|
+
_context6.next = 6;
|
|
354
386
|
return this.fetchCustomerListData(params);
|
|
355
387
|
case 6:
|
|
356
|
-
_yield$this$fetchCust2 =
|
|
388
|
+
_yield$this$fetchCust2 = _context6.sent;
|
|
357
389
|
customerList = _yield$this$fetchCust2.customerList;
|
|
358
390
|
total = _yield$this$fetchCust2.total;
|
|
359
391
|
page = _yield$this$fetchCust2.page;
|
|
@@ -386,27 +418,27 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
386
418
|
page: page,
|
|
387
419
|
pageSize: pageSize
|
|
388
420
|
};
|
|
389
|
-
return
|
|
421
|
+
return _context6.abrupt("return", response);
|
|
390
422
|
case 23:
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
return this.handleCustomerListError(
|
|
423
|
+
_context6.prev = 23;
|
|
424
|
+
_context6.t0 = _context6["catch"](1);
|
|
425
|
+
_context6.next = 27;
|
|
426
|
+
return this.handleCustomerListError(_context6.t0, 'fetch customer list');
|
|
395
427
|
case 27:
|
|
396
|
-
throw
|
|
428
|
+
throw _context6.t0;
|
|
397
429
|
case 28:
|
|
398
|
-
|
|
430
|
+
_context6.prev = 28;
|
|
399
431
|
this.store.loading = false;
|
|
400
432
|
this.storeChange();
|
|
401
|
-
|
|
433
|
+
_context6.next = 33;
|
|
402
434
|
return this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
|
|
403
435
|
case 33:
|
|
404
|
-
return
|
|
436
|
+
return _context6.finish(28);
|
|
405
437
|
case 34:
|
|
406
438
|
case "end":
|
|
407
|
-
return
|
|
439
|
+
return _context6.stop();
|
|
408
440
|
}
|
|
409
|
-
},
|
|
441
|
+
}, _callee6, this, [[1, 23, 28, 34]]);
|
|
410
442
|
}));
|
|
411
443
|
function getCustomerList() {
|
|
412
444
|
return _getCustomerList.apply(this, arguments);
|
|
@@ -583,10 +615,10 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
583
615
|
}, {
|
|
584
616
|
key: "changeCustomerPage",
|
|
585
617
|
value: (function () {
|
|
586
|
-
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
618
|
+
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(page, pageSize) {
|
|
587
619
|
var targetPageSize, skip, num;
|
|
588
|
-
return _regeneratorRuntime().wrap(function
|
|
589
|
-
while (1) switch (
|
|
620
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
621
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
590
622
|
case 0:
|
|
591
623
|
targetPageSize = pageSize || this.store.pageSize; // 先更新分页状态
|
|
592
624
|
this.setPaginationInfo(page, targetPageSize);
|
|
@@ -594,20 +626,20 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
594
626
|
// skip直接使用page,num使用pageSize
|
|
595
627
|
skip = page;
|
|
596
628
|
num = targetPageSize; // 自动调用获取客户列表,使用存储的搜索条件
|
|
597
|
-
|
|
629
|
+
_context7.next = 6;
|
|
598
630
|
return this.getCustomerList(_objectSpread({
|
|
599
631
|
skip: skip,
|
|
600
632
|
num: num
|
|
601
633
|
}, this.store.searchParams));
|
|
602
634
|
case 6:
|
|
603
|
-
return
|
|
635
|
+
return _context7.abrupt("return", _context7.sent);
|
|
604
636
|
case 7:
|
|
605
637
|
case "end":
|
|
606
|
-
return
|
|
638
|
+
return _context7.stop();
|
|
607
639
|
}
|
|
608
|
-
},
|
|
640
|
+
}, _callee7, this);
|
|
609
641
|
}));
|
|
610
|
-
function changeCustomerPage(
|
|
642
|
+
function changeCustomerPage(_x6, _x7) {
|
|
611
643
|
return _changeCustomerPage.apply(this, arguments);
|
|
612
644
|
}
|
|
613
645
|
return changeCustomerPage;
|
|
@@ -620,16 +652,16 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
620
652
|
}, {
|
|
621
653
|
key: "loadMoreCustomers",
|
|
622
654
|
value: (function () {
|
|
623
|
-
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
655
|
+
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
624
656
|
var nextPage, loadMoreParams, _yield$this$fetchCust3, newCustomers, total, page, pageSize, updatedCustomerList, response;
|
|
625
|
-
return _regeneratorRuntime().wrap(function
|
|
626
|
-
while (1) switch (
|
|
657
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
658
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
627
659
|
case 0:
|
|
628
660
|
if (!(!this.store.hasMore || this.store.loadingMore)) {
|
|
629
|
-
|
|
661
|
+
_context8.next = 2;
|
|
630
662
|
break;
|
|
631
663
|
}
|
|
632
|
-
return
|
|
664
|
+
return _context8.abrupt("return", {
|
|
633
665
|
list: [],
|
|
634
666
|
total: this.store.total,
|
|
635
667
|
page: this.store.currentPage,
|
|
@@ -638,17 +670,17 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
638
670
|
case 2:
|
|
639
671
|
// 计算下一页
|
|
640
672
|
nextPage = this.store.currentPage + 1;
|
|
641
|
-
|
|
673
|
+
_context8.prev = 3;
|
|
642
674
|
this.store.loadingMore = true;
|
|
643
675
|
this.store.error = null;
|
|
644
676
|
loadMoreParams = _objectSpread({
|
|
645
677
|
skip: nextPage,
|
|
646
678
|
num: this.store.pageSize
|
|
647
679
|
}, this.store.searchParams); // 使用公共方法获取数据,传入存储的搜索条件
|
|
648
|
-
|
|
680
|
+
_context8.next = 9;
|
|
649
681
|
return this.fetchCustomerListData(loadMoreParams);
|
|
650
682
|
case 9:
|
|
651
|
-
_yield$this$fetchCust3 =
|
|
683
|
+
_yield$this$fetchCust3 = _context8.sent;
|
|
652
684
|
newCustomers = _yield$this$fetchCust3.customerList;
|
|
653
685
|
total = _yield$this$fetchCust3.total;
|
|
654
686
|
page = _yield$this$fetchCust3.page;
|
|
@@ -661,7 +693,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
661
693
|
this.store.hasMore = page * pageSize < total;
|
|
662
694
|
|
|
663
695
|
// 触发滚动加载特定事件
|
|
664
|
-
|
|
696
|
+
_context8.next = 21;
|
|
665
697
|
return this.core.effects.emit("".concat(this.name, ":onScrollLoadMore"), {
|
|
666
698
|
newCustomers: newCustomers,
|
|
667
699
|
allCustomers: this.store.customerList,
|
|
@@ -683,27 +715,27 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
683
715
|
page: page,
|
|
684
716
|
pageSize: pageSize
|
|
685
717
|
};
|
|
686
|
-
return
|
|
718
|
+
return _context8.abrupt("return", response);
|
|
687
719
|
case 26:
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
return this.handleCustomerListError(
|
|
720
|
+
_context8.prev = 26;
|
|
721
|
+
_context8.t0 = _context8["catch"](3);
|
|
722
|
+
_context8.next = 30;
|
|
723
|
+
return this.handleCustomerListError(_context8.t0, 'load more customers');
|
|
692
724
|
case 30:
|
|
693
|
-
throw
|
|
725
|
+
throw _context8.t0;
|
|
694
726
|
case 31:
|
|
695
|
-
|
|
727
|
+
_context8.prev = 31;
|
|
696
728
|
this.store.loadingMore = false;
|
|
697
729
|
this.storeChange();
|
|
698
|
-
|
|
730
|
+
_context8.next = 36;
|
|
699
731
|
return this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
|
|
700
732
|
case 36:
|
|
701
|
-
return
|
|
733
|
+
return _context8.finish(31);
|
|
702
734
|
case 37:
|
|
703
735
|
case "end":
|
|
704
|
-
return
|
|
736
|
+
return _context8.stop();
|
|
705
737
|
}
|
|
706
|
-
},
|
|
738
|
+
}, _callee8, this, [[3, 26, 31, 37]]);
|
|
707
739
|
}));
|
|
708
740
|
function loadMoreCustomers() {
|
|
709
741
|
return _loadMoreCustomers.apply(this, arguments);
|
|
@@ -719,15 +751,15 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
719
751
|
}, {
|
|
720
752
|
key: "resetAndLoadCustomers",
|
|
721
753
|
value: (function () {
|
|
722
|
-
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
754
|
+
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
723
755
|
var params,
|
|
724
756
|
resetParams,
|
|
725
757
|
response,
|
|
726
|
-
|
|
727
|
-
return _regeneratorRuntime().wrap(function
|
|
728
|
-
while (1) switch (
|
|
758
|
+
_args9 = arguments;
|
|
759
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
760
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
729
761
|
case 0:
|
|
730
|
-
params =
|
|
762
|
+
params = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
|
|
731
763
|
// 重置状态
|
|
732
764
|
this.store.customerList = [];
|
|
733
765
|
this.store.currentPage = 1;
|
|
@@ -739,23 +771,23 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
739
771
|
skip: 1,
|
|
740
772
|
num: params.num || this.store.pageSize
|
|
741
773
|
}); // 调用普通的获取列表方法
|
|
742
|
-
|
|
774
|
+
_context9.next = 8;
|
|
743
775
|
return this.getCustomerList(resetParams);
|
|
744
776
|
case 8:
|
|
745
|
-
response =
|
|
746
|
-
|
|
777
|
+
response = _context9.sent;
|
|
778
|
+
_context9.next = 11;
|
|
747
779
|
return this.core.effects.emit("".concat(this.name, ":onScrollLoadComplete"), {
|
|
748
780
|
customers: this.store.customerList,
|
|
749
781
|
total: this.store.total,
|
|
750
782
|
hasMore: this.store.hasMore
|
|
751
783
|
});
|
|
752
784
|
case 11:
|
|
753
|
-
return
|
|
785
|
+
return _context9.abrupt("return", response);
|
|
754
786
|
case 12:
|
|
755
787
|
case "end":
|
|
756
|
-
return
|
|
788
|
+
return _context9.stop();
|
|
757
789
|
}
|
|
758
|
-
},
|
|
790
|
+
}, _callee9, this);
|
|
759
791
|
}));
|
|
760
792
|
function resetAndLoadCustomers() {
|
|
761
793
|
return _resetAndLoadCustomers.apply(this, arguments);
|
|
@@ -112,6 +112,8 @@ 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>;
|
|
115
117
|
/** 设置客户列表 */
|
|
116
118
|
setCustomerList: (customers: ShopCustomer[], total?: number) => void;
|
|
117
119
|
/** 设置当前选择的客户 */
|
|
@@ -6358,7 +6358,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
6358
6358
|
});
|
|
6359
6359
|
delete row["product_".concat('option', "_item")];
|
|
6360
6360
|
if (!Array.isArray(row.product_bundle)) row.product_bundle = [];
|
|
6361
|
-
|
|
6361
|
+
row.metadata = row.metadata && _typeof(row.metadata) === 'object' ? _objectSpread({}, row.metadata) : {};
|
|
6362
|
+
// bundle_edit 只描述当前编辑会话中的套餐修改状态,不能从本地缓存或详情响应带入新会话。
|
|
6363
|
+
delete row.bundle_edit;
|
|
6364
|
+
delete row.metadata.bundle_edit;
|
|
6362
6365
|
if (row.booking_uid && !row.metadata.booking_uid) {
|
|
6363
6366
|
row.metadata.booking_uid = row.booking_uid;
|
|
6364
6367
|
}
|
|
@@ -910,7 +910,7 @@ function formatSubmitBundleItems(bundle) {
|
|
|
910
910
|
* 本函数不再改造价格字段形状,仅做字段/metadata 裁剪。
|
|
911
911
|
*/
|
|
912
912
|
function normalizeSubmitProduct(product) {
|
|
913
|
-
var _rawMetadata$product_, _submitProduct$produc, _submitProduct$paymen;
|
|
913
|
+
var _ref29, _submitProduct$bundle, _rawMetadata$product_, _submitProduct$produc, _submitProduct$paymen;
|
|
914
914
|
var _ref28 = product,
|
|
915
915
|
_runtimeUid = _ref28.unique_identification_number,
|
|
916
916
|
submitProduct = _objectWithoutProperties(_ref28, _excluded2);
|
|
@@ -925,6 +925,10 @@ function normalizeSubmitProduct(product) {
|
|
|
925
925
|
delete productRest["product_".concat('option', "_item")];
|
|
926
926
|
var rawMetadata = submitProduct.metadata || {};
|
|
927
927
|
var bookingUid = rawMetadata.booking_uid;
|
|
928
|
+
// 兼容历史 BigSale 编辑链路:bundle_edit 曾被写入 metadata,
|
|
929
|
+
// 出站时需提升到商品顶层;套餐未编辑时也必须显式提交 0。
|
|
930
|
+
var hasProductBundle = Array.isArray(submitProduct.product_bundle) && submitProduct.product_bundle.length > 0;
|
|
931
|
+
var bundleEdit = (_ref29 = (_submitProduct$bundle = submitProduct.bundle_edit) !== null && _submitProduct$bundle !== void 0 ? _submitProduct$bundle : rawMetadata.bundle_edit) !== null && _ref29 !== void 0 ? _ref29 : hasProductBundle ? 0 : undefined;
|
|
928
932
|
var cleanMetadata = {};
|
|
929
933
|
if (rawMetadata.unique_identification_number) {
|
|
930
934
|
cleanMetadata.unique_identification_number = rawMetadata.unique_identification_number;
|
|
@@ -949,8 +953,10 @@ function normalizeSubmitProduct(product) {
|
|
|
949
953
|
var productSku = _objectSpread(_objectSpread({}, submitProduct.product_sku && _typeof(submitProduct.product_sku) === 'object' ? submitProduct.product_sku : {}), {}, {
|
|
950
954
|
option: formatSubmitOptionItems((_submitProduct$produc = submitProduct.product_sku) === null || _submitProduct$produc === void 0 ? void 0 : _submitProduct$produc.option)
|
|
951
955
|
});
|
|
952
|
-
return _objectSpread(_objectSpread(_objectSpread({}, productRest), bookingUid ? {
|
|
956
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, productRest), bookingUid ? {
|
|
953
957
|
booking_uid: bookingUid
|
|
958
|
+
} : {}), bundleEdit !== undefined ? {
|
|
959
|
+
bundle_edit: bundleEdit
|
|
954
960
|
} : {}), {}, {
|
|
955
961
|
product_quantity: toBundleNumber(num !== null && num !== void 0 ? num : submitProduct.product_quantity, 1),
|
|
956
962
|
product_sku: productSku,
|
|
@@ -1080,7 +1086,7 @@ export function createDefaultTempOrder(params) {
|
|
|
1080
1086
|
};
|
|
1081
1087
|
}
|
|
1082
1088
|
export function buildSubmitPayload(params) {
|
|
1083
|
-
var _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_,
|
|
1089
|
+
var _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref31, _tempOrder$is_price_i, _tempOrder$is_deposit, _enhancedPayload$summ;
|
|
1084
1090
|
var tempOrder = params.tempOrder,
|
|
1085
1091
|
cacheId = params.cacheId,
|
|
1086
1092
|
_params$now = params.now,
|
|
@@ -1093,26 +1099,26 @@ export function buildSubmitPayload(params) {
|
|
|
1093
1099
|
enhance = params.enhance;
|
|
1094
1100
|
var scheduleDate = tempOrder.schedule_date || tempOrder.created_at || formatDateTime(now);
|
|
1095
1101
|
var bookingUuid = createUuidV4();
|
|
1096
|
-
var
|
|
1097
|
-
_extend =
|
|
1098
|
-
_relationId =
|
|
1099
|
-
_tableFormId =
|
|
1100
|
-
_resourceId =
|
|
1101
|
-
_summary =
|
|
1102
|
-
_lastOrderInfo =
|
|
1103
|
-
_paidAmount =
|
|
1104
|
-
_shopId =
|
|
1105
|
-
_shopNote =
|
|
1106
|
-
_shopServiceType =
|
|
1107
|
-
_startTime =
|
|
1108
|
-
_customer =
|
|
1109
|
-
_discountList =
|
|
1110
|
-
_rootTaxFee =
|
|
1111
|
-
_totalAmount =
|
|
1112
|
-
_totalRefundAmount =
|
|
1113
|
-
_createDate =
|
|
1114
|
-
_holderId =
|
|
1115
|
-
tempOrderRest = _objectWithoutProperties(
|
|
1102
|
+
var _ref30 = tempOrder,
|
|
1103
|
+
_extend = _ref30._extend,
|
|
1104
|
+
_relationId = _ref30.relation_id,
|
|
1105
|
+
_tableFormId = _ref30.table_form_id,
|
|
1106
|
+
_resourceId = _ref30.resource_id,
|
|
1107
|
+
_summary = _ref30.summary,
|
|
1108
|
+
_lastOrderInfo = _ref30.lastOrderInfo,
|
|
1109
|
+
_paidAmount = _ref30.paid_amount,
|
|
1110
|
+
_shopId = _ref30.shop_id,
|
|
1111
|
+
_shopNote = _ref30.shop_note,
|
|
1112
|
+
_shopServiceType = _ref30.shop_service_type,
|
|
1113
|
+
_startTime = _ref30.start_time,
|
|
1114
|
+
_customer = _ref30.customer,
|
|
1115
|
+
_discountList = _ref30.discount_list,
|
|
1116
|
+
_rootTaxFee = _ref30.tax_fee,
|
|
1117
|
+
_totalAmount = _ref30.total_amount,
|
|
1118
|
+
_totalRefundAmount = _ref30.total_refund_amount,
|
|
1119
|
+
_createDate = _ref30.create_date,
|
|
1120
|
+
_holderId = _ref30.holder_id,
|
|
1121
|
+
tempOrderRest = _objectWithoutProperties(_ref30, _excluded4);
|
|
1116
1122
|
var submitType = type !== null && type !== void 0 ? type : tempOrder.type;
|
|
1117
1123
|
if (!submitType) {
|
|
1118
1124
|
var _tempOrder$bookings;
|
|
@@ -1137,7 +1143,7 @@ export function buildSubmitPayload(params) {
|
|
|
1137
1143
|
type: submitType,
|
|
1138
1144
|
business_code: businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code,
|
|
1139
1145
|
sales_channel: tempOrder.sales_channel || 'my_pisel',
|
|
1140
|
-
order_sales_channel: (
|
|
1146
|
+
order_sales_channel: (_ref31 = channel !== null && channel !== void 0 ? channel : tempOrder.order_sales_channel) !== null && _ref31 !== void 0 ? _ref31 : 'online_store',
|
|
1141
1147
|
status: tempOrder.status || 'normal',
|
|
1142
1148
|
payment_status: tempOrder.payment_status || 'payment_processing',
|
|
1143
1149
|
// shipping_status: tempOrder.shipping_status || 'unfulfilled',
|
|
@@ -1163,10 +1169,10 @@ export function buildSubmitPayload(params) {
|
|
|
1163
1169
|
// holder: tempOrder.holder || null,
|
|
1164
1170
|
summary: summary || tempOrder.summary || createEmptySummary(),
|
|
1165
1171
|
metadata: function () {
|
|
1166
|
-
var
|
|
1167
|
-
_collectPax =
|
|
1168
|
-
_tableOccupancyDuration =
|
|
1169
|
-
rest = _objectWithoutProperties(
|
|
1172
|
+
var _ref32 = tempOrder.metadata || {},
|
|
1173
|
+
_collectPax = _ref32.collect_pax,
|
|
1174
|
+
_tableOccupancyDuration = _ref32.table_occupancy_duration,
|
|
1175
|
+
rest = _objectWithoutProperties(_ref32, _excluded5);
|
|
1170
1176
|
return _objectSpread({}, rest);
|
|
1171
1177
|
}(),
|
|
1172
1178
|
products: (tempOrder.products || []).map(function (product) {
|
|
@@ -1374,8 +1380,8 @@ export function getRuntimeProductOrigin(tempOrder, product) {
|
|
|
1374
1380
|
return tempOrder._extend.productsByUid[uid].origin;
|
|
1375
1381
|
}
|
|
1376
1382
|
var matchedProduct = ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).find(function (item) {
|
|
1377
|
-
var
|
|
1378
|
-
return item === product || getOrderProductLineUid(item) === uid || String((
|
|
1383
|
+
var _ref33, _item$product_id, _ref34, _product$product_id;
|
|
1384
|
+
return item === product || getOrderProductLineUid(item) === uid || String((_ref33 = (_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref33 !== void 0 ? _ref33 : '') === String((_ref34 = (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id) !== null && _ref34 !== void 0 ? _ref34 : '');
|
|
1379
1385
|
});
|
|
1380
1386
|
var matchedUid = matchedProduct ? getOrderProductLineUid(matchedProduct) : '';
|
|
1381
1387
|
return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3[matchedUid]) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.origin) || null : null;
|
|
@@ -620,7 +620,6 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
620
620
|
vouchers: allList
|
|
621
621
|
});
|
|
622
622
|
recommended = res.recommended, transformList = res.transformList, noApplicableVoucher = res.noApplicableVoucher, recommendedAmount = res.recommendedAmount;
|
|
623
|
-
console.log(res, 'resres12');
|
|
624
623
|
this.walletRecommendList = recommended;
|
|
625
624
|
|
|
626
625
|
// 存储初始化数据到内存中,供 useWalletPass 使用
|
|
@@ -640,19 +639,19 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
640
639
|
noApplicableVoucher: noApplicableVoucher,
|
|
641
640
|
products: products || []
|
|
642
641
|
});
|
|
643
|
-
case
|
|
644
|
-
_context3.prev =
|
|
642
|
+
case 19:
|
|
643
|
+
_context3.prev = 19;
|
|
645
644
|
_context3.t0 = _context3["catch"](0);
|
|
646
645
|
this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context3.t0, {
|
|
647
646
|
customer_id: baseParams.customer_id,
|
|
648
647
|
order_expect_amount: baseParams.order_expect_amount
|
|
649
648
|
});
|
|
650
649
|
throw _context3.t0;
|
|
651
|
-
case
|
|
650
|
+
case 23:
|
|
652
651
|
case "end":
|
|
653
652
|
return _context3.stop();
|
|
654
653
|
}
|
|
655
|
-
}, _callee3, this, [[0,
|
|
654
|
+
}, _callee3, this, [[0, 19]]);
|
|
656
655
|
}));
|
|
657
656
|
function initializeWalletDataAsync(_x3) {
|
|
658
657
|
return _initializeWalletDataAsync.apply(this, arguments);
|
package/dist/server/index.js
CHANGED
|
@@ -1243,7 +1243,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
1243
1243
|
checkoutData: checkoutData,
|
|
1244
1244
|
order: printableOrder,
|
|
1245
1245
|
response: null,
|
|
1246
|
-
requireFullyPaid: false
|
|
1246
|
+
requireFullyPaid: false,
|
|
1247
|
+
isManualPrint: true
|
|
1247
1248
|
});
|
|
1248
1249
|
case 27:
|
|
1249
1250
|
printResult = _context19.sent;
|
|
@@ -6040,9 +6041,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
6040
6041
|
checkoutData: syncResult.checkoutData,
|
|
6041
6042
|
order: syncedOrder,
|
|
6042
6043
|
response: syncResult.normalizedResponse,
|
|
6043
|
-
requireFullyPaid: true
|
|
6044
|
+
requireFullyPaid: true
|
|
6044
6045
|
// print_all 的 type=0 是收据打印;不要沿用同步成功后的券/手环打印 type=99。
|
|
6045
|
-
isManualPrint: true
|
|
6046
6046
|
});
|
|
6047
6047
|
case 16:
|
|
6048
6048
|
return _context61.abrupt("return", response);
|
|
@@ -6317,7 +6317,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
6317
6317
|
value: function shouldAutoPrintCheckoutReceipt() {
|
|
6318
6318
|
var _this$core$context2, _this$core$context2$g, _this$app17, _this$app17$getStorag;
|
|
6319
6319
|
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;
|
|
6320
|
-
return ((_this$app17 = this.app) === null || _this$app17 === void 0 || (_this$app17 = _this$app17.storage) === null || _this$app17 === void 0 || (_this$app17$getStorag = _this$app17.getStorage) === null || _this$app17$getStorag === void 0 ? void 0 : _this$app17$getStorag.call(_this$app17, AUTO_PRINT_STORAGE_KEY))
|
|
6320
|
+
return ((_this$app17 = this.app) === null || _this$app17 === void 0 || (_this$app17 = _this$app17.storage) === null || _this$app17 === void 0 || (_this$app17$getStorag = _this$app17.getStorage) === null || _this$app17$getStorag === void 0 ? void 0 : _this$app17$getStorag.call(_this$app17, AUTO_PRINT_STORAGE_KEY)) !== 'false';
|
|
6321
6321
|
}
|
|
6322
6322
|
}, {
|
|
6323
6323
|
key: "shouldBuildSmallTicketData",
|
|
@@ -274,6 +274,7 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
274
274
|
* // => 'S-1001'
|
|
275
275
|
*/
|
|
276
276
|
private getOrderStorageKey;
|
|
277
|
+
private getPersistedOrderStorageKey;
|
|
277
278
|
private getOrderIdentityMatchKeys;
|
|
278
279
|
private doOrdersShareIdentity;
|
|
279
280
|
private findOrderIndexByIdentity;
|