pb-sxp-ui 1.10.2 → 1.10.3
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 +58 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +58 -31
- 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 +58 -31
- 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 +2 -2
- package/es/core/context/SxpDataSourceProvider.d.ts +6 -0
- package/es/core/context/SxpDataSourceProvider.js +18 -1
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +10 -3
- 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 +2 -2
- package/lib/core/context/SxpDataSourceProvider.d.ts +6 -0
- package/lib/core/context/SxpDataSourceProvider.js +18 -1
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +10 -3
- 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
@@ -161,12 +161,12 @@ export default function WaterfallList(_a) {
|
|
161
161
|
setIsLoadingData(false);
|
162
162
|
}
|
163
163
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
164
|
-
const handleClickLink = () => {
|
164
|
+
const handleClickLink = (e) => {
|
165
165
|
var _a, _b, _c, _d, _e;
|
166
166
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
167
167
|
reportTagsView();
|
168
168
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
169
|
-
jumpToWeb(rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
169
|
+
jumpToWeb(e, rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
170
170
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
171
171
|
}
|
172
172
|
};
|
@@ -269,12 +269,12 @@ export default function WaterfallList(_a) {
|
|
269
269
|
(_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', onScroll);
|
270
270
|
};
|
271
271
|
}, [onScroll, scrollParent]);
|
272
|
-
const handleClickLink = () => {
|
272
|
+
const handleClickLink = (e) => {
|
273
273
|
var _a, _b, _c, _d, _e;
|
274
274
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
275
275
|
reportTagsView();
|
276
276
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
277
|
-
jumpToWeb(rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
277
|
+
jumpToWeb(e, rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
278
278
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
279
279
|
}
|
280
280
|
};
|
@@ -200,10 +200,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
200
200
|
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';
|
201
201
|
const rec = visList[activeIndex];
|
202
202
|
return (React.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && {
|
203
|
-
onClick: () => {
|
203
|
+
onClick: (e) => {
|
204
204
|
var _a, _b, _c, _d;
|
205
205
|
if (isExternalLink) {
|
206
|
-
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));
|
206
|
+
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));
|
207
207
|
}
|
208
208
|
new Function(link)();
|
209
209
|
}
|
@@ -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 {
|
@@ -44,6 +44,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
44
44
|
const [showConsent, setShowConsent] = useState(false);
|
45
45
|
const [layoutVariantId, setLayoutVariantId] = useState();
|
46
46
|
const [channel, setChannel] = useState();
|
47
|
+
const [eventTimeList, setEventTimeList] = useState([]);
|
47
48
|
const isShowConsent = useMemo(() => {
|
48
49
|
var _a, _b, _c, _d;
|
49
50
|
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) &&
|
@@ -66,6 +67,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
66
67
|
})) !== null && _a !== void 0 ? _a : [];
|
67
68
|
return nList;
|
68
69
|
}, []);
|
70
|
+
useEffect(() => {
|
71
|
+
let intervalId;
|
72
|
+
if (eventTimeList.length > 0) {
|
73
|
+
const checkTimes = () => {
|
74
|
+
const now = new Date();
|
75
|
+
const threshold = 15 * 1000;
|
76
|
+
setEventTimeList((prevArray) => prevArray.filter((item) => now - item.time <= threshold));
|
77
|
+
};
|
78
|
+
intervalId = setInterval(checkTimes, 1000);
|
79
|
+
}
|
80
|
+
return () => {
|
81
|
+
clearInterval(intervalId);
|
82
|
+
};
|
83
|
+
}, [eventTimeList]);
|
69
84
|
useEffect(() => {
|
70
85
|
const handleChangeThemeTag = (tag) => {
|
71
86
|
themeTag.current = tag;
|
@@ -483,7 +498,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
483
498
|
isEditor,
|
484
499
|
isNoMoreData,
|
485
500
|
updateChannel,
|
486
|
-
channel
|
501
|
+
channel,
|
502
|
+
eventTimeList,
|
503
|
+
setEventTimeList
|
487
504
|
} }, isShowConsent ? (React.createElement(Consent, 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({
|
488
505
|
rtcList,
|
489
506
|
mutateLike: bffMutateLike,
|
@@ -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
|
};
|
@@ -2,9 +2,16 @@ import { useCallback } from 'react';
|
|
2
2
|
import { useSxpDataSource } from './useSxpDataSource';
|
3
3
|
import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
4
4
|
export function useEventReport() {
|
5
|
-
const { bffEventReport, popupDetailData,
|
6
|
-
const jumpToWeb = useCallback((data, product, cta, position, traceInfo) => {
|
5
|
+
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
6
|
+
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
7
7
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
8
|
+
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
9
|
+
if (i !== -1) {
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
else if (e) {
|
13
|
+
setEventTimeList === null || setEventTimeList === void 0 ? void 0 : setEventTimeList((prev) => [...prev, { target: e === null || e === void 0 ? void 0 : e.target, time: new Date() }]);
|
14
|
+
}
|
8
15
|
let fromKName = '';
|
9
16
|
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))) {
|
10
17
|
fromKName = 'pdpPage';
|
@@ -32,7 +39,7 @@ export function useEventReport() {
|
|
32
39
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
33
40
|
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', 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 }))
|
34
41
|
});
|
35
|
-
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
42
|
+
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
36
43
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
37
44
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
38
45
|
let fromKName = '';
|
@@ -16,7 +16,7 @@ const AniLink = (_a) => {
|
|
16
16
|
const isOnScreen = useOnScreen(ref);
|
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);
|
18
18
|
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);
|
19
|
-
const handleTo = () => {
|
19
|
+
const handleTo = (e) => {
|
20
20
|
var _a, _b, _c, _d;
|
21
21
|
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);
|
22
22
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -27,7 +27,7 @@ const AniLink = (_a) => {
|
|
27
27
|
if (isExternalLink) {
|
28
28
|
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);
|
29
29
|
if (link) {
|
30
|
-
jumpToWeb(recData, product, cta, index);
|
30
|
+
jumpToWeb(e, recData, product, cta, index);
|
31
31
|
window.location.href = window.getJointUtmLink(link);
|
32
32
|
}
|
33
33
|
}
|
@@ -16,7 +16,7 @@ const AniLinkPopup = (_a) => {
|
|
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);
|
18
18
|
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);
|
19
|
-
const handleTo = () => {
|
19
|
+
const handleTo = (e) => {
|
20
20
|
var _a, _b, _c, _d;
|
21
21
|
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);
|
22
22
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -27,7 +27,7 @@ const AniLinkPopup = (_a) => {
|
|
27
27
|
if (isExternalLink) {
|
28
28
|
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);
|
29
29
|
if (link) {
|
30
|
-
jumpToWeb(recData, product, cta, index);
|
30
|
+
jumpToWeb(e, recData, product, cta, index);
|
31
31
|
window.location.href = window.getJointUtmLink(link);
|
32
32
|
}
|
33
33
|
}
|
@@ -49,7 +49,7 @@ const AppointForm = (_a) => {
|
|
49
49
|
const { name, value } = e.target;
|
50
50
|
setFormData(Object.assign(Object.assign({}, formData), { [name]: value }));
|
51
51
|
}, [formData]);
|
52
|
-
const handleSubmit = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
52
|
+
const handleSubmit = debounce((e) => __awaiter(void 0, void 0, void 0, function* () {
|
53
53
|
var _d, _e, _f, _g, _h;
|
54
54
|
const vals = formData;
|
55
55
|
if (!vals)
|
@@ -72,7 +72,7 @@ const AppointForm = (_a) => {
|
|
72
72
|
const product = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
73
73
|
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;
|
74
74
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
75
|
-
jumpToWeb(data, product, cta, position);
|
75
|
+
jumpToWeb(e, data, product, cta, position);
|
76
76
|
}
|
77
77
|
if (!isPopup) {
|
78
78
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -35,9 +35,9 @@ const CommodityDetail = (_a) => {
|
|
35
35
|
product = p;
|
36
36
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
37
37
|
}
|
38
|
-
const handleLink = () => {
|
38
|
+
const handleLink = (e) => {
|
39
39
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
40
|
-
jumpToWeb(data, product, cta, position);
|
40
|
+
jumpToWeb(e, data, product, cta, position);
|
41
41
|
if (!isPost) {
|
42
42
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
43
43
|
}
|
@@ -39,9 +39,9 @@ const CommodityDetailDiroNew = (_a) => {
|
|
39
39
|
product = p;
|
40
40
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
41
41
|
}
|
42
|
-
const handleLink = () => {
|
42
|
+
const handleLink = (e) => {
|
43
43
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
44
|
-
jumpToWeb(data, product, cta, position);
|
44
|
+
jumpToWeb(e, data, product, cta, position);
|
45
45
|
if (!isPost) {
|
46
46
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
47
47
|
}
|
@@ -26,7 +26,7 @@ const CommodityList = (_a) => {
|
|
26
26
|
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
27
27
|
});
|
28
28
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
29
|
-
const handleClick = throttle((item, multiCheckIndex) => {
|
29
|
+
const handleClick = throttle((item, multiCheckIndex, e) => {
|
30
30
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
31
31
|
eventSubject: 'clickCta',
|
32
32
|
eventDescription: 'User clicked the CTA'
|
@@ -34,7 +34,7 @@ const CommodityList = (_a) => {
|
|
34
34
|
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
35
|
if (isExternalLink) {
|
36
36
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
37
|
-
jumpToWeb(recData, item, item.bindCta, index);
|
37
|
+
jumpToWeb(e, recData, item, item.bindCta, index);
|
38
38
|
window.location.href = window.getJointUtmLink(item.link);
|
39
39
|
}
|
40
40
|
}
|
@@ -49,7 +49,7 @@ const CommodityList = (_a) => {
|
|
49
49
|
}, []);
|
50
50
|
return (React.createElement("ul", { role: 'list', 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) => {
|
51
51
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
52
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("li", { role: 'listitem', key: index, onClick: () => handleClick(item, index) },
|
52
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("li", { role: 'listitem', key: index, onClick: (e) => handleClick(item, index, e) },
|
53
53
|
React.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: css({
|
54
54
|
display: 'flex',
|
55
55
|
alignItems: 'normal',
|
@@ -12,14 +12,14 @@ const Prompt = (_a) => {
|
|
12
12
|
const { popupDetailData } = useSxpDataSource();
|
13
13
|
const { jumpToWeb } = useEventReport();
|
14
14
|
const iconSrc = typeof icon === 'string' ? icon : getMediaValueByMode(icon);
|
15
|
-
const handleOk = () => {
|
15
|
+
const handleOk = (e) => {
|
16
16
|
var _a, _b, _c;
|
17
17
|
if (isExternalLink) {
|
18
18
|
const data = popupDetailData;
|
19
19
|
const product = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProduct;
|
20
20
|
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;
|
21
21
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
22
|
-
jumpToWeb(data, product, cta, position);
|
22
|
+
jumpToWeb(e, data, product, cta, position);
|
23
23
|
}
|
24
24
|
if (!isPopup) {
|
25
25
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -3,15 +3,13 @@ import { css } from '@emotion/css';
|
|
3
3
|
import React, { memo } from 'react';
|
4
4
|
import EventProvider from '../components/EventProvider';
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
|
-
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
7
6
|
import Img from '../components/Img';
|
8
7
|
import { setFontForText } from '../../../../core/utils/tool';
|
9
8
|
import styles from './index.module.less';
|
10
9
|
const Link = (_a) => {
|
11
10
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
12
11
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle", "isActive"]);
|
13
|
-
const { sxpParameter
|
14
|
-
const { jumpToWeb } = useEventReport();
|
12
|
+
const { sxpParameter } = useSxpDataSource();
|
15
13
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
16
14
|
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
17
15
|
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;
|
@@ -10,9 +10,9 @@ const EventProvider = (_a) => {
|
|
10
10
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
11
11
|
const { jumpToWeb } = useEventReport();
|
12
12
|
const [element, setElement] = useState(null);
|
13
|
-
const handleClick = throttle((
|
13
|
+
const handleClick = throttle((e) => {
|
14
14
|
var _a, _b, _c, _d, _e, _f;
|
15
|
-
|
15
|
+
e.preventDefault();
|
16
16
|
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;
|
17
17
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
18
18
|
eventSubject: 'clickCta',
|
@@ -26,7 +26,7 @@ const EventProvider = (_a) => {
|
|
26
26
|
if (jumpLink || link) {
|
27
27
|
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);
|
28
28
|
const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
|
29
|
-
jumpToWeb(rec, product, cta, index);
|
29
|
+
jumpToWeb(e, rec, product, cta, index);
|
30
30
|
window.location.href = window.getJointUtmLink(jumpLink || link || '');
|
31
31
|
}
|
32
32
|
}
|
@@ -163,12 +163,12 @@ function WaterfallList(_a) {
|
|
163
163
|
setIsLoadingData(false);
|
164
164
|
}
|
165
165
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
166
|
-
const handleClickLink = () => {
|
166
|
+
const handleClickLink = (e) => {
|
167
167
|
var _a, _b, _c, _d, _e;
|
168
168
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
169
169
|
reportTagsView();
|
170
170
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
171
|
-
jumpToWeb(rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
171
|
+
jumpToWeb(e, rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
172
172
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
173
173
|
}
|
174
174
|
};
|
@@ -271,12 +271,12 @@ function WaterfallList(_a) {
|
|
271
271
|
(_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', onScroll);
|
272
272
|
};
|
273
273
|
}, [onScroll, scrollParent]);
|
274
|
-
const handleClickLink = () => {
|
274
|
+
const handleClickLink = (e) => {
|
275
275
|
var _a, _b, _c, _d, _e;
|
276
276
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
277
277
|
reportTagsView();
|
278
278
|
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
279
|
-
jumpToWeb(rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
279
|
+
jumpToWeb(e, rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
280
280
|
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
281
281
|
}
|
282
282
|
};
|
@@ -203,10 +203,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
203
203
|
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
204
|
const rec = visList[activeIndex];
|
205
205
|
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: () => {
|
206
|
+
onClick: (e) => {
|
207
207
|
var _a, _b, _c, _d;
|
208
208
|
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));
|
209
|
+
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
210
|
}
|
211
211
|
new Function(link)();
|
212
212
|
}
|
@@ -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 {
|
@@ -47,6 +47,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
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)([]);
|
50
51
|
const isShowConsent = (0, react_1.useMemo)(() => {
|
51
52
|
var _a, _b, _c, _d;
|
52
53
|
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 +70,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
69
70
|
})) !== null && _a !== void 0 ? _a : [];
|
70
71
|
return nList;
|
71
72
|
}, []);
|
73
|
+
(0, react_1.useEffect)(() => {
|
74
|
+
let intervalId;
|
75
|
+
if (eventTimeList.length > 0) {
|
76
|
+
const checkTimes = () => {
|
77
|
+
const now = new Date();
|
78
|
+
const threshold = 15 * 1000;
|
79
|
+
setEventTimeList((prevArray) => prevArray.filter((item) => now - item.time <= threshold));
|
80
|
+
};
|
81
|
+
intervalId = setInterval(checkTimes, 1000);
|
82
|
+
}
|
83
|
+
return () => {
|
84
|
+
clearInterval(intervalId);
|
85
|
+
};
|
86
|
+
}, [eventTimeList]);
|
72
87
|
(0, react_1.useEffect)(() => {
|
73
88
|
const handleChangeThemeTag = (tag) => {
|
74
89
|
themeTag.current = tag;
|
@@ -486,7 +501,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
486
501
|
isEditor,
|
487
502
|
isNoMoreData,
|
488
503
|
updateChannel,
|
489
|
-
channel
|
504
|
+
channel,
|
505
|
+
eventTimeList,
|
506
|
+
setEventTimeList
|
490
507
|
} }, 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
508
|
rtcList,
|
492
509
|
mutateLike: bffMutateLike,
|
@@ -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 = '';
|
@@ -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();
|