pb-sxp-ui 1.2.1 → 1.2.2
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 +112 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +63 -31
- package/dist/index.js +112 -69
- 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 +112 -69
- 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/FingerSwipeTip/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +3 -3
- package/es/core/components/SxpPageRender/Hashtag/index.js +3 -1
- package/es/core/components/SxpPageRender/Navbar.js +1 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +13 -10
- package/es/core/components/SxpPageRender/WaterFall/List.js +1 -1
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
- package/es/core/components/SxpPageRender/index.d.ts +3 -0
- package/es/core/components/SxpPageRender/index.js +8 -8
- package/es/materials/sxp/HashTag/material.js +2 -1
- package/es/materials/sxp/cta/AniLink/index.js +27 -11
- package/es/materials/sxp/cta/AniLinkPopup/index.js +39 -22
- package/es/materials/sxp/popup/CommodityDetail/index.js +1 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/es/materials/sxp/template/Link/index.js +2 -2
- package/es/materials/sxp/template/components/Img.js +1 -1
- package/es/materials/sxp/template/components/settingRender.js +5 -0
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +3 -3
- package/lib/core/components/SxpPageRender/Hashtag/index.js +3 -1
- package/lib/core/components/SxpPageRender/Navbar.js +1 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +13 -10
- package/lib/core/components/SxpPageRender/WaterFall/List.js +1 -1
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
- package/lib/core/components/SxpPageRender/index.d.ts +3 -0
- package/lib/core/components/SxpPageRender/index.js +8 -8
- package/lib/materials/sxp/HashTag/material.js +2 -1
- package/lib/materials/sxp/cta/AniLink/index.js +26 -10
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +38 -21
- package/lib/materials/sxp/popup/CommodityDetail/index.js +1 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/lib/materials/sxp/template/Link/index.js +2 -2
- package/lib/materials/sxp/template/components/Img.js +1 -1
- package/lib/materials/sxp/template/components/settingRender.js +5 -0
- package/package.json +1 -1
@@ -37,6 +37,9 @@ export interface ISxpPageRenderProps {
|
|
37
37
|
swipeTipOffset?: number;
|
38
38
|
consent?: any[];
|
39
39
|
videoPlayIcon?: string;
|
40
|
+
isShowMute?: boolean;
|
41
|
+
bottomInfoDist?: number;
|
42
|
+
swiperTipAniDur?: number;
|
40
43
|
popupCloseIcon?: string;
|
41
44
|
openSlideSkip?: boolean;
|
42
45
|
slideSkipStartTime?: number;
|
@@ -223,18 +223,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
223
223
|
};
|
224
224
|
}, [isShowMore]);
|
225
225
|
const renderBottom = (0, react_1.useCallback)((rec, index) => {
|
226
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
226
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
227
227
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
228
228
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
229
229
|
((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
230
|
-
react_1.default.createElement("div", { className: 'clc-sxp-bottom' },
|
230
|
+
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: { paddingBottom: `${(_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _b !== void 0 ? _b : 40}px` } },
|
231
231
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
232
232
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
233
233
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
234
234
|
react_1.default.createElement("div", null,
|
235
|
-
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (
|
235
|
+
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
236
236
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
237
|
-
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (
|
237
|
+
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.hashTags) !== null && _f !== void 0 ? _f : [], itemId: (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId, itemType: ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))),
|
238
238
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'] })));
|
239
239
|
}
|
240
240
|
return null;
|
@@ -412,7 +412,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
412
412
|
react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } })));
|
413
413
|
}
|
414
414
|
return visList === null || visList === void 0 ? void 0 : visList.map((rec, index) => {
|
415
|
-
return (react_1.default.createElement(react_2.SwiperSlide, { key: index, virtualIndex: index }, rec && (react_1.default.createElement(react_1.default.Fragment, null, (rec === null || rec === void 0 ? void 0 : rec.loading) ? (react_1.default.createElement("div", { style: {
|
415
|
+
return (react_1.default.createElement(react_2.SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden' } }, rec && (react_1.default.createElement(react_1.default.Fragment, null, (rec === null || rec === void 0 ? void 0 : rec.loading) ? (react_1.default.createElement("div", { style: {
|
416
416
|
height,
|
417
417
|
width: containerWidth,
|
418
418
|
display: 'flex',
|
@@ -435,7 +435,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
435
435
|
react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
436
436
|
top: minusHeight
|
437
437
|
} }),
|
438
|
-
isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50
|
438
|
+
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)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
|
439
439
|
react_1.default.createElement(react_2.Swiper, { style: {
|
440
440
|
marginTop: tagHeight
|
441
441
|
}, ref: swiperRef, onSlideChange: () => {
|
@@ -459,13 +459,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
459
459
|
}
|
460
460
|
}
|
461
461
|
}, direction: 'vertical', height: height },
|
462
|
-
react_1.default.createElement(ToggleButton_1.default, { style: {
|
462
|
+
((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (react_1.default.createElement(ToggleButton_1.default, { style: {
|
463
463
|
position: 'fixed',
|
464
464
|
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',
|
465
465
|
zIndex: 999,
|
466
466
|
[(_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,
|
467
467
|
[(_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
|
468
|
-
}, 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 }),
|
468
|
+
}, 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 })),
|
469
469
|
renderView),
|
470
470
|
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))));
|
471
471
|
};
|
@@ -9,16 +9,17 @@ const tool_1 = require("../../../../core/utils/tool");
|
|
9
9
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
10
10
|
const useOnScreen_1 = tslib_1.__importDefault(require("../../../../core/hooks/useOnScreen"));
|
11
11
|
const AniLink = (_a) => {
|
12
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
12
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
13
13
|
var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false } = _a, props = tslib_1.__rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink"]);
|
14
14
|
const { ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
|
15
15
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
16
|
+
const [visible, setVisible] = (0, react_1.useState)(false);
|
16
17
|
const ref = (0, react_1.useRef)(null);
|
17
18
|
const isOnScreen = (0, useOnScreen_1.default)(ref);
|
18
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);
|
19
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);
|
20
21
|
const handleTo = () => {
|
21
|
-
var _a, _b, _c;
|
22
|
+
var _a, _b, _c, _d;
|
22
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);
|
23
24
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
24
25
|
eventSubject: 'clickCta',
|
@@ -26,12 +27,18 @@ const AniLink = (_a) => {
|
|
26
27
|
}, recData, item, index);
|
27
28
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
|
28
29
|
if (isExternalLink) {
|
29
|
-
|
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
|
+
if (link) {
|
32
|
+
jumpToWeb(recData, product, cta, index);
|
33
|
+
window.location.href = window.getJointUtmLink(link);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
else {
|
37
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
30
38
|
}
|
31
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
32
39
|
};
|
33
|
-
const title = (cta === null || cta === void 0 ? void 0 : cta.
|
34
|
-
const
|
40
|
+
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情 >';
|
41
|
+
const aniTimStyle = (0, react_1.useMemo)(() => {
|
35
42
|
var _a, _b;
|
36
43
|
const ani = event === null || event === void 0 ? void 0 : event.animation;
|
37
44
|
if (ani) {
|
@@ -53,9 +60,18 @@ const AniLink = (_a) => {
|
|
53
60
|
}, recData, product, index);
|
54
61
|
}
|
55
62
|
}, [isOnScreen]);
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
63
|
+
(0, react_1.useEffect)(() => {
|
64
|
+
if (isOnScreen) {
|
65
|
+
setVisible(true);
|
66
|
+
}
|
67
|
+
}, [isOnScreen]);
|
68
|
+
const aniNamStyle = (0, react_1.useMemo)(() => {
|
69
|
+
if (!visible)
|
70
|
+
return null;
|
71
|
+
return index_module_less_1.default['animated-button'];
|
72
|
+
}, [visible]);
|
73
|
+
return (react_1.default.createElement("div", Object.assign({ ref: ref, style: Object.assign(Object.assign(Object.assign({}, style), ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: `${(_l = style === null || style === void 0 ? void 0 : style.height) !== null && _l !== void 0 ? _l : 0}px` }) }, props, { className: `${aniNamStyle} ${(0, css_1.css)(aniTimStyle)} one-line-ellipsis`, onClick: handleTo, dangerouslySetInnerHTML: {
|
74
|
+
__html: (0, tool_1.setFontForText)(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
75
|
+
} })));
|
60
76
|
};
|
61
77
|
exports.default = (0, react_1.memo)(AniLink);
|
@@ -8,17 +8,22 @@ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
|
8
8
|
const Img_1 = tslib_1.__importDefault(require("../../template/components/Img"));
|
9
9
|
const tool_1 = require("../../../../core/utils/tool");
|
10
10
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
11
|
+
const useOnScreen_1 = tslib_1.__importDefault(require("../../../../core/hooks/useOnScreen"));
|
11
12
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
12
13
|
const AniLinkPopup = (_a) => {
|
13
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
14
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
14
15
|
var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false } = _a, props = tslib_1.__rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink"]);
|
16
|
+
style === null || style === void 0 ? true : delete style.transform;
|
15
17
|
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
|
16
18
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
17
|
-
const
|
19
|
+
const ref = (0, react_1.useRef)(null);
|
20
|
+
const isOnScreen = (0, useOnScreen_1.default)(ref);
|
21
|
+
const [visible, setVisible] = (0, react_1.useState)(false);
|
22
|
+
const [startAni, setStartAni] = (0, react_1.useState)(true);
|
18
23
|
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);
|
19
24
|
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);
|
20
25
|
const handleTo = () => {
|
21
|
-
var _a, _b, _c;
|
26
|
+
var _a, _b, _c, _d;
|
22
27
|
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);
|
23
28
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
24
29
|
eventSubject: 'clickCta',
|
@@ -26,42 +31,54 @@ const AniLinkPopup = (_a) => {
|
|
26
31
|
}, recData, item, index);
|
27
32
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
|
28
33
|
if (isExternalLink) {
|
29
|
-
|
34
|
+
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);
|
35
|
+
if (link) {
|
36
|
+
jumpToWeb(recData, product, cta, index);
|
37
|
+
window.location.href = window.getJointUtmLink(link);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
30
42
|
}
|
31
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
32
43
|
};
|
33
|
-
const title = (cta === null || cta === void 0 ? void 0 : cta.
|
34
|
-
const
|
35
|
-
var _a, _b;
|
44
|
+
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情 >';
|
45
|
+
const aniTimStyle = (0, react_1.useMemo)(() => {
|
36
46
|
const ani = event === null || event === void 0 ? void 0 : event.animation;
|
37
47
|
if (ani) {
|
38
|
-
const { delay, duration
|
48
|
+
const { delay, duration } = ani;
|
39
49
|
return {
|
40
|
-
|
41
|
-
|
42
|
-
animationDuration: `${(_b = duration / 1000) !== null && _b !== void 0 ? _b : 0}s`,
|
43
|
-
backgroundColor: `${backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : 'transparent'}`
|
44
|
-
}
|
50
|
+
animationDelay: `${delay ? delay / 1000 : 0}s`,
|
51
|
+
animationDuration: `${duration ? duration / 1000 : 0}s`
|
45
52
|
};
|
46
53
|
}
|
47
54
|
}, [event === null || event === void 0 ? void 0 : event.animation]);
|
48
55
|
const src = (_q = (_p = (_o = (_l = product === null || product === void 0 ? void 0 : product.cover) !== null && _l !== void 0 ? _l : (_m = product === null || product === void 0 ? void 0 : product.homePage) === null || _m === void 0 ? void 0 : _m[0]) !== null && _o !== void 0 ? _o : cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _p !== void 0 ? _p : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _q !== void 0 ? _q : bottom_image;
|
49
56
|
const onClose = (event) => {
|
50
57
|
event.stopPropagation();
|
51
|
-
|
58
|
+
setStartAni(false);
|
52
59
|
};
|
60
|
+
(0, react_1.useEffect)(() => {
|
61
|
+
if (isOnScreen) {
|
62
|
+
setVisible(true);
|
63
|
+
}
|
64
|
+
}, [isOnScreen]);
|
65
|
+
const aniNamStyle = (0, react_1.useMemo)(() => {
|
66
|
+
if (!visible)
|
67
|
+
return null;
|
68
|
+
return startAni ? index_module_less_1.default['animated-fadeIn'] : index_module_less_1.default['animated-fadeOut'];
|
69
|
+
}, [visible, startAni]);
|
53
70
|
return (react_1.default.createElement(react_1.default.Fragment, null, isTel ? (react_1.default.createElement("div", { style: {
|
54
71
|
height: '40px',
|
55
72
|
lineHeight: '40px',
|
56
73
|
paddingLeft: '6px'
|
57
|
-
} }, "Cta Title")) : (react_1.default.createElement("div", Object.assign({
|
58
|
-
react_1.default.createElement("div", { onClick: onClose, className: index_module_less_1.default['modal-icon-wrapper'], style: { padding: (
|
59
|
-
react_1.default.createElement("img", { src: (
|
60
|
-
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (
|
74
|
+
} }, "Cta Title")) : (react_1.default.createElement("div", Object.assign({ ref: ref }, props, { className: `${(0, css_1.css)(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${index_module_less_1.default['aniLinkPopup']} ${aniNamStyle} ${(0, css_1.css)(aniTimStyle)}`, onClick: handleTo }),
|
75
|
+
react_1.default.createElement("div", { onClick: onClose, className: index_module_less_1.default['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
|
76
|
+
react_1.default.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: index_module_less_1.default['modal-icon-wrapper-img'] })),
|
77
|
+
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_y = (_w = (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) !== null && _w !== void 0 ? _w : (_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.bindProduct) !== null && _y !== void 0 ? _y : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
61
78
|
react_1.default.createElement("div", { hidden: !!recData && !(product === null || product === void 0 ? void 0 : product.title), className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
62
|
-
__html: (0, tool_1.setFontForText)((
|
79
|
+
__html: (0, tool_1.setFontForText)((_z = product === null || product === void 0 ? void 0 : product.title) !== null && _z !== void 0 ? _z : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
|
63
80
|
} }),
|
64
|
-
react_1.default.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((
|
81
|
+
react_1.default.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((_0 = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _0 === void 0 ? void 0 : _0.height) + 'px' }), dangerouslySetInnerHTML: {
|
65
82
|
__html: (0, tool_1.setFontForText)(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
66
83
|
} })))));
|
67
84
|
};
|
@@ -126,7 +126,7 @@ const CommodityDetail = (_a) => {
|
|
126
126
|
width: '100%',
|
127
127
|
objectFit: 'cover',
|
128
128
|
display: 'block',
|
129
|
-
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ?
|
129
|
+
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
130
130
|
}, src: src }))));
|
131
131
|
}))))),
|
132
132
|
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
|
@@ -110,7 +110,7 @@ Made in Italy` })));
|
|
110
110
|
width: '100%',
|
111
111
|
objectFit: 'cover',
|
112
112
|
display: 'block',
|
113
|
-
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ?
|
113
|
+
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
114
114
|
}, src: src }))));
|
115
115
|
}))),
|
116
116
|
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
|
@@ -4,11 +4,11 @@ const tslib_1 = require("tslib");
|
|
4
4
|
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
|
-
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
8
7
|
const hooks_1 = require("../../../../core/hooks");
|
9
8
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
10
9
|
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
11
10
|
const tool_1 = require("../../../../core/utils/tool");
|
11
|
+
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
12
12
|
const Link = (_a) => {
|
13
13
|
var _b, _c, _d, _e, _f, _g, _h, _j;
|
14
14
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle"]);
|
@@ -32,7 +32,7 @@ const Link = (_a) => {
|
|
32
32
|
overflow: 'hidden'
|
33
33
|
}) },
|
34
34
|
react_1.default.createElement("div", null,
|
35
|
-
react_1.default.createElement("div", { className:
|
35
|
+
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
|
36
36
|
__html: (0, tool_1.setFontForText)((_h = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _h !== void 0 ? _h : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
37
37
|
} }),
|
38
38
|
(customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((_j = customTitle === null || customTitle === void 0 ? void 0 : customTitle.style) === null || _j === void 0 ? void 0 : _j.height) + 'px' }), className: index_module_less_1.default['one-line-ellipsis'], dangerouslySetInnerHTML: {
|
@@ -23,6 +23,6 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
|
23
23
|
}, [src]);
|
24
24
|
return (react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
|
25
25
|
react_1.default.createElement("div", { ref: ref, hidden: !src, className: (0, css_1.css)({ width: '100%', height: '100%' }) },
|
26
|
-
react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ?
|
26
|
+
react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? translateY + 50 : 50}%` }, style)), src: src }))));
|
27
27
|
};
|
28
28
|
exports.default = (0, react_1.memo)(Img);
|