@pisell/pisellos 2.2.121 → 2.2.122
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.
|
@@ -1982,12 +1982,12 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1982
1982
|
return true; // 单独购买时可用
|
|
1983
1983
|
}
|
|
1984
1984
|
if (isBundleItem) {
|
|
1985
|
-
var _flatItem$bundleItem9, _flatItem$bundleItem10, _flatItem$originProdu, _flatItem$
|
|
1985
|
+
var _flatItem$bundleItem9, _flatItem$bundleItem10, _flatItem$originProdu, _flatItem$parentProdu9;
|
|
1986
1986
|
// 套餐中购买时,判断是否为原价
|
|
1987
1987
|
var priceType = (_flatItem$bundleItem9 = flatItem.bundleItem) === null || _flatItem$bundleItem9 === void 0 ? void 0 : _flatItem$bundleItem9.price_type;
|
|
1988
1988
|
var priceTypeExt = (_flatItem$bundleItem10 = flatItem.bundleItem) === null || _flatItem$bundleItem10 === void 0 ? void 0 : _flatItem$bundleItem10.price_type_ext;
|
|
1989
1989
|
// 主商品id
|
|
1990
|
-
var mainProductId = (flatItem === null || flatItem === void 0 || (_flatItem$originProdu = flatItem.originProduct) === null || _flatItem$originProdu === void 0 ? void 0 : _flatItem$originProdu.
|
|
1990
|
+
var mainProductId = (flatItem === null || flatItem === void 0 || (_flatItem$originProdu = flatItem.originProduct) === null || _flatItem$originProdu === void 0 || (_flatItem$originProdu = _flatItem$originProdu._productOrigin) === null || _flatItem$originProdu === void 0 ? void 0 : _flatItem$originProdu.id) || (flatItem === null || flatItem === void 0 || (_flatItem$parentProdu9 = flatItem.parentProduct) === null || _flatItem$parentProdu9 === void 0 ? void 0 : _flatItem$parentProdu9.id) || 0;
|
|
1991
1991
|
// original_price 对应:
|
|
1992
1992
|
// 1. price_type: "markup" && price_type_ext: "product_price"
|
|
1993
1993
|
// markup_price 对应:
|
|
@@ -124,7 +124,7 @@ export var searchProduct = /*#__PURE__*/function () {
|
|
|
124
124
|
skip: 1,
|
|
125
125
|
num: 20,
|
|
126
126
|
status: 'published',
|
|
127
|
-
with: ['variantGroup'],
|
|
127
|
+
with: ['variantGroup.variantItem', 'optionGroup.optionItem'],
|
|
128
128
|
with_count: ['bundleGroup', 'optionGroup'],
|
|
129
129
|
exclude_extension_type: ['product_party', 'product_event', 'product_series_event', 'product_package_ticket', 'ticket', 'event_item']
|
|
130
130
|
};
|
|
@@ -1591,7 +1591,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1591
1591
|
* @returns 是否可用
|
|
1592
1592
|
*/
|
|
1593
1593
|
checkPackageSubItemUsageRules(discount, flatItem) {
|
|
1594
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1594
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1595
1595
|
const limitedData = discount.limited_relation_product_data;
|
|
1596
1596
|
const usageRules = limitedData == null ? void 0 : limitedData.package_sub_item_usage_rules;
|
|
1597
1597
|
const rules = ["original_price", ...(usageRules == null ? void 0 : usageRules.rules) || []];
|
|
@@ -1613,7 +1613,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1613
1613
|
if (isBundleItem) {
|
|
1614
1614
|
const priceType = (_a = flatItem.bundleItem) == null ? void 0 : _a.price_type;
|
|
1615
1615
|
const priceTypeExt = (_b = flatItem.bundleItem) == null ? void 0 : _b.price_type_ext;
|
|
1616
|
-
const mainProductId = ((_c = flatItem == null ? void 0 : flatItem.originProduct) == null ? void 0 : _c.
|
|
1616
|
+
const mainProductId = ((_d = (_c = flatItem == null ? void 0 : flatItem.originProduct) == null ? void 0 : _c._productOrigin) == null ? void 0 : _d.id) || ((_e = flatItem == null ? void 0 : flatItem.parentProduct) == null ? void 0 : _e.id) || 0;
|
|
1617
1617
|
const isOriginalPrice = priceType === "markup" && priceTypeExt === "product_price";
|
|
1618
1618
|
const isMarkupPrice = priceType === "markup" && (priceTypeExt === "" || !priceTypeExt);
|
|
1619
1619
|
if (rules.length > 0) {
|
|
@@ -1645,8 +1645,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1645
1645
|
return false;
|
|
1646
1646
|
}
|
|
1647
1647
|
if (isBundleItem) {
|
|
1648
|
-
const priceType = (
|
|
1649
|
-
const priceTypeExt = (
|
|
1648
|
+
const priceType = (_f = flatItem.bundleItem) == null ? void 0 : _f.price_type;
|
|
1649
|
+
const priceTypeExt = (_g = flatItem.bundleItem) == null ? void 0 : _g.price_type_ext;
|
|
1650
1650
|
const isOriginalPrice = priceType === "markup" && priceTypeExt === "product_price";
|
|
1651
1651
|
const isMarkupPrice = priceType === "markup" && (priceTypeExt === "" || !priceTypeExt);
|
|
1652
1652
|
if (rules.length > 0) {
|
|
@@ -88,7 +88,7 @@ var searchProduct = async (request, code) => {
|
|
|
88
88
|
skip: 1,
|
|
89
89
|
num: 20,
|
|
90
90
|
status: "published",
|
|
91
|
-
with: ["variantGroup"],
|
|
91
|
+
with: ["variantGroup.variantItem", "optionGroup.optionItem"],
|
|
92
92
|
with_count: ["bundleGroup", "optionGroup"],
|
|
93
93
|
exclude_extension_type: [
|
|
94
94
|
"product_party",
|