pb-sxp-ui 1.20.3 → 1.20.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 +210 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +210 -87
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +8 -8
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +8 -8
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +210 -87
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +8 -8
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/WaterFall/List.js +8 -17
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -13
- package/es/core/components/SxpPageRender/WaterFall/index.d.ts +0 -2
- package/es/core/components/SxpPageRender/WaterFall/index.js +8 -1
- package/es/core/components/SxpPageRender/index.js +23 -21
- package/es/core/context/SxpDataSourceProvider.js +3 -16
- package/es/materials/sxp/cta/AniLink/index.js +13 -2
- package/es/materials/sxp/cta/AniLinkPopup/index.js +13 -2
- package/es/materials/sxp/popup/CommodityDetail/index.js +54 -3
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +55 -4
- package/es/materials/sxp/popup/CommodityList/index.js +13 -1
- package/es/materials/sxp/template/components/EventProvider.js +19 -7
- package/lib/core/components/SxpPageRender/WaterFall/List.js +8 -17
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -13
- package/lib/core/components/SxpPageRender/WaterFall/index.d.ts +0 -2
- package/lib/core/components/SxpPageRender/WaterFall/index.js +8 -1
- package/lib/core/components/SxpPageRender/index.js +23 -21
- package/lib/core/context/SxpDataSourceProvider.js +3 -16
- package/lib/materials/sxp/cta/AniLink/index.js +13 -2
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +13 -2
- package/lib/materials/sxp/popup/CommodityDetail/index.js +54 -3
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +55 -4
- package/lib/materials/sxp/popup/CommodityList/index.js +13 -1
- package/lib/materials/sxp/template/components/EventProvider.js +19 -7
- package/package.json +1 -1
|
@@ -10,7 +10,8 @@ import { useEventReport } from '../../../../core/hooks/useEventReport';
|
|
|
10
10
|
import { getPriceText } from '../../../../core/utils/materials';
|
|
11
11
|
const WaterfallFlowItem = (props) => {
|
|
12
12
|
var _a;
|
|
13
|
-
const {
|
|
13
|
+
const { listItem, index, list, reportTagsView, textStyles, space, openFixedSize, fixedSizeRatio } = props;
|
|
14
|
+
const rec = listItem;
|
|
14
15
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
|
|
15
16
|
const [showVideo, setShowVideo] = useState(false);
|
|
16
17
|
const imgDom = useRef(null);
|
|
@@ -130,8 +131,8 @@ export default function WaterfallList(_a) {
|
|
|
130
131
|
useEffect(() => {
|
|
131
132
|
var _a, _b;
|
|
132
133
|
setIsLoadingData(true);
|
|
133
|
-
waterFallData
|
|
134
|
-
|
|
134
|
+
if (waterFallData) {
|
|
135
|
+
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
|
135
136
|
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
|
136
137
|
defaultSize: hashTagSize,
|
|
137
138
|
maxSize: hashTagSize
|
|
@@ -141,19 +142,9 @@ export default function WaterfallList(_a) {
|
|
|
141
142
|
const list = (_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : [];
|
|
142
143
|
setList(list);
|
|
143
144
|
setIsLoadingData(false);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
products.push(...((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) !== null && _b !== void 0 ? _b : []));
|
|
148
|
-
});
|
|
149
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
150
|
-
eventName: 'PageView',
|
|
151
|
-
product: products,
|
|
152
|
-
rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
|
|
153
|
-
position: cacheActiveIndex
|
|
154
|
-
});
|
|
155
|
-
}));
|
|
156
|
-
if (isOpenHashTag) {
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else if (isOpenHashTag) {
|
|
157
148
|
const res = previewData;
|
|
158
149
|
setData(res);
|
|
159
150
|
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
|
@@ -185,7 +176,7 @@ export default function WaterfallList(_a) {
|
|
|
185
176
|
__html: setFontForText(((_j = data === null || data === void 0 ? void 0 : data.tag) === null || _j === void 0 ? void 0 : _j.linkTitle) || 'Shop the collection', (_k = props === null || props === void 0 ? void 0 : props.textStyles) === null || _k === void 0 ? void 0 : _k.hashTagLink)
|
|
186
177
|
} }),
|
|
187
178
|
React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
|
|
188
|
-
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind,
|
|
179
|
+
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, listItem: item, list: list, reportTagsView: reportTagsView }, props)));
|
|
189
180
|
})),
|
|
190
181
|
React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
|
|
191
182
|
React.createElement("div", { hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: {
|
|
@@ -10,7 +10,7 @@ import { useEventReport } from '../../../../core/hooks/useEventReport';
|
|
|
10
10
|
import { getPriceText } from '../../../../core/utils/materials';
|
|
11
11
|
const WaterfallFlowItem = (props) => {
|
|
12
12
|
var _a;
|
|
13
|
-
const {
|
|
13
|
+
const { listItem, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
|
14
14
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
|
|
15
15
|
const [showVideo, setShowVideo] = useState(false);
|
|
16
16
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -23,6 +23,7 @@ const WaterfallFlowItem = (props) => {
|
|
|
23
23
|
const videoDom = useRef(null);
|
|
24
24
|
const canvasRef = useRef(null);
|
|
25
25
|
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
|
26
|
+
const rec = listItem;
|
|
26
27
|
const src = useMemo(() => {
|
|
27
28
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
28
29
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
|
|
@@ -220,17 +221,6 @@ export default function WaterfallList(_a) {
|
|
|
220
221
|
const list = (_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : [];
|
|
221
222
|
setList(list);
|
|
222
223
|
setIsLoadingData(false);
|
|
223
|
-
const products = [];
|
|
224
|
-
list === null || list === void 0 ? void 0 : list.forEach((item) => {
|
|
225
|
-
var _a, _b;
|
|
226
|
-
products.push(...((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) !== null && _b !== void 0 ? _b : []));
|
|
227
|
-
});
|
|
228
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
229
|
-
eventName: 'PageView',
|
|
230
|
-
product: products,
|
|
231
|
-
rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
|
|
232
|
-
position: cacheActiveIndex
|
|
233
|
-
});
|
|
234
224
|
}));
|
|
235
225
|
if (isOpenHashTag) {
|
|
236
226
|
const res = previewData;
|
|
@@ -308,7 +298,7 @@ export default function WaterfallList(_a) {
|
|
|
308
298
|
React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
|
|
309
299
|
list.map((item, ind) => {
|
|
310
300
|
var _a;
|
|
311
|
-
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind,
|
|
301
|
+
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, listItem: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
|
|
312
302
|
}),
|
|
313
303
|
React.createElement("div", { hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: {
|
|
314
304
|
position: 'absolute',
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.less';
|
|
3
|
-
import { RecItemType } from '../typing';
|
|
4
3
|
import { IHashTagProps } from '../../../../materials/sxp/HashTag';
|
|
5
4
|
interface IWaterFallProps {
|
|
6
|
-
rec?: RecItemType;
|
|
7
5
|
}
|
|
8
6
|
declare const _default: React.NamedExoticComponent<IWaterFallProps & IHashTagProps>;
|
|
9
7
|
export default _default;
|
|
@@ -75,10 +75,17 @@ const WaterFall = (props) => {
|
|
|
75
75
|
});
|
|
76
76
|
}, [recData, bffEventReport, viewTime, isFromHashtag, cacheActiveIndex]);
|
|
77
77
|
useEffect(() => {
|
|
78
|
+
var _a, _b;
|
|
78
79
|
if (openHashtag) {
|
|
79
80
|
setViewTime(new Date());
|
|
81
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
82
|
+
eventName: 'PageView',
|
|
83
|
+
product: (_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProducts,
|
|
84
|
+
rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
|
|
85
|
+
position: cacheActiveIndex
|
|
86
|
+
});
|
|
80
87
|
}
|
|
81
|
-
}, [openHashtag]);
|
|
88
|
+
}, [openHashtag, bffFbReport, waterFallData, cacheActiveIndex]);
|
|
82
89
|
useEffect(() => {
|
|
83
90
|
const initTime = () => {
|
|
84
91
|
setViewTime(new Date());
|
|
@@ -130,14 +130,16 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
const isPostType = ((_w = item === null || item === void 0 ? void 0 : item.video) === null || _w === void 0 ? void 0 : _w.url) || ((_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.imgUrls) === null || _y === void 0 ? void 0 : _y.length);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
if (!popupDetailData) {
|
|
134
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
135
|
+
eventName: 'ExitFeed',
|
|
136
|
+
product: isPostType ? (_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
|
|
137
|
+
rec: item,
|
|
138
|
+
position: activeIndex,
|
|
139
|
+
content_id: isPostType ? (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '' : (_3 = (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
|
|
140
|
+
view_time: new Date() - viewTime.current
|
|
141
|
+
});
|
|
142
|
+
}
|
|
141
143
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime, bffFbReport]);
|
|
142
144
|
useEffect(() => {
|
|
143
145
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
|
@@ -438,7 +440,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
438
440
|
}
|
|
439
441
|
};
|
|
440
442
|
const handleScrollEvent = (swiper) => {
|
|
441
|
-
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
|
|
443
|
+
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;
|
|
442
444
|
const item = data[swiper.previousIndex];
|
|
443
445
|
const activeItem = data[swiper.activeIndex];
|
|
444
446
|
if (!item)
|
|
@@ -460,22 +462,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
460
462
|
previousContentType = 'product';
|
|
461
463
|
previousContentId = (_m = (_l = item === null || item === void 0 ? void 0 : item.product) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '';
|
|
462
464
|
previousProduct = (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [];
|
|
463
|
-
previousContentsName =
|
|
465
|
+
previousContentsName = '';
|
|
464
466
|
}
|
|
465
|
-
if (!((
|
|
466
|
-
contentId = (
|
|
467
|
+
if (!((_o = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _o === void 0 ? void 0 : _o.url) && !((_q = (_p = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _p === void 0 ? void 0 : _p.imgUrls) === null || _q === void 0 ? void 0 : _q.length)) {
|
|
468
|
+
contentId = (_s = (_r = activeItem === null || activeItem === void 0 ? void 0 : activeItem.product) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '';
|
|
467
469
|
}
|
|
468
470
|
if (swiper.previousIndex - swiper.activeIndex < 0) {
|
|
469
471
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
470
472
|
eventInfo: {
|
|
471
473
|
eventSubject: 'scrollDown',
|
|
472
474
|
eventDescription: 'User scroll down',
|
|
473
|
-
contentId: (
|
|
474
|
-
productId: (
|
|
475
|
+
contentId: (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
|
476
|
+
productId: (_w = (_v = item === null || item === void 0 ? void 0 : item.product) === null || _v === void 0 ? void 0 : _v.itemId) !== null && _w !== void 0 ? _w : '',
|
|
475
477
|
requestId: null,
|
|
476
|
-
traceInfo: (
|
|
478
|
+
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 : '',
|
|
477
479
|
contentFormat,
|
|
478
|
-
position: ((
|
|
480
|
+
position: ((_1 = swiper.previousIndex) !== null && _1 !== void 0 ? _1 : 0) + ''
|
|
479
481
|
}
|
|
480
482
|
});
|
|
481
483
|
handleViewImageStartEnd(item);
|
|
@@ -487,12 +489,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
487
489
|
eventInfo: {
|
|
488
490
|
eventSubject: 'scrollUp',
|
|
489
491
|
eventDescription: 'User scroll up',
|
|
490
|
-
contentId: (
|
|
491
|
-
productId: (
|
|
492
|
+
contentId: (_3 = (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
|
|
493
|
+
productId: (_5 = (_4 = item.product) === null || _4 === void 0 ? void 0 : _4.itemId) !== null && _5 !== void 0 ? _5 : '',
|
|
492
494
|
requestId: null,
|
|
493
|
-
traceInfo: (
|
|
495
|
+
traceInfo: (_9 = (_7 = (_6 = item === null || item === void 0 ? void 0 : item.video) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_8 = item === null || item === void 0 ? void 0 : item.product) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : '',
|
|
494
496
|
contentFormat,
|
|
495
|
-
position: ((
|
|
497
|
+
position: ((_10 = swiper.previousIndex) !== null && _10 !== void 0 ? _10 : 0) + ''
|
|
496
498
|
}
|
|
497
499
|
});
|
|
498
500
|
handleViewImageStartEnd(item);
|
|
@@ -737,7 +739,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
737
739
|
renderView,
|
|
738
740
|
renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
|
739
741
|
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
|
|
740
|
-
React.createElement(WaterFall, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props
|
|
742
|
+
React.createElement(WaterFall, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
|
|
741
743
|
React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
|
|
742
744
|
openMultiPosts && (React.createElement(MultiPosts, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0, bottom: bottomHeight + 'px' } }))))),
|
|
743
745
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
|
|
@@ -328,7 +328,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
328
328
|
}
|
|
329
329
|
});
|
|
330
330
|
};
|
|
331
|
-
}, [
|
|
331
|
+
}, []);
|
|
332
332
|
useEffect(() => {
|
|
333
333
|
const originalOpen = XMLHttpRequest.prototype.open;
|
|
334
334
|
const originalSend = XMLHttpRequest.prototype.send;
|
|
@@ -555,7 +555,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
555
555
|
const productCustomData = {
|
|
556
556
|
content_ids: [product === null || product === void 0 ? void 0 : product.itemId],
|
|
557
557
|
content_type: 'product',
|
|
558
|
-
content_name:
|
|
558
|
+
content_name: '',
|
|
559
559
|
contents: [{
|
|
560
560
|
item_id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
561
561
|
item_price: product === null || product === void 0 ? void 0 : product.price
|
|
@@ -744,20 +744,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
744
744
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
745
745
|
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 })
|
|
746
746
|
});
|
|
747
|
-
|
|
748
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
749
|
-
eventName: 'ClickCTA',
|
|
750
|
-
product: product ? [product] : undefined,
|
|
751
|
-
contentType: contentType !== null && contentType !== void 0 ? contentType : 'post',
|
|
752
|
-
rec,
|
|
753
|
-
position,
|
|
754
|
-
cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
|
|
755
|
-
cta_action_type: ctaActionType,
|
|
756
|
-
target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
757
|
-
target_url: targetUrl
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
}, [bffEventReport, isFromHashtag, bffFbReport]);
|
|
747
|
+
}, [bffEventReport, isFromHashtag]);
|
|
761
748
|
const h5EnterLink = useCallback(() => {
|
|
762
749
|
var _a, _b;
|
|
763
750
|
const time = new Date();
|
|
@@ -9,7 +9,7 @@ import useOnScreen from '../../../../core/hooks/useOnScreen';
|
|
|
9
9
|
const AniLink = (_a) => {
|
|
10
10
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
11
11
|
var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink", "isActive"]);
|
|
12
|
-
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
|
12
|
+
const { ctaEvent, setPopupDetailData, bffFbReport } = useSxpDataSource();
|
|
13
13
|
const { jumpToWeb } = useEventReport();
|
|
14
14
|
const [visible, setVisible] = useState(false);
|
|
15
15
|
const ref = useRef(null);
|
|
@@ -23,7 +23,18 @@ const AniLink = (_a) => {
|
|
|
23
23
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
|
24
24
|
eventSubject: 'clickCta',
|
|
25
25
|
eventDescription: 'User clicked the CTA'
|
|
26
|
-
}, recData, item, index
|
|
26
|
+
}, recData, item, index);
|
|
27
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
28
|
+
eventName: 'ClickCTA',
|
|
29
|
+
product: product ? [product] : undefined,
|
|
30
|
+
contentType: 'post',
|
|
31
|
+
recData,
|
|
32
|
+
index,
|
|
33
|
+
cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
|
|
34
|
+
cta_action_type: (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup',
|
|
35
|
+
target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
36
|
+
target_url: link
|
|
37
|
+
});
|
|
27
38
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
|
|
28
39
|
if (isExternalLink) {
|
|
29
40
|
if (!link)
|
|
@@ -11,7 +11,7 @@ const AniLinkPopup = (_a) => {
|
|
|
11
11
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
12
12
|
var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink", "isActive"]);
|
|
13
13
|
style === null || style === void 0 ? true : delete style.transform;
|
|
14
|
-
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
|
14
|
+
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData, bffFbReport } = useSxpDataSource();
|
|
15
15
|
const { jumpToWeb } = useEventReport();
|
|
16
16
|
const [visible, setVisible] = useState(true);
|
|
17
17
|
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);
|
|
@@ -23,7 +23,18 @@ const AniLinkPopup = (_a) => {
|
|
|
23
23
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
|
24
24
|
eventSubject: 'clickCta',
|
|
25
25
|
eventDescription: 'User clicked the CTA'
|
|
26
|
-
}, recData, item, index
|
|
26
|
+
}, recData, item, index);
|
|
27
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
28
|
+
eventName: 'ClickCTA',
|
|
29
|
+
product: product ? [product] : undefined,
|
|
30
|
+
contentType: 'post',
|
|
31
|
+
recData,
|
|
32
|
+
index,
|
|
33
|
+
cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
|
|
34
|
+
cta_action_type: (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup',
|
|
35
|
+
target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
36
|
+
target_url: link
|
|
37
|
+
});
|
|
27
38
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
|
|
28
39
|
if (isExternalLink) {
|
|
29
40
|
if (!link)
|
|
@@ -12,6 +12,7 @@ import ExpandableText from '../../../../core/components/SxpPageRender/Expandable
|
|
|
12
12
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
|
13
13
|
import { getScreenReader, setFontForText } from '../../../../core/utils/tool';
|
|
14
14
|
import { getPriceText } from '../../../../core/utils/materials';
|
|
15
|
+
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
|
15
16
|
const CommodityDetail = (_a) => {
|
|
16
17
|
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
18
|
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"]);
|
|
@@ -45,29 +46,79 @@ const CommodityDetail = (_a) => {
|
|
|
45
46
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
|
46
47
|
eventSubject: 'clickCta',
|
|
47
48
|
eventDescription: 'User clicked the CTA'
|
|
48
|
-
}, data, product, position
|
|
49
|
+
}, data, product, position);
|
|
50
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
51
|
+
eventName: 'ClickCTA',
|
|
52
|
+
product: product ? [product] : undefined,
|
|
53
|
+
contentType: 'product',
|
|
54
|
+
data,
|
|
55
|
+
position,
|
|
56
|
+
cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
|
|
57
|
+
cta_action_type: 'open_external_link',
|
|
58
|
+
target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
59
|
+
target_url: product.link
|
|
60
|
+
});
|
|
49
61
|
}
|
|
50
62
|
window.location.href = window.getJointUtmLink(product.link);
|
|
51
63
|
}
|
|
52
64
|
};
|
|
53
65
|
useEffect(() => {
|
|
66
|
+
var _a;
|
|
54
67
|
if (!isActive)
|
|
55
68
|
return;
|
|
69
|
+
const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '', imgUrls: !isPost ? product === null || product === void 0 ? void 0 : product.homePage : (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.imgUrls }) : null });
|
|
56
70
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
57
71
|
eventName: 'ProductView',
|
|
58
72
|
product: product ? [product] : undefined,
|
|
59
73
|
contentType: 'product',
|
|
60
|
-
rec:
|
|
74
|
+
rec: recData,
|
|
61
75
|
position
|
|
62
76
|
});
|
|
63
77
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
64
78
|
eventName: 'PageView',
|
|
65
79
|
product: product ? [product] : undefined,
|
|
66
80
|
contentType: 'product',
|
|
67
|
-
rec:
|
|
81
|
+
rec: recData,
|
|
68
82
|
position
|
|
69
83
|
});
|
|
70
84
|
}, [isActive, bffFbReport]);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (!isActive || isPost)
|
|
87
|
+
return;
|
|
88
|
+
const onShow = () => {
|
|
89
|
+
curTimeRef.current = new Date();
|
|
90
|
+
};
|
|
91
|
+
const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '' }) : null });
|
|
92
|
+
const onHide = () => {
|
|
93
|
+
var _a;
|
|
94
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
95
|
+
eventName: 'ExitFeed',
|
|
96
|
+
product: product ? [product] : undefined,
|
|
97
|
+
contentType: 'product',
|
|
98
|
+
rec: recData,
|
|
99
|
+
position,
|
|
100
|
+
view_time: new Date() - curTimeRef.current,
|
|
101
|
+
content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : ''
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
|
|
105
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
|
|
106
|
+
return () => {
|
|
107
|
+
var _a;
|
|
108
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
109
|
+
eventName: 'Engagement',
|
|
110
|
+
product: product ? [product] : undefined,
|
|
111
|
+
rec: recData,
|
|
112
|
+
position,
|
|
113
|
+
content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : '',
|
|
114
|
+
engagement_type: 'close_popup',
|
|
115
|
+
contentType: 'product',
|
|
116
|
+
view_time: new Date() - curTimeRef.current
|
|
117
|
+
});
|
|
118
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
|
|
119
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
|
|
120
|
+
};
|
|
121
|
+
}, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
|
|
71
122
|
useEffect(() => {
|
|
72
123
|
const initTime = () => {
|
|
73
124
|
curTimeRef.current = new Date();
|
|
@@ -12,6 +12,7 @@ import { useEventReport } from '../../../../core/hooks/useEventReport';
|
|
|
12
12
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
|
13
13
|
import { getScreenReader, setFontForText } from '../../../../core/utils/tool';
|
|
14
14
|
import { getPriceText } from '../../../../core/utils/materials';
|
|
15
|
+
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
|
15
16
|
const CommodityDetailDiroNew = (_a) => {
|
|
16
17
|
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
18
|
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"]);
|
|
@@ -49,29 +50,79 @@ const CommodityDetailDiroNew = (_a) => {
|
|
|
49
50
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
|
50
51
|
eventSubject: 'clickCta',
|
|
51
52
|
eventDescription: 'User clicked the CTA'
|
|
52
|
-
}, data, product, position
|
|
53
|
+
}, data, product, position);
|
|
54
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
55
|
+
eventName: 'ClickCTA',
|
|
56
|
+
product: product ? [product] : undefined,
|
|
57
|
+
contentType: 'product',
|
|
58
|
+
data,
|
|
59
|
+
position,
|
|
60
|
+
cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
|
|
61
|
+
cta_action_type: 'open_external_link',
|
|
62
|
+
target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
63
|
+
target_url: product.link
|
|
64
|
+
});
|
|
53
65
|
}
|
|
54
66
|
window.location.href = window.getJointUtmLink(product.link);
|
|
55
67
|
}
|
|
56
68
|
};
|
|
57
69
|
useEffect(() => {
|
|
70
|
+
var _a;
|
|
58
71
|
if (!isActive)
|
|
59
72
|
return;
|
|
73
|
+
const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '', imgUrls: !isPost ? product === null || product === void 0 ? void 0 : product.homePage : (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.imgUrls }) : null });
|
|
60
74
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
61
75
|
eventName: 'ProductView',
|
|
62
76
|
product: product ? [product] : undefined,
|
|
63
77
|
contentType: 'product',
|
|
64
|
-
rec:
|
|
78
|
+
rec: recData,
|
|
65
79
|
position
|
|
66
80
|
});
|
|
67
81
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
68
82
|
eventName: 'PageView',
|
|
69
83
|
product: product ? [product] : undefined,
|
|
70
84
|
contentType: 'product',
|
|
71
|
-
rec:
|
|
85
|
+
rec: recData,
|
|
72
86
|
position
|
|
73
87
|
});
|
|
74
|
-
}, [isActive, bffFbReport]);
|
|
88
|
+
}, [isActive, bffFbReport, isPost]);
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (!isActive || isPost)
|
|
91
|
+
return;
|
|
92
|
+
const onShow = () => {
|
|
93
|
+
curTimeRef.current = new Date();
|
|
94
|
+
};
|
|
95
|
+
const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '' }) : null });
|
|
96
|
+
const onHide = () => {
|
|
97
|
+
var _a;
|
|
98
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
99
|
+
eventName: 'ExitFeed',
|
|
100
|
+
product: product ? [product] : undefined,
|
|
101
|
+
contentType: 'product',
|
|
102
|
+
rec: recData,
|
|
103
|
+
position,
|
|
104
|
+
view_time: new Date() - curTimeRef.current,
|
|
105
|
+
content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : ''
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
|
|
109
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
|
|
110
|
+
return () => {
|
|
111
|
+
var _a;
|
|
112
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
113
|
+
eventName: 'Engagement',
|
|
114
|
+
product: product ? [product] : undefined,
|
|
115
|
+
rec: recData,
|
|
116
|
+
position,
|
|
117
|
+
content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : '',
|
|
118
|
+
engagement_type: 'close_popup',
|
|
119
|
+
contentType: 'product',
|
|
120
|
+
view_time: new Date() - curTimeRef.current
|
|
121
|
+
});
|
|
122
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
|
|
123
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
|
|
124
|
+
};
|
|
125
|
+
}, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
|
|
75
126
|
useEffect(() => {
|
|
76
127
|
const initTime = () => {
|
|
77
128
|
if (!isActive)
|
|
@@ -27,10 +27,22 @@ const CommodityList = (_a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
|
29
29
|
const handleClick = throttle((item, multiCheckIndex, e) => {
|
|
30
|
+
var _a;
|
|
30
31
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
|
31
32
|
eventSubject: 'clickCta',
|
|
32
33
|
eventDescription: 'User clicked the CTA'
|
|
33
|
-
}, recData, item, index
|
|
34
|
+
}, recData, item, index);
|
|
35
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
36
|
+
eventName: 'ClickCTA',
|
|
37
|
+
product: item ? [item] : undefined,
|
|
38
|
+
contentType: 'product',
|
|
39
|
+
recData,
|
|
40
|
+
index,
|
|
41
|
+
cta_text: (_a = item === null || item === void 0 ? void 0 : item.bindCta) === null || _a === void 0 ? void 0 : _a.enTitle,
|
|
42
|
+
cta_action_type: isExternalLink && !!(item === null || item === void 0 ? void 0 : item.link) ? 'open_external_link' : 'open_internal_popup',
|
|
43
|
+
target_content_id: item === null || item === void 0 ? void 0 : item.itemId,
|
|
44
|
+
target_url: item.link
|
|
45
|
+
});
|
|
34
46
|
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 }));
|
|
35
47
|
if (isExternalLink) {
|
|
36
48
|
if (!(item === null || item === void 0 ? void 0 : item.link))
|
|
@@ -7,26 +7,38 @@ const EventProvider = (_a) => {
|
|
|
7
7
|
var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink, multItem, multiCheckIndex } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink", "multItem", "multiCheckIndex"]);
|
|
8
8
|
const ref = useRef(null);
|
|
9
9
|
const { popup } = useEditor();
|
|
10
|
-
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
|
10
|
+
const { setPopupDetailData, ctaEvent, bffFbReport } = useSxpDataSource();
|
|
11
11
|
const { jumpToWeb } = useEventReport();
|
|
12
12
|
const [element, setElement] = useState(null);
|
|
13
13
|
const handleClick = throttle((e) => {
|
|
14
|
-
var _a, _b, _c, _d, _e, _f;
|
|
14
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
15
15
|
e.preventDefault();
|
|
16
16
|
const item = 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);
|
|
17
|
-
const link = ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link);
|
|
17
|
+
const link = jumpLink || ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link) || '';
|
|
18
18
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
|
19
19
|
eventSubject: 'clickCta',
|
|
20
20
|
eventDescription: 'User clicked the CTA'
|
|
21
|
-
}, rec, item, index
|
|
21
|
+
}, rec, item, index);
|
|
22
|
+
const product = multItem || ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindProduct);
|
|
23
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
24
|
+
eventName: 'ClickCTA',
|
|
25
|
+
product: product ? [product] : undefined,
|
|
26
|
+
contentType: 'post',
|
|
27
|
+
rec,
|
|
28
|
+
index,
|
|
29
|
+
cta_text: (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle,
|
|
30
|
+
cta_action_type: isExternalLink && (!!link) ? 'open_external_link' : 'open_internal_popup',
|
|
31
|
+
target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
32
|
+
target_url: link
|
|
33
|
+
});
|
|
22
34
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(multItem && multiCheckIndex !== undefined && multiCheckIndex >= 0
|
|
23
35
|
? Object.assign(Object.assign({}, rec), { video: Object.assign(Object.assign({}, rec === null || rec === void 0 ? void 0 : rec.video), { bindProduct: multItem }), index, multiCheckIndex }) : Object.assign(Object.assign({}, rec), { index }));
|
|
24
36
|
setElement(ref === null || ref === void 0 ? void 0 : ref.current);
|
|
25
37
|
if (isExternalLink) {
|
|
26
|
-
if (!
|
|
38
|
+
if (!link)
|
|
27
39
|
return;
|
|
28
|
-
const cta = ((
|
|
29
|
-
const product = ((
|
|
40
|
+
const cta = ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
|
|
41
|
+
const product = ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.bindProduct) || multItem;
|
|
30
42
|
jumpToWeb(e, rec, product, cta, index);
|
|
31
43
|
window.location.href = window.getJointUtmLink(link);
|
|
32
44
|
}
|