pb-sxp-ui 1.9.5 → 1.9.8
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 +21 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -12
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +21 -12
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/context/SxpDataSourceProvider.d.ts +2 -2
- package/es/core/context/SxpDataSourceProvider.js +13 -4
- package/es/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -1
- package/es/materials/sxp/template/components/EventProvider.js +5 -5
- package/lib/core/context/SxpDataSourceProvider.d.ts +2 -2
- package/lib/core/context/SxpDataSourceProvider.js +13 -4
- package/lib/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -1
- package/lib/materials/sxp/template/components/EventProvider.js +5 -5
- package/package.json +1 -1
@@ -33,8 +33,8 @@ export interface ISxpDataSourceContext {
|
|
33
33
|
hashTag?: string;
|
34
34
|
traceInfo?: string;
|
35
35
|
themeTag?: string;
|
36
|
-
contentFilter?: string
|
37
|
-
productFilter?: string
|
36
|
+
contentFilter?: Array<string>;
|
37
|
+
productFilter?: Array<string>;
|
38
38
|
}) => Promise<RecommendVideoResultType | undefined>;
|
39
39
|
utmVal?: string;
|
40
40
|
bffEventReport?: (body: {
|
@@ -100,7 +100,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
100
100
|
}, [bffDataSource]);
|
101
101
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
102
102
|
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
103
|
-
query =
|
103
|
+
query = {
|
104
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
105
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
106
|
+
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
107
|
+
traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo,
|
108
|
+
themeTag: query === null || query === void 0 ? void 0 : query.themeTag,
|
109
|
+
pageNum: query === null || query === void 0 ? void 0 : query.pageNum,
|
110
|
+
contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter,
|
111
|
+
productFilter: query === null || query === void 0 ? void 0 : query.productFilter
|
112
|
+
};
|
104
113
|
if (utmVal) {
|
105
114
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
106
115
|
var _a, _b;
|
@@ -121,7 +130,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
121
130
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
122
131
|
var _t, _u, _v, _w, _x, _y;
|
123
132
|
query.pageNum = pageNum;
|
124
|
-
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: '
|
133
|
+
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
|
125
134
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
126
135
|
return undefined;
|
127
136
|
}
|
@@ -143,7 +152,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
143
152
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
144
153
|
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_l = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _l !== void 0 ? _l : 1 });
|
145
154
|
}
|
146
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: '
|
155
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
|
147
156
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
148
157
|
return undefined;
|
149
158
|
}
|
@@ -166,7 +175,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
166
175
|
return;
|
167
176
|
}
|
168
177
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
169
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _z === void 0 ? void 0 : _z.itemId) && { productFilter: (_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId })), (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _1 === void 0 ? void 0 : _1.itemId) && { contentFilter: (_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
178
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _z === void 0 ? void 0 : _z.itemId) && { productFilter: [(_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId] })), (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _1 === void 0 ? void 0 : _1.itemId) && { contentFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
170
179
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
171
180
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
172
181
|
return data;
|
@@ -16,7 +16,7 @@ const MultiCommodity = (_a) => {
|
|
16
16
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
17
17
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18
18
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
19
|
-
React.createElement(EventProvider, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
|
19
|
+
React.createElement(EventProvider, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex }, props),
|
20
20
|
React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
21
21
|
React.createElement("div", { className: css({
|
22
22
|
color: '#fff',
|
@@ -16,7 +16,7 @@ const MultiCommodityDiro = (_a) => {
|
|
16
16
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
17
17
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18
18
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
19
|
-
React.createElement(EventProvider, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
|
19
|
+
React.createElement(EventProvider, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex }, props),
|
20
20
|
React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
21
21
|
React.createElement("div", { className: css({
|
22
22
|
color: '#000',
|
@@ -16,7 +16,7 @@ const MultiCommodityDiroNew = (_a) => {
|
|
16
16
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
17
17
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18
18
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
19
|
-
React.createElement(EventProvider, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
|
19
|
+
React.createElement(EventProvider, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex }, props),
|
20
20
|
React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
21
21
|
React.createElement("div", { className: css({
|
22
22
|
color: '#fff',
|
@@ -11,9 +11,9 @@ const EventProvider = (_a) => {
|
|
11
11
|
const { jumpToWeb } = useEventReport();
|
12
12
|
const [element, setElement] = useState(null);
|
13
13
|
const handleClick = throttle((event) => {
|
14
|
-
var _a, _b, _c, _d, _e, _f
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
15
15
|
event.preventDefault();
|
16
|
-
const item =
|
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',
|
19
19
|
eventDescription: 'User clicked the CTA'
|
@@ -22,10 +22,10 @@ const EventProvider = (_a) => {
|
|
22
22
|
? 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 }));
|
23
23
|
setElement(ref === null || ref === void 0 ? void 0 : ref.current);
|
24
24
|
if (isExternalLink) {
|
25
|
-
const link = ((
|
25
|
+
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);
|
26
26
|
if (jumpLink || link) {
|
27
|
-
const cta = ((
|
28
|
-
const product = ((
|
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
|
+
const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
|
29
29
|
jumpToWeb(rec, product, cta, index);
|
30
30
|
window.location.href = window.getJointUtmLink(jumpLink || link || '');
|
31
31
|
}
|
@@ -33,8 +33,8 @@ export interface ISxpDataSourceContext {
|
|
33
33
|
hashTag?: string;
|
34
34
|
traceInfo?: string;
|
35
35
|
themeTag?: string;
|
36
|
-
contentFilter?: string
|
37
|
-
productFilter?: string
|
36
|
+
contentFilter?: Array<string>;
|
37
|
+
productFilter?: Array<string>;
|
38
38
|
}) => Promise<RecommendVideoResultType | undefined>;
|
39
39
|
utmVal?: string;
|
40
40
|
bffEventReport?: (body: {
|
@@ -103,7 +103,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
103
103
|
}, [bffDataSource]);
|
104
104
|
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
105
105
|
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
106
|
-
query =
|
106
|
+
query = {
|
107
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
108
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
109
|
+
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
110
|
+
traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo,
|
111
|
+
themeTag: query === null || query === void 0 ? void 0 : query.themeTag,
|
112
|
+
pageNum: query === null || query === void 0 ? void 0 : query.pageNum,
|
113
|
+
contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter,
|
114
|
+
productFilter: query === null || query === void 0 ? void 0 : query.productFilter
|
115
|
+
};
|
107
116
|
if (utmVal) {
|
108
117
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
109
118
|
var _a, _b;
|
@@ -124,7 +133,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
124
133
|
const recurveRecList = (query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
125
134
|
var _t, _u, _v, _w, _x, _y;
|
126
135
|
query.pageNum = pageNum;
|
127
|
-
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: '
|
136
|
+
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
|
128
137
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
129
138
|
return undefined;
|
130
139
|
}
|
@@ -146,7 +155,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
146
155
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
147
156
|
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_l = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _l !== void 0 ? _l : 1 });
|
148
157
|
}
|
149
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: '
|
158
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'POST', body: query }));
|
150
159
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
151
160
|
return undefined;
|
152
161
|
}
|
@@ -169,7 +178,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
169
178
|
return;
|
170
179
|
}
|
171
180
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
172
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _z === void 0 ? void 0 : _z.itemId) && { productFilter: (_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId })), (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _1 === void 0 ? void 0 : _1.itemId) && { contentFilter: (_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
181
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _z === void 0 ? void 0 : _z.itemId) && { productFilter: [(_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId] })), (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _1 === void 0 ? void 0 : _1.itemId) && { contentFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
173
182
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
174
183
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
175
184
|
return data;
|
@@ -18,7 +18,7 @@ const MultiCommodity = (_a) => {
|
|
18
18
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
19
19
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
20
20
|
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(react_2.SwiperSlide, { key: itemIndex, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
21
|
-
react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
|
21
|
+
react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex }, props),
|
22
22
|
react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
23
23
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
24
24
|
color: '#fff',
|
@@ -18,7 +18,7 @@ const MultiCommodityDiro = (_a) => {
|
|
18
18
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
19
19
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
20
20
|
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(react_2.SwiperSlide, { key: itemIndex, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
21
|
-
react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
|
21
|
+
react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex }, props),
|
22
22
|
react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
23
23
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
24
24
|
color: '#000',
|
@@ -18,7 +18,7 @@ const MultiCommodityDiroNew = (_a) => {
|
|
18
18
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
19
19
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
20
20
|
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(react_2.SwiperSlide, { key: itemIndex, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
21
|
-
react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
|
21
|
+
react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex }, props),
|
22
22
|
react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
23
23
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
24
24
|
color: '#fff',
|
@@ -13,9 +13,9 @@ const EventProvider = (_a) => {
|
|
13
13
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
14
14
|
const [element, setElement] = (0, react_1.useState)(null);
|
15
15
|
const handleClick = (0, lodash_1.throttle)((event) => {
|
16
|
-
var _a, _b, _c, _d, _e, _f
|
16
|
+
var _a, _b, _c, _d, _e, _f;
|
17
17
|
event.preventDefault();
|
18
|
-
const item =
|
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',
|
21
21
|
eventDescription: 'User clicked the CTA'
|
@@ -24,10 +24,10 @@ const EventProvider = (_a) => {
|
|
24
24
|
? 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 }));
|
25
25
|
setElement(ref === null || ref === void 0 ? void 0 : ref.current);
|
26
26
|
if (isExternalLink) {
|
27
|
-
const link = ((
|
27
|
+
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);
|
28
28
|
if (jumpLink || link) {
|
29
|
-
const cta = ((
|
30
|
-
const product = ((
|
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
|
+
const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
|
31
31
|
jumpToWeb(rec, product, cta, index);
|
32
32
|
window.location.href = window.getJointUtmLink(jumpLink || link || '');
|
33
33
|
}
|