pb-sxp-ui 1.10.1 → 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 +78 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +78 -51
- 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 +78 -51
- 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/SxpPageCore/index.js +3 -2
- 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 +4 -4
- package/es/core/context/EditorContext.d.ts +0 -2
- package/es/core/context/EditorContext.js +3 -9
- package/es/core/context/SxpDataSourceProvider.d.ts +9 -0
- package/es/core/context/SxpDataSourceProvider.js +26 -4
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +10 -3
- package/es/materials/sxp/MultiPosts/index.js +3 -4
- 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/SxpPageCore/index.js +3 -2
- 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 +4 -4
- package/lib/core/context/EditorContext.d.ts +0 -2
- package/lib/core/context/EditorContext.js +3 -9
- package/lib/core/context/SxpDataSourceProvider.d.ts +9 -0
- package/lib/core/context/SxpDataSourceProvider.js +26 -4
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +10 -3
- package/lib/materials/sxp/MultiPosts/index.js +2 -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
@@ -59,7 +59,6 @@ exports.EditorContext = react_1.default.createContext({
|
|
59
59
|
});
|
60
60
|
const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
61
61
|
const [currentNode, setCurrentNode] = (0, react_1.useState)(null);
|
62
|
-
const [channel, setChannel] = (0, react_1.useState)();
|
63
62
|
const [_schema, setSchema] = (0, react_1.useState)(schema || {
|
64
63
|
pointData: [item],
|
65
64
|
dataSource: [],
|
@@ -75,9 +74,6 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
|
|
75
74
|
const [undoStack, setUndoStack] = (0, react_1.useState)([[item]]);
|
76
75
|
const [redoStack, setRedoStack] = (0, react_1.useState)([]);
|
77
76
|
const [popup, setPopup] = (0, react_1.useState)(popupInit);
|
78
|
-
const channelParams = (0, react_1.useMemo)(() => {
|
79
|
-
return channel || utmVal;
|
80
|
-
}, [channel, utmVal]);
|
81
77
|
typeof window !== 'undefined' &&
|
82
78
|
(window.sxpPopup = (type, aniType) => {
|
83
79
|
setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
|
@@ -86,10 +82,10 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
|
|
86
82
|
(window.getJointUtmLink = (url) => {
|
87
83
|
(0, localStore_1.setSlideSkipState)();
|
88
84
|
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
89
|
-
return url + (
|
85
|
+
return url + (utmVal ? '&' + utmVal : '');
|
90
86
|
}
|
91
87
|
else {
|
92
|
-
return url + (
|
88
|
+
return url + (utmVal ? '?' + utmVal : '');
|
93
89
|
}
|
94
90
|
});
|
95
91
|
(0, react_1.useEffect)(() => {
|
@@ -150,9 +146,7 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
|
|
150
146
|
setUndoStack,
|
151
147
|
getCurPageConf,
|
152
148
|
popup,
|
153
|
-
setPopup
|
154
|
-
channel,
|
155
|
-
setChannel
|
149
|
+
setPopup
|
156
150
|
} },
|
157
151
|
react_1.default.createElement(DataSourceProvider_1.default, { isSsr: isSsr, enable: enableDataSource }, children)));
|
158
152
|
});
|
@@ -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[]>>;
|
@@ -80,6 +84,10 @@ export interface ISxpDataSourceContext {
|
|
80
84
|
checkCommodityIndexRef?: any;
|
81
85
|
isEditor?: boolean;
|
82
86
|
isNoMoreData?: boolean;
|
87
|
+
updateChannel?: (d: string) => void;
|
88
|
+
channel?: string;
|
89
|
+
eventTimeList?: Array<IEventTimeType>;
|
90
|
+
setEventTimeList?: React.Dispatch<React.SetStateAction<Array<IEventTimeType>>>;
|
83
91
|
}
|
84
92
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
85
93
|
export interface SxpDataSourceProviderProps {
|
@@ -122,6 +130,7 @@ export interface SxpDataSourceProviderProps {
|
|
122
130
|
data?: PageData;
|
123
131
|
dataList?: PageData[];
|
124
132
|
onUpdateSchema?: (d: PageData['data']) => void;
|
133
|
+
onUpdateChannel?: (d: string) => void;
|
125
134
|
}
|
126
135
|
export declare const DEFAULT_TAG = "FOR U";
|
127
136
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
@@ -11,7 +11,6 @@ const event_1 = tslib_1.__importStar(require("../utils/event"));
|
|
11
11
|
const Consent_1 = tslib_1.__importDefault(require("../components/Consent"));
|
12
12
|
const tool_1 = require("../utils/tool");
|
13
13
|
const lodash_1 = require("lodash");
|
14
|
-
const useEditor_1 = require("../hooks/useEditor");
|
15
14
|
exports.SxpDataSourceContext = (0, react_1.createContext)({
|
16
15
|
rtcList: [],
|
17
16
|
tagList: []
|
@@ -21,9 +20,8 @@ var DataSourceType;
|
|
21
20
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
22
21
|
})(DataSourceType || (DataSourceType = {}));
|
23
22
|
exports.DEFAULT_TAG = 'FOR U';
|
24
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, onUpdateSchema }) => {
|
23
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, onUpdateSchema, onUpdateChannel }) => {
|
25
24
|
var _a, _b, _c, _d, _e;
|
26
|
-
const { channel } = (0, useEditor_1.useEditor)();
|
27
25
|
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
28
26
|
const [tagList, setTagList] = (0, react_1.useState)([]);
|
29
27
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
@@ -48,11 +46,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
48
46
|
const [pageData, setPageData] = (0, react_1.useState)(data);
|
49
47
|
const [showConsent, setShowConsent] = (0, react_1.useState)(false);
|
50
48
|
const [layoutVariantId, setLayoutVariantId] = (0, react_1.useState)();
|
49
|
+
const [channel, setChannel] = (0, react_1.useState)();
|
50
|
+
const [eventTimeList, setEventTimeList] = (0, react_1.useState)([]);
|
51
51
|
const isShowConsent = (0, react_1.useMemo)(() => {
|
52
52
|
var _a, _b, _c, _d;
|
53
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) &&
|
54
54
|
showConsent);
|
55
55
|
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor, showConsent]);
|
56
|
+
const updateChannel = (0, react_1.useCallback)((d) => {
|
57
|
+
onUpdateChannel === null || onUpdateChannel === void 0 ? void 0 : onUpdateChannel(d);
|
58
|
+
setChannel(d);
|
59
|
+
}, []);
|
56
60
|
const getFilterRecList = (0, react_1.useCallback)((data) => {
|
57
61
|
var _a;
|
58
62
|
const recList = data === null || data === void 0 ? void 0 : data.recList;
|
@@ -66,6 +70,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
66
70
|
})) !== null && _a !== void 0 ? _a : [];
|
67
71
|
return nList;
|
68
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]);
|
69
87
|
(0, react_1.useEffect)(() => {
|
70
88
|
const handleChangeThemeTag = (tag) => {
|
71
89
|
themeTag.current = tag;
|
@@ -481,7 +499,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
481
499
|
popupCurTimeRef,
|
482
500
|
checkCommodityIndexRef,
|
483
501
|
isEditor,
|
484
|
-
isNoMoreData
|
502
|
+
isNoMoreData,
|
503
|
+
updateChannel,
|
504
|
+
channel,
|
505
|
+
eventTimeList,
|
506
|
+
setEventTimeList
|
485
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({
|
486
508
|
rtcList,
|
487
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 = '';
|
@@ -10,8 +10,7 @@ const react_2 = require("swiper/react");
|
|
10
10
|
const MultiPosts = (_a) => {
|
11
11
|
var _b, _c;
|
12
12
|
var { bgImgUrl, style, recData } = _a, props = tslib_1.__rest(_a, ["bgImgUrl", "style", "recData"]);
|
13
|
-
const {
|
14
|
-
const { bffEventReport, curTime } = (0, hooks_1.useSxpDataSource)();
|
13
|
+
const { bffEventReport, curTime, updateChannel } = (0, hooks_1.useSxpDataSource)();
|
15
14
|
const { isActive } = (0, react_2.useSwiperSlide)() || {};
|
16
15
|
const initRef = (0, react_1.useRef)(false);
|
17
16
|
const viewTime = (0, react_1.useRef)();
|
@@ -41,7 +40,7 @@ const MultiPosts = (_a) => {
|
|
41
40
|
});
|
42
41
|
if ((v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow') {
|
43
42
|
endMultiPost('multipostClick');
|
44
|
-
|
43
|
+
updateChannel === null || updateChannel === void 0 ? void 0 : updateChannel(value);
|
45
44
|
curTime.current = new Date();
|
46
45
|
}
|
47
46
|
else {
|
@@ -18,7 +18,7 @@ const AniLink = (_a) => {
|
|
18
18
|
const isOnScreen = (0, useOnScreen_1.default)(ref);
|
19
19
|
const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
|
20
20
|
const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
|
21
|
-
const handleTo = () => {
|
21
|
+
const handleTo = (e) => {
|
22
22
|
var _a, _b, _c, _d;
|
23
23
|
const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
|
24
24
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -29,7 +29,7 @@ const AniLink = (_a) => {
|
|
29
29
|
if (isExternalLink) {
|
30
30
|
const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
|
31
31
|
if (link) {
|
32
|
-
jumpToWeb(recData, product, cta, index);
|
32
|
+
jumpToWeb(e, recData, product, cta, index);
|
33
33
|
window.location.href = window.getJointUtmLink(link);
|
34
34
|
}
|
35
35
|
}
|
@@ -18,7 +18,7 @@ const AniLinkPopup = (_a) => {
|
|
18
18
|
const [visible, setVisible] = (0, react_1.useState)(true);
|
19
19
|
const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
|
20
20
|
const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
|
21
|
-
const handleTo = () => {
|
21
|
+
const handleTo = (e) => {
|
22
22
|
var _a, _b, _c, _d;
|
23
23
|
const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
|
24
24
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -29,7 +29,7 @@ const AniLinkPopup = (_a) => {
|
|
29
29
|
if (isExternalLink) {
|
30
30
|
const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
|
31
31
|
if (link) {
|
32
|
-
jumpToWeb(recData, product, cta, index);
|
32
|
+
jumpToWeb(e, recData, product, cta, index);
|
33
33
|
window.location.href = window.getJointUtmLink(link);
|
34
34
|
}
|
35
35
|
}
|
@@ -51,7 +51,7 @@ const AppointForm = (_a) => {
|
|
51
51
|
const { name, value } = e.target;
|
52
52
|
setFormData(Object.assign(Object.assign({}, formData), { [name]: value }));
|
53
53
|
}, [formData]);
|
54
|
-
const handleSubmit = (0, lodash_1.debounce)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
54
|
+
const handleSubmit = (0, lodash_1.debounce)((e) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
55
55
|
var _d, _e, _f, _g, _h;
|
56
56
|
const vals = formData;
|
57
57
|
if (!vals)
|
@@ -74,7 +74,7 @@ const AppointForm = (_a) => {
|
|
74
74
|
const product = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
75
75
|
const cta = (_h = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.bindCta;
|
76
76
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
77
|
-
jumpToWeb(data, product, cta, position);
|
77
|
+
jumpToWeb(e, data, product, cta, position);
|
78
78
|
}
|
79
79
|
if (!isPopup) {
|
80
80
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -37,9 +37,9 @@ const CommodityDetail = (_a) => {
|
|
37
37
|
product = p;
|
38
38
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
39
39
|
}
|
40
|
-
const handleLink = () => {
|
40
|
+
const handleLink = (e) => {
|
41
41
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
42
|
-
jumpToWeb(data, product, cta, position);
|
42
|
+
jumpToWeb(e, data, product, cta, position);
|
43
43
|
if (!isPost) {
|
44
44
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
45
45
|
}
|
@@ -41,9 +41,9 @@ const CommodityDetailDiroNew = (_a) => {
|
|
41
41
|
product = p;
|
42
42
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
43
43
|
}
|
44
|
-
const handleLink = () => {
|
44
|
+
const handleLink = (e) => {
|
45
45
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
46
|
-
jumpToWeb(data, product, cta, position);
|
46
|
+
jumpToWeb(e, data, product, cta, position);
|
47
47
|
if (!isPost) {
|
48
48
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
49
49
|
}
|
@@ -28,7 +28,7 @@ const CommodityList = (_a) => {
|
|
28
28
|
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
29
29
|
});
|
30
30
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
31
|
-
const handleClick = (0, lodash_1.throttle)((item, multiCheckIndex) => {
|
31
|
+
const handleClick = (0, lodash_1.throttle)((item, multiCheckIndex, e) => {
|
32
32
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
33
33
|
eventSubject: 'clickCta',
|
34
34
|
eventDescription: 'User clicked the CTA'
|
@@ -36,7 +36,7 @@ const CommodityList = (_a) => {
|
|
36
36
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
|
37
37
|
if (isExternalLink) {
|
38
38
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
39
|
-
jumpToWeb(recData, item, item.bindCta, index);
|
39
|
+
jumpToWeb(e, recData, item, item.bindCta, index);
|
40
40
|
window.location.href = window.getJointUtmLink(item.link);
|
41
41
|
}
|
42
42
|
}
|
@@ -51,7 +51,7 @@ const CommodityList = (_a) => {
|
|
51
51
|
}, []);
|
52
52
|
return (react_1.default.createElement("ul", { role: 'list', className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
53
53
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
54
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement("li", { role: 'listitem', key: index, onClick: () => handleClick(item, index) },
|
54
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement("li", { role: 'listitem', key: index, onClick: (e) => handleClick(item, index, e) },
|
55
55
|
react_1.default.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: (0, css_1.css)({
|
56
56
|
display: 'flex',
|
57
57
|
alignItems: 'normal',
|
@@ -14,14 +14,14 @@ const Prompt = (_a) => {
|
|
14
14
|
const { popupDetailData } = (0, hooks_1.useSxpDataSource)();
|
15
15
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
16
16
|
const iconSrc = typeof icon === 'string' ? icon : (0, materials_1.getMediaValueByMode)(icon);
|
17
|
-
const handleOk = () => {
|
17
|
+
const handleOk = (e) => {
|
18
18
|
var _a, _b, _c;
|
19
19
|
if (isExternalLink) {
|
20
20
|
const data = popupDetailData;
|
21
21
|
const product = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProduct;
|
22
22
|
const cta = (_c = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct) === null || _c === void 0 ? void 0 : _c.bindCta;
|
23
23
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
24
|
-
jumpToWeb(data, product, cta, position);
|
24
|
+
jumpToWeb(e, data, product, cta, position);
|
25
25
|
}
|
26
26
|
if (!isPopup) {
|
27
27
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
@@ -5,15 +5,13 @@ const css_1 = require("@emotion/css");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
6
|
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
7
7
|
const hooks_1 = require("../../../../core/hooks");
|
8
|
-
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
9
8
|
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
10
9
|
const tool_1 = require("../../../../core/utils/tool");
|
11
10
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
12
11
|
const Link = (_a) => {
|
13
12
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
14
13
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle, isActive } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle", "isActive"]);
|
15
|
-
const { sxpParameter
|
16
|
-
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
14
|
+
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
17
15
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
18
16
|
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
19
17
|
const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
@@ -12,9 +12,9 @@ const EventProvider = (_a) => {
|
|
12
12
|
const { setPopupDetailData, ctaEvent } = (0, hooks_1.useSxpDataSource)();
|
13
13
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
14
14
|
const [element, setElement] = (0, react_1.useState)(null);
|
15
|
-
const handleClick = (0, lodash_1.throttle)((
|
15
|
+
const handleClick = (0, lodash_1.throttle)((e) => {
|
16
16
|
var _a, _b, _c, _d, _e, _f;
|
17
|
-
|
17
|
+
e.preventDefault();
|
18
18
|
const item = multItem ? multItem : (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
|
19
19
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
20
20
|
eventSubject: 'clickCta',
|
@@ -28,7 +28,7 @@ const EventProvider = (_a) => {
|
|
28
28
|
if (jumpLink || link) {
|
29
29
|
const cta = ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
|
30
30
|
const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
|
31
|
-
jumpToWeb(rec, product, cta, index);
|
31
|
+
jumpToWeb(e, rec, product, cta, index);
|
32
32
|
window.location.href = window.getJointUtmLink(jumpLink || link || '');
|
33
33
|
}
|
34
34
|
}
|