@pisell/pisellos 2.2.277 → 2.2.279

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  2. package/dist/modules/BaseModule.d.ts +1 -0
  3. package/dist/modules/BaseModule.js +24 -28
  4. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +7 -3
  5. package/dist/modules/BookingContext/utils/productExtend.js +5 -9
  6. package/dist/modules/BookingContext/utils/timeSlices.js +24 -3
  7. package/dist/modules/Customer/index.d.ts +4 -0
  8. package/dist/modules/Customer/index.js +91 -59
  9. package/dist/modules/Customer/types.d.ts +2 -0
  10. package/dist/modules/Discount/index.d.ts +1 -0
  11. package/dist/modules/Discount/index.js +40 -11
  12. package/dist/modules/Discount/types.d.ts +1 -0
  13. package/dist/modules/Holder/index.d.ts +48 -0
  14. package/dist/modules/Holder/index.js +640 -0
  15. package/dist/modules/Holder/types.d.ts +123 -0
  16. package/dist/modules/Holder/types.js +1 -0
  17. package/dist/modules/Holder/utils.d.ts +13 -0
  18. package/dist/modules/Holder/utils.js +34 -0
  19. package/dist/modules/OpenData/index.js +2 -2
  20. package/dist/modules/Order/index.d.ts +32 -4
  21. package/dist/modules/Order/index.js +868 -675
  22. package/dist/modules/Order/types.d.ts +22 -1
  23. package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
  24. package/dist/modules/Order/utils/discountProductLineIdentity.js +227 -0
  25. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  26. package/dist/modules/Order/utils/orderCollectionIdentity.js +75 -0
  27. package/dist/modules/Order/utils.d.ts +10 -0
  28. package/dist/modules/Order/utils.js +71 -34
  29. package/dist/modules/Payment/index.d.ts +4 -0
  30. package/dist/modules/Payment/index.js +14 -4
  31. package/dist/modules/Payment/walletpass.js +48 -13
  32. package/dist/modules/Product/types.d.ts +1 -0
  33. package/dist/modules/ProductList/index.js +33 -13
  34. package/dist/modules/Quotation/index.d.ts +1 -1
  35. package/dist/modules/Quotation/index.js +2 -2
  36. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  37. package/dist/modules/ResourcePlanner/index.js +181 -0
  38. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  39. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  40. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  41. package/dist/modules/ResourcePlanner/types.js +1 -0
  42. package/dist/modules/Rules/index.js +153 -56
  43. package/dist/modules/SalesSummary/index.js +12 -13
  44. package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
  45. package/dist/modules/ScanOrderLogger/index.js +15 -2
  46. package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
  47. package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
  48. package/dist/modules/Schedule/index.d.ts +3 -1
  49. package/dist/modules/Schedule/index.js +21 -16
  50. package/dist/modules/Summary/utils.js +38 -13
  51. package/dist/modules/index.d.ts +2 -0
  52. package/dist/modules/index.js +3 -1
  53. package/dist/plugins/window.d.ts +1 -0
  54. package/dist/server/index.d.ts +20 -0
  55. package/dist/server/index.js +1101 -909
  56. package/dist/server/modules/order/index.d.ts +2 -0
  57. package/dist/server/modules/order/index.js +261 -96
  58. package/dist/server/modules/order/types.d.ts +1 -1
  59. package/dist/server/utils/small-ticket.js +2 -1
  60. package/dist/solution/BaseSales/index.d.ts +10 -1
  61. package/dist/solution/BaseSales/index.js +201 -148
  62. package/dist/solution/BaseSales/utils/cartPromotion.js +19 -1
  63. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
  64. package/dist/solution/BaseSales/utils.js +31 -20
  65. package/dist/solution/BookingByStep/index.d.ts +16 -1
  66. package/dist/solution/BookingByStep/index.js +294 -215
  67. package/dist/solution/BookingByStep/types.d.ts +2 -1
  68. package/dist/solution/BookingByStep/types.js +3 -1
  69. package/dist/solution/BookingByStep/utils/capacity.js +17 -1
  70. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  71. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  72. package/dist/solution/BookingTicket/index.d.ts +6 -2
  73. package/dist/solution/BookingTicket/index.js +125 -77
  74. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  75. package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
  76. package/dist/solution/ScanOrder/index.d.ts +26 -14
  77. package/dist/solution/ScanOrder/index.js +1142 -739
  78. package/dist/solution/ScanOrder/types.d.ts +21 -1
  79. package/dist/solution/ScanOrder/utils.d.ts +8 -0
  80. package/dist/solution/ScanOrder/utils.js +97 -45
  81. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  82. package/dist/solution/ShopDiscount/index.js +125 -87
  83. package/dist/solution/UnifiedBookingSales/index.d.ts +204 -0
  84. package/dist/solution/UnifiedBookingSales/index.js +2211 -0
  85. package/dist/solution/UnifiedBookingSales/types.d.ts +150 -0
  86. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  87. package/dist/solution/VenueBooking/index.d.ts +39 -11
  88. package/dist/solution/VenueBooking/index.js +1167 -841
  89. package/dist/solution/VenueBooking/types.d.ts +3 -0
  90. package/dist/solution/VenueBooking/utils/resource.js +1 -0
  91. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  92. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
  93. package/dist/solution/index.d.ts +1 -0
  94. package/dist/solution/index.js +2 -1
  95. package/dist/types/index.d.ts +1 -0
  96. package/lib/model/strategy/adapter/promotion/index.js +51 -0
  97. package/lib/modules/BaseModule.d.ts +1 -0
  98. package/lib/modules/BaseModule.js +24 -37
  99. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -0
  100. package/lib/modules/BookingContext/utils/productExtend.js +4 -3
  101. package/lib/modules/BookingContext/utils/timeSlices.js +18 -3
  102. package/lib/modules/Customer/index.d.ts +4 -0
  103. package/lib/modules/Customer/index.js +11 -0
  104. package/lib/modules/Customer/types.d.ts +2 -0
  105. package/lib/modules/Discount/index.d.ts +1 -0
  106. package/lib/modules/Discount/index.js +9 -0
  107. package/lib/modules/Discount/types.d.ts +1 -0
  108. package/lib/modules/Holder/index.d.ts +48 -0
  109. package/lib/modules/Holder/index.js +402 -0
  110. package/lib/modules/Holder/types.d.ts +123 -0
  111. package/lib/modules/Holder/types.js +17 -0
  112. package/lib/modules/Holder/utils.d.ts +13 -0
  113. package/lib/modules/Holder/utils.js +71 -0
  114. package/lib/modules/OpenData/index.js +1 -1
  115. package/lib/modules/Order/index.d.ts +32 -4
  116. package/lib/modules/Order/index.js +372 -156
  117. package/lib/modules/Order/types.d.ts +22 -1
  118. package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
  119. package/lib/modules/Order/utils/discountProductLineIdentity.js +170 -0
  120. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  121. package/lib/modules/Order/utils/orderCollectionIdentity.js +70 -0
  122. package/lib/modules/Order/utils.d.ts +10 -0
  123. package/lib/modules/Order/utils.js +39 -6
  124. package/lib/modules/Payment/index.d.ts +4 -0
  125. package/lib/modules/Payment/index.js +7 -0
  126. package/lib/modules/Payment/walletpass.js +27 -1
  127. package/lib/modules/Product/types.d.ts +1 -0
  128. package/lib/modules/ProductList/index.js +49 -31
  129. package/lib/modules/Quotation/index.d.ts +1 -1
  130. package/lib/modules/Quotation/index.js +2 -2
  131. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  132. package/lib/modules/ResourcePlanner/index.js +148 -0
  133. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  134. package/lib/modules/ResourcePlanner/planner.js +933 -0
  135. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  136. package/lib/modules/ResourcePlanner/types.js +17 -0
  137. package/lib/modules/Rules/index.js +117 -25
  138. package/lib/modules/SalesSummary/index.js +6 -7
  139. package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
  140. package/lib/modules/ScanOrderLogger/index.js +13 -1
  141. package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
  142. package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
  143. package/lib/modules/Schedule/index.d.ts +3 -1
  144. package/lib/modules/Schedule/index.js +10 -8
  145. package/lib/modules/Summary/utils.js +21 -1
  146. package/lib/modules/index.d.ts +2 -0
  147. package/lib/modules/index.js +5 -1
  148. package/lib/plugins/window.d.ts +1 -0
  149. package/lib/server/index.d.ts +20 -0
  150. package/lib/server/index.js +124 -19
  151. package/lib/server/modules/order/index.d.ts +2 -0
  152. package/lib/server/modules/order/index.js +75 -5
  153. package/lib/server/modules/order/types.d.ts +1 -1
  154. package/lib/server/utils/small-ticket.js +1 -1
  155. package/lib/solution/BaseSales/index.d.ts +10 -1
  156. package/lib/solution/BaseSales/index.js +73 -29
  157. package/lib/solution/BaseSales/utils/cartPromotion.js +18 -0
  158. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -0
  159. package/lib/solution/BaseSales/utils.js +29 -18
  160. package/lib/solution/BookingByStep/index.d.ts +16 -1
  161. package/lib/solution/BookingByStep/index.js +60 -18
  162. package/lib/solution/BookingByStep/types.d.ts +2 -1
  163. package/lib/solution/BookingByStep/types.js +5 -0
  164. package/lib/solution/BookingByStep/utils/capacity.js +20 -1
  165. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  166. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  167. package/lib/solution/BookingTicket/index.d.ts +6 -2
  168. package/lib/solution/BookingTicket/index.js +63 -16
  169. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  170. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  171. package/lib/solution/ScanOrder/index.d.ts +26 -14
  172. package/lib/solution/ScanOrder/index.js +449 -182
  173. package/lib/solution/ScanOrder/types.d.ts +21 -1
  174. package/lib/solution/ScanOrder/utils.d.ts +8 -0
  175. package/lib/solution/ScanOrder/utils.js +60 -18
  176. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  177. package/lib/solution/ShopDiscount/index.js +14 -0
  178. package/lib/solution/UnifiedBookingSales/index.d.ts +204 -0
  179. package/lib/solution/UnifiedBookingSales/index.js +1273 -0
  180. package/lib/solution/UnifiedBookingSales/types.d.ts +150 -0
  181. package/lib/solution/UnifiedBookingSales/types.js +33 -0
  182. package/lib/solution/VenueBooking/index.d.ts +39 -11
  183. package/lib/solution/VenueBooking/index.js +322 -110
  184. package/lib/solution/VenueBooking/types.d.ts +3 -0
  185. package/lib/solution/VenueBooking/utils/resource.js +1 -0
  186. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  187. package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
  188. package/lib/solution/index.d.ts +1 -0
  189. package/lib/solution/index.js +3 -1
  190. package/lib/types/index.d.ts +1 -0
  191. package/package.json +1 -1
@@ -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";
@@ -8,6 +8,7 @@ export declare class BaseModule {
8
8
  protected core: PisellCore;
9
9
  constructor(name?: string, version?: string);
10
10
  destroy(): void;
11
+ private isRecord;
11
12
  checkSaveCache({ cacheId, fatherModule, store, cacheKey, }: {
12
13
  cacheId: string | undefined;
13
14
  fatherModule: string | undefined;
@@ -23,45 +23,41 @@ export var BaseModule = /*#__PURE__*/function () {
23
23
  this.core.effects.offByModuleDestroy(this.name);
24
24
  this.core.unregisterModule(this);
25
25
  }
26
+ }, {
27
+ key: "isRecord",
28
+ value: function isRecord(value) {
29
+ return !!value && _typeof(value) === 'object' && !Array.isArray(value);
30
+ }
26
31
 
27
32
  // 提供统一的缓存 module 里的数据的方法
28
33
  }, {
29
34
  key: "checkSaveCache",
30
35
  value: function checkSaveCache(_ref) {
31
- var _this = this;
32
36
  var cacheId = _ref.cacheId,
33
37
  fatherModule = _ref.fatherModule,
34
38
  store = _ref.store,
35
39
  cacheKey = _ref.cacheKey;
36
- var window = this.core.getPlugin('window');
37
- if (cacheId) {
40
+ if (!cacheId) return;
41
+ try {
42
+ var window = this.core.getPlugin('window');
43
+ var sessionStorage = window === null || window === void 0 ? void 0 : window.sessionStorage;
44
+ if (!sessionStorage) return;
45
+ var storageKey = fatherModule || cacheId;
46
+ var rawCacheData = sessionStorage.getItem(storageKey);
47
+ var parsedCacheData = rawCacheData ? JSON.parse(rawCacheData) : {};
48
+ if (!this.isRecord(parsedCacheData)) return;
49
+ var cacheBucket = fatherModule ? this.isRecord(parsedCacheData[cacheId]) ? parsedCacheData[cacheId] : {} : parsedCacheData;
50
+ var moduleBucket = this.isRecord(cacheBucket[this.name]) ? cacheBucket[this.name] : {};
51
+ cacheKey.forEach(function (key) {
52
+ moduleBucket[key] = store === null || store === void 0 ? void 0 : store[key];
53
+ });
54
+ cacheBucket[this.name] = moduleBucket;
38
55
  if (fatherModule) {
39
- var currentCacheData = window.sessionStorage.getItem(fatherModule);
40
- var currentCacheDataObj = JSON.parse(currentCacheData || '{}');
41
- if (!currentCacheData || !currentCacheDataObj[cacheId]) {
42
- currentCacheDataObj = _defineProperty({}, cacheId, _defineProperty({}, this.name, {}));
43
- }
44
- if (!currentCacheDataObj[cacheId][this.name]) {
45
- currentCacheDataObj[cacheId][this.name] = {};
46
- }
47
- cacheKey.forEach(function (key) {
48
- currentCacheDataObj[cacheId][_this.name][key] = store === null || store === void 0 ? void 0 : store[key];
49
- });
50
- window.sessionStorage.setItem(fatherModule, JSON.stringify(currentCacheDataObj));
51
- } else {
52
- var _currentCacheData = window.sessionStorage.getItem(cacheId);
53
- var _currentCacheDataObj2 = JSON.parse(_currentCacheData || '{}');
54
- if (!_currentCacheDataObj2) {
55
- _currentCacheDataObj2 = {};
56
- }
57
- if (!_currentCacheDataObj2[this.name]) {
58
- _currentCacheDataObj2[this.name] = {};
59
- }
60
- cacheKey.forEach(function (key) {
61
- _currentCacheDataObj2[_this.name][key] = store[key];
62
- });
63
- window.sessionStorage.setItem(cacheId, JSON.stringify(_currentCacheDataObj2));
56
+ parsedCacheData[cacheId] = cacheBucket;
64
57
  }
58
+ sessionStorage.setItem(storageKey, JSON.stringify(parsedCacheData));
59
+ } catch (_unused) {
60
+ // sessionStorage persistence is best-effort and must not block checkout.
65
61
  }
66
62
  }
67
63
  }, {
@@ -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
- }, productOptionString ? {
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) {
@@ -1,6 +1,8 @@
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
3
  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."); }
4
+ 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); }
5
+ 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; }
4
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; } }
5
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
6
8
  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; }
@@ -8,12 +10,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
8
10
  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; }
9
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
12
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12
- 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
- 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
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
15
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
16
- 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; }
17
13
  import dayjs from 'dayjs';
18
14
  import { formatResources, getResourceByIds, getSumCapacity, getUsableTime, setDefaultCapacitys, setDefaultResource } from "./resources";
19
15
  import { hasActualResourceSelection, productNeedsResourceExtend } from "./resourceSelection";
@@ -81,9 +77,9 @@ export function getTimeObj(params) {
81
77
  useStartTime: useStartTime,
82
78
  ctx: ctx
83
79
  });
84
- var baseSlices = sliceDayIntoFiveMinutes(ctx === null || ctx === void 0 || (_ctx$bookingConfig2 = ctx.bookingConfig) === null || _ctx$bookingConfig2 === void 0 || (_ctx$bookingConfig2 = _ctx$bookingConfig2.config) === null || _ctx$bookingConfig2 === void 0 || (_ctx$bookingConfig2 = _ctx$bookingConfig2.basic) === null || _ctx$bookingConfig2 === void 0 ? void 0 : _ctx$bookingConfig2.service_time, isMultiDay);
85
- var timeSlices = _toConsumableArray(baseSlices.timeSlices);
86
- var durationSlicesBasedOnTime = _toConsumableArray(baseSlices.durationSlicesBasedOnTime);
80
+ var _sliceDayIntoFiveMinu = sliceDayIntoFiveMinutes(ctx === null || ctx === void 0 || (_ctx$bookingConfig2 = ctx.bookingConfig) === null || _ctx$bookingConfig2 === void 0 || (_ctx$bookingConfig2 = _ctx$bookingConfig2.config) === null || _ctx$bookingConfig2 === void 0 || (_ctx$bookingConfig2 = _ctx$bookingConfig2.basic) === null || _ctx$bookingConfig2 === void 0 ? void 0 : _ctx$bookingConfig2.service_time, isMultiDay),
81
+ timeSlices = _sliceDayIntoFiveMinu.timeSlices,
82
+ durationSlicesBasedOnTime = _sliceDayIntoFiveMinu.durationSlicesBasedOnTime;
87
83
  if (flexibleOption) {
88
84
  durationSlicesBasedOnTime.unshift(flexibleOption);
89
85
  }
@@ -1,5 +1,19 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ 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); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
1
7
  import dayjs from 'dayjs';
2
8
  import { getDurationValue } from "./flexible";
9
+ var timeSlicesCache = new Map();
10
+ function copyTimeSlices(result) {
11
+ return {
12
+ timeSlices: _toConsumableArray(result.timeSlices),
13
+ durationSlicesBasedOnTime: _toConsumableArray(result.durationSlicesBasedOnTime)
14
+ };
15
+ }
16
+
3
17
  /**
4
18
  * 把一天切成等长时间槽,输出 timeSlices(开始时间标签)与 durationSlicesBasedOnTime(基于切片的时长选项)。
5
19
  *
@@ -10,9 +24,12 @@ import { getDurationValue } from "./flexible";
10
24
  * @param isDay 是否跨日预约(true 时按 1~30 天切片)
11
25
  */
12
26
  export function sliceDayIntoFiveMinutes(config, isDay) {
27
+ var timeSlice = config && config.value || 5;
28
+ var cacheKey = isDay ? 'days' : "minutes:".concat(timeSlice);
29
+ var cached = timeSlicesCache.get(cacheKey);
30
+ if (cached) return copyTimeSlices(cached);
13
31
  var startTime = dayjs().startOf('day');
14
32
  var endTime = dayjs().endOf('day');
15
- var timeSlice = config && config.value || 5;
16
33
  var timeSlices = [];
17
34
  var durationSlicesBasedOnTime = [];
18
35
  var currentTime = startTime;
@@ -29,10 +46,12 @@ export function sliceDayIntoFiveMinutes(config, isDay) {
29
46
  });
30
47
  currentDay += 1;
31
48
  }
32
- return {
49
+ var _result = {
33
50
  timeSlices: timeSlices,
34
51
  durationSlicesBasedOnTime: durationSlicesBasedOnTime
35
52
  };
53
+ timeSlicesCache.set(cacheKey, _result);
54
+ return copyTimeSlices(_result);
36
55
  }
37
56
  while (currentTime.isBefore(endTime)) {
38
57
  timeSlices.push({
@@ -47,10 +66,12 @@ export function sliceDayIntoFiveMinutes(config, isDay) {
47
66
  });
48
67
  currentTime = nextTime;
49
68
  }
50
- return {
69
+ var result = {
51
70
  timeSlices: timeSlices,
52
71
  durationSlicesBasedOnTime: durationSlicesBasedOnTime
53
72
  };
73
+ timeSlicesCache.set(cacheKey, result);
74
+ return copyTimeSlices(result);
54
75
  }
55
76
 
56
77
  /**
@@ -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 _callee5() {
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
- _args5 = arguments;
346
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
347
- while (1) switch (_context5.prev = _context5.next) {
377
+ _args6 = arguments;
378
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
379
+ while (1) switch (_context6.prev = _context6.next) {
348
380
  case 0:
349
- params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
350
- _context5.prev = 1;
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
- _context5.next = 6;
385
+ _context6.next = 6;
354
386
  return this.fetchCustomerListData(params);
355
387
  case 6:
356
- _yield$this$fetchCust2 = _context5.sent;
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 _context5.abrupt("return", response);
421
+ return _context6.abrupt("return", response);
390
422
  case 23:
391
- _context5.prev = 23;
392
- _context5.t0 = _context5["catch"](1);
393
- _context5.next = 27;
394
- return this.handleCustomerListError(_context5.t0, 'fetch customer list');
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 _context5.t0;
428
+ throw _context6.t0;
397
429
  case 28:
398
- _context5.prev = 28;
430
+ _context6.prev = 28;
399
431
  this.store.loading = false;
400
432
  this.storeChange();
401
- _context5.next = 33;
433
+ _context6.next = 33;
402
434
  return this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
403
435
  case 33:
404
- return _context5.finish(28);
436
+ return _context6.finish(28);
405
437
  case 34:
406
438
  case "end":
407
- return _context5.stop();
439
+ return _context6.stop();
408
440
  }
409
- }, _callee5, this, [[1, 23, 28, 34]]);
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 _callee6(page, pageSize) {
618
+ var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(page, pageSize) {
587
619
  var targetPageSize, skip, num;
588
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
589
- while (1) switch (_context6.prev = _context6.next) {
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
- _context6.next = 6;
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 _context6.abrupt("return", _context6.sent);
635
+ return _context7.abrupt("return", _context7.sent);
604
636
  case 7:
605
637
  case "end":
606
- return _context6.stop();
638
+ return _context7.stop();
607
639
  }
608
- }, _callee6, this);
640
+ }, _callee7, this);
609
641
  }));
610
- function changeCustomerPage(_x5, _x6) {
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 _callee7() {
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 _callee7$(_context7) {
626
- while (1) switch (_context7.prev = _context7.next) {
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
- _context7.next = 2;
661
+ _context8.next = 2;
630
662
  break;
631
663
  }
632
- return _context7.abrupt("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
- _context7.prev = 3;
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
- _context7.next = 9;
680
+ _context8.next = 9;
649
681
  return this.fetchCustomerListData(loadMoreParams);
650
682
  case 9:
651
- _yield$this$fetchCust3 = _context7.sent;
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
- _context7.next = 21;
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 _context7.abrupt("return", response);
718
+ return _context8.abrupt("return", response);
687
719
  case 26:
688
- _context7.prev = 26;
689
- _context7.t0 = _context7["catch"](3);
690
- _context7.next = 30;
691
- return this.handleCustomerListError(_context7.t0, 'load more customers');
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 _context7.t0;
725
+ throw _context8.t0;
694
726
  case 31:
695
- _context7.prev = 31;
727
+ _context8.prev = 31;
696
728
  this.store.loadingMore = false;
697
729
  this.storeChange();
698
- _context7.next = 36;
730
+ _context8.next = 36;
699
731
  return this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
700
732
  case 36:
701
- return _context7.finish(31);
733
+ return _context8.finish(31);
702
734
  case 37:
703
735
  case "end":
704
- return _context7.stop();
736
+ return _context8.stop();
705
737
  }
706
- }, _callee7, this, [[3, 26, 31, 37]]);
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 _callee8() {
754
+ var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
723
755
  var params,
724
756
  resetParams,
725
757
  response,
726
- _args8 = arguments;
727
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
728
- while (1) switch (_context8.prev = _context8.next) {
758
+ _args9 = arguments;
759
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
760
+ while (1) switch (_context9.prev = _context9.next) {
729
761
  case 0:
730
- params = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
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
- _context8.next = 8;
774
+ _context9.next = 8;
743
775
  return this.getCustomerList(resetParams);
744
776
  case 8:
745
- response = _context8.sent;
746
- _context8.next = 11;
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 _context8.abrupt("return", response);
785
+ return _context9.abrupt("return", response);
754
786
  case 12:
755
787
  case "end":
756
- return _context8.stop();
788
+ return _context9.stop();
757
789
  }
758
- }, _callee8, this);
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
  /** 设置当前选择的客户 */
@@ -32,6 +32,7 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
32
32
  customerId?: number;
33
33
  orderId?: number;
34
34
  }): Promise<DiscountWithReason>;
35
+ batchSearchByProductIds(productIds: number[]): Promise<any>;
35
36
  filterEnabledDiscountList(discountList: Discount[]): Discount[];
36
37
  private checkUsageCreditsLimit;
37
38
  filterEnabledDiscountListWithReason(discountList: Discount[]): DiscountWithReason;