@pisell/pisellos 0.0.511 → 0.0.513

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 (33) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  2. package/dist/modules/Order/index.d.ts +1 -1
  3. package/dist/modules/Order/index.js +79 -58
  4. package/dist/modules/Order/types.d.ts +11 -0
  5. package/dist/modules/Order/utils.d.ts +63 -11
  6. package/dist/modules/Order/utils.js +242 -43
  7. package/dist/modules/SalesSummary/utils.js +36 -69
  8. package/dist/modules/Summary/utils.js +6 -21
  9. package/dist/solution/BookingByStep/index.d.ts +1 -1
  10. package/dist/solution/BookingTicket/index.d.ts +1 -1
  11. package/dist/solution/ScanOrder/index.d.ts +3 -0
  12. package/dist/solution/ScanOrder/index.js +558 -498
  13. package/dist/solution/ScanOrder/types.d.ts +29 -2
  14. package/dist/solution/ScanOrder/utils.d.ts +18 -2
  15. package/dist/solution/ScanOrder/utils.js +111 -29
  16. package/dist/solution/VenueBooking/index.js +35 -27
  17. package/lib/model/strategy/adapter/promotion/index.js +0 -49
  18. package/lib/modules/Order/index.d.ts +1 -1
  19. package/lib/modules/Order/index.js +20 -7
  20. package/lib/modules/Order/types.d.ts +11 -0
  21. package/lib/modules/Order/utils.d.ts +63 -11
  22. package/lib/modules/Order/utils.js +149 -17
  23. package/lib/modules/SalesSummary/utils.js +16 -48
  24. package/lib/modules/Summary/utils.js +4 -18
  25. package/lib/solution/BookingByStep/index.d.ts +1 -1
  26. package/lib/solution/BookingTicket/index.d.ts +1 -1
  27. package/lib/solution/ScanOrder/index.d.ts +3 -0
  28. package/lib/solution/ScanOrder/index.js +30 -4
  29. package/lib/solution/ScanOrder/types.d.ts +29 -2
  30. package/lib/solution/ScanOrder/utils.d.ts +18 -2
  31. package/lib/solution/ScanOrder/utils.js +66 -15
  32. package/lib/solution/VenueBooking/index.js +13 -6
  33. package/package.json +1 -1
@@ -706,31 +706,16 @@ var getBundleItemIsDiscountPrice = function getBundleItemIsDiscountPrice(item) {
706
706
  var getBundleItemIsMarkupOrDiscountPrice = function getBundleItemIsMarkupOrDiscountPrice(item) {
707
707
  return getBundleItemIsMarkupPrice(item) || getBundleItemIsDiscountPrice(item);
708
708
  };
709
- var getDiscountAmount = function getDiscountAmount(discounts) {
710
- return (discounts || []).reduce(function (total, discount) {
711
- return total.add(new Decimal(discount.amount || 0));
712
- }, new Decimal(0)).toNumber();
713
- };
714
709
 
715
710
  /**
716
711
  * 获取主商品加价减价后的总价 (主商品价格 + 子商品加价减价)
717
712
  */
718
713
  var getMainProductTotal = function getMainProductTotal(item) {
719
- var _ref8, _ref9, _item$main_product_se, _item$metadata, _item$_origin3, _item$_originData;
720
- var total = new Decimal((_ref8 = (_ref9 = (_item$main_product_se = item === null || item === void 0 ? void 0 : item.main_product_selling_price) !== null && _item$main_product_se !== void 0 ? _item$main_product_se : item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.main_product_selling_price) !== null && _ref9 !== void 0 ? _ref9 : item.price) !== null && _ref8 !== void 0 ? _ref8 : 0);
721
- var discount = (item === null || item === void 0 || (_item$_origin3 = item._origin) === null || _item$_origin3 === void 0 || (_item$_origin3 = _item$_origin3.product) === null || _item$_origin3 === void 0 ? void 0 : _item$_origin3.discount_list) || (item === null || item === void 0 || (_item$_originData = item._originData) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.product) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.discount_list) === null || _item$_originData === void 0 ? void 0 : _item$_originData.filter(function (item) {
722
- var _item$metadata2;
723
- return !(item !== null && item !== void 0 && (_item$metadata2 = item.metadata) !== null && _item$metadata2 !== void 0 && _item$metadata2.custom_product_bundle_map_id);
724
- })) || [];
725
- var mainProductDiscountAmount = getDiscountAmount(discount);
726
- total = total.minus(mainProductDiscountAmount);
727
-
728
- // 单规格
729
- if (item !== null && item !== void 0 && item.option && Array.isArray(item === null || item === void 0 ? void 0 : item.option)) {
730
- total = total.add(item === null || item === void 0 ? void 0 : item.option.reduce(function (t, option) {
731
- return t.add(new Decimal(option.price || 0).mul(option.num || 1));
732
- }, new Decimal(0)));
733
- }
714
+ var _ref8, _ref9, _item$main_product_se, _item$metadata, _item$metadata2;
715
+ // 新语义 v2 `main_product_selling_price` / `metadata.main_product_selling_price`
716
+ // 已经是"含 option、含主商品折扣"的主价,直接作为主商品基准,无需再减折扣或加 option。
717
+ // 仅需叠加 markup / markdown 类 bundle(原价 bundle 的税费单独处理)。
718
+ var total = new Decimal((_ref8 = (_ref9 = (_item$main_product_se = item === null || item === void 0 ? void 0 : item.main_product_selling_price) !== null && _item$main_product_se !== void 0 ? _item$main_product_se : item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.main_product_selling_price) !== null && _ref9 !== void 0 ? _ref9 : item === null || item === void 0 || (_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.main_product_original_price) !== null && _ref8 !== void 0 ? _ref8 : 0);
734
719
  var _iterator4 = _createForOfIteratorHelper((item === null || item === void 0 ? void 0 : item.bundle) || []),
735
720
  _step4;
736
721
  try {
@@ -738,7 +723,7 @@ var getMainProductTotal = function getMainProductTotal(item) {
738
723
  var bundleItem = _step4.value;
739
724
  if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
740
725
  var _ref10, _bundleItem$bundle_se2;
741
- // IMPORTANT: 套餐子商品如果应用了 discount,bundle_selling_price和 price 其实都已经是折后价格了,不需要单独再减一次
726
+ // IMPORTANT: 套餐子商品如果应用了 discount,bundle_selling_price 和 price 其实都已经是折后价格了,不需要单独再减一次
742
727
  var bundleItemTotal = new Decimal((_ref10 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref10 !== void 0 ? _ref10 : 0);
743
728
  total = total.add(bundleItemTotal);
744
729
  }
@@ -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 | 2 | 3 | 4 | 5 | 6;
314
+ weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -131,7 +131,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
131
131
  * 获取当前的客户搜索条件
132
132
  * @returns 当前搜索条件
133
133
  */
134
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
134
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
135
135
  /**
136
136
  * 获取客户列表状态(包含滚动加载相关状态)
137
137
  * @returns 客户状态
@@ -49,6 +49,9 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
49
49
  private registerCustomerLoginListeners;
50
50
  private refreshOrderMarketingAfterLogin;
51
51
  constructor(name?: string, version?: string);
52
+ /** 与 `otherParams.cacheId` 一致,供宿主在 URL 变化时判断是否需要重新注册模块 */
53
+ getCacheId(): string | undefined;
54
+ private destroyRegisteredChildModules;
52
55
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
53
56
  destroy(): Promise<void>;
54
57
  retryInit(): Promise<void>;