@pisell/pisellos 2.1.133 → 2.1.134
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.
|
@@ -19,7 +19,7 @@ interface PackageSubItemUsageRules {
|
|
|
19
19
|
type: 'universal_discount' | 'package_exclusive' | 'single_item_promo' | 'custom_usage_rules';
|
|
20
20
|
rules: ("original_price" | "markup_price")[];
|
|
21
21
|
package_scope?: {
|
|
22
|
-
type: 'all_packages' | 'specific_packages';
|
|
22
|
+
type: 'all_packages' | 'specific_packages' | 'product_all' | 'products';
|
|
23
23
|
exclude_bundle_product_ids: number[];
|
|
24
24
|
include_bundle_product_ids: number[];
|
|
25
25
|
filter: 0 | 1;
|
|
@@ -202,7 +202,7 @@ export function createDefaultOrderRulesHooks() {
|
|
|
202
202
|
num: (_values$quantity2 = values.quantity) !== null && _values$quantity2 !== void 0 ? _values$quantity2 : product.num,
|
|
203
203
|
product_bundle: nextBundle,
|
|
204
204
|
metadata: _objectSpread(_objectSpread({}, metadataAny), {}, {
|
|
205
|
-
source_product_price:
|
|
205
|
+
source_product_price: nextSourceOriginalPrice,
|
|
206
206
|
main_product_selling_price: nextMainSellingPrice,
|
|
207
207
|
main_product_original_price: nextMainOriginalPrice,
|
|
208
208
|
price_schema_version: 2
|
|
@@ -1882,8 +1882,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1882
1882
|
// 套餐适用范围校验
|
|
1883
1883
|
var isScopeValid = false;
|
|
1884
1884
|
|
|
1885
|
-
//
|
|
1886
|
-
if (scopeType === 'all_packages') {
|
|
1885
|
+
// 排除套餐判断, product_all值兼容旧数据
|
|
1886
|
+
if (scopeType === 'all_packages' || scopeType === 'product_all') {
|
|
1887
1887
|
// 所有套餐可用
|
|
1888
1888
|
if (!filter) {
|
|
1889
1889
|
isScopeValid = true;
|
|
@@ -1892,8 +1892,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1892
1892
|
}
|
|
1893
1893
|
}
|
|
1894
1894
|
|
|
1895
|
-
//
|
|
1896
|
-
if (scopeType === 'specific_packages') {
|
|
1895
|
+
// 包含套餐判断, products值兼容旧数据
|
|
1896
|
+
if (scopeType === 'specific_packages' || scopeType === 'products') {
|
|
1897
1897
|
isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
|
|
1898
1898
|
}
|
|
1899
1899
|
|
|
@@ -19,7 +19,7 @@ interface PackageSubItemUsageRules {
|
|
|
19
19
|
type: 'universal_discount' | 'package_exclusive' | 'single_item_promo' | 'custom_usage_rules';
|
|
20
20
|
rules: ("original_price" | "markup_price")[];
|
|
21
21
|
package_scope?: {
|
|
22
|
-
type: 'all_packages' | 'specific_packages';
|
|
22
|
+
type: 'all_packages' | 'specific_packages' | 'product_all' | 'products';
|
|
23
23
|
exclude_bundle_product_ids: number[];
|
|
24
24
|
include_bundle_product_ids: number[];
|
|
25
25
|
filter: 0 | 1;
|
|
@@ -166,7 +166,7 @@ function createDefaultOrderRulesHooks() {
|
|
|
166
166
|
product_bundle: nextBundle,
|
|
167
167
|
metadata: {
|
|
168
168
|
...metadataAny,
|
|
169
|
-
source_product_price:
|
|
169
|
+
source_product_price: nextSourceOriginalPrice,
|
|
170
170
|
main_product_selling_price: nextMainSellingPrice,
|
|
171
171
|
main_product_original_price: nextMainOriginalPrice,
|
|
172
172
|
price_schema_version: 2
|
|
@@ -1421,14 +1421,14 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1421
1421
|
const _isMarkupPrice = isMarkupPrice && rules.includes("markup_price");
|
|
1422
1422
|
const isPriceValid = _isOriginalPrice || _isMarkupPrice;
|
|
1423
1423
|
let isScopeValid = false;
|
|
1424
|
-
if (scopeType === "all_packages") {
|
|
1424
|
+
if (scopeType === "all_packages" || scopeType === "product_all") {
|
|
1425
1425
|
if (!filter) {
|
|
1426
1426
|
isScopeValid = true;
|
|
1427
1427
|
} else {
|
|
1428
1428
|
isScopeValid = !exclude_bundle_product_ids.includes(Number(mainProductId));
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
1431
|
-
if (scopeType === "specific_packages") {
|
|
1431
|
+
if (scopeType === "specific_packages" || scopeType === "products") {
|
|
1432
1432
|
isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
|
|
1433
1433
|
}
|
|
1434
1434
|
if (isPriceValid && isScopeValid) {
|