@fonixtree/magic-design 1.0.220 → 1.0.223
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.
- package/es/common/PictureModal/index.js +1 -1
- package/es/composite-comp/bol/components/Banner/pc/index.less +1 -1
- package/es/composite-comp/common/components/ProductItem/index.js +22 -27
- package/es/composite-comp/common/components/ProductItem/index.less +1 -1
- package/es/composite-comp/dito/components/GroupedImage/defaultJSON.js +1 -1
- package/es/composite-comp/dito/components/GroupedImage/pc/index.less +2 -10
- package/es/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.less +3 -1
- package/es/composite-comp/dito/components/Recommend/pc/index.js +26 -23
- package/es/composite-comp/dito/components/Recommend/pc/index.less +16 -3
- package/es/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
- package/es/core/Renderer/index.js +55 -15
- package/es/meta-comp/config-panels/ButtonConfig/index.js +4 -0
- package/es/meta-comp/config-panels/ImageConfig/index.js +1 -1
- package/es/meta-comp/config-panels/TextConfig/index.js +1 -1
- package/es/utils/coreUtil.js +3 -3
- package/lib/common/PictureModal/index.js +1 -1
- package/lib/composite-comp/bol/components/Banner/pc/index.less +1 -1
- package/lib/composite-comp/common/components/ProductItem/index.js +22 -27
- package/lib/composite-comp/common/components/ProductItem/index.less +1 -1
- package/lib/composite-comp/dito/components/GroupedImage/defaultJSON.js +1 -1
- package/lib/composite-comp/dito/components/GroupedImage/pc/index.less +2 -10
- package/lib/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.less +3 -1
- package/lib/composite-comp/dito/components/Recommend/pc/index.js +26 -23
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +16 -3
- package/lib/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
- package/lib/core/Renderer/index.js +55 -15
- package/lib/meta-comp/config-panels/ButtonConfig/index.js +4 -0
- package/lib/meta-comp/config-panels/ImageConfig/index.js +1 -1
- package/lib/meta-comp/config-panels/TextConfig/index.js +1 -1
- package/lib/utils/coreUtil.js +3 -3
- package/package.json +1 -1
|
@@ -107,22 +107,22 @@ function (_super) {
|
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
ProductItem.prototype.render = function () {
|
|
110
|
-
var _a, _b, _c, _d, _e, _f
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
data =
|
|
114
|
-
type =
|
|
115
|
-
panelProps =
|
|
116
|
-
onItemClick =
|
|
117
|
-
showProName =
|
|
118
|
-
showProgress =
|
|
119
|
-
fixHeight =
|
|
120
|
-
layout =
|
|
121
|
-
imgHeight =
|
|
122
|
-
imgWidth =
|
|
123
|
-
unknownPrice =
|
|
124
|
-
hideLabels =
|
|
125
|
-
rest = __rest(
|
|
110
|
+
var _a, _b, _c, _d, _e, _f;
|
|
111
|
+
|
|
112
|
+
var _g = this.props,
|
|
113
|
+
data = _g.data,
|
|
114
|
+
type = _g.type,
|
|
115
|
+
panelProps = _g.panelProps,
|
|
116
|
+
onItemClick = _g.onItemClick,
|
|
117
|
+
showProName = _g.showProName,
|
|
118
|
+
showProgress = _g.showProgress,
|
|
119
|
+
fixHeight = _g.fixHeight,
|
|
120
|
+
layout = _g.layout,
|
|
121
|
+
imgHeight = _g.imgHeight,
|
|
122
|
+
imgWidth = _g.imgWidth,
|
|
123
|
+
unknownPrice = _g.unknownPrice,
|
|
124
|
+
hideLabels = _g.hideLabels,
|
|
125
|
+
rest = __rest(_g, ["data", "type", "panelProps", "onItemClick", "showProName", "showProgress", "fixHeight", "layout", "imgHeight", "imgWidth", "unknownPrice", "hideLabels"]);
|
|
126
126
|
|
|
127
127
|
var promotions = (0, _businessUtil.getPromotionList)(data);
|
|
128
128
|
var price = (0, _currencyUtil.formatCurrency)(data.salesPrice);
|
|
@@ -198,10 +198,8 @@ function (_super) {
|
|
|
198
198
|
})) || [];
|
|
199
199
|
var prodLabels = ((_b = data.labels) === null || _b === void 0 ? void 0 : _b.filter(function (f) {
|
|
200
200
|
return f.position === '6';
|
|
201
|
-
})) || [];
|
|
202
|
-
|
|
203
|
-
return f.position === '7';
|
|
204
|
-
})) || []; // ad 卡片
|
|
201
|
+
})) || []; // const priceLabels = data.labels?.filter(f => f.position === '7') || [];
|
|
202
|
+
// ad 卡片
|
|
205
203
|
|
|
206
204
|
if (data.type === 'ad') {
|
|
207
205
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -289,14 +287,11 @@ function (_super) {
|
|
|
289
287
|
text: _price
|
|
290
288
|
}),
|
|
291
289
|
readonly: true
|
|
292
|
-
}), priceLabels.length > 0 && !hideLabels && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
|
|
293
|
-
labels: priceLabels,
|
|
294
|
-
small: true
|
|
295
290
|
})), panelProps.salesPrice.open && (!!discount || oldPrice) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
296
291
|
className: "price-sold-wrap"
|
|
297
292
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
298
293
|
className: "old-price-wrap"
|
|
299
|
-
}, !!discount && ((
|
|
294
|
+
}, !!discount && ((_c = panelProps.discountLabel) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
300
295
|
className: "discount",
|
|
301
296
|
data: __assign(__assign({}, panelProps.discountLabel), {
|
|
302
297
|
text: "-" + discount + "%"
|
|
@@ -311,9 +306,9 @@ function (_super) {
|
|
|
311
306
|
style: {
|
|
312
307
|
color: panelProps.salesPrice.content.color
|
|
313
308
|
}
|
|
314
|
-
})), type !== 'groupBuy' && !showProgress && data.salesCnt > 0 && data.displaySalesCntFlag === 'Y' && ((
|
|
309
|
+
})), type !== 'groupBuy' && !showProgress && data.salesCnt > 0 && data.displaySalesCntFlag === 'Y' && ((_d = panelProps.sold) === null || _d === void 0 ? void 0 : _d.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
315
310
|
className: "sold-count"
|
|
316
|
-
}, (0, _commonUtil.convertCount)(data.salesCnt), " sold"))), showProgress && ((
|
|
311
|
+
}, (0, _commonUtil.convertCount)(data.salesCnt), " sold"))), showProgress && ((_e = panelProps.salesProgressVisible) === null || _e === void 0 ? void 0 : _e.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
317
312
|
className: "progress-wrap"
|
|
318
313
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
319
314
|
className: "text"
|
|
@@ -323,7 +318,7 @@ function (_super) {
|
|
|
323
318
|
className: "progress",
|
|
324
319
|
style: {
|
|
325
320
|
width: salePercent + "%",
|
|
326
|
-
backgroundColor: (
|
|
321
|
+
backgroundColor: (_f = panelProps.salesProgressVisible) === null || _f === void 0 ? void 0 : _f.color
|
|
327
322
|
}
|
|
328
323
|
})))));
|
|
329
324
|
};
|
|
@@ -93,7 +93,7 @@ var groupedImageGroupSourceJSON = function groupedImageGroupSourceJSON(parentId,
|
|
|
93
93
|
parentId: parentId,
|
|
94
94
|
image: baseImage,
|
|
95
95
|
groupName: baseGroupName,
|
|
96
|
-
title: createTextMeta(groupId, 'Group Title', '#CE1126',
|
|
96
|
+
title: createTextMeta(groupId, 'Group Title', '#CE1126', '16px', 700),
|
|
97
97
|
images: [createImageMeta(groupId), createImageMeta(groupId), createImageMeta(groupId), createImageMeta(groupId)],
|
|
98
98
|
hover: {
|
|
99
99
|
open: true,
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
&.less-than-4 {
|
|
7
7
|
.image-list-wrapper {
|
|
8
|
-
padding-left: 0!important;
|
|
9
8
|
.image-list {
|
|
10
9
|
width: fit-content;
|
|
11
10
|
margin: 0 auto;
|
|
@@ -17,8 +16,7 @@
|
|
|
17
16
|
display: flex;
|
|
18
17
|
align-items: center;
|
|
19
18
|
gap: 16px;
|
|
20
|
-
|
|
21
|
-
overflow: auto;
|
|
19
|
+
// overflow: auto;
|
|
22
20
|
position: relative;
|
|
23
21
|
width: fit-content;
|
|
24
22
|
margin: 0 auto 15px;
|
|
@@ -48,7 +46,6 @@
|
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
.image-list-wrapper {
|
|
51
|
-
padding-left: 88px;
|
|
52
49
|
position: relative;
|
|
53
50
|
|
|
54
51
|
.image-list {
|
|
@@ -60,20 +57,15 @@
|
|
|
60
57
|
flex: 1;
|
|
61
58
|
scroll-behavior: smooth;
|
|
62
59
|
-webkit-overflow-scrolling: touch;
|
|
60
|
+
scrollbar-width: none;
|
|
63
61
|
|
|
64
62
|
&::-webkit-scrollbar {
|
|
65
63
|
display: none;
|
|
66
64
|
}
|
|
67
65
|
|
|
68
|
-
scrollbar-width: none;
|
|
69
|
-
|
|
70
66
|
.image-item {
|
|
71
67
|
flex-shrink: 0;
|
|
72
68
|
width: 300px;
|
|
73
|
-
|
|
74
|
-
&:last-child {
|
|
75
|
-
margin-right: 40px;
|
|
76
|
-
}
|
|
77
69
|
}
|
|
78
70
|
|
|
79
71
|
.empty-placeholder {
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
height: 100%;
|
|
5
5
|
display: flex;
|
|
6
6
|
justify-content: center;
|
|
7
|
+
max-height: 65px;
|
|
8
|
+
|
|
7
9
|
// overflow: hidden;
|
|
8
10
|
&>img {
|
|
9
11
|
width: 100%;
|
|
10
|
-
height: 100%;
|
|
12
|
+
// height: 100%;
|
|
11
13
|
// object-fit: contain;
|
|
12
14
|
transition: all .2s linear;
|
|
13
15
|
vertical-align: initial;
|
|
@@ -303,14 +303,14 @@ function (_super) {
|
|
|
303
303
|
|
|
304
304
|
_this.getProductList = function (index) {
|
|
305
305
|
return __awaiter(_this, void 0, void 0, function () {
|
|
306
|
-
var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d,
|
|
306
|
+
var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d, prodType, _e, intelligentType, _f, intelligentValue, _g, maxProdNum, newData, params, res, res, e_1, _cache;
|
|
307
307
|
|
|
308
|
-
var
|
|
308
|
+
var _h, _j, _k;
|
|
309
309
|
|
|
310
310
|
var _this = this;
|
|
311
311
|
|
|
312
|
-
return __generator(this, function (
|
|
313
|
-
switch (
|
|
312
|
+
return __generator(this, function (_l) {
|
|
313
|
+
switch (_l.label) {
|
|
314
314
|
case 0:
|
|
315
315
|
panelProps = this.props.panelProps;
|
|
316
316
|
groupSource = this.state.groupSource;
|
|
@@ -322,7 +322,7 @@ function (_super) {
|
|
|
322
322
|
|
|
323
323
|
if (cache) {
|
|
324
324
|
if ("products" + index in cache) {
|
|
325
|
-
this.setState((
|
|
325
|
+
this.setState((_h = {}, _h["products" + index] = cache["products" + index], _h), function () {
|
|
326
326
|
_this.resetLayout();
|
|
327
327
|
});
|
|
328
328
|
/** 如果数据未过期 */
|
|
@@ -334,12 +334,12 @@ function (_super) {
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
_a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.
|
|
337
|
+
_a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.prodType, prodType = _d === void 0 ? '' : _d, _e = _a.intelligentType, intelligentType = _e === void 0 ? '' : _e, _f = _a.intelligentValue, intelligentValue = _f === void 0 ? [] : _f, _g = _a.maxProdNum, maxProdNum = _g === void 0 ? 10 : _g;
|
|
338
338
|
newData = [];
|
|
339
|
-
|
|
339
|
+
_l.label = 1;
|
|
340
340
|
|
|
341
341
|
case 1:
|
|
342
|
-
|
|
342
|
+
_l.trys.push([1, 9,, 10]);
|
|
343
343
|
|
|
344
344
|
if (!(groupSource.length > 0)) return [3
|
|
345
345
|
/*break*/
|
|
@@ -347,22 +347,25 @@ function (_super) {
|
|
|
347
347
|
if (!(sourceType === 'select')) return [3
|
|
348
348
|
/*break*/
|
|
349
349
|
, 3];
|
|
350
|
+
if (!prodIds) return [2
|
|
351
|
+
/*return*/
|
|
352
|
+
];
|
|
353
|
+
params = {
|
|
354
|
+
state: 'A'
|
|
355
|
+
};
|
|
350
356
|
|
|
351
|
-
if (
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
357
|
+
if (prodType === 'spu') {
|
|
358
|
+
params.offers = prodIds;
|
|
359
|
+
} else {
|
|
360
|
+
params.products = prodIds;
|
|
355
361
|
}
|
|
356
362
|
|
|
357
363
|
return [4
|
|
358
364
|
/*yield*/
|
|
359
|
-
, (0, _commonUtil.commonFetch)('/designer/v1/h5/products',
|
|
360
|
-
products: prodIds,
|
|
361
|
-
state: 'A'
|
|
362
|
-
}, 'GET')];
|
|
365
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/products', params, 'GET')];
|
|
363
366
|
|
|
364
367
|
case 2:
|
|
365
|
-
res =
|
|
368
|
+
res = _l.sent();
|
|
366
369
|
newData = __spreadArrays(res.list);
|
|
367
370
|
return [3
|
|
368
371
|
/*break*/
|
|
@@ -385,7 +388,7 @@ function (_super) {
|
|
|
385
388
|
}, 'POST')];
|
|
386
389
|
|
|
387
390
|
case 4:
|
|
388
|
-
res =
|
|
391
|
+
res = _l.sent();
|
|
389
392
|
newData = __spreadArrays(res.pageInfo.list);
|
|
390
393
|
return [3
|
|
391
394
|
/*break*/
|
|
@@ -393,7 +396,7 @@ function (_super) {
|
|
|
393
396
|
|
|
394
397
|
case 5:
|
|
395
398
|
newData = [];
|
|
396
|
-
|
|
399
|
+
_l.label = 6;
|
|
397
400
|
|
|
398
401
|
case 6:
|
|
399
402
|
return [3
|
|
@@ -402,7 +405,7 @@ function (_super) {
|
|
|
402
405
|
|
|
403
406
|
case 7:
|
|
404
407
|
newData = [];
|
|
405
|
-
|
|
408
|
+
_l.label = 8;
|
|
406
409
|
|
|
407
410
|
case 8:
|
|
408
411
|
return [3
|
|
@@ -410,7 +413,7 @@ function (_super) {
|
|
|
410
413
|
, 10];
|
|
411
414
|
|
|
412
415
|
case 9:
|
|
413
|
-
e_1 =
|
|
416
|
+
e_1 = _l.sent();
|
|
414
417
|
newData = [];
|
|
415
418
|
return [3
|
|
416
419
|
/*break*/
|
|
@@ -419,10 +422,10 @@ function (_super) {
|
|
|
419
422
|
case 10:
|
|
420
423
|
if (!(0, _coreUtil.isDesignMode)()) {
|
|
421
424
|
_cache = (0, _storeUtil.getMagicStore)("recommend_" + pageId + "_" + recommendId);
|
|
422
|
-
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (
|
|
425
|
+
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (_j = {}, _j["products" + index] = newData, _j.endTime = Date.now() + 3 * 60 * 1000, _j)));
|
|
423
426
|
}
|
|
424
427
|
|
|
425
|
-
this.setState((
|
|
428
|
+
this.setState((_k = {}, _k["products" + index] = newData, _k), function () {
|
|
426
429
|
_this.resetLayout();
|
|
427
430
|
});
|
|
428
431
|
return [2
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
.recommend-tab-select-wrap {
|
|
17
17
|
display: flex;
|
|
18
18
|
align-items: center;
|
|
19
|
-
height: 50px;
|
|
20
|
-
|
|
21
|
-
overflow: auto;
|
|
19
|
+
// height: 50px;
|
|
20
|
+
// overflow: auto;
|
|
22
21
|
position: relative;
|
|
23
22
|
width: fit-content;
|
|
24
23
|
margin: 0 auto;
|
|
@@ -62,6 +61,14 @@
|
|
|
62
61
|
.tab-list {
|
|
63
62
|
width: 100%;
|
|
64
63
|
}
|
|
64
|
+
|
|
65
|
+
.m-product-item-wrap {
|
|
66
|
+
border-radius: 8px;
|
|
67
|
+
|
|
68
|
+
.img-wrap {
|
|
69
|
+
border-radius: 8px 8px 0 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
.arrow-icon {
|
|
@@ -89,6 +96,10 @@
|
|
|
89
96
|
margin: 0;
|
|
90
97
|
}
|
|
91
98
|
|
|
99
|
+
.scrollContainer::-webkit-scrollbar {
|
|
100
|
+
display: none; /* Chrome, Safari, Opera */
|
|
101
|
+
}
|
|
102
|
+
|
|
92
103
|
.scrollContainer {
|
|
93
104
|
display: flex;
|
|
94
105
|
flex-direction: row;
|
|
@@ -96,6 +107,8 @@
|
|
|
96
107
|
flex: 1;
|
|
97
108
|
margin: 0;
|
|
98
109
|
overflow-x: auto;
|
|
110
|
+
scrollbar-width: none; /* Firefox */
|
|
111
|
+
-ms-overflow-style: none; /* IE 和 Edge */
|
|
99
112
|
padding-bottom: 15px;
|
|
100
113
|
|
|
101
114
|
&.pl_100 {
|
|
@@ -71,7 +71,7 @@ function (_super) {
|
|
|
71
71
|
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
72
72
|
data: panelProps.image,
|
|
73
73
|
needClickArea: false,
|
|
74
|
-
onlySpecificCode:
|
|
74
|
+
onlySpecificCode: ['CustomizedPage', 'FunctionPage']
|
|
75
75
|
}),
|
|
76
76
|
metaOption: panelProps.image
|
|
77
77
|
}];
|
|
@@ -102,6 +102,17 @@ var Renderer = function Renderer(props) {
|
|
|
102
102
|
toastState = _e[0],
|
|
103
103
|
setToastState = _e[1];
|
|
104
104
|
|
|
105
|
+
var timerRef = (0, _react.useRef)(null);
|
|
106
|
+
var isMountedRef = (0, _react.useRef)(true); // 使用 useMemo 来稳定 pageData 的引用,避免不必要的重新渲染
|
|
107
|
+
|
|
108
|
+
var pageDataKey = (0, _react.useMemo)(function () {
|
|
109
|
+
if (!pageData || !pageData.childNodes) return ''; // 创建一个稳定的标识符,基于 childNodes 的内容
|
|
110
|
+
|
|
111
|
+
return pageData.childNodes.map(function (node) {
|
|
112
|
+
return node.id + "-" + node.type;
|
|
113
|
+
}).join(',');
|
|
114
|
+
}, [pageData]);
|
|
115
|
+
|
|
105
116
|
if (!noSetWindow) {
|
|
106
117
|
setDesignConfig(props);
|
|
107
118
|
}
|
|
@@ -109,11 +120,21 @@ var Renderer = function Renderer(props) {
|
|
|
109
120
|
window.magicDesignPageData = pageData;
|
|
110
121
|
var pageBackground = window.magicDesign.pageBackground;
|
|
111
122
|
(0, _react.useEffect)(function () {
|
|
112
|
-
|
|
123
|
+
isMountedRef.current = true; // 清除之前的定时器
|
|
124
|
+
|
|
125
|
+
if (timerRef.current) {
|
|
126
|
+
clearTimeout(timerRef.current);
|
|
127
|
+
timerRef.current = null;
|
|
128
|
+
}
|
|
129
|
+
|
|
113
130
|
var filterData = [];
|
|
114
131
|
|
|
115
132
|
if (pageData && pageData.childNodes && pageData.childNodes.length) {
|
|
116
|
-
|
|
133
|
+
filterData = pageData.childNodes.filter(function (node) {
|
|
134
|
+
return (0, _coreUtil.isActiveFloor)(node.activeTerminal);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
var graduallySetFloors_1 = function graduallySetFloors_1(data, step, interval, start) {
|
|
117
138
|
if (step === void 0) {
|
|
118
139
|
step = 5;
|
|
119
140
|
}
|
|
@@ -124,6 +145,11 @@ var Renderer = function Renderer(props) {
|
|
|
124
145
|
|
|
125
146
|
if (start === void 0) {
|
|
126
147
|
start = 0;
|
|
148
|
+
} // 检查组件是否仍然挂载
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
if (!isMountedRef.current) {
|
|
152
|
+
return;
|
|
127
153
|
} // 计算这一步应该显示的最终索引
|
|
128
154
|
|
|
129
155
|
|
|
@@ -132,18 +158,29 @@ var Renderer = function Renderer(props) {
|
|
|
132
158
|
setFloors(data.slice(0, end)); // 如果还有更多楼层要显示,设置一个定时器来递归调用此函数
|
|
133
159
|
|
|
134
160
|
if (end < data.length) {
|
|
135
|
-
setTimeout(function () {
|
|
136
|
-
|
|
161
|
+
timerRef.current = setTimeout(function () {
|
|
162
|
+
graduallySetFloors_1(data, step, interval, end);
|
|
137
163
|
}, interval);
|
|
164
|
+
} else {
|
|
165
|
+
timerRef.current = null;
|
|
138
166
|
}
|
|
139
167
|
};
|
|
140
168
|
|
|
141
|
-
filterData
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
169
|
+
graduallySetFloors_1(filterData);
|
|
170
|
+
} else {
|
|
171
|
+
setFloors([]);
|
|
172
|
+
} // 清理函数:清除所有未完成的定时器
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
return function () {
|
|
176
|
+
isMountedRef.current = false;
|
|
177
|
+
|
|
178
|
+
if (timerRef.current) {
|
|
179
|
+
clearTimeout(timerRef.current);
|
|
180
|
+
timerRef.current = null;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
}, [pageDataKey]);
|
|
147
184
|
(0, _react.useEffect)(function () {
|
|
148
185
|
setTimeout(function () {
|
|
149
186
|
var _a;
|
|
@@ -219,7 +256,6 @@ var Renderer = function Renderer(props) {
|
|
|
219
256
|
};
|
|
220
257
|
};
|
|
221
258
|
|
|
222
|
-
console.log('window.magicDesign.designMode', window.magicDesign.designMode);
|
|
223
259
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
224
260
|
className: "render_wrap",
|
|
225
261
|
magic_design: "",
|
|
@@ -239,13 +275,17 @@ var Renderer = function Renderer(props) {
|
|
|
239
275
|
console.error("[MagicBox] Can not find type " + nodeData.type);
|
|
240
276
|
return;
|
|
241
277
|
}
|
|
242
|
-
/** 添加模块需要 给GA使用 */
|
|
243
278
|
|
|
279
|
+
console.log('----nodeData', nodeData, moduleIndex);
|
|
280
|
+
/** 添加模块需要 给GA使用 */
|
|
281
|
+
// 避免直接修改原始 nodeData,创建新对象
|
|
244
282
|
|
|
245
|
-
|
|
283
|
+
var nodeDataWithIndex = __assign(__assign({}, nodeData), {
|
|
284
|
+
moduleIndex: moduleIndex + 1
|
|
285
|
+
});
|
|
246
286
|
|
|
247
|
-
var newInstanceProps = __assign(__assign({},
|
|
248
|
-
nodeData:
|
|
287
|
+
var newInstanceProps = __assign(__assign({}, nodeDataWithIndex), {
|
|
288
|
+
nodeData: nodeDataWithIndex,
|
|
249
289
|
mode: 'renderer',
|
|
250
290
|
outputType: outputType
|
|
251
291
|
});
|
|
@@ -146,6 +146,10 @@ function (_super) {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
if (!data.buttonText.pcFontSize) {
|
|
150
|
+
data.buttonText.pcFontSize = 14;
|
|
151
|
+
}
|
|
152
|
+
|
|
149
153
|
var contentSetting = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
150
154
|
split: true,
|
|
151
155
|
title: "URL"
|
|
@@ -379,7 +379,7 @@ function (_super) {
|
|
|
379
379
|
})), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
380
380
|
title: (0, _locale.i18n)('BORDER_RADIUS')
|
|
381
381
|
}, /*#__PURE__*/_react["default"].createElement(_common.Slider, {
|
|
382
|
-
maxVal:
|
|
382
|
+
maxVal: 200,
|
|
383
383
|
minVal: 0,
|
|
384
384
|
onChange: function onChange(_a) {
|
|
385
385
|
var count = _a.count;
|
|
@@ -287,7 +287,7 @@ function (_super) {
|
|
|
287
287
|
},
|
|
288
288
|
unit: "px",
|
|
289
289
|
value: {
|
|
290
|
-
count: window.magicDesign.device == 'pc' ? textData.pcFontSize : textData.fontSize
|
|
290
|
+
count: window.magicDesign.device == 'pc' ? textData.pcFontSize || textData.fontSize : textData.fontSize
|
|
291
291
|
}
|
|
292
292
|
}))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
293
293
|
title: ""
|
package/es/utils/coreUtil.js
CHANGED
|
@@ -350,8 +350,7 @@ var createProdCardModal = function createProdCardModal(ids) {
|
|
|
350
350
|
exports.createProdCardModal = createProdCardModal;
|
|
351
351
|
|
|
352
352
|
var createPictureModal = function createPictureModal(url) {
|
|
353
|
-
if (!url) return;
|
|
354
|
-
document.body.classList.add('no-scroll');
|
|
353
|
+
if (!url) return; // document.body.classList.add('no-scroll');
|
|
355
354
|
|
|
356
355
|
_mobx.frameStore.setState({
|
|
357
356
|
pictureModalState: {
|
|
@@ -368,8 +367,9 @@ var clickUrl = function clickUrl(url, state) {
|
|
|
368
367
|
|
|
369
368
|
if (url === void 0) {
|
|
370
369
|
url = '';
|
|
371
|
-
}
|
|
370
|
+
}
|
|
372
371
|
|
|
372
|
+
console.log('clickUrl....', url); // 只读模式,设计模式,url为空,邮箱模版
|
|
373
373
|
|
|
374
374
|
if (window.magicDesign.readOnly || window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
|
|
375
375
|
return;
|
|
@@ -107,22 +107,22 @@ function (_super) {
|
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
ProductItem.prototype.render = function () {
|
|
110
|
-
var _a, _b, _c, _d, _e, _f
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
data =
|
|
114
|
-
type =
|
|
115
|
-
panelProps =
|
|
116
|
-
onItemClick =
|
|
117
|
-
showProName =
|
|
118
|
-
showProgress =
|
|
119
|
-
fixHeight =
|
|
120
|
-
layout =
|
|
121
|
-
imgHeight =
|
|
122
|
-
imgWidth =
|
|
123
|
-
unknownPrice =
|
|
124
|
-
hideLabels =
|
|
125
|
-
rest = __rest(
|
|
110
|
+
var _a, _b, _c, _d, _e, _f;
|
|
111
|
+
|
|
112
|
+
var _g = this.props,
|
|
113
|
+
data = _g.data,
|
|
114
|
+
type = _g.type,
|
|
115
|
+
panelProps = _g.panelProps,
|
|
116
|
+
onItemClick = _g.onItemClick,
|
|
117
|
+
showProName = _g.showProName,
|
|
118
|
+
showProgress = _g.showProgress,
|
|
119
|
+
fixHeight = _g.fixHeight,
|
|
120
|
+
layout = _g.layout,
|
|
121
|
+
imgHeight = _g.imgHeight,
|
|
122
|
+
imgWidth = _g.imgWidth,
|
|
123
|
+
unknownPrice = _g.unknownPrice,
|
|
124
|
+
hideLabels = _g.hideLabels,
|
|
125
|
+
rest = __rest(_g, ["data", "type", "panelProps", "onItemClick", "showProName", "showProgress", "fixHeight", "layout", "imgHeight", "imgWidth", "unknownPrice", "hideLabels"]);
|
|
126
126
|
|
|
127
127
|
var promotions = (0, _businessUtil.getPromotionList)(data);
|
|
128
128
|
var price = (0, _currencyUtil.formatCurrency)(data.salesPrice);
|
|
@@ -198,10 +198,8 @@ function (_super) {
|
|
|
198
198
|
})) || [];
|
|
199
199
|
var prodLabels = ((_b = data.labels) === null || _b === void 0 ? void 0 : _b.filter(function (f) {
|
|
200
200
|
return f.position === '6';
|
|
201
|
-
})) || [];
|
|
202
|
-
|
|
203
|
-
return f.position === '7';
|
|
204
|
-
})) || []; // ad 卡片
|
|
201
|
+
})) || []; // const priceLabels = data.labels?.filter(f => f.position === '7') || [];
|
|
202
|
+
// ad 卡片
|
|
205
203
|
|
|
206
204
|
if (data.type === 'ad') {
|
|
207
205
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -289,14 +287,11 @@ function (_super) {
|
|
|
289
287
|
text: _price
|
|
290
288
|
}),
|
|
291
289
|
readonly: true
|
|
292
|
-
}), priceLabels.length > 0 && !hideLabels && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
|
|
293
|
-
labels: priceLabels,
|
|
294
|
-
small: true
|
|
295
290
|
})), panelProps.salesPrice.open && (!!discount || oldPrice) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
296
291
|
className: "price-sold-wrap"
|
|
297
292
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
298
293
|
className: "old-price-wrap"
|
|
299
|
-
}, !!discount && ((
|
|
294
|
+
}, !!discount && ((_c = panelProps.discountLabel) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
300
295
|
className: "discount",
|
|
301
296
|
data: __assign(__assign({}, panelProps.discountLabel), {
|
|
302
297
|
text: "-" + discount + "%"
|
|
@@ -311,9 +306,9 @@ function (_super) {
|
|
|
311
306
|
style: {
|
|
312
307
|
color: panelProps.salesPrice.content.color
|
|
313
308
|
}
|
|
314
|
-
})), type !== 'groupBuy' && !showProgress && data.salesCnt > 0 && data.displaySalesCntFlag === 'Y' && ((
|
|
309
|
+
})), type !== 'groupBuy' && !showProgress && data.salesCnt > 0 && data.displaySalesCntFlag === 'Y' && ((_d = panelProps.sold) === null || _d === void 0 ? void 0 : _d.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
315
310
|
className: "sold-count"
|
|
316
|
-
}, (0, _commonUtil.convertCount)(data.salesCnt), " sold"))), showProgress && ((
|
|
311
|
+
}, (0, _commonUtil.convertCount)(data.salesCnt), " sold"))), showProgress && ((_e = panelProps.salesProgressVisible) === null || _e === void 0 ? void 0 : _e.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
317
312
|
className: "progress-wrap"
|
|
318
313
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
319
314
|
className: "text"
|
|
@@ -323,7 +318,7 @@ function (_super) {
|
|
|
323
318
|
className: "progress",
|
|
324
319
|
style: {
|
|
325
320
|
width: salePercent + "%",
|
|
326
|
-
backgroundColor: (
|
|
321
|
+
backgroundColor: (_f = panelProps.salesProgressVisible) === null || _f === void 0 ? void 0 : _f.color
|
|
327
322
|
}
|
|
328
323
|
})))));
|
|
329
324
|
};
|
|
@@ -93,7 +93,7 @@ var groupedImageGroupSourceJSON = function groupedImageGroupSourceJSON(parentId,
|
|
|
93
93
|
parentId: parentId,
|
|
94
94
|
image: baseImage,
|
|
95
95
|
groupName: baseGroupName,
|
|
96
|
-
title: createTextMeta(groupId, 'Group Title', '#CE1126',
|
|
96
|
+
title: createTextMeta(groupId, 'Group Title', '#CE1126', '16px', 700),
|
|
97
97
|
images: [createImageMeta(groupId), createImageMeta(groupId), createImageMeta(groupId), createImageMeta(groupId)],
|
|
98
98
|
hover: {
|
|
99
99
|
open: true,
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
&.less-than-4 {
|
|
7
7
|
.image-list-wrapper {
|
|
8
|
-
padding-left: 0!important;
|
|
9
8
|
.image-list {
|
|
10
9
|
width: fit-content;
|
|
11
10
|
margin: 0 auto;
|
|
@@ -17,8 +16,7 @@
|
|
|
17
16
|
display: flex;
|
|
18
17
|
align-items: center;
|
|
19
18
|
gap: 16px;
|
|
20
|
-
|
|
21
|
-
overflow: auto;
|
|
19
|
+
// overflow: auto;
|
|
22
20
|
position: relative;
|
|
23
21
|
width: fit-content;
|
|
24
22
|
margin: 0 auto 15px;
|
|
@@ -48,7 +46,6 @@
|
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
.image-list-wrapper {
|
|
51
|
-
padding-left: 88px;
|
|
52
49
|
position: relative;
|
|
53
50
|
|
|
54
51
|
.image-list {
|
|
@@ -60,20 +57,15 @@
|
|
|
60
57
|
flex: 1;
|
|
61
58
|
scroll-behavior: smooth;
|
|
62
59
|
-webkit-overflow-scrolling: touch;
|
|
60
|
+
scrollbar-width: none;
|
|
63
61
|
|
|
64
62
|
&::-webkit-scrollbar {
|
|
65
63
|
display: none;
|
|
66
64
|
}
|
|
67
65
|
|
|
68
|
-
scrollbar-width: none;
|
|
69
|
-
|
|
70
66
|
.image-item {
|
|
71
67
|
flex-shrink: 0;
|
|
72
68
|
width: 300px;
|
|
73
|
-
|
|
74
|
-
&:last-child {
|
|
75
|
-
margin-right: 40px;
|
|
76
|
-
}
|
|
77
69
|
}
|
|
78
70
|
|
|
79
71
|
.empty-placeholder {
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
height: 100%;
|
|
5
5
|
display: flex;
|
|
6
6
|
justify-content: center;
|
|
7
|
+
max-height: 65px;
|
|
8
|
+
|
|
7
9
|
// overflow: hidden;
|
|
8
10
|
&>img {
|
|
9
11
|
width: 100%;
|
|
10
|
-
height: 100%;
|
|
12
|
+
// height: 100%;
|
|
11
13
|
// object-fit: contain;
|
|
12
14
|
transition: all .2s linear;
|
|
13
15
|
vertical-align: initial;
|
|
@@ -303,14 +303,14 @@ function (_super) {
|
|
|
303
303
|
|
|
304
304
|
_this.getProductList = function (index) {
|
|
305
305
|
return __awaiter(_this, void 0, void 0, function () {
|
|
306
|
-
var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d,
|
|
306
|
+
var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d, prodType, _e, intelligentType, _f, intelligentValue, _g, maxProdNum, newData, params, res, res, e_1, _cache;
|
|
307
307
|
|
|
308
|
-
var
|
|
308
|
+
var _h, _j, _k;
|
|
309
309
|
|
|
310
310
|
var _this = this;
|
|
311
311
|
|
|
312
|
-
return __generator(this, function (
|
|
313
|
-
switch (
|
|
312
|
+
return __generator(this, function (_l) {
|
|
313
|
+
switch (_l.label) {
|
|
314
314
|
case 0:
|
|
315
315
|
panelProps = this.props.panelProps;
|
|
316
316
|
groupSource = this.state.groupSource;
|
|
@@ -322,7 +322,7 @@ function (_super) {
|
|
|
322
322
|
|
|
323
323
|
if (cache) {
|
|
324
324
|
if ("products" + index in cache) {
|
|
325
|
-
this.setState((
|
|
325
|
+
this.setState((_h = {}, _h["products" + index] = cache["products" + index], _h), function () {
|
|
326
326
|
_this.resetLayout();
|
|
327
327
|
});
|
|
328
328
|
/** 如果数据未过期 */
|
|
@@ -334,12 +334,12 @@ function (_super) {
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
_a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.
|
|
337
|
+
_a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.prodType, prodType = _d === void 0 ? '' : _d, _e = _a.intelligentType, intelligentType = _e === void 0 ? '' : _e, _f = _a.intelligentValue, intelligentValue = _f === void 0 ? [] : _f, _g = _a.maxProdNum, maxProdNum = _g === void 0 ? 10 : _g;
|
|
338
338
|
newData = [];
|
|
339
|
-
|
|
339
|
+
_l.label = 1;
|
|
340
340
|
|
|
341
341
|
case 1:
|
|
342
|
-
|
|
342
|
+
_l.trys.push([1, 9,, 10]);
|
|
343
343
|
|
|
344
344
|
if (!(groupSource.length > 0)) return [3
|
|
345
345
|
/*break*/
|
|
@@ -347,22 +347,25 @@ function (_super) {
|
|
|
347
347
|
if (!(sourceType === 'select')) return [3
|
|
348
348
|
/*break*/
|
|
349
349
|
, 3];
|
|
350
|
+
if (!prodIds) return [2
|
|
351
|
+
/*return*/
|
|
352
|
+
];
|
|
353
|
+
params = {
|
|
354
|
+
state: 'A'
|
|
355
|
+
};
|
|
350
356
|
|
|
351
|
-
if (
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
357
|
+
if (prodType === 'spu') {
|
|
358
|
+
params.offers = prodIds;
|
|
359
|
+
} else {
|
|
360
|
+
params.products = prodIds;
|
|
355
361
|
}
|
|
356
362
|
|
|
357
363
|
return [4
|
|
358
364
|
/*yield*/
|
|
359
|
-
, (0, _commonUtil.commonFetch)('/designer/v1/h5/products',
|
|
360
|
-
products: prodIds,
|
|
361
|
-
state: 'A'
|
|
362
|
-
}, 'GET')];
|
|
365
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/products', params, 'GET')];
|
|
363
366
|
|
|
364
367
|
case 2:
|
|
365
|
-
res =
|
|
368
|
+
res = _l.sent();
|
|
366
369
|
newData = __spreadArrays(res.list);
|
|
367
370
|
return [3
|
|
368
371
|
/*break*/
|
|
@@ -385,7 +388,7 @@ function (_super) {
|
|
|
385
388
|
}, 'POST')];
|
|
386
389
|
|
|
387
390
|
case 4:
|
|
388
|
-
res =
|
|
391
|
+
res = _l.sent();
|
|
389
392
|
newData = __spreadArrays(res.pageInfo.list);
|
|
390
393
|
return [3
|
|
391
394
|
/*break*/
|
|
@@ -393,7 +396,7 @@ function (_super) {
|
|
|
393
396
|
|
|
394
397
|
case 5:
|
|
395
398
|
newData = [];
|
|
396
|
-
|
|
399
|
+
_l.label = 6;
|
|
397
400
|
|
|
398
401
|
case 6:
|
|
399
402
|
return [3
|
|
@@ -402,7 +405,7 @@ function (_super) {
|
|
|
402
405
|
|
|
403
406
|
case 7:
|
|
404
407
|
newData = [];
|
|
405
|
-
|
|
408
|
+
_l.label = 8;
|
|
406
409
|
|
|
407
410
|
case 8:
|
|
408
411
|
return [3
|
|
@@ -410,7 +413,7 @@ function (_super) {
|
|
|
410
413
|
, 10];
|
|
411
414
|
|
|
412
415
|
case 9:
|
|
413
|
-
e_1 =
|
|
416
|
+
e_1 = _l.sent();
|
|
414
417
|
newData = [];
|
|
415
418
|
return [3
|
|
416
419
|
/*break*/
|
|
@@ -419,10 +422,10 @@ function (_super) {
|
|
|
419
422
|
case 10:
|
|
420
423
|
if (!(0, _coreUtil.isDesignMode)()) {
|
|
421
424
|
_cache = (0, _storeUtil.getMagicStore)("recommend_" + pageId + "_" + recommendId);
|
|
422
|
-
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (
|
|
425
|
+
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (_j = {}, _j["products" + index] = newData, _j.endTime = Date.now() + 3 * 60 * 1000, _j)));
|
|
423
426
|
}
|
|
424
427
|
|
|
425
|
-
this.setState((
|
|
428
|
+
this.setState((_k = {}, _k["products" + index] = newData, _k), function () {
|
|
426
429
|
_this.resetLayout();
|
|
427
430
|
});
|
|
428
431
|
return [2
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
.recommend-tab-select-wrap {
|
|
17
17
|
display: flex;
|
|
18
18
|
align-items: center;
|
|
19
|
-
height: 50px;
|
|
20
|
-
|
|
21
|
-
overflow: auto;
|
|
19
|
+
// height: 50px;
|
|
20
|
+
// overflow: auto;
|
|
22
21
|
position: relative;
|
|
23
22
|
width: fit-content;
|
|
24
23
|
margin: 0 auto;
|
|
@@ -62,6 +61,14 @@
|
|
|
62
61
|
.tab-list {
|
|
63
62
|
width: 100%;
|
|
64
63
|
}
|
|
64
|
+
|
|
65
|
+
.m-product-item-wrap {
|
|
66
|
+
border-radius: 8px;
|
|
67
|
+
|
|
68
|
+
.img-wrap {
|
|
69
|
+
border-radius: 8px 8px 0 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
.arrow-icon {
|
|
@@ -89,6 +96,10 @@
|
|
|
89
96
|
margin: 0;
|
|
90
97
|
}
|
|
91
98
|
|
|
99
|
+
.scrollContainer::-webkit-scrollbar {
|
|
100
|
+
display: none; /* Chrome, Safari, Opera */
|
|
101
|
+
}
|
|
102
|
+
|
|
92
103
|
.scrollContainer {
|
|
93
104
|
display: flex;
|
|
94
105
|
flex-direction: row;
|
|
@@ -96,6 +107,8 @@
|
|
|
96
107
|
flex: 1;
|
|
97
108
|
margin: 0;
|
|
98
109
|
overflow-x: auto;
|
|
110
|
+
scrollbar-width: none; /* Firefox */
|
|
111
|
+
-ms-overflow-style: none; /* IE 和 Edge */
|
|
99
112
|
padding-bottom: 15px;
|
|
100
113
|
|
|
101
114
|
&.pl_100 {
|
|
@@ -71,7 +71,7 @@ function (_super) {
|
|
|
71
71
|
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
72
72
|
data: panelProps.image,
|
|
73
73
|
needClickArea: false,
|
|
74
|
-
onlySpecificCode:
|
|
74
|
+
onlySpecificCode: ['CustomizedPage', 'FunctionPage']
|
|
75
75
|
}),
|
|
76
76
|
metaOption: panelProps.image
|
|
77
77
|
}];
|
|
@@ -102,6 +102,17 @@ var Renderer = function Renderer(props) {
|
|
|
102
102
|
toastState = _e[0],
|
|
103
103
|
setToastState = _e[1];
|
|
104
104
|
|
|
105
|
+
var timerRef = (0, _react.useRef)(null);
|
|
106
|
+
var isMountedRef = (0, _react.useRef)(true); // 使用 useMemo 来稳定 pageData 的引用,避免不必要的重新渲染
|
|
107
|
+
|
|
108
|
+
var pageDataKey = (0, _react.useMemo)(function () {
|
|
109
|
+
if (!pageData || !pageData.childNodes) return ''; // 创建一个稳定的标识符,基于 childNodes 的内容
|
|
110
|
+
|
|
111
|
+
return pageData.childNodes.map(function (node) {
|
|
112
|
+
return node.id + "-" + node.type;
|
|
113
|
+
}).join(',');
|
|
114
|
+
}, [pageData]);
|
|
115
|
+
|
|
105
116
|
if (!noSetWindow) {
|
|
106
117
|
setDesignConfig(props);
|
|
107
118
|
}
|
|
@@ -109,11 +120,21 @@ var Renderer = function Renderer(props) {
|
|
|
109
120
|
window.magicDesignPageData = pageData;
|
|
110
121
|
var pageBackground = window.magicDesign.pageBackground;
|
|
111
122
|
(0, _react.useEffect)(function () {
|
|
112
|
-
|
|
123
|
+
isMountedRef.current = true; // 清除之前的定时器
|
|
124
|
+
|
|
125
|
+
if (timerRef.current) {
|
|
126
|
+
clearTimeout(timerRef.current);
|
|
127
|
+
timerRef.current = null;
|
|
128
|
+
}
|
|
129
|
+
|
|
113
130
|
var filterData = [];
|
|
114
131
|
|
|
115
132
|
if (pageData && pageData.childNodes && pageData.childNodes.length) {
|
|
116
|
-
|
|
133
|
+
filterData = pageData.childNodes.filter(function (node) {
|
|
134
|
+
return (0, _coreUtil.isActiveFloor)(node.activeTerminal);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
var graduallySetFloors_1 = function graduallySetFloors_1(data, step, interval, start) {
|
|
117
138
|
if (step === void 0) {
|
|
118
139
|
step = 5;
|
|
119
140
|
}
|
|
@@ -124,6 +145,11 @@ var Renderer = function Renderer(props) {
|
|
|
124
145
|
|
|
125
146
|
if (start === void 0) {
|
|
126
147
|
start = 0;
|
|
148
|
+
} // 检查组件是否仍然挂载
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
if (!isMountedRef.current) {
|
|
152
|
+
return;
|
|
127
153
|
} // 计算这一步应该显示的最终索引
|
|
128
154
|
|
|
129
155
|
|
|
@@ -132,18 +158,29 @@ var Renderer = function Renderer(props) {
|
|
|
132
158
|
setFloors(data.slice(0, end)); // 如果还有更多楼层要显示,设置一个定时器来递归调用此函数
|
|
133
159
|
|
|
134
160
|
if (end < data.length) {
|
|
135
|
-
setTimeout(function () {
|
|
136
|
-
|
|
161
|
+
timerRef.current = setTimeout(function () {
|
|
162
|
+
graduallySetFloors_1(data, step, interval, end);
|
|
137
163
|
}, interval);
|
|
164
|
+
} else {
|
|
165
|
+
timerRef.current = null;
|
|
138
166
|
}
|
|
139
167
|
};
|
|
140
168
|
|
|
141
|
-
filterData
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
169
|
+
graduallySetFloors_1(filterData);
|
|
170
|
+
} else {
|
|
171
|
+
setFloors([]);
|
|
172
|
+
} // 清理函数:清除所有未完成的定时器
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
return function () {
|
|
176
|
+
isMountedRef.current = false;
|
|
177
|
+
|
|
178
|
+
if (timerRef.current) {
|
|
179
|
+
clearTimeout(timerRef.current);
|
|
180
|
+
timerRef.current = null;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
}, [pageDataKey]);
|
|
147
184
|
(0, _react.useEffect)(function () {
|
|
148
185
|
setTimeout(function () {
|
|
149
186
|
var _a;
|
|
@@ -219,7 +256,6 @@ var Renderer = function Renderer(props) {
|
|
|
219
256
|
};
|
|
220
257
|
};
|
|
221
258
|
|
|
222
|
-
console.log('window.magicDesign.designMode', window.magicDesign.designMode);
|
|
223
259
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
224
260
|
className: "render_wrap",
|
|
225
261
|
magic_design: "",
|
|
@@ -239,13 +275,17 @@ var Renderer = function Renderer(props) {
|
|
|
239
275
|
console.error("[MagicBox] Can not find type " + nodeData.type);
|
|
240
276
|
return;
|
|
241
277
|
}
|
|
242
|
-
/** 添加模块需要 给GA使用 */
|
|
243
278
|
|
|
279
|
+
console.log('----nodeData', nodeData, moduleIndex);
|
|
280
|
+
/** 添加模块需要 给GA使用 */
|
|
281
|
+
// 避免直接修改原始 nodeData,创建新对象
|
|
244
282
|
|
|
245
|
-
|
|
283
|
+
var nodeDataWithIndex = __assign(__assign({}, nodeData), {
|
|
284
|
+
moduleIndex: moduleIndex + 1
|
|
285
|
+
});
|
|
246
286
|
|
|
247
|
-
var newInstanceProps = __assign(__assign({},
|
|
248
|
-
nodeData:
|
|
287
|
+
var newInstanceProps = __assign(__assign({}, nodeDataWithIndex), {
|
|
288
|
+
nodeData: nodeDataWithIndex,
|
|
249
289
|
mode: 'renderer',
|
|
250
290
|
outputType: outputType
|
|
251
291
|
});
|
|
@@ -146,6 +146,10 @@ function (_super) {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
if (!data.buttonText.pcFontSize) {
|
|
150
|
+
data.buttonText.pcFontSize = 14;
|
|
151
|
+
}
|
|
152
|
+
|
|
149
153
|
var contentSetting = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
150
154
|
split: true,
|
|
151
155
|
title: "URL"
|
|
@@ -379,7 +379,7 @@ function (_super) {
|
|
|
379
379
|
})), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
380
380
|
title: (0, _locale.i18n)('BORDER_RADIUS')
|
|
381
381
|
}, /*#__PURE__*/_react["default"].createElement(_common.Slider, {
|
|
382
|
-
maxVal:
|
|
382
|
+
maxVal: 200,
|
|
383
383
|
minVal: 0,
|
|
384
384
|
onChange: function onChange(_a) {
|
|
385
385
|
var count = _a.count;
|
|
@@ -287,7 +287,7 @@ function (_super) {
|
|
|
287
287
|
},
|
|
288
288
|
unit: "px",
|
|
289
289
|
value: {
|
|
290
|
-
count: window.magicDesign.device == 'pc' ? textData.pcFontSize : textData.fontSize
|
|
290
|
+
count: window.magicDesign.device == 'pc' ? textData.pcFontSize || textData.fontSize : textData.fontSize
|
|
291
291
|
}
|
|
292
292
|
}))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
293
293
|
title: ""
|
package/lib/utils/coreUtil.js
CHANGED
|
@@ -350,8 +350,7 @@ var createProdCardModal = function createProdCardModal(ids) {
|
|
|
350
350
|
exports.createProdCardModal = createProdCardModal;
|
|
351
351
|
|
|
352
352
|
var createPictureModal = function createPictureModal(url) {
|
|
353
|
-
if (!url) return;
|
|
354
|
-
document.body.classList.add('no-scroll');
|
|
353
|
+
if (!url) return; // document.body.classList.add('no-scroll');
|
|
355
354
|
|
|
356
355
|
_mobx.frameStore.setState({
|
|
357
356
|
pictureModalState: {
|
|
@@ -368,8 +367,9 @@ var clickUrl = function clickUrl(url, state) {
|
|
|
368
367
|
|
|
369
368
|
if (url === void 0) {
|
|
370
369
|
url = '';
|
|
371
|
-
}
|
|
370
|
+
}
|
|
372
371
|
|
|
372
|
+
console.log('clickUrl....', url); // 只读模式,设计模式,url为空,邮箱模版
|
|
373
373
|
|
|
374
374
|
if (window.magicDesign.readOnly || window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
|
|
375
375
|
return;
|