@pisell/pisellos 0.0.166 → 0.0.168

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.
@@ -316,7 +316,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
316
316
 
317
317
  // 然后再处理应用哪些优惠券,此时只考虑filteredDiscountList中的优惠券
318
318
  sortedProductList.forEach(function (originProduct, i) {
319
- var _product$discount_lis3, _product$discount_lis4, _product$discount_lis5, _product$discount_lis6, _product$discount_lis7;
319
+ var _product$discount_lis3, _product$discount_lis4, _product$discount_lis5, _product$discount_lis6, _product$discount_lis7, _product$discount_lis8;
320
320
  var product = _this3.hooks.getProduct(originProduct);
321
321
  if (product !== null && product !== void 0 && product.booking_id && (_product$discount_lis3 = product.discount_list) !== null && _product$discount_lis3 !== void 0 && _product$discount_lis3.length && product !== null && product !== void 0 && (_product$discount_lis4 = product.discount_list) !== null && _product$discount_lis4 !== void 0 && _product$discount_lis4.every(function (discount) {
322
322
  return discount.id && ['good_pass', 'discount_card', 'product_discount_card'].includes(discount.tag || discount.type);
@@ -352,7 +352,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
352
352
  })));
353
353
 
354
354
  // 勾选时覆盖手动折扣
355
- if (options !== null && options !== void 0 && options.discountId && product.discount_list.some(function (item) {
355
+ if (options !== null && options !== void 0 && options.discountId && (_product$discount_lis8 = product.discount_list) !== null && _product$discount_lis8 !== void 0 && _product$discount_lis8.some(function (item) {
356
356
  var _item$discount;
357
357
  return ((_item$discount = item.discount) === null || _item$discount === void 0 ? void 0 : _item$discount.resource_id) === options.discountId;
358
358
  })) {
@@ -452,6 +452,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
452
452
  bundle: product.bundle,
453
453
  options: product.options
454
454
  }),
455
+ variant: originProduct._productInit.variant,
455
456
  original_price: new Decimal(product.price || 0).toNumber(),
456
457
  total: targetProductTotal
457
458
  }));
@@ -206,7 +206,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
206
206
  });
207
207
  console.log(sortedProductList, "sortedProductListsortedProductList");
208
208
  sortedProductList.forEach((originProduct, i) => {
209
- var _a, _b, _c, _d, _e;
209
+ var _a, _b, _c, _d, _e, _f;
210
210
  const product = this.hooks.getProduct(originProduct);
211
211
  if ((product == null ? void 0 : product.booking_id) && ((_a = product.discount_list) == null ? void 0 : _a.length) && ((_b = product == null ? void 0 : product.discount_list) == null ? void 0 : _b.every((discount) => discount.id && ["good_pass", "discount_card", "product_discount_card"].includes(discount.tag || discount.type)))) {
212
212
  processedProductsMap.set(product._id, [originProduct]);
@@ -228,10 +228,10 @@ var RulesModule = class extends import_BaseModule.BaseModule {
228
228
  });
229
229
  const selectedDiscount = applicableDiscounts[0];
230
230
  let isManualDiscount = typeof product.isManualDiscount === "boolean" ? product.isManualDiscount : product.total != product.origin_total && (!((_c = product.discount_list) == null ? void 0 : _c.length) || ((_e = (_d = product == null ? void 0 : product.discount_list) == null ? void 0 : _d.every) == null ? void 0 : _e.call(_d, (item) => item.type === "product")));
231
- if ((options == null ? void 0 : options.discountId) && product.discount_list.some((item) => {
231
+ if ((options == null ? void 0 : options.discountId) && ((_f = product.discount_list) == null ? void 0 : _f.some((item) => {
232
232
  var _a2;
233
233
  return ((_a2 = item.discount) == null ? void 0 : _a2.resource_id) === options.discountId;
234
- })) {
234
+ }))) {
235
235
  isManualDiscount = false;
236
236
  }
237
237
  if (applicableDiscounts.length === 0 || isManualDiscount) {
@@ -320,6 +320,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
320
320
  bundle: product.bundle,
321
321
  options: product.options
322
322
  }),
323
+ variant: originProduct._productInit.variant,
323
324
  original_price: new import_decimal.default(product.price || 0).toNumber(),
324
325
  total: targetProductTotal
325
326
  }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.166",
4
+ "version": "0.0.168",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",