@pisell/pisellos 0.0.143 → 0.0.144

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.
@@ -350,7 +350,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
350
350
 
351
351
  // 记录实际应用了优惠券的商品信息
352
352
  var appliedProducts = appliedDiscountProducts.get(selectedDiscount.id) || [];
353
- var targetProductPrice = selectedDiscount.tag === 'good_pass' ? '0' : new Decimal(selectedDiscount.par_value || 0).div(100).mul(new Decimal(product.price || 0)).toFixed(2);
353
+ var targetProductPrice = selectedDiscount.tag === 'good_pass' ? '0' : new Decimal(100).minus(selectedDiscount.par_value || 0).div(100).mul(new Decimal(product.price || 0)).toFixed(2);
354
354
  var discountDetail = {
355
355
  amount: selectedDiscount.tag === 'product_discount_card' ? new Decimal(product.price || 0).minus(new Decimal(targetProductPrice)).toNumber() : product.price,
356
356
  type: selectedDiscount.tag === 'product_discount_card' ? 'discount_card' : selectedDiscount.tag,
@@ -251,7 +251,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
251
251
  }
252
252
  usedDiscounts.set(selectedDiscount.id, true);
253
253
  const appliedProducts = appliedDiscountProducts.get(selectedDiscount.id) || [];
254
- const targetProductPrice = selectedDiscount.tag === "good_pass" ? "0" : new import_decimal.default(selectedDiscount.par_value || 0).div(100).mul(new import_decimal.default(product.price || 0)).toFixed(2);
254
+ const targetProductPrice = selectedDiscount.tag === "good_pass" ? "0" : new import_decimal.default(100).minus(selectedDiscount.par_value || 0).div(100).mul(new import_decimal.default(product.price || 0)).toFixed(2);
255
255
  const discountDetail = {
256
256
  amount: selectedDiscount.tag === "product_discount_card" ? new import_decimal.default(product.price || 0).minus(new import_decimal.default(targetProductPrice)).toNumber() : product.price,
257
257
  type: selectedDiscount.tag === "product_discount_card" ? "discount_card" : selectedDiscount.tag,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.143",
4
+ "version": "0.0.144",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",