pb-sxp-ui 1.10.2 → 1.10.4
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 +133 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +133 -75
- 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 +133 -75
- 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/SxpPageRender/WaterFall/List.js +2 -2
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +2 -2
- package/es/core/components/SxpPageRender/index.js +26 -18
- package/es/core/context/SxpDataSourceProvider.d.ts +6 -0
- package/es/core/context/SxpDataSourceProvider.js +62 -16
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +10 -3
- package/es/materials/sxp/MultiPosts/index.js +6 -12
- package/es/materials/sxp/cta/AniLink/index.js +2 -2
- package/es/materials/sxp/cta/AniLinkPopup/index.js +2 -2
- package/es/materials/sxp/popup/AppointForm/index.js +2 -2
- package/es/materials/sxp/popup/CommodityDetail/index.js +2 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -2
- package/es/materials/sxp/popup/CommodityList/index.js +3 -3
- package/es/materials/sxp/popup/Prompt/index.js +2 -2
- package/es/materials/sxp/template/Link/index.js +1 -3
- package/es/materials/sxp/template/components/EventProvider.js +3 -3
- package/lib/core/components/SxpPageRender/WaterFall/List.js +2 -2
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +2 -2
- package/lib/core/components/SxpPageRender/index.js +26 -18
- package/lib/core/context/SxpDataSourceProvider.d.ts +6 -0
- package/lib/core/context/SxpDataSourceProvider.js +62 -16
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +10 -3
- package/lib/materials/sxp/MultiPosts/index.js +6 -12
- package/lib/materials/sxp/cta/AniLink/index.js +2 -2
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +2 -2
- package/lib/materials/sxp/popup/AppointForm/index.js +2 -2
- package/lib/materials/sxp/popup/CommodityDetail/index.js +2 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +3 -3
- package/lib/materials/sxp/popup/Prompt/index.js +2 -2
- package/lib/materials/sxp/template/Link/index.js +1 -3
- package/lib/materials/sxp/template/components/EventProvider.js +3 -3
- package/package.json +1 -1
@@ -115,20 +115,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
115
115
|
else if (item === null || item === void 0 ? void 0 : item.product) {
|
116
116
|
fromKName = 'productPage';
|
117
117
|
}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
118
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.playbook) !== 'organic menu' || activeIndex !== 0) {
|
119
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
120
|
+
eventInfo: {
|
121
|
+
sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
|
122
|
+
eventSubject: 'sessionCompleted',
|
123
|
+
eventDescription: 'Session completed',
|
124
|
+
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
125
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
126
|
+
position: activeIndex + '',
|
127
|
+
fromKName,
|
128
|
+
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
129
|
+
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 : '',
|
130
|
+
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 : ''
|
131
|
+
}
|
132
|
+
});
|
133
|
+
}
|
132
134
|
}
|
133
135
|
else if (document.visibilityState === 'visible') {
|
134
136
|
if (skipLinkRef.current === true) {
|
@@ -203,10 +205,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
203
205
|
const isExternalLink = ((_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
204
206
|
const rec = visList[activeIndex];
|
205
207
|
return (react_1.default.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && {
|
206
|
-
onClick: () => {
|
208
|
+
onClick: (e) => {
|
207
209
|
var _a, _b, _c, _d;
|
208
210
|
if (isExternalLink) {
|
209
|
-
jumpToWeb(rec, (_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.bindCta, activeIndex, ((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || ((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo));
|
211
|
+
jumpToWeb(e, rec, (_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.bindCta, activeIndex, ((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || ((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo));
|
210
212
|
}
|
211
213
|
new Function(link)();
|
212
214
|
}
|
@@ -309,9 +311,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
309
311
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike) || !visible)
|
310
312
|
return;
|
311
313
|
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
312
|
-
if (waterFallData && top < 40 && globalConfig.likeIconYPosit === 'top') {
|
314
|
+
if (waterFallData && top < 40 && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconYPosit) === 'top') {
|
313
315
|
top += 40;
|
314
316
|
}
|
317
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconYPosit) === 'top') {
|
318
|
+
top += minusHeight;
|
319
|
+
}
|
315
320
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
316
321
|
return (react_1.default.createElement(LikeButton_1.default, { key: rec.position, activeIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon, unActicveIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
|
317
322
|
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed) ? 'fixed' : 'absolute',
|
@@ -479,6 +484,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
479
484
|
if (waterFallData && top < 40 && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
|
480
485
|
top += 40;
|
481
486
|
}
|
487
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
|
488
|
+
top += minusHeight;
|
489
|
+
}
|
482
490
|
return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (react_1.default.createElement(ToggleButton_1.default, { style: {
|
483
491
|
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
|
484
492
|
visibility: ((_c = (_b = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
@@ -538,7 +546,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
538
546
|
eventInfo: {
|
539
547
|
eventSubject: 'backMultiPostClick',
|
540
548
|
eventDescription: 'backMultiPostClick',
|
541
|
-
|
549
|
+
traceInfo: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.traceInfo) !== null && _c !== void 0 ? _c : ''
|
542
550
|
}
|
543
551
|
});
|
544
552
|
location === null || location === void 0 ? void 0 : location.reload();
|
@@ -8,6 +8,10 @@ export interface IWaterFallDataType {
|
|
8
8
|
itemType?: 'VIDEO' | 'PRODUCT' | null;
|
9
9
|
rec: RecItemType;
|
10
10
|
}
|
11
|
+
export interface IEventTimeType {
|
12
|
+
time: Date;
|
13
|
+
target: EventTarget;
|
14
|
+
}
|
11
15
|
export interface ISxpDataSourceContext {
|
12
16
|
rtcList: RecItemType[];
|
13
17
|
setRtcList?: React.Dispatch<React.SetStateAction<RecItemType[]>>;
|
@@ -82,6 +86,8 @@ export interface ISxpDataSourceContext {
|
|
82
86
|
isNoMoreData?: boolean;
|
83
87
|
updateChannel?: (d: string) => void;
|
84
88
|
channel?: string;
|
89
|
+
eventTimeList?: Array<IEventTimeType>;
|
90
|
+
setEventTimeList?: React.Dispatch<React.SetStateAction<Array<IEventTimeType>>>;
|
85
91
|
}
|
86
92
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
87
93
|
export interface SxpDataSourceProviderProps {
|
@@ -43,10 +43,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
43
43
|
const popupCurTimeRef = (0, react_1.useRef)(null);
|
44
44
|
const [isNoMoreData, setIsNoMoreData] = (0, react_1.useState)(false);
|
45
45
|
const [globalConfig, setGlobalConfig] = (0, react_1.useState)((_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig);
|
46
|
-
const [pageData, setPageData] = (0, react_1.useState)(
|
46
|
+
const [pageData, setPageData] = (0, react_1.useState)();
|
47
47
|
const [showConsent, setShowConsent] = (0, react_1.useState)(false);
|
48
48
|
const [layoutVariantId, setLayoutVariantId] = (0, react_1.useState)();
|
49
49
|
const [channel, setChannel] = (0, react_1.useState)();
|
50
|
+
const [eventTimeList, setEventTimeList] = (0, react_1.useState)([]);
|
51
|
+
const [playbookType, setPlaybookType] = (0, react_1.useState)();
|
52
|
+
const finalPageData = (0, react_1.useMemo)(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
50
53
|
const isShowConsent = (0, react_1.useMemo)(() => {
|
51
54
|
var _a, _b, _c, _d;
|
52
55
|
return (((((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent) &&
|
@@ -69,6 +72,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
69
72
|
})) !== null && _a !== void 0 ? _a : [];
|
70
73
|
return nList;
|
71
74
|
}, []);
|
75
|
+
(0, react_1.useEffect)(() => {
|
76
|
+
let intervalId;
|
77
|
+
if (eventTimeList.length > 0) {
|
78
|
+
const checkTimes = () => {
|
79
|
+
const now = new Date();
|
80
|
+
const threshold = 15 * 1000;
|
81
|
+
setEventTimeList((prevArray) => prevArray.filter((item) => now - item.time <= threshold));
|
82
|
+
};
|
83
|
+
intervalId = setInterval(checkTimes, 1000);
|
84
|
+
}
|
85
|
+
return () => {
|
86
|
+
clearInterval(intervalId);
|
87
|
+
};
|
88
|
+
}, [eventTimeList]);
|
72
89
|
(0, react_1.useEffect)(() => {
|
73
90
|
const handleChangeThemeTag = (tag) => {
|
74
91
|
themeTag.current = tag;
|
@@ -205,7 +222,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
205
222
|
userInfo = {};
|
206
223
|
}
|
207
224
|
const sessionID = (0, sessionStore_1.storeAndLoadFeSessionId)();
|
208
|
-
const ef = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), ((0, tool_1.getDevice)() && { sxpDevice: (0, tool_1.getDevice)() })), ((0, tool_1.getSystem)() && { sxpSystem: (0, tool_1.getSystem)() })), ((0, tool_1.getBrowserInfo)() && { sxpBrowser: (0, tool_1.getBrowserInfo)() })), {
|
225
|
+
const ef = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, { playbookType }), eventInfo), ((0, tool_1.getDevice)() && { sxpDevice: (0, tool_1.getDevice)() })), ((0, tool_1.getSystem)() && { sxpSystem: (0, tool_1.getSystem)() })), ((0, tool_1.getBrowserInfo)() && { sxpBrowser: (0, tool_1.getBrowserInfo)() })), (layoutVariantId && reportLayId && { layoutVariantId })), ((eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) && channel && { position: Number(eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) + 1 + '' }));
|
209
226
|
const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
|
210
227
|
const realEventInfo = Object.entries(ef)
|
211
228
|
.map(([k, v]) => v && { name: k, value: v })
|
@@ -219,7 +236,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
219
236
|
body: { userInfo: realUserInfo, eventInfo: realEventInfo },
|
220
237
|
type: 'beacon'
|
221
238
|
});
|
222
|
-
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, layoutVariantId]);
|
239
|
+
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, layoutVariantId, globalConfig, playbookType]);
|
223
240
|
const bffFbReport = (0, react_1.useCallback)(({ eventName, product }) => {
|
224
241
|
var _a, _b, _c, _d, _e;
|
225
242
|
if (!enableReportEvent ||
|
@@ -379,17 +396,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
379
396
|
return;
|
380
397
|
setLoading(true);
|
381
398
|
let layId;
|
399
|
+
let pbType;
|
382
400
|
getRecommendVideos()
|
383
401
|
.then((data) => {
|
384
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
402
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
385
403
|
if (data) {
|
386
404
|
const list = getFilterRecList(data);
|
387
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.playbook) === 'organic menu' && !channel) {
|
388
|
-
list.unshift('organic menu');
|
389
|
-
}
|
390
|
-
setRtcList(list);
|
391
|
-
setCacheRtcList(list);
|
392
405
|
let curData;
|
406
|
+
let gldata;
|
393
407
|
if (data === null || data === void 0 ? void 0 : data.layoutVariantId) {
|
394
408
|
const id = (_b = (_a = data === null || data === void 0 ? void 0 : data.layoutVariantId) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[1];
|
395
409
|
if (id) {
|
@@ -399,19 +413,49 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
399
413
|
if (curData) {
|
400
414
|
setPageData(curData);
|
401
415
|
document.title = (_c = curData === null || curData === void 0 ? void 0 : curData.name) !== null && _c !== void 0 ? _c : 'home';
|
402
|
-
|
416
|
+
gldata = (_e = (_d = curData === null || curData === void 0 ? void 0 : curData.data) === null || _d === void 0 ? void 0 : _d.sxpPageConf) === null || _e === void 0 ? void 0 : _e.globalConfig;
|
417
|
+
setGlobalConfig(gldata);
|
403
418
|
onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
|
404
|
-
if ((
|
419
|
+
if ((_j = (_h = (_g = (_f = gldata === null || gldata === void 0 ? void 0 : gldata.consent) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.item) === null || _h === void 0 ? void 0 : _h.props) === null || _j === void 0 ? void 0 : _j.privacy_necessity)
|
405
420
|
setShowConsent(true);
|
406
421
|
}
|
422
|
+
else {
|
423
|
+
setShowConsent(true);
|
424
|
+
}
|
425
|
+
}
|
426
|
+
}
|
427
|
+
else {
|
428
|
+
setShowConsent(true);
|
429
|
+
}
|
430
|
+
if (!channel) {
|
431
|
+
if ((gldata === null || gldata === void 0 ? void 0 : gldata.playbook) === 'organic menu' || (!gldata && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.playbook) === 'organic menu')) {
|
432
|
+
setPlaybookType('organicMenu');
|
433
|
+
list.unshift('organic menu');
|
434
|
+
pbType = 'organicMenu';
|
435
|
+
}
|
436
|
+
else {
|
437
|
+
setPlaybookType('paidMedia');
|
438
|
+
pbType = 'paidMedia';
|
407
439
|
}
|
408
440
|
}
|
409
|
-
|
441
|
+
setRtcList(list);
|
442
|
+
setCacheRtcList(list);
|
443
|
+
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
444
|
+
if (channel) {
|
445
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
446
|
+
eventInfo: {
|
447
|
+
eventSubject: 'multiPostClick',
|
448
|
+
eventDescription: 'multiPostClick',
|
449
|
+
traceInfo: (_m = (_l = (_k = list === null || list === void 0 ? void 0 : list[0]) === null || _k === void 0 ? void 0 : _k.video) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : '',
|
450
|
+
branchfeed: channel
|
451
|
+
}
|
452
|
+
});
|
453
|
+
}
|
410
454
|
}
|
411
455
|
})
|
412
456
|
.finally(() => {
|
413
457
|
bffEventReport({
|
414
|
-
eventInfo: Object.assign({ eventSubject: 'apiRequest', eventDescription: 'api request succeed' }, (layId && { layoutVariantId: layId }))
|
458
|
+
eventInfo: Object.assign(Object.assign({ eventSubject: 'apiRequest', eventDescription: 'api request succeed' }, (layId && { layoutVariantId: layId })), (pbType && { playbookType: pbType }))
|
415
459
|
});
|
416
460
|
setLoading(false);
|
417
461
|
});
|
@@ -420,7 +464,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
420
464
|
if (!isPreview)
|
421
465
|
return;
|
422
466
|
setLoading(true);
|
423
|
-
bffGetTagList(
|
467
|
+
bffGetTagList(data);
|
424
468
|
getRecommendVideos()
|
425
469
|
.then((data) => {
|
426
470
|
if (data) {
|
@@ -486,14 +530,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
486
530
|
isEditor,
|
487
531
|
isNoMoreData,
|
488
532
|
updateChannel,
|
489
|
-
channel
|
533
|
+
channel,
|
534
|
+
eventTimeList,
|
535
|
+
setEventTimeList
|
490
536
|
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
|
491
537
|
rtcList,
|
492
538
|
mutateLike: bffMutateLike,
|
493
539
|
mutateUnlike: bffMutateUnlike,
|
494
540
|
submitForm: bffSubmitForm,
|
495
541
|
tagList,
|
496
|
-
pageData
|
542
|
+
pageData: finalPageData
|
497
543
|
}))));
|
498
544
|
};
|
499
545
|
exports.default = (0, react_1.memo)(SxpDataSourceProvider);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { RecItemType } from '../components/SxpPageRender/typing';
|
2
2
|
export declare function useEventReport(): {
|
3
|
-
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number, traceInfo?: string) => void;
|
3
|
+
jumpToWeb: (e: React.MouseEvent<HTMLElement>, data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number, traceInfo?: string) => void;
|
4
4
|
productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
|
5
5
|
backMainFeed: (lastFeed: 'theme' | 'branch' | 'external', selectTag?: string, themeTag?: string, hashTag?: string) => void;
|
6
6
|
};
|
@@ -5,9 +5,16 @@ const react_1 = require("react");
|
|
5
5
|
const useSxpDataSource_1 = require("./useSxpDataSource");
|
6
6
|
const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
7
7
|
function useEventReport() {
|
8
|
-
const { bffEventReport, popupDetailData,
|
9
|
-
const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position, traceInfo) => {
|
8
|
+
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = (0, useSxpDataSource_1.useSxpDataSource)();
|
9
|
+
const jumpToWeb = (0, react_1.useCallback)((e, data, product, cta, position, traceInfo) => {
|
10
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
|
+
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
12
|
+
if (i !== -1) {
|
13
|
+
return;
|
14
|
+
}
|
15
|
+
else if (e) {
|
16
|
+
setEventTimeList === null || setEventTimeList === void 0 ? void 0 : setEventTimeList((prev) => [...prev, { target: e === null || e === void 0 ? void 0 : e.target, time: new Date() }]);
|
17
|
+
}
|
11
18
|
let fromKName = '';
|
12
19
|
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))) {
|
13
20
|
fromKName = 'pdpPage';
|
@@ -35,7 +42,7 @@ function useEventReport() {
|
|
35
42
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
36
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 }))
|
37
44
|
});
|
38
|
-
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
45
|
+
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
39
46
|
const productView = (0, react_1.useCallback)((data, product, cta, viewTime, position) => {
|
40
47
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
41
48
|
let fromKName = '';
|
@@ -14,7 +14,7 @@ const MultiPosts = (_a) => {
|
|
14
14
|
const { isActive } = (0, react_2.useSwiperSlide)() || {};
|
15
15
|
const initRef = (0, react_1.useRef)(false);
|
16
16
|
const viewTime = (0, react_1.useRef)();
|
17
|
-
const
|
17
|
+
const traceInfo = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.traceInfo) !== null && _c !== void 0 ? _c : '';
|
18
18
|
const getPropsVal = (0, react_1.useCallback)((index, str) => {
|
19
19
|
try {
|
20
20
|
return new Function('props', 'str', `if (str) {
|
@@ -30,14 +30,6 @@ const MultiPosts = (_a) => {
|
|
30
30
|
const value = v === null || v === void 0 ? void 0 : v.value;
|
31
31
|
if (!value)
|
32
32
|
return;
|
33
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
34
|
-
eventInfo: {
|
35
|
-
eventSubject: 'multiPostClick',
|
36
|
-
eventDescription: 'multiPostClick',
|
37
|
-
traceinfo,
|
38
|
-
branchfeed: (v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow' && value ? value : ''
|
39
|
-
}
|
40
|
-
});
|
41
33
|
if ((v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow') {
|
42
34
|
endMultiPost('multipostClick');
|
43
35
|
updateChannel === null || updateChannel === void 0 ? void 0 : updateChannel(value);
|
@@ -55,7 +47,7 @@ const MultiPosts = (_a) => {
|
|
55
47
|
eventDescription: 'startMultiPost',
|
56
48
|
contentFormat: 'IMAGE',
|
57
49
|
position: '0',
|
58
|
-
|
50
|
+
traceInfo
|
59
51
|
}
|
60
52
|
});
|
61
53
|
}, []);
|
@@ -66,7 +58,7 @@ const MultiPosts = (_a) => {
|
|
66
58
|
eventDescription: 'endMultiPost',
|
67
59
|
contentFormat: 'IMAGE',
|
68
60
|
position: '0',
|
69
|
-
|
61
|
+
traceInfo,
|
70
62
|
nextStep: nextStep || 'others',
|
71
63
|
timeOnSite: Math.floor((new Date() - (viewTime === null || viewTime === void 0 ? void 0 : viewTime.current)) / 1000) + ''
|
72
64
|
}
|
@@ -82,6 +74,8 @@ const MultiPosts = (_a) => {
|
|
82
74
|
}
|
83
75
|
}, [isActive]);
|
84
76
|
(0, react_1.useEffect)(() => {
|
77
|
+
if (!isActive)
|
78
|
+
return;
|
85
79
|
const onShow = () => startMultiPost();
|
86
80
|
const onHide = () => endMultiPost();
|
87
81
|
event_1.default.on(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
@@ -92,7 +86,7 @@ const MultiPosts = (_a) => {
|
|
92
86
|
};
|
93
87
|
}, [isActive]);
|
94
88
|
return (react_1.default.createElement("div", { className: 'multiposts', style: Object.assign(Object.assign({}, style), (0, materials_1.getBgStyle)(bgImgUrl)) }, Array.from({ length: 4 }, (_, index) => {
|
95
|
-
return (react_1.default.createElement("button", { className: 'multiposts-btn', role: 'button', "aria-label": `multiposts-${index + 1}`, onClick: () => handleClick(index) },
|
89
|
+
return (react_1.default.createElement("button", { hidden: !getPropsVal(index, 'Url'), className: 'multiposts-btn', role: 'button', "aria-label": `multiposts-${index + 1}`, onClick: () => handleClick(index) },
|
96
90
|
react_1.default.createElement("img", { className: 'multiposts-btn-img', src: getPropsVal(index, 'Url'), alt: `multiposts-img-${index + 1}` })));
|
97
91
|
})));
|
98
92
|
};
|
@@ -18,7 +18,7 @@ const AniLink = (_a) => {
|
|
18
18
|
const isOnScreen = (0, useOnScreen_1.default)(ref);
|
19
19
|
const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
|
20
20
|
const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
|
21
|
-
const handleTo = () => {
|
21
|
+
const handleTo = (e) => {
|
22
22
|
var _a, _b, _c, _d;
|
23
23
|
const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
|
24
24
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -29,7 +29,7 @@ const AniLink = (_a) => {
|
|
29
29
|
if (isExternalLink) {
|
30
30
|
const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
|
31
31
|
if (link) {
|
32
|
-
jumpToWeb(recData, product, cta, index);
|
32
|
+
jumpToWeb(e, recData, product, cta, index);
|
33
33
|
window.location.href = window.getJointUtmLink(link);
|
34
34
|
}
|
35
35
|
}
|
@@ -18,7 +18,7 @@ const AniLinkPopup = (_a) => {
|
|
18
18
|
const [visible, setVisible] = (0, react_1.useState)(true);
|
19
19
|
const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
|
20
20
|
const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
|
21
|
-
const handleTo = () => {
|
21
|
+
const handleTo = (e) => {
|
22
22
|
var _a, _b, _c, _d;
|
23
23
|
const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
|
24
24
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -29,7 +29,7 @@ const AniLinkPopup = (_a) => {
|
|
29
29
|
if (isExternalLink) {
|
30
30
|
const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
|
31
31
|
if (link) {
|
32
|
-
jumpToWeb(recData, product, cta, index);
|
32
|
+
jumpToWeb(e, recData, product, cta, index);
|
33
33
|
window.location.href = window.getJointUtmLink(link);
|
34
34
|
}
|
35
35
|
}
|
@@ -51,7 +51,7 @@ const AppointForm = (_a) => {
|
|
51
51
|
const { name, value } = e.target;
|
52
52
|
setFormData(Object.assign(Object.assign({}, formData), { [name]: value }));
|
53
53
|
}, [formData]);
|
54
|
-
const handleSubmit = (0, lodash_1.debounce)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
54
|
+
const handleSubmit = (0, lodash_1.debounce)((e) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
55
55
|
var _d, _e, _f, _g, _h;
|
56
56
|
const vals = formData;
|
57
57
|
if (!vals)
|
@@ -74,7 +74,7 @@ const AppointForm = (_a) => {
|
|
74
74
|
const product = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
75
75
|
const cta = (_h = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.bindCta;
|
76
76
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
77
|
-
jumpToWeb(data, product, cta, position);
|
77
|
+
jumpToWeb(e, data, product, cta, position);
|
78
78
|
}
|
79
79
|
if (!isPopup) {
|
80
80
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -37,9 +37,9 @@ const CommodityDetail = (_a) => {
|
|
37
37
|
product = p;
|
38
38
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
39
39
|
}
|
40
|
-
const handleLink = () => {
|
40
|
+
const handleLink = (e) => {
|
41
41
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
42
|
-
jumpToWeb(data, product, cta, position);
|
42
|
+
jumpToWeb(e, data, product, cta, position);
|
43
43
|
if (!isPost) {
|
44
44
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
45
45
|
}
|
@@ -41,9 +41,9 @@ const CommodityDetailDiroNew = (_a) => {
|
|
41
41
|
product = p;
|
42
42
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
43
43
|
}
|
44
|
-
const handleLink = () => {
|
44
|
+
const handleLink = (e) => {
|
45
45
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
46
|
-
jumpToWeb(data, product, cta, position);
|
46
|
+
jumpToWeb(e, data, product, cta, position);
|
47
47
|
if (!isPost) {
|
48
48
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
49
49
|
}
|
@@ -28,7 +28,7 @@ const CommodityList = (_a) => {
|
|
28
28
|
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
29
29
|
});
|
30
30
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
31
|
-
const handleClick = (0, lodash_1.throttle)((item, multiCheckIndex) => {
|
31
|
+
const handleClick = (0, lodash_1.throttle)((item, multiCheckIndex, e) => {
|
32
32
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
33
33
|
eventSubject: 'clickCta',
|
34
34
|
eventDescription: 'User clicked the CTA'
|
@@ -36,7 +36,7 @@ const CommodityList = (_a) => {
|
|
36
36
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
|
37
37
|
if (isExternalLink) {
|
38
38
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
39
|
-
jumpToWeb(recData, item, item.bindCta, index);
|
39
|
+
jumpToWeb(e, recData, item, item.bindCta, index);
|
40
40
|
window.location.href = window.getJointUtmLink(item.link);
|
41
41
|
}
|
42
42
|
}
|
@@ -51,7 +51,7 @@ const CommodityList = (_a) => {
|
|
51
51
|
}, []);
|
52
52
|
return (react_1.default.createElement("ul", { role: 'list', className: (0, css_1.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) => {
|
53
53
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
54
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement("li", { role: 'listitem', key: index, onClick: () => handleClick(item, index) },
|
54
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement("li", { role: 'listitem', key: index, onClick: (e) => handleClick(item, index, e) },
|
55
55
|
react_1.default.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: (0, css_1.css)({
|
56
56
|
display: 'flex',
|
57
57
|
alignItems: 'normal',
|
@@ -14,14 +14,14 @@ const Prompt = (_a) => {
|
|
14
14
|
const { popupDetailData } = (0, hooks_1.useSxpDataSource)();
|
15
15
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
16
16
|
const iconSrc = typeof icon === 'string' ? icon : (0, materials_1.getMediaValueByMode)(icon);
|
17
|
-
const handleOk = () => {
|
17
|
+
const handleOk = (e) => {
|
18
18
|
var _a, _b, _c;
|
19
19
|
if (isExternalLink) {
|
20
20
|
const data = popupDetailData;
|
21
21
|
const product = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProduct;
|
22
22
|
const cta = (_c = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct) === null || _c === void 0 ? void 0 : _c.bindCta;
|
23
23
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
24
|
-
jumpToWeb(data, product, cta, position);
|
24
|
+
jumpToWeb(e, data, product, cta, position);
|
25
25
|
}
|
26
26
|
if (!isPopup) {
|
27
27
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -5,15 +5,13 @@ const css_1 = require("@emotion/css");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
6
|
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
7
7
|
const hooks_1 = require("../../../../core/hooks");
|
8
|
-
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
9
8
|
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
10
9
|
const tool_1 = require("../../../../core/utils/tool");
|
11
10
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
12
11
|
const Link = (_a) => {
|
13
12
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
14
13
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle, isActive } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle", "isActive"]);
|
15
|
-
const { sxpParameter
|
16
|
-
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
14
|
+
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
17
15
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
18
16
|
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
19
17
|
const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
@@ -12,9 +12,9 @@ const EventProvider = (_a) => {
|
|
12
12
|
const { setPopupDetailData, ctaEvent } = (0, hooks_1.useSxpDataSource)();
|
13
13
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
14
14
|
const [element, setElement] = (0, react_1.useState)(null);
|
15
|
-
const handleClick = (0, lodash_1.throttle)((
|
15
|
+
const handleClick = (0, lodash_1.throttle)((e) => {
|
16
16
|
var _a, _b, _c, _d, _e, _f;
|
17
|
-
|
17
|
+
e.preventDefault();
|
18
18
|
const item = multItem ? multItem : (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
|
19
19
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
20
20
|
eventSubject: 'clickCta',
|
@@ -28,7 +28,7 @@ const EventProvider = (_a) => {
|
|
28
28
|
if (jumpLink || link) {
|
29
29
|
const cta = ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
|
30
30
|
const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
|
31
|
-
jumpToWeb(rec, product, cta, index);
|
31
|
+
jumpToWeb(e, rec, product, cta, index);
|
32
32
|
window.location.href = window.getJointUtmLink(jumpLink || link || '');
|
33
33
|
}
|
34
34
|
}
|