@fonixtree/magic-design 0.0.93 → 0.0.96
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/composite-comp/bol/components/Banner/pc/index.js +1 -14
- package/es/composite-comp/bol/components/Carousel/imgs/pcDefImg1.png +0 -0
- package/es/composite-comp/bol/components/Carousel/mobile/index.js +6 -36
- package/es/composite-comp/bol/components/Carousel/mobile/index.less +12 -5
- package/es/composite-comp/bol/components/Carousel/pc/index.js +6 -36
- package/es/composite-comp/bol/components/Carousel/pc/index.less +12 -9
- package/es/composite-comp/bol/components/ImageGallery/imgs/defImg1.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/defImg2.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/defImg3.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/defImg4.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/defImg5.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/pcDefImg1.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/pcDefImg2.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/pcDefImg3.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/pcDefImg4.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/pcDefImg5.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/pcDefImg6.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/mobile/index.js +38 -14
- package/es/composite-comp/bol/components/ImageGallery/mobile/index.less +17 -13
- package/es/composite-comp/bol/components/ImageGallery/pc/index.js +41 -15
- package/es/composite-comp/bol/components/ImageGallery/pc/index.less +18 -13
- package/es/composite-comp/common/components/ProductItem/index.js +1 -1
- package/es/composite-comp/common/components/ProductItem/index.less +2 -0
- package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +8 -2
- package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -15
- package/es/composite-comp/dito/components/FlashDeal/pc/index.js +1 -15
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +21 -29
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +1 -0
- package/es/composite-comp/dito/components/Recommend/pc/index.js +31 -32
- package/es/composite-comp/dito/components/Recommend/pc/index.less +1 -0
- package/es/core/Designer/ViewArea/index.js +3 -1
- package/es/core/Designer/ViewArea/index.less +14 -3
- package/es/decorator/compositeDecorator.js +3 -2
- package/es/meta-comp/components/Image/image/h5DefImg.png +0 -0
- package/es/meta-comp/components/Image/image/h5Img.png +0 -0
- package/es/meta-comp/components/Image/image/pcDefImg.png +0 -0
- package/es/meta-comp/components/Image/image/pcImg.png +0 -0
- package/es/meta-comp/components/Image/index.js +6 -3
- package/lib/composite-comp/bol/components/Banner/pc/index.js +1 -14
- package/lib/composite-comp/bol/components/Carousel/imgs/pcDefImg1.png +0 -0
- package/lib/composite-comp/bol/components/Carousel/mobile/index.js +6 -36
- package/lib/composite-comp/bol/components/Carousel/mobile/index.less +12 -5
- package/lib/composite-comp/bol/components/Carousel/pc/index.js +6 -36
- package/lib/composite-comp/bol/components/Carousel/pc/index.less +12 -9
- package/lib/composite-comp/bol/components/ImageGallery/imgs/defImg1.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/defImg2.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/defImg3.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/defImg4.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/defImg5.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/pcDefImg1.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/pcDefImg2.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/pcDefImg3.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/pcDefImg4.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/pcDefImg5.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/pcDefImg6.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/mobile/index.js +38 -14
- package/lib/composite-comp/bol/components/ImageGallery/mobile/index.less +17 -13
- package/lib/composite-comp/bol/components/ImageGallery/pc/index.js +41 -15
- package/lib/composite-comp/bol/components/ImageGallery/pc/index.less +18 -13
- package/lib/composite-comp/common/components/ProductItem/index.js +1 -1
- package/lib/composite-comp/common/components/ProductItem/index.less +2 -0
- package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +8 -2
- package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -15
- package/lib/composite-comp/dito/components/FlashDeal/pc/index.js +1 -15
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +21 -29
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +1 -0
- package/lib/composite-comp/dito/components/Recommend/pc/index.js +31 -32
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +1 -0
- package/lib/core/Designer/ViewArea/index.js +3 -1
- package/lib/core/Designer/ViewArea/index.less +14 -3
- package/lib/decorator/compositeDecorator.js +3 -2
- package/lib/meta-comp/components/Image/image/h5DefImg.png +0 -0
- package/lib/meta-comp/components/Image/image/h5Img.png +0 -0
- package/lib/meta-comp/components/Image/image/pcDefImg.png +0 -0
- package/lib/meta-comp/components/Image/image/pcImg.png +0 -0
- package/lib/meta-comp/components/Image/index.js +6 -3
- package/package.json +1 -1
|
@@ -184,20 +184,7 @@ function (_super) {
|
|
|
184
184
|
|
|
185
185
|
BannerPc.prototype.componentWillUnmount = function () {
|
|
186
186
|
this.destroy();
|
|
187
|
-
};
|
|
188
|
-
// const { data } = this.props;
|
|
189
|
-
// const bgStyle = {
|
|
190
|
-
// justifyContent: alignItemMap[item.customize.layout],
|
|
191
|
-
// };
|
|
192
|
-
// if (item.background.bgType === 'color') {
|
|
193
|
-
// bgStyle.backgroundColor = getColorRgba(item.background.color || '#fff', item.background.opacity / 100 || 1);
|
|
194
|
-
// } else {
|
|
195
|
-
// bgStyle.backgroundImage = `url(${item.background.image})`;
|
|
196
|
-
// }
|
|
197
|
-
// if (data.setting.pcHeight) bgStyle.height = data.setting.pcHeight;
|
|
198
|
-
// return bgStyle;
|
|
199
|
-
// }
|
|
200
|
-
|
|
187
|
+
};
|
|
201
188
|
|
|
202
189
|
BannerPc.prototype.render = function () {
|
|
203
190
|
var _this = this;
|
|
Binary file
|
|
@@ -13,14 +13,10 @@ var _reactSlick = _interopRequireDefault(require("react-slick"));
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
-
var _lodash = require("lodash");
|
|
17
|
-
|
|
18
16
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
19
17
|
|
|
20
18
|
var _components = require("../../../../../meta-comp/components");
|
|
21
19
|
|
|
22
|
-
var _commonUtil = require("../../../../../utils/commonUtil");
|
|
23
|
-
|
|
24
20
|
require("slick-carousel/slick/slick.css");
|
|
25
21
|
|
|
26
22
|
require("slick-carousel/slick/slick-theme.css");
|
|
@@ -99,19 +95,11 @@ function (_super) {
|
|
|
99
95
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
100
96
|
|
|
101
97
|
_this.state = {
|
|
102
|
-
sliderIndex: 0
|
|
103
|
-
contentWidth: 0
|
|
98
|
+
sliderIndex: 0
|
|
104
99
|
};
|
|
105
100
|
_this.sliderRef = /*#__PURE__*/_react["default"].createRef();
|
|
106
101
|
_this.destroy = null;
|
|
107
102
|
|
|
108
|
-
_this.listenWidth = function () {
|
|
109
|
-
var renderContainer = document.querySelector('.composite_wrap');
|
|
110
|
-
if (renderContainer) _this.setState({
|
|
111
|
-
contentWidth: renderContainer.offsetWidth
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
|
|
115
103
|
_this.sliderGoTo = function (groupSource) {
|
|
116
104
|
var nextIndex = groupSource.findIndex(function (item) {
|
|
117
105
|
return item.id === _mobx.store.clickedGroup;
|
|
@@ -173,8 +161,6 @@ function (_super) {
|
|
|
173
161
|
_this.sliderRef.slickPause();
|
|
174
162
|
}
|
|
175
163
|
});
|
|
176
|
-
this.listenWidth();
|
|
177
|
-
window.addEventListener('resize', (0, _lodash.debounce)(this.listenWidth));
|
|
178
164
|
};
|
|
179
165
|
|
|
180
166
|
CarouselMobile.prototype.componentWillReceiveProps = function (nextProps) {
|
|
@@ -195,24 +181,9 @@ function (_super) {
|
|
|
195
181
|
var _this = this;
|
|
196
182
|
|
|
197
183
|
var data = this.props.data;
|
|
198
|
-
var
|
|
199
|
-
sliderIndex = _a.sliderIndex,
|
|
200
|
-
contentWidth = _a.contentWidth;
|
|
184
|
+
var sliderIndex = this.state.sliderIndex;
|
|
201
185
|
var showText = data.customize.layout === 'layout2';
|
|
202
186
|
var colNum = showText ? 1 : Math.min(data.customize.rowNum, data.groupSource.length);
|
|
203
|
-
var bgStyle = {};
|
|
204
|
-
|
|
205
|
-
if (data.background.bgType === 'color') {
|
|
206
|
-
bgStyle = {
|
|
207
|
-
backgroundColor: (0, _commonUtil.getColorRgba)(data.background.color || '#fff', data.background.opacity / 100 || 1)
|
|
208
|
-
};
|
|
209
|
-
} else {
|
|
210
|
-
bgStyle = {
|
|
211
|
-
background: "url(" + data.background.image + ") no-repeat center",
|
|
212
|
-
backgroundSize: '100%'
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
|
|
216
187
|
var autoplay = data.setting.autoplay.open;
|
|
217
188
|
/** 设计器模式下 如果选中特定group 自动播放关闭 */
|
|
218
189
|
|
|
@@ -236,14 +207,13 @@ function (_super) {
|
|
|
236
207
|
});
|
|
237
208
|
}
|
|
238
209
|
};
|
|
239
|
-
var spacing = data.spacing[window.magicDesign.device];
|
|
240
210
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
241
|
-
className: "m-carousel-mobile"
|
|
242
|
-
style: bgStyle
|
|
211
|
+
className: "m-carousel-mobile"
|
|
243
212
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
244
|
-
className: "content
|
|
213
|
+
className: (0, _classnames["default"])('content', {
|
|
214
|
+
isHorizontal: colNum === 1
|
|
215
|
+
}),
|
|
245
216
|
style: {
|
|
246
|
-
width: contentWidth - spacing.paddingLeft - spacing.paddingRight,
|
|
247
217
|
paddingBottom: data.setting.dots.open && data.groupSource.length / colNum > 1 ? '20px' : '0'
|
|
248
218
|
}
|
|
249
219
|
}, /*#__PURE__*/_react["default"].createElement(_reactSlick["default"], _extends({
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
.content {
|
|
6
6
|
display: flex;
|
|
7
7
|
margin: 0 auto;
|
|
8
|
+
|
|
9
|
+
&.isHorizontal {
|
|
10
|
+
.slick-track {
|
|
11
|
+
gap: 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
.slider-wrap {
|
|
@@ -12,6 +18,12 @@
|
|
|
12
18
|
margin: 0 auto;
|
|
13
19
|
line-height: 1;
|
|
14
20
|
|
|
21
|
+
.slick-track {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 12px;
|
|
25
|
+
}
|
|
26
|
+
|
|
15
27
|
.img-wrap {
|
|
16
28
|
.img {
|
|
17
29
|
width: fit-content;
|
|
@@ -49,11 +61,6 @@
|
|
|
49
61
|
}
|
|
50
62
|
}
|
|
51
63
|
}
|
|
52
|
-
|
|
53
|
-
.slick-track {
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
}
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
.swiper-ban {
|
|
@@ -13,16 +13,12 @@ var _reactSlick = _interopRequireDefault(require("react-slick"));
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
-
var _lodash = require("lodash");
|
|
17
|
-
|
|
18
16
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
19
17
|
|
|
20
18
|
var _mobx = require("../../../../../mobx");
|
|
21
19
|
|
|
22
20
|
var _components = require("../../../../../meta-comp/components");
|
|
23
21
|
|
|
24
|
-
var _commonUtil = require("../../../../../utils/commonUtil");
|
|
25
|
-
|
|
26
22
|
var _Iconfont = _interopRequireDefault(require("../../../../../common/Iconfont"));
|
|
27
23
|
|
|
28
24
|
require("slick-carousel/slick/slick.css");
|
|
@@ -100,19 +96,11 @@ function (_super) {
|
|
|
100
96
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
101
97
|
|
|
102
98
|
_this.state = {
|
|
103
|
-
sliderIndex: 0
|
|
104
|
-
contentWidth: 0
|
|
99
|
+
sliderIndex: 0
|
|
105
100
|
};
|
|
106
101
|
_this.sliderRef = /*#__PURE__*/_react["default"].createRef();
|
|
107
102
|
_this.destroy = null;
|
|
108
103
|
|
|
109
|
-
_this.listenWidth = function () {
|
|
110
|
-
var renderContainer = document.querySelector('.composite_wrap');
|
|
111
|
-
if (renderContainer) _this.setState({
|
|
112
|
-
contentWidth: renderContainer.offsetWidth
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
|
|
116
104
|
_this.sliderGoTo = function (groupSource) {
|
|
117
105
|
var nextIndex = groupSource.findIndex(function (item) {
|
|
118
106
|
return item.id === _mobx.store.clickedGroup;
|
|
@@ -166,8 +154,6 @@ function (_super) {
|
|
|
166
154
|
_this.sliderRef.slickPause();
|
|
167
155
|
}
|
|
168
156
|
});
|
|
169
|
-
this.listenWidth();
|
|
170
|
-
window.addEventListener('resize', (0, _lodash.debounce)(this.listenWidth));
|
|
171
157
|
};
|
|
172
158
|
|
|
173
159
|
CarouselPc.prototype.componentWillReceiveProps = function (nextProps) {
|
|
@@ -188,24 +174,9 @@ function (_super) {
|
|
|
188
174
|
var _this = this;
|
|
189
175
|
|
|
190
176
|
var data = this.props.data;
|
|
191
|
-
var
|
|
192
|
-
sliderIndex = _a.sliderIndex,
|
|
193
|
-
contentWidth = _a.contentWidth;
|
|
177
|
+
var sliderIndex = this.state.sliderIndex;
|
|
194
178
|
var showText = data.customize.layout === 'layout2';
|
|
195
179
|
var colNum = showText ? 1 : Math.min(data.customize.pcRowNum, data.groupSource.length);
|
|
196
|
-
var bgStyle = {};
|
|
197
|
-
|
|
198
|
-
if (data.background.bgType === 'color') {
|
|
199
|
-
bgStyle = {
|
|
200
|
-
backgroundColor: (0, _commonUtil.getColorRgba)(data.background.color || '#fff', data.background.opacity / 100 || 1)
|
|
201
|
-
};
|
|
202
|
-
} else {
|
|
203
|
-
bgStyle = {
|
|
204
|
-
background: "url(" + data.background.image + ") no-repeat center",
|
|
205
|
-
backgroundSize: '100%'
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
180
|
var autoplay = data.setting.autoplay.open;
|
|
210
181
|
/** 设计器模式下 如果选中特定group 自动播放关闭 */
|
|
211
182
|
|
|
@@ -233,14 +204,13 @@ function (_super) {
|
|
|
233
204
|
fontSize: data.setting.navigation.size,
|
|
234
205
|
color: data.setting.navigation.color
|
|
235
206
|
};
|
|
236
|
-
var spacing = data.spacing[window.magicDesign.device];
|
|
237
207
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
238
|
-
className: "m-carousel-pc"
|
|
239
|
-
style: bgStyle
|
|
208
|
+
className: "m-carousel-pc"
|
|
240
209
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
241
|
-
className: "content
|
|
210
|
+
className: (0, _classnames["default"])('content', {
|
|
211
|
+
isHorizontal: colNum === 1
|
|
212
|
+
}),
|
|
242
213
|
style: {
|
|
243
|
-
width: contentWidth - spacing.paddingLeft - spacing.paddingRight,
|
|
244
214
|
paddingBottom: data.setting.dots.open && data.groupSource.length / colNum > 1 ? '30px' : '0'
|
|
245
215
|
}
|
|
246
216
|
}, data.setting.navigation.open && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
.content {
|
|
6
6
|
display: flex;
|
|
7
7
|
margin: 0 auto;
|
|
8
|
+
|
|
9
|
+
&.isHorizontal {
|
|
10
|
+
.slick-track {
|
|
11
|
+
gap: 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
.carousel-icon-left {
|
|
@@ -22,13 +28,15 @@
|
|
|
22
28
|
margin: 0 auto;
|
|
23
29
|
line-height: 1;
|
|
24
30
|
|
|
25
|
-
.
|
|
26
|
-
|
|
31
|
+
.slick-track {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 24px;
|
|
35
|
+
}
|
|
27
36
|
|
|
37
|
+
.img-wrap {
|
|
28
38
|
.img {
|
|
29
39
|
width: fit-content;
|
|
30
|
-
height: fit-content;
|
|
31
|
-
display: block;
|
|
32
40
|
margin: 0 auto;
|
|
33
41
|
}
|
|
34
42
|
|
|
@@ -61,11 +69,6 @@
|
|
|
61
69
|
}
|
|
62
70
|
}
|
|
63
71
|
}
|
|
64
|
-
|
|
65
|
-
.slick-track {
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
}
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
.swiper-ban {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -41,6 +41,20 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
41
41
|
};
|
|
42
42
|
}();
|
|
43
43
|
|
|
44
|
+
var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
45
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
|
|
46
|
+
s += arguments[i].length;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
|
50
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
|
51
|
+
r[k] = a[j];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return r;
|
|
56
|
+
};
|
|
57
|
+
|
|
44
58
|
var MOBILE_IMG_SIZE = {
|
|
45
59
|
1: {
|
|
46
60
|
maxW: 343,
|
|
@@ -85,26 +99,36 @@ function (_super) {
|
|
|
85
99
|
var data = this.props.data;
|
|
86
100
|
var isHorizontal = data.customize.layout.h5Layout === 'layout2';
|
|
87
101
|
var colNum = isHorizontal ? data.customize.rowNum : 1;
|
|
102
|
+
var newData = data.groupSource.reduce(function (prev, curr, index) {
|
|
103
|
+
var i = Math.floor(index / colNum);
|
|
104
|
+
prev[i] = __spreadArrays(prev[i] || [], [curr]);
|
|
105
|
+
return prev;
|
|
106
|
+
}, []);
|
|
88
107
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
89
108
|
className: "m-image-gallery-mobile"
|
|
90
109
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
91
|
-
className:
|
|
92
|
-
|
|
93
|
-
}),
|
|
94
|
-
style: {
|
|
95
|
-
gap: MOBILE_IMG_SIZE[colNum].gap
|
|
96
|
-
}
|
|
97
|
-
}, data.groupSource.map(function (m) {
|
|
110
|
+
className: "content"
|
|
111
|
+
}, newData.map(function (arr, index) {
|
|
98
112
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
99
|
-
key:
|
|
100
|
-
className: "
|
|
113
|
+
key: index,
|
|
114
|
+
className: (0, _classnames["default"])('line', {
|
|
115
|
+
isHorizontal: isHorizontal
|
|
116
|
+
}),
|
|
101
117
|
style: {
|
|
102
|
-
|
|
118
|
+
gap: MOBILE_IMG_SIZE[colNum].gap
|
|
103
119
|
}
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
120
|
+
}, arr.map(function (item) {
|
|
121
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
122
|
+
key: item.id,
|
|
123
|
+
className: "img-wrap",
|
|
124
|
+
style: {
|
|
125
|
+
width: "calc((100% - " + MOBILE_IMG_SIZE[colNum].gap * (colNum - 1) + "px) / " + colNum + ")"
|
|
126
|
+
}
|
|
127
|
+
}, /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
|
|
128
|
+
data: item.image,
|
|
129
|
+
maxHeight: MOBILE_IMG_SIZE[colNum].maxH,
|
|
130
|
+
maxWidth: MOBILE_IMG_SIZE[colNum].maxW
|
|
131
|
+
}));
|
|
108
132
|
}));
|
|
109
133
|
})));
|
|
110
134
|
};
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
.m-image-gallery-mobile {
|
|
2
|
-
overflow-x: auto;
|
|
3
|
-
|
|
4
2
|
.content {
|
|
5
|
-
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
flex-wrap: wrap;
|
|
8
|
-
width: 345px;
|
|
3
|
+
max-width: 345px;
|
|
9
4
|
margin: 0 auto;
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
.line {
|
|
7
|
+
margin-bottom: 12px;
|
|
8
|
+
|
|
9
|
+
&.isHorizontal {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:last-child {
|
|
15
|
+
margin-bottom: 0;
|
|
16
|
+
}
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
.img-wrap {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
}
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
}
|
|
@@ -41,10 +41,24 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
41
41
|
};
|
|
42
42
|
}();
|
|
43
43
|
|
|
44
|
+
var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
45
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
|
|
46
|
+
s += arguments[i].length;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
|
50
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
|
51
|
+
r[k] = a[j];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return r;
|
|
56
|
+
};
|
|
57
|
+
|
|
44
58
|
var PC_IMG_SIZE = {
|
|
45
59
|
1: {
|
|
46
60
|
minW: 150,
|
|
47
|
-
maxW:
|
|
61
|
+
maxW: 1280,
|
|
48
62
|
minH: 150,
|
|
49
63
|
maxH: 960,
|
|
50
64
|
gap: 20
|
|
@@ -102,26 +116,38 @@ function (_super) {
|
|
|
102
116
|
var data = this.props.data;
|
|
103
117
|
var isHorizontal = data.customize.layout.pcLayout === 'layout2';
|
|
104
118
|
var colNum = isHorizontal ? data.customize.pcRowNum : 1;
|
|
119
|
+
var newData = data.groupSource.reduce(function (prev, curr, index) {
|
|
120
|
+
var i = Math.floor(index / colNum);
|
|
121
|
+
prev[i] = __spreadArrays(prev[i] || [], [curr]);
|
|
122
|
+
return prev;
|
|
123
|
+
}, []);
|
|
105
124
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
106
125
|
className: "m-image-gallery-pc"
|
|
107
126
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
108
|
-
className:
|
|
109
|
-
|
|
110
|
-
}),
|
|
111
|
-
style: {
|
|
112
|
-
gap: PC_IMG_SIZE[colNum].gap
|
|
113
|
-
}
|
|
114
|
-
}, data.groupSource.map(function (m) {
|
|
127
|
+
className: "content"
|
|
128
|
+
}, newData.map(function (arr, index) {
|
|
115
129
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
116
|
-
key:
|
|
117
|
-
className: "
|
|
130
|
+
key: index,
|
|
131
|
+
className: (0, _classnames["default"])('line', {
|
|
132
|
+
isHorizontal: isHorizontal
|
|
133
|
+
}),
|
|
118
134
|
style: {
|
|
119
|
-
|
|
135
|
+
gap: PC_IMG_SIZE[colNum].gap
|
|
120
136
|
}
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
137
|
+
}, arr.map(function (item) {
|
|
138
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
139
|
+
key: item.id,
|
|
140
|
+
className: "img-wrap",
|
|
141
|
+
style: {
|
|
142
|
+
width: "calc((100% - " + PC_IMG_SIZE[colNum].gap * (colNum - 1) + "px) / " + colNum + ")"
|
|
143
|
+
}
|
|
144
|
+
}, /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
|
|
145
|
+
data: item.image,
|
|
146
|
+
maxHeight: PC_IMG_SIZE[colNum].maxH,
|
|
147
|
+
maxWidth: PC_IMG_SIZE[colNum].maxW,
|
|
148
|
+
minHeight: PC_IMG_SIZE[colNum].minH,
|
|
149
|
+
minWidth: PC_IMG_SIZE[colNum].minW
|
|
150
|
+
}));
|
|
125
151
|
}));
|
|
126
152
|
})));
|
|
127
153
|
};
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
.m-image-gallery-pc {
|
|
2
|
-
overflow-x: auto;
|
|
3
|
-
|
|
4
2
|
.content {
|
|
5
|
-
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
flex-wrap: wrap;
|
|
8
|
-
width: 1280px;
|
|
3
|
+
max-width: 1280px;
|
|
9
4
|
margin: 0 auto;
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
.line {
|
|
7
|
+
margin-bottom: 20px;
|
|
8
|
+
|
|
9
|
+
&.isHorizontal {
|
|
10
|
+
margin-bottom: 24px;
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: flex-start;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&:last-child {
|
|
16
|
+
margin-bottom: 0;
|
|
17
|
+
}
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
.img-wrap {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
}
|
|
@@ -167,7 +167,7 @@ function (_super) {
|
|
|
167
167
|
className: "content-wrap"
|
|
168
168
|
}, panelProps.label.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
169
169
|
className: "promotions-wrap"
|
|
170
|
-
},
|
|
170
|
+
}, ['promotion', 'recommend', 'helloworld'].map(function (promot, index) {
|
|
171
171
|
return /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
172
172
|
key: index,
|
|
173
173
|
className: "promotion-item",
|
|
@@ -185,9 +185,15 @@ function (_super) {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
CustomizeConfig.prototype.componentDidMount = function () {
|
|
188
|
-
var _a
|
|
188
|
+
var _a = this.props,
|
|
189
|
+
selectedLayoutFun = _a.selectedLayoutFun,
|
|
190
|
+
data = _a.data;
|
|
189
191
|
|
|
190
|
-
|
|
192
|
+
if (selectedLayoutFun) {
|
|
193
|
+
this.onInit((0, _coreUtil.isPc)() ? data.layout.pcLayout : data.layout.h5Layout);
|
|
194
|
+
} else {
|
|
195
|
+
this.onInit(data.layout);
|
|
196
|
+
}
|
|
191
197
|
};
|
|
192
198
|
|
|
193
199
|
CustomizeConfig.prototype.render = function () {
|
|
@@ -383,22 +383,8 @@ function (_super) {
|
|
|
383
383
|
|
|
384
384
|
var _list = list.length === 0 && (0, _coreUtil.isDesignMode)() ? defaultData : list;
|
|
385
385
|
|
|
386
|
-
var bgStyle = {};
|
|
387
|
-
|
|
388
|
-
if (panelProps.background.bgType === 'color') {
|
|
389
|
-
bgStyle = {
|
|
390
|
-
backgroundColor: (0, _commonUtil.getColorRgba)(panelProps.background.color || '#fff', panelProps.background.opacity / 100 || 1)
|
|
391
|
-
};
|
|
392
|
-
} else {
|
|
393
|
-
bgStyle = {
|
|
394
|
-
background: "url(" + panelProps.background.image + ") no-repeat center",
|
|
395
|
-
backgroundSize: '100%'
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
|
|
399
386
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _list.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
400
|
-
className: "m-flash-deal-mobile"
|
|
401
|
-
style: bgStyle
|
|
387
|
+
className: "m-flash-deal-mobile"
|
|
402
388
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
403
389
|
className: "flash-deal-title"
|
|
404
390
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -484,24 +484,10 @@ function (_super) {
|
|
|
484
484
|
|
|
485
485
|
var _list = list.length === 0 && (0, _coreUtil.isDesignMode)() ? defaultData : list;
|
|
486
486
|
|
|
487
|
-
var bgStyle = {};
|
|
488
|
-
|
|
489
|
-
if (panelProps.background.bgType === 'color') {
|
|
490
|
-
bgStyle = {
|
|
491
|
-
backgroundColor: (0, _commonUtil.getColorRgba)(panelProps.background.color || '#fff', panelProps.background.opacity / 100 || 1)
|
|
492
|
-
};
|
|
493
|
-
} else {
|
|
494
|
-
bgStyle = {
|
|
495
|
-
background: "url(" + panelProps.background.image + ") no-repeat center",
|
|
496
|
-
backgroundSize: '100%'
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
|
|
500
487
|
var imgHeight = panelProps.customize.pcRowNum === 6 ? 153 : 193;
|
|
501
488
|
var imgWidth = panelProps.customize.pcRowNum === 6 ? 153 : 193;
|
|
502
489
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _list.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
503
|
-
className: "m-flash-deal-pc"
|
|
504
|
-
style: bgStyle
|
|
490
|
+
className: "m-flash-deal-pc"
|
|
505
491
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
506
492
|
className: "flash-deal-title"
|
|
507
493
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|