pb-sxp-ui 1.0.87 → 1.0.89
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 +297 -353
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +298 -354
- 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 +300 -356
- 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/components/SxpPageRender/FormatImage.js +2 -7
- package/es/core/components/SxpPageRender/VideoWidget/index.js +39 -31
- package/es/core/components/SxpPageRender/index.js +78 -91
- package/es/core/context/SxpDataSourceProvider.js +19 -16
- package/es/materials/sxp/popup/AppointForm/index.js +1 -3
- package/es/materials/sxp/template/Appoint/index.js +7 -6
- package/es/materials/sxp/template/Commodity/index.js +7 -14
- package/es/materials/sxp/template/CommodityDiro/index.js +7 -14
- package/es/materials/sxp/template/CommodityDiroNew/index.js +7 -14
- package/es/materials/sxp/template/Link/index.js +5 -5
- package/es/materials/sxp/template/MultiCommodity/index.js +3 -6
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
- package/es/materials/sxp/template/components/EventProvider.js +1 -13
- package/es/materials/sxp/template/components/Img.d.ts +5 -3
- package/es/materials/sxp/template/components/Img.js +4 -3
- package/lib/core/components/SxpPageRender/FormatImage.js +2 -7
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +39 -31
- package/lib/core/components/SxpPageRender/index.js +78 -91
- package/lib/core/context/SxpDataSourceProvider.js +19 -16
- package/lib/materials/sxp/popup/AppointForm/index.js +1 -3
- package/lib/materials/sxp/template/Appoint/index.js +7 -6
- package/lib/materials/sxp/template/Commodity/index.js +7 -14
- package/lib/materials/sxp/template/CommodityDiro/index.js +7 -14
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +7 -14
- package/lib/materials/sxp/template/Link/index.js +5 -5
- package/lib/materials/sxp/template/MultiCommodity/index.js +3 -6
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
- package/lib/materials/sxp/template/components/EventProvider.js +0 -12
- package/lib/materials/sxp/template/components/Img.d.ts +5 -3
- package/lib/materials/sxp/template/components/Img.js +4 -3
- package/package.json +2 -4
@@ -24,9 +24,8 @@ const useEventReport_1 = require("../../../core/hooks/useEventReport");
|
|
24
24
|
const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
|
25
25
|
const Tagbar_1 = tslib_1.__importDefault(require("./Tagbar"));
|
26
26
|
const localStore_1 = require("../../../core/utils/localStore");
|
27
|
-
const Consent_1 = tslib_1.__importDefault(require("../Consent"));
|
28
27
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
29
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
30
29
|
const { schema } = (0, hooks_1.useEditor)();
|
31
30
|
const [activeIndex, setActiveIndex] = (0, react_1.useState)(0);
|
32
31
|
const viewImageStartTime = (0, react_1.useRef)(0);
|
@@ -37,58 +36,44 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
37
36
|
const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
|
38
37
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = (0, hooks_1.useSxpDataSource)();
|
39
38
|
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
40
|
-
const
|
41
|
-
const playerRef = (0, react_1.useRef)();
|
39
|
+
const videoRef = (0, react_1.useRef)();
|
42
40
|
const { productView } = (0, useEventReport_1.useEventReport)();
|
43
41
|
const isShowFingerTip = (0, react_1.useMemo)(() => {
|
44
42
|
return data.length > 0 && !loading && (0, localStore_1.getFeUserId)();
|
45
43
|
}, [data, loading]);
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
(0, react_1.useEffect)(() => {
|
45
|
+
(0, sessionStore_1.refreshFeSessionId)();
|
46
|
+
}, []);
|
47
|
+
(0, react_1.useEffect)(() => {
|
48
|
+
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
49
|
+
const now = new Date();
|
50
|
+
viewTime.current = now;
|
51
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
52
|
+
eventName: 'PageView'
|
53
|
+
});
|
49
54
|
}
|
55
|
+
}, [data === null || data === void 0 ? void 0 : data.length]);
|
56
|
+
const handleH5EnterLink = (0, react_1.useCallback)(() => {
|
50
57
|
(0, sessionStore_1.refreshFeSessionId)();
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
58
|
+
h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
|
59
|
+
if (data.length > 0) {
|
60
|
+
const now = new Date();
|
61
|
+
viewTime.current = now;
|
62
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
63
|
+
eventName: 'PageView'
|
64
|
+
});
|
55
65
|
}
|
56
|
-
|
57
|
-
eventName: 'PageView'
|
58
|
-
});
|
59
|
-
setIsInit(true);
|
60
|
-
}, [data.length, bffFbReport, h5EnterLink, isInit]);
|
66
|
+
}, [data.length, bffFbReport, h5EnterLink]);
|
61
67
|
const firstRef = (0, react_1.useRef)();
|
62
68
|
(0, react_1.useEffect)(() => {
|
63
69
|
var _a, _b, _c, _d;
|
64
|
-
if (!firstRef.current &&
|
70
|
+
if (!firstRef.current && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
|
65
71
|
firstRef.current = true;
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
loop: false,
|
70
|
-
autoplay: true,
|
71
|
-
muted: true,
|
72
|
-
preload: 'auto',
|
73
|
-
posterImage: false,
|
74
|
-
bigPlayButton: true,
|
75
|
-
sources: ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url)
|
76
|
-
? [
|
77
|
-
{
|
78
|
-
src: (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url
|
79
|
-
}
|
80
|
-
]
|
81
|
-
: []
|
82
|
-
});
|
83
|
-
player === null || player === void 0 ? void 0 : player.ready(() => {
|
84
|
-
setVideoRef(player);
|
85
|
-
});
|
72
|
+
if ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) {
|
73
|
+
videoRef.current.src = (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url;
|
74
|
+
}
|
86
75
|
}
|
87
|
-
}, [videoRef,
|
88
|
-
(0, react_1.useEffect)(() => {
|
89
|
-
if (!isInit)
|
90
|
-
handleH5EnterLink();
|
91
|
-
}, [handleH5EnterLink, isInit]);
|
76
|
+
}, [videoRef, data]);
|
92
77
|
(0, react_1.useEffect)(() => {
|
93
78
|
var _a;
|
94
79
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
@@ -203,7 +188,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
203
188
|
const renderContent = (0, react_1.useCallback)((rec, index) => {
|
204
189
|
var _a, _b, _c, _d;
|
205
190
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
206
|
-
return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef }));
|
191
|
+
return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef.current }));
|
207
192
|
}
|
208
193
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
209
194
|
return (react_1.default.createElement(PictureGroup_1.default, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
@@ -229,7 +214,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
229
214
|
tipText,
|
230
215
|
resolver,
|
231
216
|
schema,
|
232
|
-
videoRef
|
217
|
+
videoRef.current
|
233
218
|
]);
|
234
219
|
const onExpandableChange = (0, react_1.useCallback)((v) => {
|
235
220
|
setIsShowMore(v);
|
@@ -383,14 +368,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
383
368
|
}
|
384
369
|
};
|
385
370
|
const visList = (0, react_1.useMemo)(() => {
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
371
|
+
var _a;
|
372
|
+
const list = activeIndex === 0
|
373
|
+
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
374
|
+
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
375
|
+
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
376
|
+
return item;
|
377
|
+
}
|
378
|
+
else {
|
379
|
+
return null;
|
380
|
+
}
|
381
|
+
});
|
394
382
|
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
395
383
|
}, [data, activeIndex, waterFallData]);
|
396
384
|
const renderView = (0, react_1.useMemo)(() => {
|
@@ -415,47 +403,46 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
415
403
|
const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
416
404
|
const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
417
405
|
return (react_1.default.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
if (
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
});
|
445
|
-
}
|
406
|
+
waterFallData && (react_1.default.createElement(Navbar_1.default, { icon: left_png_1.default, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
|
407
|
+
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
408
|
+
} })),
|
409
|
+
renderLogo,
|
410
|
+
react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
411
|
+
isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 + ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _a !== void 0 ? _a : 0)}%` } })) : null,
|
412
|
+
react_1.default.createElement(react_2.Swiper, { style: {
|
413
|
+
marginTop: tagHeight
|
414
|
+
}, ref: swiperRef, onSlideChange: () => {
|
415
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
416
|
+
setTimeout(() => {
|
417
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
418
|
+
}, 500);
|
419
|
+
}, onActiveIndexChange: (swiper) => {
|
420
|
+
setActiveIndex(swiper.activeIndex);
|
421
|
+
if (openHashtag)
|
422
|
+
return;
|
423
|
+
handleScrollEvent(swiper);
|
424
|
+
if (waterFallData)
|
425
|
+
return;
|
426
|
+
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 2 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
427
|
+
if (!isLoadMore) {
|
428
|
+
setIsLoadMore(true);
|
429
|
+
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(Math.ceil(activeIndex / 10) + 1).then(() => {
|
430
|
+
setIsLoadMore(false);
|
431
|
+
});
|
446
432
|
}
|
447
|
-
}
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
433
|
+
}
|
434
|
+
}, direction: 'vertical', height: height },
|
435
|
+
react_1.default.createElement(ToggleButton_1.default, { style: {
|
436
|
+
position: 'fixed',
|
437
|
+
visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
438
|
+
zIndex: 999,
|
439
|
+
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
|
440
|
+
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _g !== void 0 ? _g : 23
|
441
|
+
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted }),
|
442
|
+
renderView),
|
443
|
+
react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props)),
|
457
444
|
react_1.default.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
458
|
-
react_1.default.createElement("video", { ref:
|
445
|
+
react_1.default.createElement("video", { ref: videoRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
|
459
446
|
backgroundColor: 'transparent',
|
460
447
|
width: '100%',
|
461
448
|
height: '100%',
|
@@ -8,6 +8,7 @@ const sessionStore_1 = require("../utils/sessionStore");
|
|
8
8
|
const localStore_1 = require("../utils/localStore");
|
9
9
|
const useIconLink_1 = require("../components/SxpPageRender/useIconLink");
|
10
10
|
const event_1 = tslib_1.__importStar(require("../utils/event"));
|
11
|
+
const Consent_1 = tslib_1.__importDefault(require("../components/Consent"));
|
11
12
|
exports.SxpDataSourceContext = (0, react_1.createContext)({
|
12
13
|
rtcList: [],
|
13
14
|
tagList: []
|
@@ -19,6 +20,7 @@ var DataSourceType;
|
|
19
20
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
20
21
|
exports.DEFAULT_TAG = 'FOR U';
|
21
22
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
|
23
|
+
var _a, _b, _c;
|
22
24
|
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
23
25
|
const [tagList, setTagList] = (0, react_1.useState)([]);
|
24
26
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
@@ -79,10 +81,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
79
81
|
.catch((err) => Promise.reject(err));
|
80
82
|
}, [bffDataSource]);
|
81
83
|
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
82
|
-
var
|
84
|
+
var _d, _e, _f, _g, _h;
|
83
85
|
query = {
|
84
|
-
maxSize: (
|
85
|
-
defaultSize: (
|
86
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
87
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
86
88
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
87
89
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
88
90
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -90,10 +92,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
90
92
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
91
93
|
};
|
92
94
|
if (utmVal) {
|
93
|
-
const val = (
|
95
|
+
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
94
96
|
const key = val.split('=')[0];
|
95
97
|
return UTM_KEYS.includes(key);
|
96
|
-
})) === null ||
|
98
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
97
99
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
98
100
|
}
|
99
101
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -105,7 +107,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
105
107
|
return result === null || result === void 0 ? void 0 : result.data;
|
106
108
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
107
109
|
const loadVideos = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
108
|
-
var
|
110
|
+
var _j, _k;
|
109
111
|
if (rtcList.length <= 0) {
|
110
112
|
return;
|
111
113
|
}
|
@@ -115,8 +117,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
115
117
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
116
118
|
themeTag: themeTag.current
|
117
119
|
});
|
118
|
-
setRtcList(rtcList.concat((
|
119
|
-
setCacheRtcList(cacheRtcList.concat((
|
120
|
+
setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
|
121
|
+
setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
|
120
122
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
121
123
|
const bffEventReport = (0, react_1.useCallback)(({ userInfo, eventInfo }) => {
|
122
124
|
if (!enableReportEvent) {
|
@@ -174,16 +176,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
174
176
|
return res === null || res === void 0 ? void 0 : res.success;
|
175
177
|
}), [bffFetch]);
|
176
178
|
const bffGetTagList = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
177
|
-
var
|
179
|
+
var _l, _m, _o, _p, _q;
|
178
180
|
if (!utmVal || !isShowTag)
|
179
181
|
return;
|
180
182
|
try {
|
181
|
-
const val = (
|
183
|
+
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
182
184
|
const key = val.split('=')[0];
|
183
185
|
return UTM_KEYS.includes(key);
|
184
|
-
})) === null ||
|
186
|
+
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
185
187
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
186
|
-
setTagList((
|
188
|
+
setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
|
187
189
|
}
|
188
190
|
catch (e) {
|
189
191
|
console.log('e', e);
|
@@ -234,8 +236,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
234
236
|
});
|
235
237
|
}, [bffEventReport]);
|
236
238
|
(0, react_1.useEffect)(() => {
|
237
|
-
|
238
|
-
|
239
|
+
if (!isShowConsent)
|
240
|
+
h5EnterLink();
|
241
|
+
}, [isShowConsent]);
|
239
242
|
(0, react_1.useEffect)(() => {
|
240
243
|
if (isShowConsent)
|
241
244
|
return;
|
@@ -318,12 +321,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
318
321
|
isShowConsent,
|
319
322
|
selectTag,
|
320
323
|
setSelectTag
|
321
|
-
} }, render({
|
324
|
+
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_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))) : (render({
|
322
325
|
rtcList,
|
323
326
|
mutateLike: bffMutateLike,
|
324
327
|
mutateUnlike: bffMutateUnlike,
|
325
328
|
submitForm: bffSubmitForm,
|
326
329
|
tagList
|
327
|
-
})));
|
330
|
+
}))));
|
328
331
|
};
|
329
332
|
exports.default = (0, react_1.memo)(SxpDataSourceProvider);
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
const css_1 = require("@emotion/css");
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
|
-
const pro_components_1 = require("@ant-design/pro-components");
|
7
6
|
const lodash_1 = require("lodash");
|
8
7
|
const hooks_1 = require("../../../../core/hooks");
|
9
8
|
require("./index.less");
|
@@ -83,8 +82,7 @@ const AppointForm = (_a) => {
|
|
83
82
|
return (react_1.default.createElement("div", { className: 'pb-appoint-form' },
|
84
83
|
react_1.default.createElement("div", { className: `pb-appoint-form-title ${(0, css_1.css)(Object.assign({}, textStyle))}` }, title),
|
85
84
|
react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign({}, style)) }, props),
|
86
|
-
react_1.default.createElement("div", { className: 'pb-appoint-form-container' },
|
87
|
-
react_1.default.createElement(pro_components_1.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
|
85
|
+
react_1.default.createElement("div", { className: 'pb-appoint-form-container' })),
|
88
86
|
react_1.default.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
89
87
|
react_1.default.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? react_1.default.createElement(react_1.default.Fragment, null, "loading...") : submitText))));
|
90
88
|
};
|
@@ -5,14 +5,15 @@ 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 Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
8
9
|
const Appoint = (_a) => {
|
9
|
-
var _b, _c, _d, _e;
|
10
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
10
|
+
var _b, _c, _d, _e, _f, _g;
|
11
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
11
12
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
12
13
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
14
|
+
const src = (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image;
|
15
|
+
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' }, index: index }, props),
|
16
|
+
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) !== null && _f !== void 0 ? _f : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
17
|
+
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _g !== void 0 ? _g : 'Product Name')));
|
17
18
|
};
|
18
19
|
exports.default = (0, react_1.memo)(Appoint);
|
@@ -6,22 +6,15 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
7
7
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
|
-
const
|
9
|
+
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
10
10
|
const Commodity = (_a) => {
|
11
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
12
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
11
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
12
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
|
13
13
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
14
14
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
15
15
|
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
16
|
-
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
17
|
-
react_1.default.createElement(
|
18
|
-
react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({
|
19
|
-
width: '100%',
|
20
|
-
objectFit: 'cover',
|
21
|
-
height: '100%',
|
22
|
-
display: 'block',
|
23
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
24
|
-
}), src: src })),
|
16
|
+
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
17
|
+
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
25
18
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
26
19
|
color: '#fff',
|
27
20
|
display: 'flex',
|
@@ -30,7 +23,7 @@ const Commodity = (_a) => {
|
|
30
23
|
width: '100%',
|
31
24
|
overflow: 'hidden'
|
32
25
|
}) },
|
33
|
-
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
34
|
-
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
26
|
+
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
|
27
|
+
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now'))));
|
35
28
|
};
|
36
29
|
exports.default = (0, react_1.memo)(Commodity);
|
@@ -6,22 +6,15 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
7
7
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
|
-
const
|
9
|
+
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
10
10
|
const CommodityDiro = (_a) => {
|
11
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
12
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
11
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
12
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
|
13
13
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
14
14
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
15
15
|
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
16
|
-
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
17
|
-
react_1.default.createElement(
|
18
|
-
react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({
|
19
|
-
width: '100%',
|
20
|
-
objectFit: 'cover',
|
21
|
-
height: '100%',
|
22
|
-
display: 'block',
|
23
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
24
|
-
}), src: src })),
|
16
|
+
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
17
|
+
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
25
18
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
26
19
|
color: '#fff',
|
27
20
|
display: 'flex',
|
@@ -30,7 +23,7 @@ const CommodityDiro = (_a) => {
|
|
30
23
|
width: '100%',
|
31
24
|
overflow: 'hidden'
|
32
25
|
}) },
|
33
|
-
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
34
|
-
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
26
|
+
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
|
27
|
+
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now'))));
|
35
28
|
};
|
36
29
|
exports.default = (0, react_1.memo)(CommodityDiro);
|
@@ -6,22 +6,15 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
7
7
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
|
-
const
|
9
|
+
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
10
10
|
const CommodityDiroNew = (_a) => {
|
11
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
12
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
11
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
12
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
|
13
13
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
14
14
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
15
15
|
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
16
|
-
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
17
|
-
react_1.default.createElement(
|
18
|
-
react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({
|
19
|
-
width: '100%',
|
20
|
-
objectFit: 'cover',
|
21
|
-
height: '100%',
|
22
|
-
display: 'block',
|
23
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
24
|
-
}), src: src })),
|
16
|
+
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
17
|
+
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
25
18
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
26
19
|
color: '#fff',
|
27
20
|
display: 'flex',
|
@@ -30,7 +23,7 @@ const CommodityDiroNew = (_a) => {
|
|
30
23
|
width: '100%',
|
31
24
|
overflow: 'hidden'
|
32
25
|
}) },
|
33
|
-
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
34
|
-
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
26
|
+
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
|
27
|
+
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop now'))));
|
35
28
|
};
|
36
29
|
exports.default = (0, react_1.memo)(CommodityDiroNew);
|
@@ -7,9 +7,9 @@ const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProv
|
|
7
7
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
9
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
10
|
-
const
|
10
|
+
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
11
11
|
const Link = (_a) => {
|
12
|
-
var _b, _c, _d, _e, _f;
|
12
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
13
13
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
|
14
14
|
const { sxpParameter, bffEventReport } = (0, hooks_1.useSxpDataSource)();
|
15
15
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
@@ -21,15 +21,15 @@ const Link = (_a) => {
|
|
21
21
|
window.location.href = window.getJointUtmLink(cta.link);
|
22
22
|
}
|
23
23
|
};
|
24
|
+
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;
|
24
25
|
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ index: index, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
25
|
-
react_1.default.createElement(
|
26
|
-
react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), 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 })),
|
26
|
+
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.bindProduct) !== null && _g !== void 0 ? _g : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
27
27
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
28
28
|
display: 'flex',
|
29
29
|
alignItems: 'center',
|
30
30
|
width: '100%',
|
31
31
|
overflow: 'hidden'
|
32
32
|
}) },
|
33
|
-
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (
|
33
|
+
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (_h = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _h !== void 0 ? _h : 'Product Name'))));
|
34
34
|
};
|
35
35
|
exports.default = (0, react_1.memo)(Link);
|
@@ -36,11 +36,8 @@ const MultiCommodity = (_a) => {
|
|
36
36
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
37
37
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
38
38
|
var _a, _b, _c, _d, _e, _f, _g;
|
39
|
-
return (react_1.default.createElement(
|
40
|
-
react_1.default.createElement(
|
41
|
-
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: index, style: {
|
42
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
43
|
-
} })),
|
39
|
+
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, Object.assign({ key: item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
40
|
+
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: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
44
41
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
45
42
|
color: '#fff',
|
46
43
|
display: 'flex',
|
@@ -50,7 +47,7 @@ const MultiCommodity = (_a) => {
|
|
50
47
|
overflow: 'hidden'
|
51
48
|
}) },
|
52
49
|
react_1.default.createElement("div", { className: index_module_less_1.default['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
53
|
-
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
|
50
|
+
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))))));
|
54
51
|
})));
|
55
52
|
};
|
56
53
|
exports.default = (0, react_1.memo)(MultiCommodity);
|