@pisell/pisellos 0.0.358 → 0.0.359

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.
@@ -1315,31 +1315,14 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1315
1315
  // 套餐中购买时,判断是否为原价
1316
1316
  var priceType = (_flatItem$bundleItem5 = flatItem.bundleItem) === null || _flatItem$bundleItem5 === void 0 ? void 0 : _flatItem$bundleItem5.price_type;
1317
1317
  var priceTypeExt = (_flatItem$bundleItem6 = flatItem.bundleItem) === null || _flatItem$bundleItem6 === void 0 ? void 0 : _flatItem$bundleItem6.price_type_ext;
1318
- // 原价包括:price_type: "markup" && price_type_ext: "product_price"
1319
- return priceType === 'markup' && priceTypeExt === 'product_price';
1320
- }
1321
- return true;
1322
- }
1323
-
1324
- // package_exclusive: 仅在套餐中(子商品为原价)时可使用
1325
- if (ruleType === 'package_exclusive') {
1326
- if (isMainProduct) {
1327
- return false; // 单独购买时不可用
1328
- }
1329
- if (isBundleItem) {
1330
- var _flatItem$bundleItem7, _flatItem$bundleItem8;
1331
- // 套餐中购买时,判断是否为原价
1332
- var _priceType = (_flatItem$bundleItem7 = flatItem.bundleItem) === null || _flatItem$bundleItem7 === void 0 ? void 0 : _flatItem$bundleItem7.price_type;
1333
- var _priceTypeExt = (_flatItem$bundleItem8 = flatItem.bundleItem) === null || _flatItem$bundleItem8 === void 0 ? void 0 : _flatItem$bundleItem8.price_type_ext;
1334
-
1335
1318
  // original_price 对应:
1336
1319
  // 1. price_type: "markup" && price_type_ext: "product_price"
1337
1320
  // markup_price 对应:
1338
1321
  // price_type: "markup" && price_type_ext: ""
1339
1322
  /** 原价 */
1340
- var isOriginalPrice = _priceType === 'markup' && _priceTypeExt === 'product_price';
1323
+ var isOriginalPrice = priceType === 'markup' && priceTypeExt === 'product_price';
1341
1324
  /** 加价 */
1342
- var isMarkupPrice = _priceType === 'markup' && (_priceTypeExt === '' || !_priceTypeExt);
1325
+ var isMarkupPrice = priceType === 'markup' && (priceTypeExt === '' || !priceTypeExt);
1343
1326
 
1344
1327
  // 检查 rules
1345
1328
  if (rules.length > 0) {
@@ -1360,6 +1343,22 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1360
1343
  // 原价包括:price_type: "markup" && price_type_ext: "product_price"
1361
1344
  return isOriginalPrice;
1362
1345
  }
1346
+ return true;
1347
+ }
1348
+
1349
+ // package_exclusive: 仅在套餐中(子商品为原价)时可使用
1350
+ if (ruleType === 'package_exclusive') {
1351
+ if (isMainProduct) {
1352
+ return false; // 单独购买时不可用
1353
+ }
1354
+ if (isBundleItem) {
1355
+ var _flatItem$bundleItem7, _flatItem$bundleItem8;
1356
+ // 套餐中购买时,判断是否为原价
1357
+ var _priceType = (_flatItem$bundleItem7 = flatItem.bundleItem) === null || _flatItem$bundleItem7 === void 0 ? void 0 : _flatItem$bundleItem7.price_type;
1358
+ var _priceTypeExt = (_flatItem$bundleItem8 = flatItem.bundleItem) === null || _flatItem$bundleItem8 === void 0 ? void 0 : _flatItem$bundleItem8.price_type_ext;
1359
+ // 原价包括:price_type: "markup" && price_type_ext: "product_price"
1360
+ return _priceType === 'markup' && _priceTypeExt === 'product_price';
1361
+ }
1363
1362
  return false;
1364
1363
  }
1365
1364
 
@@ -1014,17 +1014,6 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1014
1014
  if (isBundleItem) {
1015
1015
  const priceType = (_a = flatItem.bundleItem) == null ? void 0 : _a.price_type;
1016
1016
  const priceTypeExt = (_b = flatItem.bundleItem) == null ? void 0 : _b.price_type_ext;
1017
- return priceType === "markup" && priceTypeExt === "product_price";
1018
- }
1019
- return true;
1020
- }
1021
- if (ruleType === "package_exclusive") {
1022
- if (isMainProduct) {
1023
- return false;
1024
- }
1025
- if (isBundleItem) {
1026
- const priceType = (_c = flatItem.bundleItem) == null ? void 0 : _c.price_type;
1027
- const priceTypeExt = (_d = flatItem.bundleItem) == null ? void 0 : _d.price_type_ext;
1028
1017
  const isOriginalPrice = priceType === "markup" && priceTypeExt === "product_price";
1029
1018
  const isMarkupPrice = priceType === "markup" && (priceTypeExt === "" || !priceTypeExt);
1030
1019
  if (rules.length > 0) {
@@ -1038,6 +1027,17 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1038
1027
  }
1039
1028
  return isOriginalPrice;
1040
1029
  }
1030
+ return true;
1031
+ }
1032
+ if (ruleType === "package_exclusive") {
1033
+ if (isMainProduct) {
1034
+ return false;
1035
+ }
1036
+ if (isBundleItem) {
1037
+ const priceType = (_c = flatItem.bundleItem) == null ? void 0 : _c.price_type;
1038
+ const priceTypeExt = (_d = flatItem.bundleItem) == null ? void 0 : _d.price_type_ext;
1039
+ return priceType === "markup" && priceTypeExt === "product_price";
1040
+ }
1041
1041
  return false;
1042
1042
  }
1043
1043
  if (ruleType === "single_item_promo") {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.358",
4
+ "version": "0.0.359",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",