@pisell/pisellos 2.1.50 → 2.1.52

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.
@@ -652,6 +652,7 @@ export interface WalletInitBusinessData {
652
652
  order_wait_pay_amount?: number;
653
653
  /** 订单ID */
654
654
  payment_order_id?: string;
655
+ is_price_include_tax: number;
655
656
  }
656
657
  /**
657
658
  * 查询用户识别码列表请求参数
@@ -63,12 +63,14 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
63
63
  amountInfo = businessData.amountInfo,
64
64
  products = businessData.products,
65
65
  order_wait_pay_amount = businessData.order_wait_pay_amount,
66
- payment_order_id = businessData.payment_order_id;
66
+ payment_order_id = businessData.payment_order_id,
67
+ is_price_include_tax = businessData.is_price_include_tax;
67
68
 
68
69
  // 转换金额为数字类型
69
70
  var totalAmount = Number(amountInfo.totalAmount);
70
71
  var subTotal = Number(amountInfo.subTotal);
71
72
  var walletParams = {
73
+ is_price_include_tax: is_price_include_tax,
72
74
  sale_channel: 'pos',
73
75
  customer_id: customer_id || 0,
74
76
  // 提供默认值,确保类型为 number
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -660,7 +660,10 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
660
660
  discount_list: []
661
661
  }))]);
662
662
  } else {
663
- processedProductsMap.set(product._id, [_this3.hooks.setProduct(originProduct, _objectSpread(_objectSpread({}, isManualDiscount ? {} : {
663
+ processedProductsMap.set(product._id, [_this3.hooks.setProduct(originProduct, _objectSpread(_objectSpread({}, isManualDiscount ? {
664
+ price: product.price,
665
+ main_product_selling_price: product.price
666
+ } : {
664
667
  _id: product._id.split('___')[0] + '___' + index,
665
668
  total: product.origin_total || product.total,
666
669
  price: product.price,
@@ -673,7 +676,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
673
676
  // bundle子商品:保存到扁平化Map
674
677
  processedFlatItemsMap.set(flatItem._id, [_objectSpread(_objectSpread({}, flatItem), {}, {
675
678
  discount_list: [],
676
- price: flatItem.bundleItem.original_price,
679
+ price: isManualDiscount ? flatItem.bundleItem.price : flatItem.bundleItem.original_price,
677
680
  processed: true
678
681
  })]);
679
682
  }
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
342
342
  };
343
343
  setOtherData(key: string, value: any): void;
344
344
  getOtherData(key: string): any;
345
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
345
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
346
346
  /**
347
347
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
348
348
  *
@@ -417,6 +417,14 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
417
417
  main_product_original_price: item.price,
418
418
  // 主商品折扣后金额,不包含套餐子商品
419
419
  main_product_selling_price: item.main_product_selling_price,
420
+ metadata: {
421
+ // 主商品+非原价(加减价)子商品税费
422
+ "main_product_attached_bundle_tax_fee": item.metadata.main_product_attached_bundle_tax_fee,
423
+ // 主商品+非原价(加减价)子商品附加费
424
+ "main_product_attached_bundle_surcharge_fee": item.metadata.main_product_attached_bundle_surcharge_fee,
425
+ // 可选,附加费均摊舍入金额
426
+ "surcharge_rounding_remainder": item.metadata.surcharge_rounding_remainder
427
+ },
420
428
  product_bundle: item.product_bundle.map(function (bundle) {
421
429
  return {
422
430
  bundle_id: bundle.bundle_id,
@@ -428,7 +436,15 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
428
436
  bundle_sum_price: bundle.bundle_sum_price,
429
437
  // 套餐子商品折扣后金额
430
438
  bundle_selling_price: bundle.bundle_selling_price,
431
- num: bundle.num
439
+ num: bundle.num,
440
+ is_charge_tax: bundle.is_charge_tax,
441
+ tax_fee: bundle.tax_fee,
442
+ metadata: {
443
+ // 子商品单数量附加费
444
+ "surcharge_fee": bundle.metadata.surcharge_fee,
445
+ // 可选,附加费均摊舍入金额
446
+ "surcharge_rounding_remainder": bundle.metadata.surcharge_rounding_remainder
447
+ }
432
448
  };
433
449
  })
434
450
  };
@@ -473,7 +489,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
473
489
  depositAmount: (_this$store$currentOr4 = this.store.currentOrder) === null || _this$store$currentOr4 === void 0 ? void 0 : _this$store$currentOr4.deposit_amount,
474
490
  isDeposit: (_this$store$currentOr5 = this.store.currentOrder) === null || _this$store$currentOr5 === void 0 ? void 0 : _this$store$currentOr5.is_deposit
475
491
  },
476
- products: this.getProductListByOrder()
492
+ products: this.getProductListByOrder(),
493
+ is_price_include_tax: this.otherParams.is_price_include_tax
477
494
  }, params); // 判断订单是否已经同步,如果是则追加payment_order_id参数
478
495
  if (this.store.isOrderSynced) {
479
496
  walletBusinessData.payment_order_id = (_this$store$currentOr6 = this.store.currentOrder) === null || _this$store$currentOr6 === void 0 ? void 0 : _this$store$currentOr6.order_id;
@@ -652,6 +652,7 @@ export interface WalletInitBusinessData {
652
652
  order_wait_pay_amount?: number;
653
653
  /** 订单ID */
654
654
  payment_order_id?: string;
655
+ is_price_include_tax: number;
655
656
  }
656
657
  /**
657
658
  * 查询用户识别码列表请求参数
@@ -51,10 +51,18 @@ var WalletPassPaymentImpl = class {
51
51
  */
52
52
  generateWalletParams(businessData) {
53
53
  var _a;
54
- const { customer_id, amountInfo, products, order_wait_pay_amount, payment_order_id } = businessData;
54
+ const {
55
+ customer_id,
56
+ amountInfo,
57
+ products,
58
+ order_wait_pay_amount,
59
+ payment_order_id,
60
+ is_price_include_tax
61
+ } = businessData;
55
62
  const totalAmount = Number(amountInfo.totalAmount);
56
63
  const subTotal = Number(amountInfo.subTotal);
57
64
  const walletParams = {
65
+ is_price_include_tax,
58
66
  sale_channel: "pos",
59
67
  customer_id: customer_id || 0,
60
68
  // 提供默认值,确保类型为 number
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -467,7 +467,10 @@ var RulesModule = class extends import_BaseModule.BaseModule {
467
467
  processedProductsMap.set(
468
468
  product._id,
469
469
  [this.hooks.setProduct(originProduct, {
470
- ...isManualDiscount ? {} : {
470
+ ...isManualDiscount ? {
471
+ price: product.price,
472
+ main_product_selling_price: product.price
473
+ } : {
471
474
  _id: product._id.split("___")[0] + "___" + index,
472
475
  total: product.origin_total || product.total,
473
476
  price: product.price,
@@ -481,7 +484,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
481
484
  processedFlatItemsMap.set(flatItem._id, [{
482
485
  ...flatItem,
483
486
  discount_list: [],
484
- price: flatItem.bundleItem.original_price,
487
+ price: isManualDiscount ? flatItem.bundleItem.price : flatItem.bundleItem.original_price,
485
488
  processed: true
486
489
  }]);
487
490
  }
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
342
342
  };
343
343
  setOtherData(key: string, value: any): void;
344
344
  getOtherData(key: string): any;
345
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
345
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
346
346
  /**
347
347
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
348
348
  *
@@ -236,6 +236,14 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
236
236
  main_product_original_price: item.price,
237
237
  // 主商品折扣后金额,不包含套餐子商品
238
238
  main_product_selling_price: item.main_product_selling_price,
239
+ metadata: {
240
+ // 主商品+非原价(加减价)子商品税费
241
+ "main_product_attached_bundle_tax_fee": item.metadata.main_product_attached_bundle_tax_fee,
242
+ // 主商品+非原价(加减价)子商品附加费
243
+ "main_product_attached_bundle_surcharge_fee": item.metadata.main_product_attached_bundle_surcharge_fee,
244
+ // 可选,附加费均摊舍入金额
245
+ "surcharge_rounding_remainder": item.metadata.surcharge_rounding_remainder
246
+ },
239
247
  product_bundle: item.product_bundle.map((bundle) => {
240
248
  return {
241
249
  bundle_id: bundle.bundle_id,
@@ -247,7 +255,15 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
247
255
  bundle_sum_price: bundle.bundle_sum_price,
248
256
  // 套餐子商品折扣后金额
249
257
  bundle_selling_price: bundle.bundle_selling_price,
250
- num: bundle.num
258
+ num: bundle.num,
259
+ is_charge_tax: bundle.is_charge_tax,
260
+ tax_fee: bundle.tax_fee,
261
+ metadata: {
262
+ // 子商品单数量附加费
263
+ "surcharge_fee": bundle.metadata.surcharge_fee,
264
+ // 可选,附加费均摊舍入金额
265
+ "surcharge_rounding_remainder": bundle.metadata.surcharge_rounding_remainder
266
+ }
251
267
  };
252
268
  })
253
269
  })
@@ -287,6 +303,8 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
287
303
  isDeposit: (_e = this.store.currentOrder) == null ? void 0 : _e.is_deposit
288
304
  },
289
305
  products: this.getProductListByOrder(),
306
+ is_price_include_tax: this.otherParams.is_price_include_tax,
307
+ // core 有
290
308
  ...params
291
309
  };
292
310
  if (this.store.isOrderSynced) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.1.50",
4
+ "version": "2.1.52",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",