pb-sxp-ui 1.7.1 → 1.7.2
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 +118 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +118 -57
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +118 -57
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/Modal/index.js +6 -3
- package/es/core/components/SxpPageRender/VideoWidget/index.js +8 -5
- package/es/core/components/SxpPageRender/WaterFall/index.js +5 -2
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +10 -17
- package/es/core/context/SxpDataSourceProvider.d.ts +2 -4
- package/es/core/context/SxpDataSourceProvider.js +53 -11
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +12 -7
- package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -8
- package/es/materials/sxp/popup/CommodityList/index.js +7 -2
- package/lib/core/components/SxpPageRender/Modal/index.js +5 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +8 -5
- package/lib/core/components/SxpPageRender/WaterFall/index.js +5 -2
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +10 -17
- package/lib/core/context/SxpDataSourceProvider.d.ts +2 -4
- package/lib/core/context/SxpDataSourceProvider.js +53 -11
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +12 -7
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -8
- package/lib/materials/sxp/popup/CommodityList/index.js +6 -1
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import { debounce } from 'lodash';
|
2
|
-
import React, { memo, useEffect, useMemo, useRef, useState } from 'react';
|
2
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
3
|
import * as ReactDOM from 'react-dom';
|
4
4
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
@@ -15,7 +15,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
15
15
|
const [isShow, setIsShow] = useState(false);
|
16
16
|
const modalEleRef = useRef(null);
|
17
17
|
const { globalConfig, popupDetailData } = useSxpDataSource();
|
18
|
-
const { schema: _schema } = useEditor();
|
18
|
+
const { schema: _schema, popup: _popup } = useEditor();
|
19
19
|
const [scrollTop, setScrollTop] = useState(15);
|
20
20
|
useEffect(() => {
|
21
21
|
const parentNode = document.getElementById('sxp-render');
|
@@ -53,6 +53,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
53
53
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
54
54
|
}
|
55
55
|
}, [isOpen, popup]);
|
56
|
+
const child = useCallback(() => {
|
57
|
+
return children;
|
58
|
+
}, [_popup]);
|
56
59
|
if (!modalEleRef.current)
|
57
60
|
return null;
|
58
61
|
const handleClose = debounce(() => {
|
@@ -135,6 +138,6 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
135
138
|
var _a;
|
136
139
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
137
140
|
}
|
138
|
-
})),
|
141
|
+
})), child())))))), modalEleRef.current);
|
139
142
|
};
|
140
143
|
export default memo(Modal);
|
@@ -240,17 +240,18 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
240
240
|
};
|
241
241
|
}, [isActive]);
|
242
242
|
useEffect(() => {
|
243
|
-
var _a, _b;
|
243
|
+
var _a, _b, _c, _d;
|
244
244
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
245
245
|
return;
|
246
246
|
if (isActive) {
|
247
247
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
248
|
-
eventName: 'ViewContent'
|
248
|
+
eventName: 'ViewContent',
|
249
|
+
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
249
250
|
});
|
250
|
-
(
|
251
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
251
252
|
}
|
252
253
|
else {
|
253
|
-
(
|
254
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
254
255
|
}
|
255
256
|
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
256
257
|
useEffect(() => {
|
@@ -269,9 +270,11 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
269
270
|
if (!isActive)
|
270
271
|
return;
|
271
272
|
const onShow = () => {
|
273
|
+
var _a, _b;
|
272
274
|
handleClickVideo('start')();
|
273
275
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
274
|
-
eventName: 'ViewContent'
|
276
|
+
eventName: 'ViewContent',
|
277
|
+
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
275
278
|
});
|
276
279
|
};
|
277
280
|
const onHide = handleClickVideo('pause');
|
@@ -9,7 +9,7 @@ import { useSxpDataSource } from '../../../../core/hooks';
|
|
9
9
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
10
10
|
const WaterFall = (props) => {
|
11
11
|
var _a;
|
12
|
-
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
|
12
|
+
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
|
13
13
|
const { backMainFeed } = useEventReport();
|
14
14
|
const ref = useRef(null);
|
15
15
|
const modalEleRef = useRef(null);
|
@@ -78,8 +78,11 @@ const WaterFall = (props) => {
|
|
78
78
|
useEffect(() => {
|
79
79
|
if (openHashtag) {
|
80
80
|
setViewTime(new Date());
|
81
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
82
|
+
eventName: 'PageView'
|
83
|
+
});
|
81
84
|
}
|
82
|
-
}, [openHashtag]);
|
85
|
+
}, [openHashtag, bffFbReport]);
|
83
86
|
useEffect(() => {
|
84
87
|
const initTime = () => {
|
85
88
|
setViewTime(new Date());
|
@@ -48,9 +48,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
48
48
|
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
49
49
|
const now = new Date();
|
50
50
|
viewTime.current = now;
|
51
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
52
|
-
eventName: 'PageView'
|
53
|
-
});
|
54
51
|
}
|
55
52
|
}, [data === null || data === void 0 ? void 0 : data.length]);
|
56
53
|
const handleH5EnterLink = useCallback(() => {
|
@@ -59,11 +56,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
59
56
|
if (data.length > 0) {
|
60
57
|
const now = new Date();
|
61
58
|
viewTime.current = now;
|
62
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
63
|
-
eventName: 'PageView'
|
64
|
-
});
|
65
59
|
}
|
66
|
-
}, [data.length,
|
60
|
+
}, [data.length, h5EnterLink]);
|
67
61
|
useEffect(() => {
|
68
62
|
var _a;
|
69
63
|
if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
|
@@ -229,7 +223,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
229
223
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
230
224
|
const Component = withBindDataSource(t);
|
231
225
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
232
|
-
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index })));
|
226
|
+
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index, isActive: activeIndex === index })));
|
233
227
|
});
|
234
228
|
}
|
235
229
|
return null;
|
@@ -365,7 +359,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
365
359
|
}
|
366
360
|
};
|
367
361
|
const handleScrollEvent = (swiper) => {
|
368
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
362
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
369
363
|
const item = data[swiper.previousIndex];
|
370
364
|
if (!item)
|
371
365
|
return;
|
@@ -407,12 +401,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
407
401
|
handleReportViewImageEnd(item);
|
408
402
|
}
|
409
403
|
handleReportProductView(item);
|
410
|
-
const curItem = data[swiper.activeIndex];
|
411
|
-
if (!((_r = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _r === void 0 ? void 0 : _r.url) && !((_s = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
|
412
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
413
|
-
eventName: 'ProductView'
|
414
|
-
});
|
415
|
-
}
|
416
404
|
viewTime.current = new Date();
|
417
405
|
};
|
418
406
|
const handleReportProductView = (item) => {
|
@@ -431,7 +419,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
431
419
|
}
|
432
420
|
}, [openHashtag, data, activeIndex]);
|
433
421
|
const handleViewImageStartEvent = (activeIndex) => {
|
434
|
-
var _a, _b, _c, _d, _e, _f;
|
422
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
435
423
|
const item = data[activeIndex];
|
436
424
|
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)) {
|
437
425
|
const startTime = Date.now();
|
@@ -450,7 +438,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
450
438
|
}
|
451
439
|
});
|
452
440
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
453
|
-
eventName: 'ViewContent'
|
441
|
+
eventName: 'ViewContent',
|
442
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
443
|
+
});
|
444
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
445
|
+
eventName: 'PageView',
|
446
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
454
447
|
});
|
455
448
|
}
|
456
449
|
};
|
@@ -67,10 +67,8 @@ export interface ISxpDataSourceContext {
|
|
67
67
|
videoRef?: any;
|
68
68
|
setVideoRef?: React.Dispatch<React.SetStateAction<any>>;
|
69
69
|
bffFbReport?: (body: {
|
70
|
-
eventName:
|
71
|
-
|
72
|
-
eventSourceUrl?: string;
|
73
|
-
externalId?: string;
|
70
|
+
eventName: 'PageView' | 'ProductView' | 'ViewContent';
|
71
|
+
product?: any;
|
74
72
|
}) => Promise<any> | undefined | boolean;
|
75
73
|
curTime?: any;
|
76
74
|
h5EnterLink?: () => void;
|
@@ -189,23 +189,65 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
189
189
|
type: 'beacon'
|
190
190
|
});
|
191
191
|
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
192
|
-
const bffFbReport = useCallback((
|
193
|
-
var _b, _c, _d;
|
194
|
-
var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
|
192
|
+
const bffFbReport = useCallback(({ eventName, product }) => {
|
193
|
+
var _a, _b, _c, _d;
|
195
194
|
if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
196
195
|
return;
|
197
196
|
}
|
198
|
-
|
197
|
+
let jsonParams = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName];
|
199
198
|
const urlParams = new URLSearchParams(window.location.search);
|
200
|
-
const fbclid = urlParams.get('fbclid');
|
199
|
+
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
200
|
+
const fix_par = {
|
201
|
+
event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
|
202
|
+
external_id: storeAndLoadFeUserId(),
|
203
|
+
client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '',
|
204
|
+
fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
|
205
|
+
fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
|
206
|
+
time: new Date().getTime()
|
207
|
+
};
|
208
|
+
const regex = /\{\{(.*?)\}\}/g;
|
209
|
+
const getEventParams = (obj) => {
|
210
|
+
if (!obj)
|
211
|
+
return;
|
212
|
+
if (obj instanceof Array) {
|
213
|
+
obj === null || obj === void 0 ? void 0 : obj.map((item) => getEventParams(item));
|
214
|
+
}
|
215
|
+
else {
|
216
|
+
for (const key in obj) {
|
217
|
+
if (obj.hasOwnProperty(key)) {
|
218
|
+
const value = obj === null || obj === void 0 ? void 0 : obj[key];
|
219
|
+
if (typeof value === 'object') {
|
220
|
+
getEventParams(value);
|
221
|
+
}
|
222
|
+
else if (typeof value === 'string') {
|
223
|
+
const matches = value === null || value === void 0 ? void 0 : value.match(regex);
|
224
|
+
if (matches) {
|
225
|
+
matches.forEach((match) => {
|
226
|
+
const prop = match.substring(2, match.length - 2);
|
227
|
+
try {
|
228
|
+
const replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
229
|
+
if (replaceValue) {
|
230
|
+
obj[key] = replaceValue;
|
231
|
+
}
|
232
|
+
else {
|
233
|
+
delete obj[key];
|
234
|
+
}
|
235
|
+
}
|
236
|
+
catch (error) {
|
237
|
+
delete obj[key];
|
238
|
+
console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
|
239
|
+
}
|
240
|
+
});
|
241
|
+
}
|
242
|
+
}
|
243
|
+
}
|
244
|
+
}
|
245
|
+
}
|
246
|
+
};
|
247
|
+
getEventParams(jsonParams);
|
201
248
|
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
|
202
249
|
method: 'POST',
|
203
|
-
body:
|
204
|
-
eventName,
|
205
|
-
actionSource,
|
206
|
-
eventSourceUrl,
|
207
|
-
userData: Object.assign(Object.assign(Object.assign({ externalId: fakeUserId }, (fbclid && { fbc: `fb.2.${new Date().getTime()}.${fbclid}` })), (getCookie('_fbp') && { fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` })), { clientUserAgent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '' })
|
208
|
-
},
|
250
|
+
body: jsonParams,
|
209
251
|
type: 'beacon'
|
210
252
|
});
|
211
253
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
@@ -14,7 +14,7 @@ import CommodityGroup from '../../template/components/CommodityGroup';
|
|
14
14
|
import { getPriceText } from '../../../../core/utils/materials';
|
15
15
|
const CommodityDetail = (_a) => {
|
16
16
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
17
|
-
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
|
17
|
+
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
18
18
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
19
19
|
const { jumpToWeb, productView } = useEventReport();
|
20
20
|
const curTimeRef = useRef(null);
|
@@ -44,12 +44,17 @@ const CommodityDetail = (_a) => {
|
|
44
44
|
}
|
45
45
|
};
|
46
46
|
useEffect(() => {
|
47
|
-
if (!
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
if (!isActive)
|
48
|
+
return;
|
49
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
50
|
+
eventName: 'ProductView',
|
51
|
+
product
|
52
|
+
});
|
53
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
54
|
+
eventName: 'PageView',
|
55
|
+
product
|
56
|
+
});
|
57
|
+
}, [isActive, bffFbReport]);
|
53
58
|
useEffect(() => {
|
54
59
|
const initTime = () => {
|
55
60
|
curTimeRef.current = new Date();
|
@@ -10,7 +10,7 @@ import { useEventReport } from '../../../../core/hooks/useEventReport';
|
|
10
10
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
11
11
|
const CommodityDetailDiro = (_a) => {
|
12
12
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
13
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "index"]);
|
13
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, index, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "index", "isActive"]);
|
14
14
|
const [spread, setSpread] = useState(true);
|
15
15
|
const { sxpParameter } = useSxpDataSource();
|
16
16
|
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
@@ -36,14 +36,21 @@ const CommodityDetailDiro = (_a) => {
|
|
36
36
|
}
|
37
37
|
};
|
38
38
|
useEffect(() => {
|
39
|
-
if (!
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
if (!isActive)
|
40
|
+
return;
|
41
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
42
|
+
eventName: 'ProductView',
|
43
|
+
product
|
44
|
+
});
|
45
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
46
|
+
eventName: 'PageView',
|
47
|
+
product
|
48
|
+
});
|
49
|
+
}, [isActive, bffFbReport]);
|
45
50
|
useEffect(() => {
|
46
51
|
const initTime = () => {
|
52
|
+
if (!isActive)
|
53
|
+
return;
|
47
54
|
curTimeRef.current = new Date();
|
48
55
|
};
|
49
56
|
initTime();
|
@@ -51,7 +58,7 @@ const CommodityDetailDiro = (_a) => {
|
|
51
58
|
return () => {
|
52
59
|
window.removeEventListener('pageshow', initTime);
|
53
60
|
};
|
54
|
-
}, []);
|
61
|
+
}, [isActive]);
|
55
62
|
const priceText = useMemo(() => {
|
56
63
|
var _a, _b, _c, _d, _e;
|
57
64
|
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
@@ -14,7 +14,7 @@ import CommodityGroup from '../../template/components/CommodityGroup';
|
|
14
14
|
import { getPriceText } from '../../../../core/utils/materials';
|
15
15
|
const CommodityDetailDiroNew = (_a) => {
|
16
16
|
var _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;
|
17
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
|
17
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
18
18
|
const [spread, setSpread] = useState(true);
|
19
19
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
20
20
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -48,14 +48,21 @@ const CommodityDetailDiroNew = (_a) => {
|
|
48
48
|
}
|
49
49
|
};
|
50
50
|
useEffect(() => {
|
51
|
-
if (!
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
if (!isActive)
|
52
|
+
return;
|
53
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
54
|
+
eventName: 'ProductView',
|
55
|
+
product
|
56
|
+
});
|
57
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
58
|
+
eventName: 'PageView',
|
59
|
+
product
|
60
|
+
});
|
61
|
+
}, [isActive, bffFbReport]);
|
57
62
|
useEffect(() => {
|
58
63
|
const initTime = () => {
|
64
|
+
if (!isActive)
|
65
|
+
return;
|
59
66
|
curTimeRef.current = new Date();
|
60
67
|
};
|
61
68
|
initTime();
|
@@ -63,7 +70,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
63
70
|
return () => {
|
64
71
|
window.removeEventListener('pageshow', initTime);
|
65
72
|
};
|
66
|
-
}, []);
|
73
|
+
}, [isActive]);
|
67
74
|
const priceText = getPriceText({
|
68
75
|
product,
|
69
76
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
|
-
import React, { memo, useCallback } from 'react';
|
3
|
+
import React, { memo, useCallback, useEffect } from 'react';
|
4
4
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import './index.less';
|
6
6
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
@@ -11,7 +11,7 @@ import { getPriceText } from '../../../../core/utils/materials';
|
|
11
11
|
const CommodityList = (_a) => {
|
12
12
|
var _b, _c, _d;
|
13
13
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
|
14
|
-
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig } = useSxpDataSource();
|
14
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig, bffFbReport } = useSxpDataSource();
|
15
15
|
const { jumpToWeb } = useEventReport();
|
16
16
|
const { popup } = useEditor();
|
17
17
|
const recData = isPost ? rec : popupDetailData;
|
@@ -41,6 +41,11 @@ const CommodityList = (_a) => {
|
|
41
41
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
42
42
|
}
|
43
43
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
44
|
+
useEffect(() => {
|
45
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
46
|
+
eventName: 'PageView'
|
47
|
+
});
|
48
|
+
}, []);
|
44
49
|
return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
45
50
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
46
51
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css({
|
@@ -18,7 +18,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
18
18
|
const [isShow, setIsShow] = (0, react_1.useState)(false);
|
19
19
|
const modalEleRef = (0, react_1.useRef)(null);
|
20
20
|
const { globalConfig, popupDetailData } = (0, hooks_1.useSxpDataSource)();
|
21
|
-
const { schema: _schema } = (0, hooks_1.useEditor)();
|
21
|
+
const { schema: _schema, popup: _popup } = (0, hooks_1.useEditor)();
|
22
22
|
const [scrollTop, setScrollTop] = (0, react_1.useState)(15);
|
23
23
|
(0, react_1.useEffect)(() => {
|
24
24
|
const parentNode = document.getElementById('sxp-render');
|
@@ -56,6 +56,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
56
56
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
57
57
|
}
|
58
58
|
}, [isOpen, popup]);
|
59
|
+
const child = (0, react_1.useCallback)(() => {
|
60
|
+
return children;
|
61
|
+
}, [_popup]);
|
59
62
|
if (!modalEleRef.current)
|
60
63
|
return null;
|
61
64
|
const handleClose = (0, lodash_1.debounce)(() => {
|
@@ -138,6 +141,6 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
138
141
|
var _a;
|
139
142
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
140
143
|
}
|
141
|
-
})),
|
144
|
+
})), child())))))), modalEleRef.current);
|
142
145
|
};
|
143
146
|
exports.default = (0, react_1.memo)(Modal);
|
@@ -243,17 +243,18 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
243
243
|
};
|
244
244
|
}, [isActive]);
|
245
245
|
(0, react_1.useEffect)(() => {
|
246
|
-
var _a, _b;
|
246
|
+
var _a, _b, _c, _d;
|
247
247
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
248
248
|
return;
|
249
249
|
if (isActive) {
|
250
250
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
251
|
-
eventName: 'ViewContent'
|
251
|
+
eventName: 'ViewContent',
|
252
|
+
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
252
253
|
});
|
253
|
-
(
|
254
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
254
255
|
}
|
255
256
|
else {
|
256
|
-
(
|
257
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
257
258
|
}
|
258
259
|
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
259
260
|
(0, react_1.useEffect)(() => {
|
@@ -272,9 +273,11 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
272
273
|
if (!isActive)
|
273
274
|
return;
|
274
275
|
const onShow = () => {
|
276
|
+
var _a, _b;
|
275
277
|
handleClickVideo('start')();
|
276
278
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
277
|
-
eventName: 'ViewContent'
|
279
|
+
eventName: 'ViewContent',
|
280
|
+
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
278
281
|
});
|
279
282
|
};
|
280
283
|
const onHide = handleClickVideo('pause');
|
@@ -12,7 +12,7 @@ const hooks_1 = require("../../../../core/hooks");
|
|
12
12
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
13
13
|
const WaterFall = (props) => {
|
14
14
|
var _a;
|
15
|
-
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = (0, hooks_1.useSxpDataSource)();
|
15
|
+
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = (0, hooks_1.useSxpDataSource)();
|
16
16
|
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
17
17
|
const ref = (0, react_1.useRef)(null);
|
18
18
|
const modalEleRef = (0, react_1.useRef)(null);
|
@@ -81,8 +81,11 @@ const WaterFall = (props) => {
|
|
81
81
|
(0, react_1.useEffect)(() => {
|
82
82
|
if (openHashtag) {
|
83
83
|
setViewTime(new Date());
|
84
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
85
|
+
eventName: 'PageView'
|
86
|
+
});
|
84
87
|
}
|
85
|
-
}, [openHashtag]);
|
88
|
+
}, [openHashtag, bffFbReport]);
|
86
89
|
(0, react_1.useEffect)(() => {
|
87
90
|
const initTime = () => {
|
88
91
|
setViewTime(new Date());
|
@@ -51,9 +51,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
51
51
|
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
52
52
|
const now = new Date();
|
53
53
|
viewTime.current = now;
|
54
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
55
|
-
eventName: 'PageView'
|
56
|
-
});
|
57
54
|
}
|
58
55
|
}, [data === null || data === void 0 ? void 0 : data.length]);
|
59
56
|
const handleH5EnterLink = (0, react_1.useCallback)(() => {
|
@@ -62,11 +59,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
62
59
|
if (data.length > 0) {
|
63
60
|
const now = new Date();
|
64
61
|
viewTime.current = now;
|
65
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
66
|
-
eventName: 'PageView'
|
67
|
-
});
|
68
62
|
}
|
69
|
-
}, [data.length,
|
63
|
+
}, [data.length, h5EnterLink]);
|
70
64
|
(0, react_1.useEffect)(() => {
|
71
65
|
var _a;
|
72
66
|
if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
|
@@ -232,7 +226,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
232
226
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
233
227
|
const Component = (0, withBindDataSource_1.default)(t);
|
234
228
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
235
|
-
return (react_1.default.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index })));
|
229
|
+
return (react_1.default.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index, isActive: activeIndex === index })));
|
236
230
|
});
|
237
231
|
}
|
238
232
|
return null;
|
@@ -368,7 +362,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
368
362
|
}
|
369
363
|
};
|
370
364
|
const handleScrollEvent = (swiper) => {
|
371
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
365
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
372
366
|
const item = data[swiper.previousIndex];
|
373
367
|
if (!item)
|
374
368
|
return;
|
@@ -410,12 +404,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
410
404
|
handleReportViewImageEnd(item);
|
411
405
|
}
|
412
406
|
handleReportProductView(item);
|
413
|
-
const curItem = data[swiper.activeIndex];
|
414
|
-
if (!((_r = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _r === void 0 ? void 0 : _r.url) && !((_s = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
|
415
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
416
|
-
eventName: 'ProductView'
|
417
|
-
});
|
418
|
-
}
|
419
407
|
viewTime.current = new Date();
|
420
408
|
};
|
421
409
|
const handleReportProductView = (item) => {
|
@@ -434,7 +422,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
434
422
|
}
|
435
423
|
}, [openHashtag, data, activeIndex]);
|
436
424
|
const handleViewImageStartEvent = (activeIndex) => {
|
437
|
-
var _a, _b, _c, _d, _e, _f;
|
425
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
438
426
|
const item = data[activeIndex];
|
439
427
|
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)) {
|
440
428
|
const startTime = Date.now();
|
@@ -453,7 +441,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
453
441
|
}
|
454
442
|
});
|
455
443
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
456
|
-
eventName: 'ViewContent'
|
444
|
+
eventName: 'ViewContent',
|
445
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
446
|
+
});
|
447
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
448
|
+
eventName: 'PageView',
|
449
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
457
450
|
});
|
458
451
|
}
|
459
452
|
};
|