@pisell/pisellos 0.0.174 → 0.0.175

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.
@@ -328,7 +328,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
328
328
  // 找到适用于此商品的所有优惠券,仅考虑isSelected不为false的优惠券
329
329
  var applicableDiscounts = sortedDiscountList.filter(function (discount) {
330
330
  // 如果商品价格为 0,其实不需要使用任何优惠券,直接 return true
331
- if (Number(product.price) === 0 || !product.price) return false;
331
+ if (Number(product.price) === 0 && discount.tag === 'good_pass' || Number(product.total) === 0 && discount.tag !== 'good_pass' || !product.price) return false;
332
332
  // 如果优惠券已被使用,则跳过
333
333
  var targetUsedDiscounts = usedDiscounts.get(discount.id);
334
334
  if (targetUsedDiscounts && (discount.tag || discount.type) === 'good_pass') return false;
@@ -213,7 +213,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
213
213
  return;
214
214
  }
215
215
  const applicableDiscounts = sortedDiscountList.filter((discount) => {
216
- if (Number(product.price) === 0 || !product.price)
216
+ if (Number(product.price) === 0 && discount.tag === "good_pass" || Number(product.total) === 0 && discount.tag !== "good_pass" || !product.price)
217
217
  return false;
218
218
  const targetUsedDiscounts = usedDiscounts.get(discount.id);
219
219
  if (targetUsedDiscounts && (discount.tag || discount.type) === "good_pass")
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.174",
4
+ "version": "0.0.175",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",