pb-sxp-ui 1.20.10 → 1.20.11
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/dist/index.cjs +248 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +248 -172
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +7 -7
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +7 -7
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +248 -172
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +7 -7
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/es/core/components/SxpPageRender/LikeButton/index.js +20 -18
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +39 -13
- package/es/core/components/SxpPageRender/VideoWidget/index.js +33 -46
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/index.js +56 -40
- package/es/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/es/core/context/SxpDataSourceProvider.js +81 -38
- package/es/core/hooks/useEventReport.js +6 -5
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/lib/core/components/SxpPageRender/LikeButton/index.js +20 -18
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +38 -12
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +33 -46
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/index.js +56 -40
- package/lib/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/lib/core/context/SxpDataSourceProvider.js +81 -38
- package/lib/core/hooks/useEventReport.js +6 -5
- package/package.json +1 -1
|
@@ -4,24 +4,50 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const modules_1 = require("swiper/modules");
|
|
6
6
|
const react_2 = require("swiper/react");
|
|
7
|
+
const css_1 = require("@emotion/css");
|
|
7
8
|
const Picture_1 = tslib_1.__importDefault(require("./Picture"));
|
|
8
9
|
const hooks_1 = require("../../../../core/hooks");
|
|
9
|
-
const css_1 = require("@emotion/css");
|
|
10
10
|
const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
|
11
11
|
const tool_1 = require("../../../../core/utils/tool");
|
|
12
|
-
const PictureGroup = ({ imgUrls,
|
|
12
|
+
const PictureGroup = (0, react_1.forwardRef)(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
|
15
|
-
const {
|
|
15
|
+
const { firstRtcList, openHashtag, isDiyH5 } = (0, hooks_1.useSxpDataSource)();
|
|
16
16
|
const [isLoad, setIsLoad] = (0, react_1.useState)(false);
|
|
17
17
|
const [imgInfo, setImgInfo] = (0, react_1.useState)();
|
|
18
18
|
const [swiperActiveIndex, setSwiperActiveIndex] = (0, react_1.useState)(0);
|
|
19
|
-
const
|
|
19
|
+
const imgsSwiperRef = (0, react_1.useRef)();
|
|
20
20
|
const isFirstPlayRef = (0, react_1.useRef)(true);
|
|
21
|
+
const loopPlayRef = (0, react_1.useRef)(true);
|
|
21
22
|
const initTime = new Date();
|
|
23
|
+
(0, react_1.useImperativeHandle)(ref, () => {
|
|
24
|
+
return {
|
|
25
|
+
setLoopPlay(v) {
|
|
26
|
+
loopPlayRef.current = v;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
(0, react_1.useEffect)(() => {
|
|
31
|
+
let timerId;
|
|
32
|
+
if (isLoad && isActive && isDiyH5) {
|
|
33
|
+
timerId = setTimeout(() => {
|
|
34
|
+
var _a, _b, _c, _d;
|
|
35
|
+
if (!loopPlayRef.current)
|
|
36
|
+
return;
|
|
37
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
|
38
|
+
const i = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
|
|
39
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(i + 1);
|
|
40
|
+
}
|
|
41
|
+
}, 3000);
|
|
42
|
+
}
|
|
43
|
+
return () => {
|
|
44
|
+
if (timerId)
|
|
45
|
+
clearTimeout(timerId);
|
|
46
|
+
};
|
|
47
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
|
22
48
|
(0, react_1.useEffect)(() => {
|
|
23
49
|
if (isLoad && isActive) {
|
|
24
|
-
(
|
|
50
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
|
25
51
|
if (openHashtag) {
|
|
26
52
|
onViewImageEndEvent(rec);
|
|
27
53
|
}
|
|
@@ -31,7 +57,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
|
31
57
|
}
|
|
32
58
|
}
|
|
33
59
|
else {
|
|
34
|
-
(
|
|
60
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
|
|
35
61
|
}
|
|
36
62
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
|
37
63
|
const showFirstImageFn = (0, react_1.useCallback)((e) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -55,13 +81,13 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
|
55
81
|
};
|
|
56
82
|
}, [isActive, imgInfo]);
|
|
57
83
|
const handleMouseEnter = (0, react_1.useCallback)(() => {
|
|
58
|
-
if (
|
|
59
|
-
|
|
84
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
|
85
|
+
imgsSwiperRef.current.swiper.autoplay.stop();
|
|
60
86
|
}
|
|
61
87
|
}, []);
|
|
62
88
|
const handleMouseLeave = (0, react_1.useCallback)(() => {
|
|
63
|
-
if (
|
|
64
|
-
|
|
89
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
|
90
|
+
imgsSwiperRef.current.swiper.autoplay.start();
|
|
65
91
|
}
|
|
66
92
|
}, []);
|
|
67
93
|
const handleSlideChange = (0, react_1.useCallback)((swiper) => {
|
|
@@ -82,7 +108,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
|
82
108
|
enabled: true
|
|
83
109
|
}
|
|
84
110
|
}
|
|
85
|
-
: {}), { loop: true, ref:
|
|
111
|
+
: {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: (0, css_1.css)(Object.assign(Object.assign({ '.swiper-pagination': {
|
|
86
112
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
|
87
113
|
fontSize: '14px'
|
|
88
114
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
|
@@ -99,5 +125,5 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
|
99
125
|
return (react_1.default.createElement(react_2.SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
|
100
126
|
react_1.default.createElement(Picture_1.default, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
|
101
127
|
}))));
|
|
102
|
-
};
|
|
128
|
+
});
|
|
103
129
|
exports.default = (0, react_1.memo)(PictureGroup);
|
|
@@ -12,7 +12,7 @@ const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
|
|
12
12
|
const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef, visibleHeight }, ref) => {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
|
|
15
|
-
const { bffEventReport, sxpParameter,
|
|
15
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = (0, hooks_1.useSxpDataSource)();
|
|
16
16
|
const videoStartTime = (0, react_1.useRef)(0);
|
|
17
17
|
const [isLoadFinish, setIsLoadFinish] = (0, react_1.useState)(false);
|
|
18
18
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
|
@@ -29,7 +29,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
29
29
|
const loopPlayRef = (0, react_1.useRef)(loopPlay);
|
|
30
30
|
const scene = rec.video.scene;
|
|
31
31
|
const videoUrl = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) || ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url);
|
|
32
|
-
const videoCover = (
|
|
32
|
+
const videoCover = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
|
|
33
33
|
const videoPoster = videoCover || (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image);
|
|
34
34
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
35
35
|
return {
|
|
@@ -78,6 +78,23 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
78
78
|
return;
|
|
79
79
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
80
80
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
81
|
+
const handleEnd = () => {
|
|
82
|
+
var _a, _b, _c, _d, _e, _f;
|
|
83
|
+
if (!videoRef.current)
|
|
84
|
+
return;
|
|
85
|
+
if (isDiyH5) {
|
|
86
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
87
|
+
if (!loopPlayRef.current)
|
|
88
|
+
return;
|
|
89
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
|
90
|
+
const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
|
|
91
|
+
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(i + 1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
81
98
|
const PAUSE_ICON = (0, useIconLink_1.useIconLink)('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
|
82
99
|
const handlePlaying = (0, react_1.useCallback)(() => {
|
|
83
100
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
@@ -86,7 +103,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
86
103
|
setIsLoadFinish(true);
|
|
87
104
|
}, []);
|
|
88
105
|
const handleStartPlay = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
106
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
90
107
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
91
108
|
return;
|
|
92
109
|
setIsPauseVideo(false);
|
|
@@ -97,16 +114,11 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
97
114
|
const videoCurrentTime = ((_h = (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.currentTime) !== null && _h !== void 0 ? _h : 0).toFixed(2);
|
|
98
115
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
|
99
116
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
100
|
-
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
|
117
|
+
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '', sceneId: (_o = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.scene) === null || _m === void 0 ? void 0 : _m.sceneId) !== null && _o !== void 0 ? _o : '', contentName: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.title) !== null && _q !== void 0 ? _q : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []), position: index + '', contentFormat: 'video', traceInfo: (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.traceInfo }, ((isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) && { loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + '' }))
|
|
101
118
|
});
|
|
102
119
|
isFirstPlayRef.current = false;
|
|
103
120
|
}
|
|
104
121
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
105
|
-
const setCurrentTimeByStartTime = (0, react_1.useCallback)(() => {
|
|
106
|
-
if (isDiyH5) {
|
|
107
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
108
|
-
}
|
|
109
|
-
}, []);
|
|
110
122
|
const handLoadeddata = (0, react_1.useCallback)(() => {
|
|
111
123
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
|
112
124
|
return;
|
|
@@ -131,13 +143,12 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
131
143
|
const handleLoadedmetadata = (0, react_1.useCallback)(() => {
|
|
132
144
|
if (!videoRef.current)
|
|
133
145
|
return;
|
|
134
|
-
setCurrentTimeByStartTime();
|
|
135
146
|
loadedTimeRef.current = new Date();
|
|
136
147
|
handleStartPlay();
|
|
137
148
|
handLoadeddata();
|
|
138
149
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
|
139
150
|
const handleClickVideo = (0, react_1.useCallback)((type) => () => {
|
|
140
|
-
var _a, _b, _c, _d, _e
|
|
151
|
+
var _a, _b, _c, _d, _e;
|
|
141
152
|
if (!videoRef.current)
|
|
142
153
|
return;
|
|
143
154
|
if (!isLoadFinish)
|
|
@@ -158,20 +169,17 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
158
169
|
break;
|
|
159
170
|
default:
|
|
160
171
|
if (isPause) {
|
|
161
|
-
|
|
162
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
163
|
-
}
|
|
164
|
-
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
|
172
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
|
165
173
|
}
|
|
166
174
|
else {
|
|
167
|
-
(
|
|
175
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
|
168
176
|
}
|
|
169
177
|
setIsPauseVideo(!isPause);
|
|
170
178
|
break;
|
|
171
179
|
}
|
|
172
180
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
173
181
|
const handlePause = (0, react_1.useCallback)(() => {
|
|
174
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
182
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
175
183
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
176
184
|
return;
|
|
177
185
|
if (activeIndex !== index)
|
|
@@ -187,14 +195,15 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
187
195
|
eventSubject: 'playOverVideo',
|
|
188
196
|
eventDescription: 'User finished playing the video',
|
|
189
197
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
|
190
|
-
|
|
198
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
|
199
|
+
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
|
191
200
|
endTime: videoCurrentTime,
|
|
192
201
|
videoDuration,
|
|
193
202
|
playDuration,
|
|
194
|
-
contentTags: JSON.stringify((
|
|
203
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
|
195
204
|
position: index + '',
|
|
196
205
|
contentFormat: 'video',
|
|
197
|
-
traceInfo: (
|
|
206
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
|
198
207
|
}
|
|
199
208
|
});
|
|
200
209
|
}
|
|
@@ -202,27 +211,8 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
202
211
|
const handleWaiting = (0, react_1.useCallback)(() => {
|
|
203
212
|
setWaiting(true);
|
|
204
213
|
}, []);
|
|
205
|
-
const handleTimeUpload = () => {
|
|
206
|
-
if (!videoRef.current || !isDiyH5)
|
|
207
|
-
return;
|
|
208
|
-
setTimeout(() => {
|
|
209
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
210
|
-
if (Math.round((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = scene === null || scene === void 0 ? void 0 : scene.endTime) !== null && _b !== void 0 ? _b : 0)) {
|
|
211
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
|
212
|
-
if (!loopPlayRef.current)
|
|
213
|
-
return;
|
|
214
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
|
215
|
-
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(0);
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
const i = (_g = (_f = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _f === void 0 ? void 0 : _f.swiper) === null || _g === void 0 ? void 0 : _g.activeIndex;
|
|
219
|
-
(_j = (_h = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _h === void 0 ? void 0 : _h.swiper) === null || _j === void 0 ? void 0 : _j.slideTo(i + 1);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
};
|
|
224
214
|
(0, react_1.useEffect)(() => {
|
|
225
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
215
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
226
216
|
if (!isActive)
|
|
227
217
|
return;
|
|
228
218
|
const videoSrc = videoUrl;
|
|
@@ -243,7 +233,6 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
243
233
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
|
244
234
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
245
235
|
var _a;
|
|
246
|
-
setCurrentTimeByStartTime();
|
|
247
236
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
248
237
|
});
|
|
249
238
|
}
|
|
@@ -257,12 +246,11 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
257
246
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
|
258
247
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
|
259
248
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
|
260
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
|
249
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
|
|
261
250
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
|
262
251
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
|
263
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
|
264
252
|
return () => {
|
|
265
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
253
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
266
254
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
|
267
255
|
if (!isPause)
|
|
268
256
|
handlePause();
|
|
@@ -274,10 +262,9 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
|
274
262
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
|
275
263
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
|
276
264
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
|
277
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
|
265
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
|
|
278
266
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
|
279
267
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
|
280
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
|
281
268
|
};
|
|
282
269
|
}, [isActive]);
|
|
283
270
|
(0, react_1.useEffect)(() => {
|
|
@@ -44,7 +44,7 @@ const WaterFall = (props) => {
|
|
|
44
44
|
}
|
|
45
45
|
}, [waterFallData]);
|
|
46
46
|
const reportTagsView = (0, react_1.useCallback)(() => {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f;
|
|
47
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
48
48
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
|
49
49
|
if (!rec)
|
|
50
50
|
return;
|
|
@@ -64,9 +64,10 @@ const WaterFall = (props) => {
|
|
|
64
64
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
65
65
|
eventInfo: {
|
|
66
66
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
|
67
|
+
sceneId: (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
|
67
68
|
position: cacheActiveIndex + '',
|
|
68
|
-
contentTags: JSON.stringify((
|
|
69
|
-
traceInfo: (
|
|
69
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
|
70
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
|
70
71
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
|
71
72
|
fromKName,
|
|
72
73
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
@@ -48,6 +48,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
48
48
|
const [pageNum, setPageNum] = (0, react_1.useState)(2);
|
|
49
49
|
const [isShowCookieSetting, setIsShowCookieSetting] = (0, react_1.useState)(false);
|
|
50
50
|
const videoWidgetRef = (0, react_1.useRef)(null);
|
|
51
|
+
const pictureGroupRef = (0, react_1.useRef)(null);
|
|
51
52
|
const fbcRef = (0, react_1.useRef)('');
|
|
52
53
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5, pixelPvStatusRef } = (0, hooks_1.useSxpDataSource)();
|
|
53
54
|
const { backMainFeed, productView, jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
|
@@ -97,7 +98,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
97
98
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
|
98
99
|
}, [data, ctaType, swiperRef]);
|
|
99
100
|
const handleSessionCompleted = (0, react_1.useCallback)((fk) => {
|
|
100
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
101
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
101
102
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
|
102
103
|
let fromKName = '';
|
|
103
104
|
if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
|
@@ -124,22 +125,23 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
124
125
|
eventSubject: 'sessionCompleted',
|
|
125
126
|
eventDescription: 'Session completed',
|
|
126
127
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
|
127
|
-
|
|
128
|
+
sceneId: (_q = (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.scene) === null || _p === void 0 ? void 0 : _p.sceneId) !== null && _q !== void 0 ? _q : '',
|
|
129
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
|
128
130
|
position: activeIndex + '',
|
|
129
131
|
fromKName: fk || fromKName,
|
|
130
132
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
131
|
-
ctatId: (
|
|
132
|
-
traceInfo: (
|
|
133
|
+
ctatId: (_u = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
|
134
|
+
traceInfo: (_y = (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = item === null || item === void 0 ? void 0 : item.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : ''
|
|
133
135
|
}
|
|
134
136
|
});
|
|
135
|
-
const isPostType = ((
|
|
137
|
+
const isPostType = ((_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.url) || ((_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.imgUrls) === null || _1 === void 0 ? void 0 : _1.length);
|
|
136
138
|
if (!popupDetailData) {
|
|
137
139
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
138
140
|
eventName: 'ExitFeed',
|
|
139
|
-
product: isPostType ? (
|
|
141
|
+
product: isPostType ? (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
|
|
140
142
|
rec: item,
|
|
141
143
|
position: activeIndex,
|
|
142
|
-
content_id: isPostType ? (
|
|
144
|
+
content_id: isPostType ? (_4 = (_3 = item === null || item === void 0 ? void 0 : item.video) === null || _3 === void 0 ? void 0 : _3.itemId) !== null && _4 !== void 0 ? _4 : '' : (_6 = (_5 = item === null || item === void 0 ? void 0 : item.product) === null || _5 === void 0 ? void 0 : _5.itemId) !== null && _6 !== void 0 ? _6 : '',
|
|
143
145
|
view_time: new Date() - viewTime.current
|
|
144
146
|
});
|
|
145
147
|
}
|
|
@@ -196,8 +198,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
196
198
|
refreshFeSession
|
|
197
199
|
]);
|
|
198
200
|
const handleSessionExpire = (0, react_1.useCallback)((0, lodash_1.debounce)(() => {
|
|
199
|
-
var _a;
|
|
201
|
+
var _a, _b;
|
|
200
202
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
203
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
201
204
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
|
202
205
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
|
203
206
|
(0, react_1.useEffect)(() => {
|
|
@@ -268,18 +271,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
268
271
|
return null;
|
|
269
272
|
}, [globalConfig, activeIndex, visList]);
|
|
270
273
|
const renderContent = (0, react_1.useCallback)((rec, index) => {
|
|
271
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
274
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
272
275
|
if (rec === 'organic menu') {
|
|
273
276
|
return (react_1.default.createElement(MultiPosts_1.default, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
|
|
274
277
|
}
|
|
275
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
|
278
|
+
if (((_h = (_g = rec.video) === null || _g === void 0 ? void 0 : _g.scene) === null || _h === void 0 ? void 0 : _h.mediaUrl) || ((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.url)) {
|
|
276
279
|
return (react_1.default.createElement(VideoWidget_1.default, Object.assign({ key: isReload }, (activeIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, loopPlay: true, swiperRef: swiperRef, visibleHeight: visibleHeight })));
|
|
277
280
|
}
|
|
278
|
-
if ((
|
|
279
|
-
return (react_1.default.createElement(PictureGroup_1.default, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
|
281
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
|
282
|
+
return (react_1.default.createElement(PictureGroup_1.default, Object.assign({ data: data }, (activeIndex === index && { ref: pictureGroupRef }), { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, swiperRef: swiperRef })));
|
|
280
283
|
}
|
|
281
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
|
282
|
-
return (
|
|
284
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _l === void 0 ? void 0 : _l.length) > 0) {
|
|
285
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
|
283
286
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
284
287
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
|
285
288
|
const Component = (0, withBindDataSource_1.default)(t);
|
|
@@ -318,7 +321,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
318
321
|
};
|
|
319
322
|
}, [isShowMore]);
|
|
320
323
|
const renderBottom = (0, react_1.useCallback)((rec, index) => {
|
|
321
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
324
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
322
325
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
|
323
326
|
let cta = null;
|
|
324
327
|
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
|
@@ -327,24 +330,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
327
330
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
|
328
331
|
cta = '商品CTA';
|
|
329
332
|
}
|
|
333
|
+
else if (tempMap && ((_d = Object.keys(tempMap)) === null || _d === void 0 ? void 0 : _d.includes('服务CTA')) && ((_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId)) {
|
|
334
|
+
cta = '服务CTA';
|
|
335
|
+
}
|
|
330
336
|
else {
|
|
331
|
-
cta = (
|
|
337
|
+
cta = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) === null || _h === void 0 ? void 0 : _h.itemId;
|
|
332
338
|
}
|
|
333
339
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
|
334
340
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
|
335
341
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 1 : 0) &&
|
|
336
|
-
((
|
|
342
|
+
((_j = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _j === void 0 ? void 0 : _j.includes((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type));
|
|
337
343
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
338
344
|
isNineProduct && (react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
|
|
339
|
-
((
|
|
340
|
-
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
|
345
|
+
((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.title) && !isShowMore && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
|
346
|
+
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _m !== void 0 ? _m : 40}px` } },
|
|
341
347
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
|
342
348
|
((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
|
343
349
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
|
|
344
350
|
react_1.default.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
345
|
-
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (
|
|
351
|
+
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.title) !== null && _p !== void 0 ? _p : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
|
346
352
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
|
347
|
-
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (
|
|
353
|
+
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.hashTags) !== null && _r !== void 0 ? _r : [], itemId: (_s = rec === null || rec === void 0 ? void 0 : rec.video) === null || _s === void 0 ? void 0 : _s.itemId, itemType: ((_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
|
348
354
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
|
349
355
|
}
|
|
350
356
|
return null;
|
|
@@ -386,7 +392,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
386
392
|
return null;
|
|
387
393
|
}, [globalConfig, waterFallData, bottomHeight]);
|
|
388
394
|
const handleViewImageStartEnd = (item) => {
|
|
389
|
-
var _a, _b, _c, _d, _e, _f;
|
|
395
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
390
396
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
|
391
397
|
const endTime = Date.now();
|
|
392
398
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
|
@@ -395,10 +401,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
395
401
|
eventSubject: 'viewImageCarouselEnd',
|
|
396
402
|
eventDescription: 'User end view the image carousel',
|
|
397
403
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
|
398
|
-
|
|
404
|
+
sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
|
405
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
399
406
|
imageEndTime: `${endTime}`,
|
|
400
407
|
playDuration: `${duration}`,
|
|
401
|
-
contentTags: JSON.stringify((
|
|
408
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
|
402
409
|
position: activeIndex + '',
|
|
403
410
|
contentFormat: 'image',
|
|
404
411
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
|
@@ -407,7 +414,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
407
414
|
}
|
|
408
415
|
};
|
|
409
416
|
const handleSlideSkip = (item, position) => {
|
|
410
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
417
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
411
418
|
if (isPreview || waterFallData)
|
|
412
419
|
return;
|
|
413
420
|
const t = new Date() - curTime.current;
|
|
@@ -433,7 +440,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
433
440
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
|
434
441
|
position: position + '',
|
|
435
442
|
contentId: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.itemId) !== null && _t !== void 0 ? _t : '',
|
|
436
|
-
|
|
443
|
+
sceneId: (_w = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.scene) === null || _v === void 0 ? void 0 : _v.sceneId) !== null && _w !== void 0 ? _w : '',
|
|
444
|
+
traceInfo: (_0 = (_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_z = item === null || item === void 0 ? void 0 : item.product) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : '',
|
|
437
445
|
contentFormat
|
|
438
446
|
}
|
|
439
447
|
});
|
|
@@ -443,7 +451,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
443
451
|
}
|
|
444
452
|
};
|
|
445
453
|
const handleScrollEvent = (swiper) => {
|
|
446
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
454
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
|
|
447
455
|
const item = data[swiper.previousIndex];
|
|
448
456
|
const activeItem = data[swiper.activeIndex];
|
|
449
457
|
if (!item)
|
|
@@ -476,11 +484,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
476
484
|
eventSubject: 'scrollDown',
|
|
477
485
|
eventDescription: 'User scroll down',
|
|
478
486
|
contentId: (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
|
479
|
-
|
|
487
|
+
sceneId: (_x = (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.scene) === null || _w === void 0 ? void 0 : _w.sceneId) !== null && _x !== void 0 ? _x : '',
|
|
488
|
+
productId: (_z = (_y = item === null || item === void 0 ? void 0 : item.product) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '',
|
|
480
489
|
requestId: null,
|
|
481
|
-
traceInfo: (
|
|
490
|
+
traceInfo: (_3 = (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.traceInfo) !== null && _3 !== void 0 ? _3 : '',
|
|
482
491
|
contentFormat,
|
|
483
|
-
position: ((
|
|
492
|
+
position: ((_4 = swiper.previousIndex) !== null && _4 !== void 0 ? _4 : 0) + ''
|
|
484
493
|
}
|
|
485
494
|
});
|
|
486
495
|
handleViewImageStartEnd(item);
|
|
@@ -492,12 +501,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
492
501
|
eventInfo: {
|
|
493
502
|
eventSubject: 'scrollUp',
|
|
494
503
|
eventDescription: 'User scroll up',
|
|
495
|
-
contentId: (
|
|
496
|
-
|
|
504
|
+
contentId: (_6 = (_5 = item === null || item === void 0 ? void 0 : item.video) === null || _5 === void 0 ? void 0 : _5.itemId) !== null && _6 !== void 0 ? _6 : '',
|
|
505
|
+
sceneId: (_9 = (_8 = (_7 = item === null || item === void 0 ? void 0 : item.video) === null || _7 === void 0 ? void 0 : _7.scene) === null || _8 === void 0 ? void 0 : _8.sceneId) !== null && _9 !== void 0 ? _9 : '',
|
|
506
|
+
productId: (_11 = (_10 = item.product) === null || _10 === void 0 ? void 0 : _10.itemId) !== null && _11 !== void 0 ? _11 : '',
|
|
497
507
|
requestId: null,
|
|
498
|
-
traceInfo: (
|
|
508
|
+
traceInfo: (_15 = (_13 = (_12 = item === null || item === void 0 ? void 0 : item.video) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : (_14 = item === null || item === void 0 ? void 0 : item.product) === null || _14 === void 0 ? void 0 : _14.traceInfo) !== null && _15 !== void 0 ? _15 : '',
|
|
499
509
|
contentFormat,
|
|
500
|
-
position: ((
|
|
510
|
+
position: ((_16 = swiper.previousIndex) !== null && _16 !== void 0 ? _16 : 0) + ''
|
|
501
511
|
}
|
|
502
512
|
});
|
|
503
513
|
handleViewImageStartEnd(item);
|
|
@@ -594,7 +604,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
594
604
|
};
|
|
595
605
|
}, [globalConfig, bffEventReport, data, activeIndex]);
|
|
596
606
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
|
597
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
607
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
598
608
|
const item = data[activeIndex];
|
|
599
609
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
|
600
610
|
const startTime = Date.now();
|
|
@@ -604,9 +614,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
604
614
|
eventSubject: 'viewImageCarouselStart',
|
|
605
615
|
eventDescription: 'User start view the image carousel',
|
|
606
616
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
|
607
|
-
|
|
617
|
+
sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
|
618
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
608
619
|
imageStartTime: `${startTime}`,
|
|
609
|
-
contentTags: JSON.stringify((
|
|
620
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
|
610
621
|
position: activeIndex + '',
|
|
611
622
|
contentFormat: 'image',
|
|
612
623
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
|
@@ -616,13 +627,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
616
627
|
if (enableCapi) {
|
|
617
628
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
618
629
|
eventName: 'ViewContent',
|
|
619
|
-
product: (
|
|
630
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProducts,
|
|
620
631
|
rec: item,
|
|
621
632
|
position: activeIndex
|
|
622
633
|
});
|
|
623
634
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
624
635
|
eventName: 'PageView',
|
|
625
|
-
product: (
|
|
636
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProducts,
|
|
626
637
|
rec: item,
|
|
627
638
|
position: activeIndex
|
|
628
639
|
});
|
|
@@ -720,14 +731,19 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
720
731
|
swiperRef.current.swiper.allowTouchMove = true;
|
|
721
732
|
}, 500);
|
|
722
733
|
}, onActiveIndexChange: (swiper) => {
|
|
734
|
+
var _a, _b;
|
|
723
735
|
setActiveIndex(swiper.activeIndex);
|
|
724
736
|
if (openHashtag)
|
|
725
737
|
return;
|
|
726
738
|
handleScrollEvent(swiper);
|
|
727
|
-
if (waterFallData || isEditor
|
|
739
|
+
if (waterFallData || isEditor)
|
|
728
740
|
return;
|
|
729
741
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
|
730
742
|
if (!isLoadMore) {
|
|
743
|
+
if (isDiyH5) {
|
|
744
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
745
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
746
|
+
}
|
|
731
747
|
setIsLoadMore(true);
|
|
732
748
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
|
733
749
|
var _a;
|