@pisell/pisellos 0.0.424 → 0.0.426
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.
|
@@ -23,11 +23,27 @@ export var formatDefaultCapacitys = function formatDefaultCapacitys(_ref) {
|
|
|
23
23
|
product_bundle = _ref.product_bundle;
|
|
24
24
|
if ((capacity === null || capacity === void 0 ? void 0 : capacity.type) === 'package') {
|
|
25
25
|
return (product_bundle || []).map(function (d) {
|
|
26
|
+
var _window;
|
|
26
27
|
var id = d.bundle_product_id;
|
|
27
28
|
var variantId = d.bundle_variant_id;
|
|
28
29
|
var item = ((capacity === null || capacity === void 0 ? void 0 : capacity.package) || []).find(function (item) {
|
|
29
|
-
return item.product_id
|
|
30
|
+
return item.product_id == id || item.product_id == variantId;
|
|
30
31
|
});
|
|
32
|
+
if (!item && (_window = window) !== null && _window !== void 0 && _window.sendWarningLog) {
|
|
33
|
+
window.sendWarningLog({
|
|
34
|
+
title: '未找到套餐 capacity 配置',
|
|
35
|
+
content: [{
|
|
36
|
+
key: 'product_id',
|
|
37
|
+
value: id
|
|
38
|
+
}, {
|
|
39
|
+
key: 'variant_id',
|
|
40
|
+
value: variantId
|
|
41
|
+
}, {
|
|
42
|
+
key: 'package',
|
|
43
|
+
value: JSON.stringify((capacity === null || capacity === void 0 ? void 0 : capacity.package) || [])
|
|
44
|
+
}]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
31
47
|
return {
|
|
32
48
|
id: id,
|
|
33
49
|
value: item ? d.num || 0 : 0,
|
|
@@ -49,8 +49,27 @@ var formatDefaultCapacitys = ({
|
|
|
49
49
|
const id = d.bundle_product_id;
|
|
50
50
|
const variantId = d.bundle_variant_id;
|
|
51
51
|
const item = ((capacity == null ? void 0 : capacity.package) || []).find(
|
|
52
|
-
(item2) => item2.product_id
|
|
52
|
+
(item2) => item2.product_id == id || item2.product_id == variantId
|
|
53
53
|
);
|
|
54
|
+
if (!item && (window == null ? void 0 : window.sendWarningLog)) {
|
|
55
|
+
window.sendWarningLog({
|
|
56
|
+
title: "未找到套餐 capacity 配置",
|
|
57
|
+
content: [
|
|
58
|
+
{
|
|
59
|
+
key: "product_id",
|
|
60
|
+
value: id
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: "variant_id",
|
|
64
|
+
value: variantId
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: "package",
|
|
68
|
+
value: JSON.stringify((capacity == null ? void 0 : capacity.package) || [])
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
54
73
|
return {
|
|
55
74
|
id,
|
|
56
75
|
value: item ? d.num || 0 : 0,
|