@pisell/pisellos 0.0.155 → 0.0.156

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.
@@ -107,6 +107,18 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
107
107
  };
108
108
  }
109
109
 
110
+ // 编辑商品已有商品券
111
+ if (productList.every(function (item) {
112
+ var _item$discount_list;
113
+ return item.booking_id && ((_item$discount_list = item.discount_list) === null || _item$discount_list === void 0 ? void 0 : _item$discount_list.length);
114
+ })) {
115
+ return {
116
+ isAvailable: false,
117
+ discountList: oldDiscountList,
118
+ productList: productList
119
+ };
120
+ }
121
+
110
122
  // 合并新旧折扣列表,并计算折扣结果
111
123
  var mergedDiscountList = uniqueById(uniqueById([].concat(_toConsumableArray(oldDiscountList), _toConsumableArray(newDiscountList))), 'product_id');
112
124
  var result = this.calcDiscount({
@@ -69,6 +69,16 @@ var RulesModule = class extends import_BaseModule.BaseModule {
69
69
  productList
70
70
  };
71
71
  }
72
+ if (productList.every((item) => {
73
+ var _a;
74
+ return item.booking_id && ((_a = item.discount_list) == null ? void 0 : _a.length);
75
+ })) {
76
+ return {
77
+ isAvailable: false,
78
+ discountList: oldDiscountList,
79
+ productList
80
+ };
81
+ }
72
82
  const mergedDiscountList = (0, import_utils.uniqueById)((0, import_utils.uniqueById)([
73
83
  ...oldDiscountList,
74
84
  ...newDiscountList
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.155",
4
+ "version": "0.0.156",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",