@pisell/pisellos 0.0.296 → 0.0.297

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.
@@ -483,9 +483,13 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
483
483
  hasDeposit: false
484
484
  };
485
485
  bookings === null || bookings === void 0 || bookings.forEach(function (item) {
486
+ var total = item.product.calculated_selling_price;
487
+ item.product.discount_list.forEach(function (discount) {
488
+ summaryDeposit.total = new Decimal(summaryDeposit.total).minus(discount.amount || 0).toNumber();
489
+ });
486
490
  var deposit = getProductDeposit({
487
491
  cartItem: {
488
- total: item.product.price * (item.product.num || 1)
492
+ total: total
489
493
  },
490
494
  product: item.product,
491
495
  bundle: item.bundle,
@@ -494,11 +498,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
494
498
  });
495
499
  item.deposit = deposit;
496
500
  if (deposit !== null && deposit !== void 0 && deposit.total && Number(deposit.total) > 0) {
497
- // 需要减去商品券折扣卡抵扣的金额
498
- summaryDeposit.total = new Decimal(summaryDeposit.total).plus(deposit.total).toNumber();
499
- item.product.discount_list.forEach(function (discount) {
500
- summaryDeposit.total = new Decimal(summaryDeposit.total).minus(discount.amount || 0).toNumber();
501
- });
502
501
  summaryDeposit.protocols = summaryDeposit.protocols.concat(deposit.protocols);
503
502
  summaryDeposit.hasDeposit = true;
504
503
  }
@@ -280,9 +280,13 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
280
280
  hasDeposit: false
281
281
  };
282
282
  bookings == null ? void 0 : bookings.forEach((item) => {
283
+ const total = item.product.calculated_selling_price;
284
+ item.product.discount_list.forEach((discount) => {
285
+ summaryDeposit.total = new import_decimal.default(summaryDeposit.total).minus(discount.amount || 0).toNumber();
286
+ });
283
287
  const deposit = (0, import_utils2.getProductDeposit)({
284
288
  cartItem: {
285
- total: item.product.price * (item.product.num || 1)
289
+ total
286
290
  },
287
291
  product: item.product,
288
292
  bundle: item.bundle,
@@ -291,10 +295,6 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
291
295
  });
292
296
  item.deposit = deposit;
293
297
  if ((deposit == null ? void 0 : deposit.total) && Number(deposit.total) > 0) {
294
- summaryDeposit.total = new import_decimal.default(summaryDeposit.total).plus(deposit.total).toNumber();
295
- item.product.discount_list.forEach((discount) => {
296
- summaryDeposit.total = new import_decimal.default(summaryDeposit.total).minus(discount.amount || 0).toNumber();
297
- });
298
298
  summaryDeposit.protocols = summaryDeposit.protocols.concat(
299
299
  deposit.protocols
300
300
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.296",
4
+ "version": "0.0.297",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",