pb-sxp-ui 1.15.23-alpha.1 → 1.15.24
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 +143 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +143 -157
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +5 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +5 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +143 -157
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +5 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/es/core/components/SxpPageRender/ExpandableText.js +52 -44
- package/es/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/es/core/components/SxpPageRender/VideoWidget/index.js +18 -20
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +33 -42
- package/es/core/context/SxpDataSourceProvider.js +2 -2
- package/es/core/hooks/useEventReport.js +5 -6
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/SxpPageRender/ExpandableText.js +51 -44
- package/lib/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +18 -20
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +33 -42
- package/lib/core/context/SxpDataSourceProvider.js +2 -2
- package/lib/core/hooks/useEventReport.js +5 -6
- package/package.json +1 -1
@@ -86,7 +86,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
86
86
|
setIsLoadFinish(true);
|
87
87
|
}, []);
|
88
88
|
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
|
89
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
90
90
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
91
91
|
return;
|
92
92
|
setIsPauseVideo(false);
|
@@ -97,15 +97,14 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
97
97
|
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
98
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
99
99
|
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 : '',
|
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 : '', contentName: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []), position: index + '', contentFormat: 'video', traceInfo: (_q = item === null || item === void 0 ? void 0 : item.video) === null || _q === void 0 ? void 0 : _q.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
101
|
});
|
102
102
|
isFirstPlayRef.current = false;
|
103
103
|
}
|
104
104
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
105
105
|
const setCurrentTimeByStartTime = (0, react_1.useCallback)(() => {
|
106
|
-
var _a;
|
107
106
|
if (isDiyH5) {
|
108
|
-
videoRef.current.currentTime =
|
107
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
109
108
|
}
|
110
109
|
}, []);
|
111
110
|
const handLoadeddata = (0, react_1.useCallback)(() => {
|
@@ -138,7 +137,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
138
137
|
handLoadeddata();
|
139
138
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
140
139
|
const handleClickVideo = (0, react_1.useCallback)((type) => () => {
|
141
|
-
var _a, _b, _c, _d, _e, _f
|
140
|
+
var _a, _b, _c, _d, _e, _f;
|
142
141
|
if (!videoRef.current)
|
143
142
|
return;
|
144
143
|
if (!isLoadFinish)
|
@@ -159,20 +158,20 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
159
158
|
break;
|
160
159
|
default:
|
161
160
|
if (isPause) {
|
162
|
-
if (Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (
|
163
|
-
|
161
|
+
if (isDiyH5 && Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (scene === null || scene === void 0 ? void 0 : scene.endTime)) {
|
162
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
164
163
|
}
|
165
|
-
(
|
164
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
166
165
|
}
|
167
166
|
else {
|
168
|
-
(
|
167
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
169
168
|
}
|
170
169
|
setIsPauseVideo(!isPause);
|
171
170
|
break;
|
172
171
|
}
|
173
172
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
174
173
|
const handlePause = (0, react_1.useCallback)(() => {
|
175
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
174
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
176
175
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
177
176
|
return;
|
178
177
|
if (activeIndex !== index)
|
@@ -188,15 +187,14 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
188
187
|
eventSubject: 'playOverVideo',
|
189
188
|
eventDescription: 'User finished playing the video',
|
190
189
|
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 : '',
|
191
|
-
|
192
|
-
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 : '',
|
190
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
193
191
|
endTime: videoCurrentTime,
|
194
192
|
videoDuration,
|
195
193
|
playDuration,
|
196
|
-
contentTags: JSON.stringify((
|
194
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
197
195
|
position: index + '',
|
198
196
|
contentFormat: 'video',
|
199
|
-
traceInfo: (
|
197
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
200
198
|
}
|
201
199
|
});
|
202
200
|
}
|
@@ -208,17 +206,17 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
208
206
|
if (!videoRef.current || !isDiyH5)
|
209
207
|
return;
|
210
208
|
setTimeout(() => {
|
211
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
212
|
-
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 :
|
213
|
-
(
|
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();
|
214
212
|
if (!loopPlayRef.current)
|
215
213
|
return;
|
216
214
|
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
217
|
-
(
|
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);
|
218
216
|
}
|
219
217
|
else {
|
220
|
-
const i = (
|
221
|
-
(
|
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);
|
222
220
|
}
|
223
221
|
}
|
224
222
|
});
|
@@ -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;
|
48
48
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
49
49
|
if (!rec)
|
50
50
|
return;
|
@@ -64,10 +64,9 @@ 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 : '',
|
68
67
|
position: cacheActiveIndex + '',
|
69
|
-
contentTags: JSON.stringify((
|
70
|
-
traceInfo: (
|
68
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
69
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
71
70
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
72
71
|
fromKName,
|
73
72
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -92,7 +92,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
92
92
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
93
93
|
}, [data, ctaType, swiperRef]);
|
94
94
|
const handleSessionCompleted = (0, react_1.useCallback)((fk) => {
|
95
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
95
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
96
96
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
97
97
|
let fromKName = '';
|
98
98
|
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))) {
|
@@ -119,13 +119,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
119
119
|
eventSubject: 'sessionCompleted',
|
120
120
|
eventDescription: 'Session completed',
|
121
121
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
122
|
-
|
123
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
122
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
124
123
|
position: activeIndex + '',
|
125
124
|
fromKName: fk || fromKName,
|
126
125
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
127
|
-
ctatId: (
|
128
|
-
traceInfo: (
|
126
|
+
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
127
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
|
129
128
|
}
|
130
129
|
});
|
131
130
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -252,18 +251,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
252
251
|
return null;
|
253
252
|
}, [globalConfig, activeIndex, visList]);
|
254
253
|
const renderContent = (0, react_1.useCallback)((rec, index) => {
|
255
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
254
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
256
255
|
if (rec === 'organic menu') {
|
257
256
|
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)));
|
258
257
|
}
|
259
|
-
if ((
|
258
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
260
259
|
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 })));
|
261
260
|
}
|
262
|
-
if ((
|
261
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
263
262
|
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 }));
|
264
263
|
}
|
265
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
266
|
-
return (
|
264
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
265
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
267
266
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
268
267
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
269
268
|
const Component = (0, withBindDataSource_1.default)(t);
|
@@ -301,7 +300,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
301
300
|
};
|
302
301
|
}, [isShowMore]);
|
303
302
|
const renderBottom = (0, react_1.useCallback)((rec, index) => {
|
304
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
303
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
305
304
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
306
305
|
let cta = null;
|
307
306
|
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) {
|
@@ -310,23 +309,20 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
310
309
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
311
310
|
cta = '商品CTA';
|
312
311
|
}
|
313
|
-
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)) {
|
314
|
-
cta = '服务CTA';
|
315
|
-
}
|
316
312
|
else {
|
317
|
-
cta = (
|
313
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
318
314
|
}
|
319
315
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
320
316
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
321
|
-
((
|
322
|
-
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
317
|
+
((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && !isShowMore && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
318
|
+
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px` } },
|
323
319
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
324
320
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
325
321
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
326
322
|
react_1.default.createElement("div", null,
|
327
|
-
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: (
|
323
|
+
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: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', 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 }),
|
328
324
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
329
|
-
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (
|
325
|
+
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.hashTags) !== null && _l !== void 0 ? _l : [], itemId: (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.itemId, itemType: ((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
330
326
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
331
327
|
}
|
332
328
|
return null;
|
@@ -364,7 +360,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
364
360
|
return null;
|
365
361
|
}, [globalConfig, waterFallData]);
|
366
362
|
const handleViewImageStartEnd = (item) => {
|
367
|
-
var _a, _b, _c, _d, _e, _f
|
363
|
+
var _a, _b, _c, _d, _e, _f;
|
368
364
|
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)) {
|
369
365
|
const endTime = Date.now();
|
370
366
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -373,11 +369,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
373
369
|
eventSubject: 'viewImageCarouselEnd',
|
374
370
|
eventDescription: 'User end view the image carousel',
|
375
371
|
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 : '',
|
376
|
-
|
377
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
372
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
378
373
|
imageEndTime: `${endTime}`,
|
379
374
|
playDuration: `${duration}`,
|
380
|
-
contentTags: JSON.stringify((
|
375
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
381
376
|
position: activeIndex + '',
|
382
377
|
contentFormat: 'image',
|
383
378
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -386,7 +381,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
386
381
|
}
|
387
382
|
};
|
388
383
|
const handleSlideSkip = (item, position) => {
|
389
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
384
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
390
385
|
if (isPreview || waterFallData)
|
391
386
|
return;
|
392
387
|
const t = new Date() - curTime.current;
|
@@ -412,8 +407,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
412
407
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
413
408
|
position: position + '',
|
414
409
|
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 : '',
|
415
|
-
|
416
|
-
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 : '',
|
410
|
+
traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
|
417
411
|
contentFormat
|
418
412
|
}
|
419
413
|
});
|
@@ -423,7 +417,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
423
417
|
}
|
424
418
|
};
|
425
419
|
const handleScrollEvent = (swiper) => {
|
426
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
420
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
427
421
|
const item = data[swiper.previousIndex];
|
428
422
|
if (!item)
|
429
423
|
return;
|
@@ -440,12 +434,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
440
434
|
eventSubject: 'scrollDown',
|
441
435
|
eventDescription: 'User scroll down',
|
442
436
|
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 : '',
|
443
|
-
|
444
|
-
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 : '',
|
437
|
+
productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
445
438
|
requestId: null,
|
446
|
-
traceInfo: (
|
439
|
+
traceInfo: (_l = (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : (_k = item === null || item === void 0 ? void 0 : item.product) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : '',
|
447
440
|
contentFormat,
|
448
|
-
position: ((
|
441
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
449
442
|
}
|
450
443
|
});
|
451
444
|
handleViewImageStartEnd(item);
|
@@ -456,13 +449,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
456
449
|
eventInfo: {
|
457
450
|
eventSubject: 'scrollUp',
|
458
451
|
eventDescription: 'User scroll up',
|
459
|
-
contentId: (
|
460
|
-
|
461
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
452
|
+
contentId: (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
453
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
462
454
|
requestId: null,
|
463
|
-
traceInfo: (
|
455
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : '',
|
464
456
|
contentFormat,
|
465
|
-
position: ((
|
457
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
466
458
|
}
|
467
459
|
});
|
468
460
|
handleViewImageStartEnd(item);
|
@@ -486,7 +478,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
486
478
|
}
|
487
479
|
}, [openHashtag, data, activeIndex]);
|
488
480
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
489
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
481
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
490
482
|
const item = data[activeIndex];
|
491
483
|
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)) {
|
492
484
|
const startTime = Date.now();
|
@@ -496,10 +488,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
496
488
|
eventSubject: 'viewImageCarouselStart',
|
497
489
|
eventDescription: 'User start view the image carousel',
|
498
490
|
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 : '',
|
499
|
-
|
500
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
491
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
501
492
|
imageStartTime: `${startTime}`,
|
502
|
-
contentTags: JSON.stringify((
|
493
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
503
494
|
position: activeIndex + '',
|
504
495
|
contentFormat: 'image',
|
505
496
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -509,11 +500,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
509
500
|
if (enableCapi) {
|
510
501
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
511
502
|
eventName: 'ViewContent',
|
512
|
-
product: (
|
503
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
513
504
|
});
|
514
505
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
515
506
|
eventName: 'PageView',
|
516
|
-
product: (
|
507
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
517
508
|
});
|
518
509
|
}
|
519
510
|
}
|
@@ -464,7 +464,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
464
464
|
}
|
465
465
|
}), [bffFetch, utmVal]);
|
466
466
|
const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position) => {
|
467
|
-
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
|
467
|
+
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;
|
468
468
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
469
469
|
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);
|
470
470
|
let fromKName = '';
|
@@ -482,7 +482,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
482
482
|
}
|
483
483
|
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;
|
484
484
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
485
|
-
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 : '',
|
485
|
+
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: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
|
486
486
|
});
|
487
487
|
}, [bffEventReport, isFromHashtag]);
|
488
488
|
const h5EnterLink = (0, react_1.useCallback)(() => {
|
@@ -2,12 +2,12 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.useEventReport = void 0;
|
4
4
|
const react_1 = require("react");
|
5
|
-
const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
6
5
|
const useSxpDataSource_1 = require("./useSxpDataSource");
|
6
|
+
const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
7
7
|
function useEventReport() {
|
8
8
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = (0, useSxpDataSource_1.useSxpDataSource)();
|
9
9
|
const jumpToWeb = (0, react_1.useCallback)((e, data, product, cta, position, traceInfo) => {
|
10
|
-
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
|
10
|
+
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;
|
11
11
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
12
12
|
if (i !== -1) {
|
13
13
|
return;
|
@@ -40,11 +40,11 @@ function useEventReport() {
|
|
40
40
|
contentFormat = 'image';
|
41
41
|
}
|
42
42
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
43
|
-
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 : '',
|
43
|
+
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 : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
|
44
44
|
});
|
45
45
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
46
46
|
const productView = (0, react_1.useCallback)((data, product, cta, viewTime, position) => {
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
47
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
48
48
|
let fromKName = '';
|
49
49
|
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))) {
|
50
50
|
fromKName = 'pdpPage';
|
@@ -63,9 +63,8 @@ function useEventReport() {
|
|
63
63
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
64
64
|
position: position + '',
|
65
65
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
66
|
-
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 : '',
|
67
66
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
68
|
-
traceInfo: (
|
67
|
+
traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
69
68
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
70
69
|
eventSubject: 'productView',
|
71
70
|
eventDescription: 'User browsed the product'
|