pb-sxp-ui 1.15.22 → 1.15.23-alpha.1
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 +103 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +103 -86
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +103 -86
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- 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 +17 -15
- package/es/core/components/SxpPageRender/VideoWidget/index.js +20 -18
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/index.js +42 -33
- package/es/core/context/SxpDataSourceProvider.js +2 -2
- 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 +17 -15
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +20 -18
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/index.js +42 -33
- package/lib/core/context/SxpDataSourceProvider.js +2 -2
- package/lib/core/hooks/useEventReport.js +6 -5
- package/package.json +1 -1
@@ -22,7 +22,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
22
22
|
}, []);
|
23
23
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
24
24
|
const handlePlaying = useCallback(() => {
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
26
26
|
setIsPauseVideo(false);
|
27
27
|
const item = data[index];
|
28
28
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -35,14 +35,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
35
35
|
eventSubject: 'playVideo',
|
36
36
|
eventDescription: 'User played the video',
|
37
37
|
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 : '',
|
38
|
-
|
38
|
+
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 : '',
|
39
|
+
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 : '',
|
39
40
|
playType,
|
40
41
|
startTime: videoCurrentTime,
|
41
42
|
videoDuration,
|
42
|
-
contentTags: JSON.stringify((
|
43
|
+
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 : []),
|
43
44
|
position: index + '',
|
44
45
|
contentFormat: 'video',
|
45
|
-
traceInfo: (
|
46
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
46
47
|
}
|
47
48
|
});
|
48
49
|
setIsFirstPlay(false);
|
@@ -81,7 +82,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
81
82
|
}
|
82
83
|
}, [isLoadFinish]);
|
83
84
|
const onPause = useCallback(() => {
|
84
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
85
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
85
86
|
const item = data[index];
|
86
87
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
87
88
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -92,14 +93,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
92
93
|
eventSubject: 'playOverVideo',
|
93
94
|
eventDescription: 'User finished playing the video',
|
94
95
|
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 : '',
|
95
|
-
|
96
|
+
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 : '',
|
97
|
+
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 : '',
|
96
98
|
endTime: videoCurrentTime,
|
97
99
|
videoDuration,
|
98
100
|
playDuration,
|
99
|
-
contentTags: JSON.stringify((
|
101
|
+
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 : []),
|
100
102
|
position: index + '',
|
101
103
|
contentFormat: 'video',
|
102
|
-
traceInfo: (
|
104
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
103
105
|
}
|
104
106
|
});
|
105
107
|
}
|
@@ -13,7 +13,7 @@ const LikeButton = (_a) => {
|
|
13
13
|
const likeIcon = useIconLink(defaultLikeIconPath);
|
14
14
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath);
|
15
15
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
16
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
16
|
+
var _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;
|
17
17
|
if (state) {
|
18
18
|
setState(false);
|
19
19
|
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
@@ -22,51 +22,53 @@ const LikeButton = (_a) => {
|
|
22
22
|
eventSubject: 'favoriteContentCanceled',
|
23
23
|
eventDescription: 'This content was unfavorite by the user',
|
24
24
|
contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
25
|
-
|
26
|
-
|
25
|
+
sceneId: (_k = (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.scene) === null || _j === void 0 ? void 0 : _j.sceneId) !== null && _k !== void 0 ? _k : '',
|
26
|
+
contentName: (_m = (_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '',
|
27
|
+
contentTags: JSON.stringify((_p = (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []),
|
27
28
|
position: position + '',
|
28
|
-
contentFormat: ((
|
29
|
-
traceInfo: (
|
29
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
30
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
30
31
|
}
|
31
32
|
});
|
32
33
|
if (!result) {
|
33
34
|
setState(true);
|
34
35
|
}
|
35
36
|
else {
|
36
|
-
const nRtcList = (
|
37
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
37
38
|
if (index === position) {
|
38
39
|
item.isCollected = false;
|
39
40
|
}
|
40
41
|
return item;
|
41
|
-
})) !== null &&
|
42
|
+
})) !== null && _s !== void 0 ? _s : [];
|
42
43
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
43
44
|
}
|
44
45
|
}
|
45
46
|
else {
|
46
47
|
setState(true);
|
47
|
-
const result = (
|
48
|
+
const result = (_t = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _t !== void 0 ? _t : false;
|
48
49
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
49
50
|
eventInfo: {
|
50
51
|
eventSubject: 'favoriteContent',
|
51
52
|
eventDescription: 'This content was favorite by the user',
|
52
|
-
contentId: (
|
53
|
-
|
54
|
-
|
53
|
+
contentId: (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.itemId) !== null && _v !== void 0 ? _v : '',
|
54
|
+
sceneId: (_y = (_x = (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.scene) === null || _x === void 0 ? void 0 : _x.sceneId) !== null && _y !== void 0 ? _y : '',
|
55
|
+
contentName: (_0 = (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.title) !== null && _0 !== void 0 ? _0 : '',
|
56
|
+
contentTags: JSON.stringify((_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.tags) !== null && _2 !== void 0 ? _2 : []),
|
55
57
|
position: position + '',
|
56
|
-
contentFormat: ((
|
57
|
-
traceInfo: (
|
58
|
+
contentFormat: ((_3 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _3 === void 0 ? void 0 : _3.url) ? 'video' : 'image',
|
59
|
+
traceInfo: (_4 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _4 === void 0 ? void 0 : _4.traceInfo
|
58
60
|
}
|
59
61
|
});
|
60
62
|
if (!result) {
|
61
63
|
setState(false);
|
62
64
|
}
|
63
65
|
else {
|
64
|
-
const nRtcList = (
|
66
|
+
const nRtcList = (_5 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
65
67
|
if (index === position) {
|
66
68
|
item.isCollected = true;
|
67
69
|
}
|
68
70
|
return item;
|
69
|
-
})) !== null &&
|
71
|
+
})) !== null && _5 !== void 0 ? _5 : [];
|
70
72
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
71
73
|
}
|
72
74
|
}
|
@@ -84,7 +84,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
84
84
|
setIsLoadFinish(true);
|
85
85
|
}, []);
|
86
86
|
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
87
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
87
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
88
88
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
89
89
|
return;
|
90
90
|
setIsPauseVideo(false);
|
@@ -95,14 +95,15 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
95
95
|
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);
|
96
96
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
97
97
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
98
|
-
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 : '',
|
98
|
+
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) + '' }))
|
99
99
|
});
|
100
100
|
isFirstPlayRef.current = false;
|
101
101
|
}
|
102
102
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
103
103
|
const setCurrentTimeByStartTime = useCallback(() => {
|
104
|
+
var _a;
|
104
105
|
if (isDiyH5) {
|
105
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
106
|
+
videoRef.current.currentTime = (_a = scene === null || scene === void 0 ? void 0 : scene.startTime) !== null && _a !== void 0 ? _a : 0;
|
106
107
|
}
|
107
108
|
}, []);
|
108
109
|
const handLoadeddata = useCallback(() => {
|
@@ -135,7 +136,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
135
136
|
handLoadeddata();
|
136
137
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
137
138
|
const handleClickVideo = useCallback((type) => () => {
|
138
|
-
var _a, _b, _c, _d, _e, _f;
|
139
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
139
140
|
if (!videoRef.current)
|
140
141
|
return;
|
141
142
|
if (!isLoadFinish)
|
@@ -156,20 +157,20 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
156
157
|
break;
|
157
158
|
default:
|
158
159
|
if (isPause) {
|
159
|
-
if (
|
160
|
-
|
160
|
+
if (Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= ((_e = scene === null || scene === void 0 ? void 0 : scene.endTime) !== null && _e !== void 0 ? _e : (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.duration)) {
|
161
|
+
setCurrentTimeByStartTime();
|
161
162
|
}
|
162
|
-
(
|
163
|
+
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.play();
|
163
164
|
}
|
164
165
|
else {
|
165
|
-
(
|
166
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.pause();
|
166
167
|
}
|
167
168
|
setIsPauseVideo(!isPause);
|
168
169
|
break;
|
169
170
|
}
|
170
171
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
171
172
|
const handlePause = useCallback(() => {
|
172
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
173
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
173
174
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
174
175
|
return;
|
175
176
|
if (activeIndex !== index)
|
@@ -185,14 +186,15 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
185
186
|
eventSubject: 'playOverVideo',
|
186
187
|
eventDescription: 'User finished playing the video',
|
187
188
|
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 : '',
|
188
|
-
|
189
|
+
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 : '',
|
190
|
+
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 : '',
|
189
191
|
endTime: videoCurrentTime,
|
190
192
|
videoDuration,
|
191
193
|
playDuration,
|
192
|
-
contentTags: JSON.stringify((
|
194
|
+
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 : []),
|
193
195
|
position: index + '',
|
194
196
|
contentFormat: 'video',
|
195
|
-
traceInfo: (
|
197
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
196
198
|
}
|
197
199
|
});
|
198
200
|
}
|
@@ -204,17 +206,17 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
204
206
|
if (!videoRef.current || !isDiyH5)
|
205
207
|
return;
|
206
208
|
setTimeout(() => {
|
207
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
208
|
-
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)) {
|
209
|
-
(
|
209
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
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 : (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration)) {
|
211
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
210
212
|
if (!loopPlayRef.current)
|
211
213
|
return;
|
212
214
|
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
213
|
-
(
|
215
|
+
(_f = (_e = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _e === void 0 ? void 0 : _e.swiper) === null || _f === void 0 ? void 0 : _f.slideTo(0);
|
214
216
|
}
|
215
217
|
else {
|
216
|
-
const i = (
|
217
|
-
(
|
218
|
+
const i = (_h = (_g = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _g === void 0 ? void 0 : _g.swiper) === null || _h === void 0 ? void 0 : _h.activeIndex;
|
219
|
+
(_k = (_j = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _j === void 0 ? void 0 : _j.swiper) === null || _k === void 0 ? void 0 : _k.slideTo(i + 1);
|
218
220
|
}
|
219
221
|
}
|
220
222
|
});
|
@@ -41,7 +41,7 @@ const WaterFall = (props) => {
|
|
41
41
|
}
|
42
42
|
}, [waterFallData]);
|
43
43
|
const reportTagsView = useCallback(() => {
|
44
|
-
var _a, _b, _c, _d, _e, _f;
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
45
45
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
46
46
|
if (!rec)
|
47
47
|
return;
|
@@ -61,9 +61,10 @@ const WaterFall = (props) => {
|
|
61
61
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
62
62
|
eventInfo: {
|
63
63
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
64
|
+
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 : '',
|
64
65
|
position: cacheActiveIndex + '',
|
65
|
-
contentTags: JSON.stringify((
|
66
|
-
traceInfo: (
|
66
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
67
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
67
68
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
68
69
|
fromKName,
|
69
70
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -89,7 +89,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
89
89
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
90
90
|
}, [data, ctaType, swiperRef]);
|
91
91
|
const handleSessionCompleted = useCallback((fk) => {
|
92
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
92
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
93
93
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
94
94
|
let fromKName = '';
|
95
95
|
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))) {
|
@@ -116,12 +116,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
116
116
|
eventSubject: 'sessionCompleted',
|
117
117
|
eventDescription: 'Session completed',
|
118
118
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
119
|
-
|
119
|
+
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 : '',
|
120
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
120
121
|
position: activeIndex + '',
|
121
122
|
fromKName: fk || fromKName,
|
122
123
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
123
|
-
ctatId: (
|
124
|
-
traceInfo: (
|
124
|
+
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 : '',
|
125
|
+
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 : ''
|
125
126
|
}
|
126
127
|
});
|
127
128
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -248,18 +249,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
248
249
|
return null;
|
249
250
|
}, [globalConfig, activeIndex, visList]);
|
250
251
|
const renderContent = useCallback((rec, index) => {
|
251
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
252
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
252
253
|
if (rec === 'organic menu') {
|
253
254
|
return (React.createElement(MultiPosts, 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)));
|
254
255
|
}
|
255
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
256
|
+
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)) {
|
256
257
|
return (React.createElement(VideoWidget, 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 })));
|
257
258
|
}
|
258
|
-
if ((
|
259
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
259
260
|
return (React.createElement(PictureGroup, { 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 }));
|
260
261
|
}
|
261
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
262
|
-
return (
|
262
|
+
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) {
|
263
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
263
264
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
264
265
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
265
266
|
const Component = withBindDataSource(t);
|
@@ -297,7 +298,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
297
298
|
};
|
298
299
|
}, [isShowMore]);
|
299
300
|
const renderBottom = useCallback((rec, index) => {
|
300
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
301
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
301
302
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
302
303
|
let cta = null;
|
303
304
|
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) {
|
@@ -306,20 +307,23 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
306
307
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
307
308
|
cta = '商品CTA';
|
308
309
|
}
|
310
|
+
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)) {
|
311
|
+
cta = '服务CTA';
|
312
|
+
}
|
309
313
|
else {
|
310
|
-
cta = (
|
314
|
+
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;
|
311
315
|
}
|
312
316
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
313
317
|
return (React.createElement(React.Fragment, null,
|
314
|
-
((
|
315
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
318
|
+
((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
319
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _k !== void 0 ? _k : 40}px` } },
|
316
320
|
React.createElement(Nudge, { nudge: nudge }),
|
317
321
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
318
322
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
319
323
|
React.createElement("div", null,
|
320
|
-
React.createElement(ExpandableText, { 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: (
|
324
|
+
React.createElement(ExpandableText, { 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: (_m = (_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '', 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 }),
|
321
325
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
322
|
-
React.createElement(Hashtag, { index: activeIndex, tags: (
|
326
|
+
React.createElement(Hashtag, { index: activeIndex, tags: (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.hashTags) !== null && _p !== void 0 ? _p : [], itemId: (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.itemId, itemType: ((_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
323
327
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
324
328
|
}
|
325
329
|
return null;
|
@@ -357,7 +361,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
357
361
|
return null;
|
358
362
|
}, [globalConfig, waterFallData]);
|
359
363
|
const handleViewImageStartEnd = (item) => {
|
360
|
-
var _a, _b, _c, _d, _e, _f;
|
364
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
361
365
|
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)) {
|
362
366
|
const endTime = Date.now();
|
363
367
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -366,10 +370,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
366
370
|
eventSubject: 'viewImageCarouselEnd',
|
367
371
|
eventDescription: 'User end view the image carousel',
|
368
372
|
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 : '',
|
369
|
-
|
373
|
+
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 : '',
|
374
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
370
375
|
imageEndTime: `${endTime}`,
|
371
376
|
playDuration: `${duration}`,
|
372
|
-
contentTags: JSON.stringify((
|
377
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
373
378
|
position: activeIndex + '',
|
374
379
|
contentFormat: 'image',
|
375
380
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -378,7 +383,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
378
383
|
}
|
379
384
|
};
|
380
385
|
const handleSlideSkip = (item, position) => {
|
381
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
386
|
+
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;
|
382
387
|
if (isPreview || waterFallData)
|
383
388
|
return;
|
384
389
|
const t = new Date() - curTime.current;
|
@@ -404,7 +409,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
404
409
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
405
410
|
position: position + '',
|
406
411
|
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 : '',
|
407
|
-
|
412
|
+
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 : '',
|
413
|
+
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 : '',
|
408
414
|
contentFormat
|
409
415
|
}
|
410
416
|
});
|
@@ -414,7 +420,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
414
420
|
}
|
415
421
|
};
|
416
422
|
const handleScrollEvent = (swiper) => {
|
417
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
423
|
+
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;
|
418
424
|
const item = data[swiper.previousIndex];
|
419
425
|
if (!item)
|
420
426
|
return;
|
@@ -431,11 +437,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
431
437
|
eventSubject: 'scrollDown',
|
432
438
|
eventDescription: 'User scroll down',
|
433
439
|
contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
|
434
|
-
|
440
|
+
sceneId: (_h = (_g = (_f = item === null || item === void 0 ? void 0 : item.video) === null || _f === void 0 ? void 0 : _f.scene) === null || _g === void 0 ? void 0 : _g.sceneId) !== null && _h !== void 0 ? _h : '',
|
441
|
+
productId: (_k = (_j = item === null || item === void 0 ? void 0 : item.product) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
435
442
|
requestId: null,
|
436
|
-
traceInfo: (
|
443
|
+
traceInfo: (_p = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
437
444
|
contentFormat,
|
438
|
-
position: ((
|
445
|
+
position: ((_q = swiper.previousIndex) !== null && _q !== void 0 ? _q : 0) + ''
|
439
446
|
}
|
440
447
|
});
|
441
448
|
handleViewImageStartEnd(item);
|
@@ -446,12 +453,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
446
453
|
eventInfo: {
|
447
454
|
eventSubject: 'scrollUp',
|
448
455
|
eventDescription: 'User scroll up',
|
449
|
-
contentId: (
|
450
|
-
|
456
|
+
contentId: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
457
|
+
sceneId: (_v = (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.scene) === null || _u === void 0 ? void 0 : _u.sceneId) !== null && _v !== void 0 ? _v : '',
|
458
|
+
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
451
459
|
requestId: null,
|
452
|
-
traceInfo: (
|
460
|
+
traceInfo: (_1 = (_z = (_y = item === null || item === void 0 ? void 0 : item.video) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_0 = item === null || item === void 0 ? void 0 : item.product) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : '',
|
453
461
|
contentFormat,
|
454
|
-
position: ((
|
462
|
+
position: ((_2 = swiper.previousIndex) !== null && _2 !== void 0 ? _2 : 0) + ''
|
455
463
|
}
|
456
464
|
});
|
457
465
|
handleViewImageStartEnd(item);
|
@@ -475,7 +483,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
475
483
|
}
|
476
484
|
}, [openHashtag, data, activeIndex]);
|
477
485
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
478
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
486
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
479
487
|
const item = data[activeIndex];
|
480
488
|
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)) {
|
481
489
|
const startTime = Date.now();
|
@@ -485,9 +493,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
485
493
|
eventSubject: 'viewImageCarouselStart',
|
486
494
|
eventDescription: 'User start view the image carousel',
|
487
495
|
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 : '',
|
488
|
-
|
496
|
+
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 : '',
|
497
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
489
498
|
imageStartTime: `${startTime}`,
|
490
|
-
contentTags: JSON.stringify((
|
499
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
491
500
|
position: activeIndex + '',
|
492
501
|
contentFormat: 'image',
|
493
502
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -497,11 +506,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
497
506
|
if (enableCapi) {
|
498
507
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
499
508
|
eventName: 'ViewContent',
|
500
|
-
product: (
|
509
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProduct
|
501
510
|
});
|
502
511
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
503
512
|
eventName: 'PageView',
|
504
|
-
product: (
|
513
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProduct
|
505
514
|
});
|
506
515
|
}
|
507
516
|
}
|
@@ -461,7 +461,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
461
461
|
}
|
462
462
|
}), [bffFetch, utmVal]);
|
463
463
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
464
|
-
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;
|
464
|
+
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;
|
465
465
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
466
466
|
const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
|
467
467
|
let fromKName = '';
|
@@ -479,7 +479,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
479
479
|
}
|
480
480
|
const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
|
481
481
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
482
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (
|
482
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', sceneId: (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.scene) === null || _w === void 0 ? void 0 : _w.sceneId) !== null && _x !== void 0 ? _x : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_13 = (_10 = (_5 = (_1 = (_y = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : (_4 = (_3 = (_2 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.bindCta) === null || _4 === void 0 ? void 0 : _4.traceInfo) !== null && _5 !== void 0 ? _5 : (_9 = (_8 = (_7 = (_6 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _6 === void 0 ? void 0 : _6.bindProducts) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '', fromKName, fromKPage: (_14 = location === null || location === void 0 ? void 0 : location.href) !== null && _14 !== void 0 ? _14 : '', contentFormat })
|
483
483
|
});
|
484
484
|
}, [bffEventReport, isFromHashtag]);
|
485
485
|
const h5EnterLink = useCallback(() => {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { useCallback } from 'react';
|
2
|
-
import { useSxpDataSource } from './useSxpDataSource';
|
3
2
|
import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
3
|
+
import { useSxpDataSource } from './useSxpDataSource';
|
4
4
|
export function useEventReport() {
|
5
5
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
6
6
|
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
7
|
-
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;
|
7
|
+
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;
|
8
8
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
9
9
|
if (i !== -1) {
|
10
10
|
return;
|
@@ -37,11 +37,11 @@ export function useEventReport() {
|
|
37
37
|
contentFormat = 'image';
|
38
38
|
}
|
39
39
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
40
|
-
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '',
|
40
|
+
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', sceneId: (_2 = (_1 = (_0 = data === null || data === void 0 ? void 0 : data.video) === null || _0 === void 0 ? void 0 : _0.scene) === null || _1 === void 0 ? void 0 : _1.sceneId) !== null && _2 !== void 0 ? _2 : '', ctatId: (_3 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _3 !== void 0 ? _3 : '', traceInfo: (_16 = (_13 = (_11 = (_7 = (_4 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _4 !== void 0 ? _4 : (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProduct) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = data === null || data === void 0 ? void 0 : data.video) === null || _8 === void 0 ? void 0 : _8.bindProducts) === null || _9 === void 0 ? void 0 : _9[0]) === null || _10 === void 0 ? void 0 : _10.traceInfo) !== null && _11 !== void 0 ? _11 : (_12 = data === null || data === void 0 ? void 0 : data.product) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : (_15 = (_14 = data === null || data === void 0 ? void 0 : data.video) === null || _14 === void 0 ? void 0 : _14.bindCta) === null || _15 === void 0 ? void 0 : _15.traceInfo) !== null && _16 !== void 0 ? _16 : '' }, (contentFormat && { contentFormat }))
|
41
41
|
});
|
42
42
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
43
43
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
44
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
45
45
|
let fromKName = '';
|
46
46
|
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
47
47
|
fromKName = 'pdpPage';
|
@@ -60,8 +60,9 @@ export function useEventReport() {
|
|
60
60
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
61
61
|
position: position + '',
|
62
62
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
63
|
+
sceneId: (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
63
64
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
64
|
-
traceInfo: (
|
65
|
+
traceInfo: (_s = (_q = (_l = (_h = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _h !== void 0 ? _h : (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_p = (_o = (_m = data === null || data === void 0 ? void 0 : data.video) === null || _m === void 0 ? void 0 : _m.bindProducts) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_r = data === null || data === void 0 ? void 0 : data.product) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : '',
|
65
66
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
66
67
|
eventSubject: 'productView',
|
67
68
|
eventDescription: 'User browsed the product'
|