@fonixtree/magic-design 0.0.160 → 0.0.162
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/ImageModal/index.js +9 -37
- package/es/common/SwiperBan/index.less +1 -1
- package/es/common/Video/index.js +79 -19
- package/es/common/Video/index.less +14 -0
- package/es/composite-comp/bol/components/Banner/defaultJSON.js +2 -6
- package/es/composite-comp/bol/components/Video/components/VideoTag/index.js +3 -1
- package/es/composite-comp/bol/components/Video/components/VideoTag/index.less +4 -0
- package/es/composite-comp/bol/components/Video/defaultJSON.js +4 -8
- package/es/composite-comp/bol/components/Video/mobile/Layout1/index.js +30 -21
- package/es/composite-comp/bol/components/Video/mobile/Layout2/index.js +29 -21
- package/es/composite-comp/bol/components/Video/mobile/Layout2/index.less +1 -1
- package/es/composite-comp/bol/components/Video/mobile/Layout3/index.js +30 -21
- package/es/composite-comp/bol/components/Video/mobile/Layout3/index.less +2 -2
- package/es/composite-comp/bol/components/Video/pc/Layout1/index.js +30 -21
- package/es/composite-comp/bol/components/Video/pc/Layout2/index.js +41 -40
- package/es/composite-comp/bol/components/Video/pc/Layout3/index.js +33 -24
- package/es/composite-comp/bol/components/Video/pc/Layout4/index.js +30 -21
- package/es/composite-comp/bol/components/Video/pc/Layout5/index.js +30 -21
- package/es/core/Designer/PageCompList/index.js +34 -14
- package/es/utils/commonUtil.js +27 -2
- package/lib/common/ImageModal/index.js +9 -37
- package/lib/common/SwiperBan/index.less +1 -1
- package/lib/common/Video/index.js +79 -19
- package/lib/common/Video/index.less +14 -0
- package/lib/composite-comp/bol/components/Banner/defaultJSON.js +2 -6
- package/lib/composite-comp/bol/components/Video/components/VideoTag/index.js +3 -1
- package/lib/composite-comp/bol/components/Video/components/VideoTag/index.less +4 -0
- package/lib/composite-comp/bol/components/Video/defaultJSON.js +4 -8
- package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.js +30 -21
- package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.js +29 -21
- package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.less +1 -1
- package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.js +30 -21
- package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.less +2 -2
- package/lib/composite-comp/bol/components/Video/pc/Layout1/index.js +30 -21
- package/lib/composite-comp/bol/components/Video/pc/Layout2/index.js +41 -40
- package/lib/composite-comp/bol/components/Video/pc/Layout3/index.js +33 -24
- package/lib/composite-comp/bol/components/Video/pc/Layout4/index.js +30 -21
- package/lib/composite-comp/bol/components/Video/pc/Layout5/index.js +30 -21
- package/lib/core/Designer/PageCompList/index.js +34 -14
- package/lib/utils/commonUtil.js +27 -2
- package/package.json +1 -1
|
@@ -77,6 +77,27 @@ function (_super) {
|
|
|
77
77
|
/** 视频ref映射 */
|
|
78
78
|
|
|
79
79
|
_this.videoRefMap = {};
|
|
80
|
+
|
|
81
|
+
_this.playOrPause = function (group) {
|
|
82
|
+
(0, _commonUtil.ensure)(function () {
|
|
83
|
+
if (_this.videoRefMap[group.id].playing) {
|
|
84
|
+
_this.videoRefMap[group.id].playing = false;
|
|
85
|
+
|
|
86
|
+
_this.videoRefMap[group.id].el.player.pause();
|
|
87
|
+
} else {
|
|
88
|
+
if (group.video.playPosition == 'Popup') {
|
|
89
|
+
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
90
|
+
} else {
|
|
91
|
+
_this.videoRefMap[group.id].playing = true;
|
|
92
|
+
|
|
93
|
+
_this.videoRefMap[group.id].el.player.play();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_this.setState({});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
80
101
|
return _this;
|
|
81
102
|
}
|
|
82
103
|
|
|
@@ -90,7 +111,7 @@ function (_super) {
|
|
|
90
111
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
91
112
|
className: "video-pc-layout1-wrap"
|
|
92
113
|
}, /*#__PURE__*/_react["default"].createElement("div", null, data.groupSource.map(function (group) {
|
|
93
|
-
var _a;
|
|
114
|
+
var _a, _b;
|
|
94
115
|
/** 当前是否在播放 */
|
|
95
116
|
|
|
96
117
|
|
|
@@ -98,25 +119,6 @@ function (_super) {
|
|
|
98
119
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
99
120
|
key: group.id,
|
|
100
121
|
className: "video-item-wrap",
|
|
101
|
-
onClick: function onClick() {
|
|
102
|
-
(0, _commonUtil.ensure)(function () {
|
|
103
|
-
if (_this.videoRefMap[group.id].playing) {
|
|
104
|
-
_this.videoRefMap[group.id].playing = false;
|
|
105
|
-
|
|
106
|
-
_this.videoRefMap[group.id].el.player.pause();
|
|
107
|
-
} else {
|
|
108
|
-
if (group.video.playPosition == 'Popup') {
|
|
109
|
-
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
110
|
-
} else {
|
|
111
|
-
_this.videoRefMap[group.id].playing = true;
|
|
112
|
-
|
|
113
|
-
_this.videoRefMap[group.id].el.player.play();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
_this.setState({});
|
|
118
|
-
});
|
|
119
|
-
},
|
|
120
122
|
style: {
|
|
121
123
|
height: data.pcHeight
|
|
122
124
|
}
|
|
@@ -135,9 +137,13 @@ function (_super) {
|
|
|
135
137
|
cover: (0, _coreUtil.getVideoCover)(group),
|
|
136
138
|
source: group.video.sourceUrl
|
|
137
139
|
}),
|
|
140
|
+
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
138
141
|
videoId: group.id
|
|
139
142
|
}), !isPlaying && group.video.playButton == 'Middle' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
140
|
-
className: "play-btn center"
|
|
143
|
+
className: "play-btn center",
|
|
144
|
+
onClick: function onClick() {
|
|
145
|
+
_this.playOrPause(group);
|
|
146
|
+
}
|
|
141
147
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
142
148
|
alt: "",
|
|
143
149
|
src: _playCircle["default"]
|
|
@@ -145,6 +151,9 @@ function (_super) {
|
|
|
145
151
|
align: data.customize.align,
|
|
146
152
|
data: group,
|
|
147
153
|
noShare: true,
|
|
154
|
+
onPlayClick: function onPlayClick() {
|
|
155
|
+
return _this.playOrPause(group);
|
|
156
|
+
},
|
|
148
157
|
padding: 48
|
|
149
158
|
}), data.share.open && !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
150
159
|
data: __assign({
|
|
@@ -79,6 +79,27 @@ function (_super) {
|
|
|
79
79
|
/** 视频ref映射 */
|
|
80
80
|
|
|
81
81
|
_this.videoRefMap = {};
|
|
82
|
+
|
|
83
|
+
_this.playOrPause = function (group) {
|
|
84
|
+
(0, _commonUtil.ensure)(function () {
|
|
85
|
+
if (_this.videoRefMap[group.id].playing) {
|
|
86
|
+
_this.videoRefMap[group.id].playing = false;
|
|
87
|
+
|
|
88
|
+
_this.videoRefMap[group.id].el.player.pause();
|
|
89
|
+
} else {
|
|
90
|
+
if (group.video.playPosition == 'Popup') {
|
|
91
|
+
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
92
|
+
} else {
|
|
93
|
+
_this.videoRefMap[group.id].playing = true;
|
|
94
|
+
|
|
95
|
+
_this.videoRefMap[group.id].el.player.play();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_this.setState({});
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
82
103
|
return _this;
|
|
83
104
|
}
|
|
84
105
|
|
|
@@ -102,22 +123,7 @@ function (_super) {
|
|
|
102
123
|
}
|
|
103
124
|
}, firstGroup && /*#__PURE__*/_react["default"].createElement("div", {
|
|
104
125
|
key: firstGroup.id,
|
|
105
|
-
className: "video-left-wrap"
|
|
106
|
-
onClick: function onClick() {
|
|
107
|
-
(0, _commonUtil.ensure)(function () {
|
|
108
|
-
if (_this.videoRefMap[firstGroup.id].playing) {
|
|
109
|
-
_this.videoRefMap[firstGroup.id].playing = false;
|
|
110
|
-
|
|
111
|
-
_this.videoRefMap[firstGroup.id].el.player.pause();
|
|
112
|
-
} else {
|
|
113
|
-
_this.videoRefMap[firstGroup.id].playing = true;
|
|
114
|
-
|
|
115
|
-
_this.videoRefMap[firstGroup.id].el.player.play();
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
_this.setState({});
|
|
119
|
-
});
|
|
120
|
-
}
|
|
126
|
+
className: "video-left-wrap"
|
|
121
127
|
}, /*#__PURE__*/_react["default"].createElement(_common.Video, {
|
|
122
128
|
ref: function ref(el) {
|
|
123
129
|
if (!_this.videoRefMap[firstGroup.id]) {
|
|
@@ -133,9 +139,13 @@ function (_super) {
|
|
|
133
139
|
cover: (0, _coreUtil.isPc)() ? firstGroup.overilay.content.pcImgSrc : firstGroup.overilay.content.h5ImgSrc,
|
|
134
140
|
source: firstGroup.video.sourceUrl
|
|
135
141
|
}),
|
|
142
|
+
play: isFirstGroupPlaying,
|
|
136
143
|
videoId: firstGroup.id
|
|
137
144
|
}), !isFirstGroupPlaying && firstGroup.video.playButton == 'Middle' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
138
|
-
className: "play-btn center"
|
|
145
|
+
className: "play-btn center",
|
|
146
|
+
onClick: function onClick() {
|
|
147
|
+
_this.playOrPause(firstGroup);
|
|
148
|
+
}
|
|
139
149
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
140
150
|
alt: "",
|
|
141
151
|
src: _playCircle["default"]
|
|
@@ -143,37 +153,21 @@ function (_super) {
|
|
|
143
153
|
align: data.customize.align,
|
|
144
154
|
data: firstGroup,
|
|
145
155
|
noShare: true,
|
|
156
|
+
onPlayClick: function onPlayClick() {
|
|
157
|
+
return _this.playOrPause(firstGroup);
|
|
158
|
+
},
|
|
146
159
|
padding: 32
|
|
147
160
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
148
161
|
className: "right-list-wrap"
|
|
149
162
|
}, data.groupSource.slice(1).map(function (group) {
|
|
150
|
-
var _a;
|
|
163
|
+
var _a, _b;
|
|
151
164
|
/** 当前是否在播放 */
|
|
152
165
|
|
|
153
166
|
|
|
154
167
|
var isPlaying = !!((_a = _this.videoRefMap[group.id]) === null || _a === void 0 ? void 0 : _a.playing);
|
|
155
168
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
169
|
key: group.id,
|
|
157
|
-
className: "video-item-wrap"
|
|
158
|
-
onClick: function onClick() {
|
|
159
|
-
(0, _commonUtil.ensure)(function () {
|
|
160
|
-
if (_this.videoRefMap[group.id].playing) {
|
|
161
|
-
_this.videoRefMap[group.id].playing = false;
|
|
162
|
-
|
|
163
|
-
_this.videoRefMap[group.id].el.player.pause();
|
|
164
|
-
} else {
|
|
165
|
-
if (group.video.playPosition == 'Popup') {
|
|
166
|
-
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
167
|
-
} else {
|
|
168
|
-
_this.videoRefMap[group.id].playing = true;
|
|
169
|
-
|
|
170
|
-
_this.videoRefMap[group.id].el.player.play();
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
_this.setState({});
|
|
175
|
-
});
|
|
176
|
-
}
|
|
170
|
+
className: "video-item-wrap"
|
|
177
171
|
}, /*#__PURE__*/_react["default"].createElement(_common.Video, {
|
|
178
172
|
ref: function ref(el) {
|
|
179
173
|
if (!_this.videoRefMap[group.id]) {
|
|
@@ -189,16 +183,23 @@ function (_super) {
|
|
|
189
183
|
cover: (0, _coreUtil.getVideoCover)(group),
|
|
190
184
|
source: group.video.sourceUrl
|
|
191
185
|
}),
|
|
186
|
+
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
192
187
|
videoId: group.id
|
|
193
188
|
}), !isPlaying && group.video.playButton == 'Middle' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
194
|
-
className: "play-btn center"
|
|
189
|
+
className: "play-btn center",
|
|
190
|
+
onClick: function onClick() {
|
|
191
|
+
_this.playOrPause(group);
|
|
192
|
+
}
|
|
195
193
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
196
194
|
alt: "",
|
|
197
195
|
src: _playCircle["default"]
|
|
198
|
-
})),
|
|
196
|
+
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
199
197
|
align: data.customize.align,
|
|
200
198
|
data: group,
|
|
201
199
|
noShare: true,
|
|
200
|
+
onPlayClick: function onPlayClick() {
|
|
201
|
+
return _this.playOrPause(group);
|
|
202
|
+
},
|
|
202
203
|
padding: 32
|
|
203
204
|
}));
|
|
204
205
|
})), data.share.open && !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
@@ -79,6 +79,27 @@ function (_super) {
|
|
|
79
79
|
/** 视频ref映射 */
|
|
80
80
|
|
|
81
81
|
_this.videoRefMap = {};
|
|
82
|
+
|
|
83
|
+
_this.playOrPause = function (group) {
|
|
84
|
+
(0, _commonUtil.ensure)(function () {
|
|
85
|
+
if (_this.videoRefMap[group.id].playing) {
|
|
86
|
+
_this.videoRefMap[group.id].playing = false;
|
|
87
|
+
|
|
88
|
+
_this.videoRefMap[group.id].el.player.pause();
|
|
89
|
+
} else {
|
|
90
|
+
if (group.video.playPosition == 'Popup') {
|
|
91
|
+
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
92
|
+
} else {
|
|
93
|
+
_this.videoRefMap[group.id].playing = true;
|
|
94
|
+
|
|
95
|
+
_this.videoRefMap[group.id].el.player.play();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_this.setState({});
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
82
103
|
return _this;
|
|
83
104
|
}
|
|
84
105
|
|
|
@@ -94,7 +115,7 @@ function (_super) {
|
|
|
94
115
|
style: {
|
|
95
116
|
height: data.pcHeight
|
|
96
117
|
}
|
|
97
|
-
}, !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
118
|
+
}, data.share.open && !hasPlaying && /*#__PURE__*/_react["default"].createElement(_ShareBtn["default"], {
|
|
98
119
|
data: __assign({
|
|
99
120
|
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
100
121
|
scroll: 'node-' + data.id
|
|
@@ -102,33 +123,14 @@ function (_super) {
|
|
|
102
123
|
}, data.share),
|
|
103
124
|
pc: true
|
|
104
125
|
}), data.groupSource.map(function (group) {
|
|
105
|
-
var _a;
|
|
126
|
+
var _a, _b;
|
|
106
127
|
/** 当前是否在播放 */
|
|
107
128
|
|
|
108
129
|
|
|
109
130
|
var isPlaying = !!((_a = _this.videoRefMap[group.id]) === null || _a === void 0 ? void 0 : _a.playing);
|
|
110
131
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
111
132
|
key: group.id,
|
|
112
|
-
className: "video-item-wrap"
|
|
113
|
-
onClick: function onClick() {
|
|
114
|
-
(0, _commonUtil.ensure)(function () {
|
|
115
|
-
if (_this.videoRefMap[group.id].playing) {
|
|
116
|
-
_this.videoRefMap[group.id].playing = false;
|
|
117
|
-
|
|
118
|
-
_this.videoRefMap[group.id].el.player.pause();
|
|
119
|
-
} else {
|
|
120
|
-
if (group.video.playPosition == 'Popup') {
|
|
121
|
-
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
122
|
-
} else {
|
|
123
|
-
_this.videoRefMap[group.id].playing = true;
|
|
124
|
-
|
|
125
|
-
_this.videoRefMap[group.id].el.player.play();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
_this.setState({});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
133
|
+
className: "video-item-wrap"
|
|
132
134
|
}, /*#__PURE__*/_react["default"].createElement(_common.Video, {
|
|
133
135
|
ref: function ref(el) {
|
|
134
136
|
if (!_this.videoRefMap[group.id]) {
|
|
@@ -144,16 +146,23 @@ function (_super) {
|
|
|
144
146
|
cover: (0, _coreUtil.getVideoCover)(group),
|
|
145
147
|
source: group.video.sourceUrl
|
|
146
148
|
}),
|
|
149
|
+
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
147
150
|
videoId: group.id
|
|
148
151
|
}), !isPlaying && group.video.playButton == 'Middle' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
149
|
-
className: "play-btn center"
|
|
152
|
+
className: "play-btn center",
|
|
153
|
+
onClick: function onClick() {
|
|
154
|
+
_this.playOrPause(group);
|
|
155
|
+
}
|
|
150
156
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
151
157
|
alt: "",
|
|
152
158
|
src: _playCircle["default"]
|
|
153
|
-
})),
|
|
159
|
+
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
154
160
|
align: data.customize.align,
|
|
155
161
|
data: group,
|
|
156
162
|
noShare: true,
|
|
163
|
+
onPlayClick: function onPlayClick() {
|
|
164
|
+
return _this.playOrPause(group);
|
|
165
|
+
},
|
|
157
166
|
padding: 20
|
|
158
167
|
}));
|
|
159
168
|
}));
|
|
@@ -81,6 +81,27 @@ function (_super) {
|
|
|
81
81
|
/** 视频ref映射 */
|
|
82
82
|
|
|
83
83
|
_this.videoRefMap = {};
|
|
84
|
+
|
|
85
|
+
_this.playOrPause = function (group) {
|
|
86
|
+
(0, _commonUtil.ensure)(function () {
|
|
87
|
+
if (_this.videoRefMap[group.id].playing) {
|
|
88
|
+
_this.videoRefMap[group.id].playing = false;
|
|
89
|
+
|
|
90
|
+
_this.videoRefMap[group.id].el.player.pause();
|
|
91
|
+
} else {
|
|
92
|
+
if (group.video.playPosition == 'Popup') {
|
|
93
|
+
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
94
|
+
} else {
|
|
95
|
+
_this.videoRefMap[group.id].playing = true;
|
|
96
|
+
|
|
97
|
+
_this.videoRefMap[group.id].el.player.play();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
_this.setState({});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
84
105
|
return _this;
|
|
85
106
|
}
|
|
86
107
|
|
|
@@ -91,7 +112,7 @@ function (_super) {
|
|
|
91
112
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
92
113
|
className: "video-layout4-wrap"
|
|
93
114
|
}, data.groupSource.map(function (group) {
|
|
94
|
-
var _a;
|
|
115
|
+
var _a, _b;
|
|
95
116
|
/** 当前是否在播放 */
|
|
96
117
|
|
|
97
118
|
|
|
@@ -101,25 +122,6 @@ function (_super) {
|
|
|
101
122
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
123
|
key: group.id,
|
|
103
124
|
className: "video-item-wrap",
|
|
104
|
-
onClick: function onClick() {
|
|
105
|
-
(0, _commonUtil.ensure)(function () {
|
|
106
|
-
if (_this.videoRefMap[group.id].playing) {
|
|
107
|
-
_this.videoRefMap[group.id].playing = false;
|
|
108
|
-
|
|
109
|
-
_this.videoRefMap[group.id].el.player.pause();
|
|
110
|
-
} else {
|
|
111
|
-
if (group.video.playPosition == 'Popup') {
|
|
112
|
-
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
113
|
-
} else {
|
|
114
|
-
_this.videoRefMap[group.id].playing = true;
|
|
115
|
-
|
|
116
|
-
_this.videoRefMap[group.id].el.player.play();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
_this.setState({});
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
125
|
style: {
|
|
124
126
|
height: data.pcHeight
|
|
125
127
|
}
|
|
@@ -138,12 +140,16 @@ function (_super) {
|
|
|
138
140
|
cover: (0, _coreUtil.getVideoCover)(group),
|
|
139
141
|
source: group.video.sourceUrl
|
|
140
142
|
}),
|
|
143
|
+
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
141
144
|
videoId: group.id
|
|
142
145
|
}), !isPlaying && /*#__PURE__*/_react["default"].createElement("div", {
|
|
143
146
|
className: (0, _classnames["default"])('play-btn', {
|
|
144
147
|
middle: group.video.playButton == 'Middle',
|
|
145
148
|
bottomLeft: group.video.playButton == 'Bottom Left'
|
|
146
|
-
})
|
|
149
|
+
}),
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
_this.playOrPause(group);
|
|
152
|
+
}
|
|
147
153
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
148
154
|
alt: "",
|
|
149
155
|
src: _playCircle["default"]
|
|
@@ -162,6 +168,9 @@ function (_super) {
|
|
|
162
168
|
data: group,
|
|
163
169
|
layout: 'pc-' + data.customize.layout.pcLayout,
|
|
164
170
|
noShare: true,
|
|
171
|
+
onPlayClick: function onPlayClick() {
|
|
172
|
+
return _this.playOrPause(group);
|
|
173
|
+
},
|
|
165
174
|
position: "relative"
|
|
166
175
|
})));
|
|
167
176
|
}));
|
|
@@ -81,6 +81,27 @@ function (_super) {
|
|
|
81
81
|
/** 视频ref映射 */
|
|
82
82
|
|
|
83
83
|
_this.videoRefMap = {};
|
|
84
|
+
|
|
85
|
+
_this.playOrPause = function (group) {
|
|
86
|
+
(0, _commonUtil.ensure)(function () {
|
|
87
|
+
if (_this.videoRefMap[group.id].playing) {
|
|
88
|
+
_this.videoRefMap[group.id].playing = false;
|
|
89
|
+
|
|
90
|
+
_this.videoRefMap[group.id].el.player.pause();
|
|
91
|
+
} else {
|
|
92
|
+
if (group.video.playPosition == 'Popup') {
|
|
93
|
+
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
94
|
+
} else {
|
|
95
|
+
_this.videoRefMap[group.id].playing = true;
|
|
96
|
+
|
|
97
|
+
_this.videoRefMap[group.id].el.player.play();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
_this.setState({});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
84
105
|
return _this;
|
|
85
106
|
}
|
|
86
107
|
|
|
@@ -91,7 +112,7 @@ function (_super) {
|
|
|
91
112
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
92
113
|
className: "video-layout5-wrap"
|
|
93
114
|
}, data.groupSource.map(function (group) {
|
|
94
|
-
var _a;
|
|
115
|
+
var _a, _b;
|
|
95
116
|
/** 当前是否在播放 */
|
|
96
117
|
|
|
97
118
|
|
|
@@ -101,25 +122,6 @@ function (_super) {
|
|
|
101
122
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
123
|
key: group.id,
|
|
103
124
|
className: "video-item-wrap",
|
|
104
|
-
onClick: function onClick() {
|
|
105
|
-
(0, _commonUtil.ensure)(function () {
|
|
106
|
-
if (_this.videoRefMap[group.id].playing) {
|
|
107
|
-
_this.videoRefMap[group.id].playing = false;
|
|
108
|
-
|
|
109
|
-
_this.videoRefMap[group.id].el.player.pause();
|
|
110
|
-
} else {
|
|
111
|
-
if (group.video.playPosition == 'Popup') {
|
|
112
|
-
_this.videoRefMap[group.id].el.fullPlay('pc');
|
|
113
|
-
} else {
|
|
114
|
-
_this.videoRefMap[group.id].playing = true;
|
|
115
|
-
|
|
116
|
-
_this.videoRefMap[group.id].el.player.play();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
_this.setState({});
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
125
|
style: {
|
|
124
126
|
height: data.pcHeight
|
|
125
127
|
}
|
|
@@ -138,12 +140,16 @@ function (_super) {
|
|
|
138
140
|
cover: (0, _coreUtil.getVideoCover)(group),
|
|
139
141
|
source: group.video.sourceUrl
|
|
140
142
|
}),
|
|
143
|
+
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
141
144
|
videoId: group.id
|
|
142
145
|
}), !isPlaying && /*#__PURE__*/_react["default"].createElement("div", {
|
|
143
146
|
className: (0, _classnames["default"])('play-btn', {
|
|
144
147
|
middle: group.video.playButton == 'Middle',
|
|
145
148
|
bottomLeft: group.video.playButton == 'Bottom Left'
|
|
146
|
-
})
|
|
149
|
+
}),
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
_this.playOrPause(group);
|
|
152
|
+
}
|
|
147
153
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
148
154
|
alt: "",
|
|
149
155
|
src: _playCircle["default"]
|
|
@@ -162,6 +168,9 @@ function (_super) {
|
|
|
162
168
|
data: group,
|
|
163
169
|
layout: 'pc-' + data.customize.layout.pcLayout,
|
|
164
170
|
noShare: true,
|
|
171
|
+
onPlayClick: function onPlayClick() {
|
|
172
|
+
return _this.playOrPause(group);
|
|
173
|
+
},
|
|
165
174
|
position: "relative"
|
|
166
175
|
})));
|
|
167
176
|
}));
|
|
@@ -15,6 +15,8 @@ var _immutabilityHelper = _interopRequireDefault(require("immutability-helper"))
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
+
var _lodash = require("lodash");
|
|
19
|
+
|
|
18
20
|
var _common = require("../../../common");
|
|
19
21
|
|
|
20
22
|
var _coreUtil = require("../../../utils/coreUtil");
|
|
@@ -78,6 +80,15 @@ function PageCompList(_a) {
|
|
|
78
80
|
setHoveredFloor = _e[1];
|
|
79
81
|
|
|
80
82
|
var ref = (0, _react.useRef)();
|
|
83
|
+
|
|
84
|
+
var getActiveComponents = function getActiveComponents() {
|
|
85
|
+
var filter = components.filter(function (comp) {
|
|
86
|
+
return (0, _coreUtil.isActiveFloor)(comp.activeTerminal);
|
|
87
|
+
});
|
|
88
|
+
return filter;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var activeComponents = getActiveComponents();
|
|
81
92
|
(0, _react.useEffect)(function () {
|
|
82
93
|
setComponents(pageData || []);
|
|
83
94
|
}, [pageData]);
|
|
@@ -109,7 +120,6 @@ function PageCompList(_a) {
|
|
|
109
120
|
};
|
|
110
121
|
|
|
111
122
|
var onDragEnter = function onDragEnter(e) {
|
|
112
|
-
console.log('drag enter');
|
|
113
123
|
var hoverNodeId = e.currentTarget.dataset.nodeid;
|
|
114
124
|
|
|
115
125
|
if (dragId === hoverNodeId) {
|
|
@@ -127,18 +137,36 @@ function PageCompList(_a) {
|
|
|
127
137
|
}
|
|
128
138
|
};
|
|
129
139
|
|
|
140
|
+
var getLastSameIndex = function getLastSameIndex(comps, index) {
|
|
141
|
+
var lastComps = comps.slice(0, index);
|
|
142
|
+
var newIndex = (0, _lodash.findLastIndex)(lastComps, function (comp) {
|
|
143
|
+
return (0, _coreUtil.isActiveFloor)(comp.activeTerminal);
|
|
144
|
+
});
|
|
145
|
+
return newIndex;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
var getNextSameIndex = function getNextSameIndex(comps, index) {
|
|
149
|
+
var nextComps = comps.slice(index + 1);
|
|
150
|
+
var newIndex = (0, _lodash.findIndex)(nextComps, function (comp) {
|
|
151
|
+
return (0, _coreUtil.isActiveFloor)(comp.activeTerminal);
|
|
152
|
+
});
|
|
153
|
+
return newIndex + index + 1;
|
|
154
|
+
};
|
|
155
|
+
|
|
130
156
|
var onMenuClick = function onMenuClick(activeComp, operType) {
|
|
131
157
|
var newComponents = __spreadArrays(components);
|
|
132
158
|
|
|
133
159
|
var index = newComponents.indexOf(activeComp);
|
|
134
160
|
|
|
135
161
|
if (operType === operTypeMap.MOVE_UP) {
|
|
136
|
-
var
|
|
137
|
-
|
|
162
|
+
var newIndex = getLastSameIndex(newComponents, index);
|
|
163
|
+
var temp = newComponents[newIndex];
|
|
164
|
+
newComponents[newIndex] = newComponents[index];
|
|
138
165
|
newComponents[index] = temp;
|
|
139
166
|
} else if (operType === operTypeMap.MOVE_DOWN) {
|
|
140
|
-
var
|
|
141
|
-
|
|
167
|
+
var newIndex = getNextSameIndex(newComponents, index);
|
|
168
|
+
var temp = newComponents[newIndex];
|
|
169
|
+
newComponents[newIndex] = newComponents[index];
|
|
142
170
|
newComponents[index] = temp;
|
|
143
171
|
} else if (operType === operTypeMap.COPY) {
|
|
144
172
|
var copyComponent = (0, _coreUtil.copyNode)(newComponents[index]);
|
|
@@ -193,7 +221,7 @@ function PageCompList(_a) {
|
|
|
193
221
|
}, index !== 0 && /*#__PURE__*/_react["default"].createElement(_antd.Menu.Item, {
|
|
194
222
|
className: "menu_item",
|
|
195
223
|
value: "1"
|
|
196
|
-
}, (0, _locale.i18n)('MOVE_UP')), index !==
|
|
224
|
+
}, (0, _locale.i18n)('MOVE_UP')), index !== activeComponents.length - 1 && /*#__PURE__*/_react["default"].createElement(_antd.Menu.Item, {
|
|
197
225
|
className: "menu_item",
|
|
198
226
|
value: "2"
|
|
199
227
|
}, (0, _locale.i18n)('MOVE_DOWN')), /*#__PURE__*/_react["default"].createElement(_antd.Menu.Item, {
|
|
@@ -277,14 +305,6 @@ function PageCompList(_a) {
|
|
|
277
305
|
})));
|
|
278
306
|
};
|
|
279
307
|
|
|
280
|
-
var getActiveComponents = function getActiveComponents() {
|
|
281
|
-
var filter = components.filter(function (comp) {
|
|
282
|
-
return (0, _coreUtil.isActiveFloor)(comp.activeTerminal);
|
|
283
|
-
});
|
|
284
|
-
return filter;
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
var activeComponents = getActiveComponents();
|
|
288
308
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
289
309
|
className: "page-comp-wrap"
|
|
290
310
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -14,7 +14,7 @@ exports.dragSource = void 0;
|
|
|
14
14
|
exports.ensure = ensure;
|
|
15
15
|
exports.getColorRgba = void 0;
|
|
16
16
|
exports.getPageDataMap = getPageDataMap;
|
|
17
|
-
exports.navigateTo = exports.importAsync = exports.getUrlParams = void 0;
|
|
17
|
+
exports.nextTick = exports.navigateTo = exports.importAsync = exports.getUrlParams = void 0;
|
|
18
18
|
exports.pushGA = pushGA;
|
|
19
19
|
exports.shareFacebook = shareFacebook;
|
|
20
20
|
exports.shareLinkedin = shareLinkedin;
|
|
@@ -474,4 +474,29 @@ function covertKey(data, func) {
|
|
|
474
474
|
var newData = (0, _lodash.cloneDeep)(data);
|
|
475
475
|
func(newData);
|
|
476
476
|
return JSON.stringify(newData);
|
|
477
|
-
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
var nextTick = function nextTick(func, interval, count) {
|
|
480
|
+
if (interval === void 0) {
|
|
481
|
+
interval = 100;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
if (count === void 0) {
|
|
485
|
+
count = 5;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
try {
|
|
489
|
+
func();
|
|
490
|
+
} catch (error) {
|
|
491
|
+
if (count == 0) {
|
|
492
|
+
console.error('nextTick 失败');
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
setTimeout(function () {
|
|
497
|
+
nextTick(func, interval, count - 1);
|
|
498
|
+
}, interval);
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
exports.nextTick = nextTick;
|
|
@@ -427,46 +427,18 @@ function ImageModal(_a) {
|
|
|
427
427
|
}
|
|
428
428
|
});
|
|
429
429
|
});
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
_a.trys.push([0, 2,, 3]);
|
|
439
|
-
|
|
440
|
-
return [4
|
|
441
|
-
/*yield*/
|
|
442
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/pages/platforminfo")];
|
|
430
|
+
}; // const getPreConfig = async () => {
|
|
431
|
+
// try {
|
|
432
|
+
// const { wapUrl } = await commonFetch(`/designer/v1/${window.magicDesign.MBaseUrl}/pages/platforminfo`);
|
|
433
|
+
// setWapUrl(wapUrl);
|
|
434
|
+
// } catch (error) {
|
|
435
|
+
// console.error(error);
|
|
436
|
+
// }
|
|
437
|
+
// };
|
|
443
438
|
|
|
444
|
-
case 1:
|
|
445
|
-
wapUrl_1 = _a.sent().wapUrl;
|
|
446
|
-
setWapUrl(wapUrl_1);
|
|
447
|
-
return [3
|
|
448
|
-
/*break*/
|
|
449
|
-
, 3];
|
|
450
|
-
|
|
451
|
-
case 2:
|
|
452
|
-
error_1 = _a.sent();
|
|
453
|
-
console.error(error_1);
|
|
454
|
-
return [3
|
|
455
|
-
/*break*/
|
|
456
|
-
, 3];
|
|
457
|
-
|
|
458
|
-
case 3:
|
|
459
|
-
return [2
|
|
460
|
-
/*return*/
|
|
461
|
-
];
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
});
|
|
465
|
-
};
|
|
466
439
|
|
|
467
440
|
(0, _react.useEffect)(function () {
|
|
468
|
-
getContentCatgs();
|
|
469
|
-
getPreConfig();
|
|
441
|
+
getContentCatgs(); // getPreConfig();
|
|
470
442
|
}, []);
|
|
471
443
|
|
|
472
444
|
var selectFolder = function selectFolder(id) {
|