@pisell/pisellos 2.1.49 → 2.1.51

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(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -142,10 +142,15 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
142
142
  // 遍历处理后的产品列表,检查是否有产品使用了新折扣
143
143
  result.productList.forEach(function (product) {
144
144
  var _this2$hooks$getProdu = _this2.hooks.getProduct(product),
145
- discount_list = _this2$hooks$getProdu.discount_list;
146
- if (discount_list && discount_list.length > 0) {
145
+ discount_list = _this2$hooks$getProdu.discount_list,
146
+ bundle = _this2$hooks$getProdu.bundle;
147
+ var allDiscountList = _toConsumableArray(discount_list || []);
148
+ (bundle || []).forEach(function (item) {
149
+ allDiscountList.push.apply(allDiscountList, _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []));
150
+ });
151
+ if (allDiscountList && allDiscountList.length > 0) {
147
152
  // 检查是否有使用新折扣的情况
148
- var usedNewDiscount = discount_list.some(function (discount) {
153
+ var usedNewDiscount = allDiscountList.some(function (discount) {
149
154
  var _discount$discount;
150
155
  return newDiscountIds.includes(discount === null || discount === void 0 || (_discount$discount = discount.discount) === null || _discount$discount === void 0 ? void 0 : _discount$discount.resource_id);
151
156
  });
@@ -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<"normal" | "duration" | "session">;
345
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
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(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -95,9 +95,13 @@ var RulesModule = class extends import_BaseModule.BaseModule {
95
95
  let hasApplicableDiscount = false;
96
96
  const newDiscountIds = newDiscountList.map((discount) => discount.id);
97
97
  result.productList.forEach((product) => {
98
- const { discount_list } = this.hooks.getProduct(product);
99
- if (discount_list && discount_list.length > 0) {
100
- const usedNewDiscount = discount_list.some(
98
+ const { discount_list, bundle } = this.hooks.getProduct(product);
99
+ const allDiscountList = [...discount_list || []];
100
+ (bundle || []).forEach((item) => {
101
+ allDiscountList.push(...(item == null ? void 0 : item.discount_list) || []);
102
+ });
103
+ if (allDiscountList && allDiscountList.length > 0) {
104
+ const usedNewDiscount = allDiscountList.some(
101
105
  (discount) => {
102
106
  var _a;
103
107
  return newDiscountIds.includes((_a = discount == null ? void 0 : discount.discount) == null ? void 0 : _a.resource_id);
@@ -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<"normal" | "duration" | "session">;
345
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
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.49",
4
+ "version": "2.1.51",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",