pb-sxp-ui 1.0.3 → 1.0.5
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 +62 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.js +62 -24
- 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 +62 -24
- 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/RenderCard.js +3 -2
- package/es/core/components/SxpPageRender/index.js +1 -2
- package/es/materials/sxp/template/Appoint/index.d.ts +1 -0
- package/es/materials/sxp/template/Appoint/index.js +3 -3
- package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/es/materials/sxp/template/Commodity/index.js +2 -2
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +12 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +12 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +12 -2
- package/es/materials/sxp/template/components/EventProvider.d.ts +1 -0
- package/es/materials/sxp/template/components/EventProvider.js +15 -3
- package/lib/core/components/SxpPageRender/RenderCard.js +3 -2
- package/lib/core/components/SxpPageRender/index.js +1 -2
- package/lib/materials/sxp/template/Appoint/index.d.ts +1 -0
- package/lib/materials/sxp/template/Appoint/index.js +3 -3
- package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/Commodity/index.js +2 -2
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +12 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +12 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +12 -2
- package/lib/materials/sxp/template/components/EventProvider.d.ts +1 -0
- package/lib/materials/sxp/template/components/EventProvider.js +15 -3
- package/package.json +1 -1
@@ -5,7 +5,7 @@ import { useEditor } from '../../../core/hooks';
|
|
5
5
|
const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
6
6
|
const { schema } = useEditor();
|
7
7
|
const renderComp = useMemo(() => {
|
8
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
9
9
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
10
10
|
return null;
|
11
11
|
let cta = null;
|
@@ -31,7 +31,8 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
|
31
31
|
const t = resolver[(_w = value === null || value === void 0 ? void 0 : value.item) === null || _w === void 0 ? void 0 : _w.type];
|
32
32
|
const Component = withBindDataSource(t);
|
33
33
|
const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
|
34
|
-
|
34
|
+
const isExternalLink = ((_0 = (_z = (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.event) === null || _z === void 0 ? void 0 : _z.onClick) === null || _0 === void 0 ? void 0 : _0.linkType) === 'externalLink';
|
35
|
+
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.textStyle), bindDatas: (_4 = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.bindDatas) !== null && _4 !== void 0 ? _4 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.props, { event: ((_6 = value === null || value === void 0 ? void 0 : value.item) === null || _6 === void 0 ? void 0 : _6.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink })));
|
35
36
|
}
|
36
37
|
else {
|
37
38
|
return null;
|
@@ -176,8 +176,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
176
176
|
React.createElement(Nudge, { nudge: nudge }),
|
177
177
|
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
178
178
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
179
|
-
React.createElement(
|
180
|
-
React.createElement(ExpandableText, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle })),
|
179
|
+
React.createElement(ExpandableText, { 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: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle }),
|
181
180
|
React.createElement(Hashtag, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
|
182
181
|
}
|
183
182
|
return null;
|
@@ -5,12 +5,12 @@ import EventProvider from '../components/EventProvider';
|
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
6
|
const Appoint = (_a) => {
|
7
7
|
var _b, _c, _d, _e;
|
8
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9
9
|
const { sxpParameter } = useSxpDataSource();
|
10
10
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
11
|
-
return (React.createElement(EventProvider, Object.assign({ rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
11
|
+
return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
12
12
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
13
|
-
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), 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, alt: '' })),
|
13
|
+
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), 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, alt: '' })),
|
14
14
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
|
15
15
|
};
|
16
16
|
export default memo(Appoint);
|
@@ -6,11 +6,11 @@ import styles from './index.module.less';
|
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
7
|
const Commodity = (_a) => {
|
8
8
|
var _b, _c, _d, _e, _f, _g, _h;
|
9
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
9
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
10
10
|
const { sxpParameter } = useSxpDataSource();
|
11
11
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
12
12
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
13
|
-
return (React.createElement(EventProvider, Object.assign({ rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
13
|
+
return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
14
14
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
15
15
|
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
16
16
|
React.createElement("div", { className: css({
|
@@ -6,11 +6,11 @@ import styles from './index.module.less';
|
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
7
|
const CommodityDiro = (_a) => {
|
8
8
|
var _b, _c, _d, _e, _f, _g, _h;
|
9
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
9
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
10
10
|
const { sxpParameter } = useSxpDataSource();
|
11
11
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
12
12
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
13
|
-
return (React.createElement(EventProvider, Object.assign({ rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
13
|
+
return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
14
14
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
15
15
|
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
16
16
|
React.createElement("div", { className: css({
|
@@ -8,6 +8,7 @@ export interface ICommodityDiroNewProps {
|
|
8
8
|
recData?: RecItemType;
|
9
9
|
bottom_image?: string;
|
10
10
|
ctaTempStyles?: ICtaTempStylesType;
|
11
|
+
isExternalLink?: boolean;
|
11
12
|
}
|
12
13
|
declare const _default: React.NamedExoticComponent<ICommodityDiroNewProps>;
|
13
14
|
export default _default;
|
@@ -6,11 +6,11 @@ import styles from './index.module.less';
|
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
7
|
const CommodityDiroNew = (_a) => {
|
8
8
|
var _b, _c, _d, _e, _f, _g, _h;
|
9
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
9
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
10
10
|
const { sxpParameter } = useSxpDataSource();
|
11
11
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
12
12
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
13
|
-
return (React.createElement(EventProvider, Object.assign({ rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
13
|
+
return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
14
14
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
15
15
|
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
16
16
|
React.createElement("div", { className: css({
|
@@ -9,6 +9,7 @@ export interface IMultiCommodityProps {
|
|
9
9
|
onClick?: () => void;
|
10
10
|
bottom_image?: string;
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
|
+
isExternalLink?: boolean;
|
12
13
|
}
|
13
14
|
declare const _default: React.NamedExoticComponent<IMultiCommodityProps>;
|
14
15
|
export default _default;
|
@@ -7,20 +7,30 @@ import Img from '../components/Img';
|
|
7
7
|
import Scroll from '../components/Scroll';
|
8
8
|
import styles from './index.module.less';
|
9
9
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
10
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
10
11
|
const MultiCommodity = (_a) => {
|
11
12
|
var _b, _c;
|
12
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
13
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
13
14
|
const { sxpParameter } = useSxpDataSource();
|
14
15
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
15
16
|
const { popupAni } = useEditor();
|
16
17
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
18
|
+
const { jumpToWeb } = useEventReport();
|
17
19
|
const handleClick = throttle((item) => {
|
18
20
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
19
21
|
eventSubject: 'clickCta',
|
20
22
|
eventDescription: 'User clicked the CTA'
|
21
23
|
}, recData, item);
|
22
24
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
23
|
-
|
25
|
+
if (isExternalLink) {
|
26
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
27
|
+
jumpToWeb(recData, item, item.bindCta);
|
28
|
+
window.location.href = item.link;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
33
|
+
}
|
24
34
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
25
35
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
26
36
|
var _a, _b, _c, _d, _e, _f;
|
@@ -9,6 +9,7 @@ export interface IMultiCommodityDiroProps {
|
|
9
9
|
onClick?: () => void;
|
10
10
|
bottom_image?: string;
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
|
+
isExternalLink?: boolean;
|
12
13
|
}
|
13
14
|
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroProps>;
|
14
15
|
export default _default;
|
@@ -7,11 +7,13 @@ import Scroll from '../components/Scroll';
|
|
7
7
|
import Img from '../components/Img';
|
8
8
|
import styles from './index.module.less';
|
9
9
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
10
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
10
11
|
const MultiCommodityDiro = (_a) => {
|
11
12
|
var _b, _c;
|
12
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
13
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
13
14
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
14
15
|
const { popupAni } = useEditor();
|
16
|
+
const { jumpToWeb } = useEventReport();
|
15
17
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
16
18
|
const handleClick = throttle((item) => {
|
17
19
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -19,7 +21,15 @@ const MultiCommodityDiro = (_a) => {
|
|
19
21
|
eventDescription: 'User clicked the CTA'
|
20
22
|
}, recData, item);
|
21
23
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
22
|
-
|
24
|
+
if (isExternalLink) {
|
25
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
26
|
+
jumpToWeb(recData, item, item.bindCta);
|
27
|
+
window.location.href = item.link;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
32
|
+
}
|
23
33
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
24
34
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
25
35
|
var _a, _b, _c, _d, _e, _f;
|
@@ -9,6 +9,7 @@ export interface IMultiCommodityDiroNewProps {
|
|
9
9
|
onClick?: () => void;
|
10
10
|
bottom_image?: string;
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
|
+
isExternalLink?: boolean;
|
12
13
|
}
|
13
14
|
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroNewProps>;
|
14
15
|
export default _default;
|
@@ -7,11 +7,13 @@ import Scroll from '../components/Scroll';
|
|
7
7
|
import Img from '../components/Img';
|
8
8
|
import styles from './index.module.less';
|
9
9
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
10
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
10
11
|
const MultiCommodityDiroNew = (_a) => {
|
11
12
|
var _b, _c;
|
12
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
13
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
13
14
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
14
15
|
const { popupAni } = useEditor();
|
16
|
+
const { jumpToWeb } = useEventReport();
|
15
17
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
16
18
|
const handleClick = throttle((item) => {
|
17
19
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -19,7 +21,15 @@ const MultiCommodityDiroNew = (_a) => {
|
|
19
21
|
eventDescription: 'User clicked the CTA'
|
20
22
|
}, recData, item);
|
21
23
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
22
|
-
|
24
|
+
if (isExternalLink) {
|
25
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
26
|
+
jumpToWeb(recData, item, item.bindCta);
|
27
|
+
window.location.href = item.link;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
32
|
+
}
|
23
33
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
24
34
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
25
35
|
var _a, _b, _c, _d, _e, _f;
|
@@ -3,12 +3,14 @@ import React, { memo, useEffect, useRef } from 'react';
|
|
3
3
|
import { throttle } from 'lodash';
|
4
4
|
import useOnScreen from '../../../../core/hooks/useOnScreen';
|
5
5
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
6
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
6
7
|
const EventProvider = (_a) => {
|
7
|
-
var { rec, children, className, onClick, style } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style"]);
|
8
|
+
var { rec, children, className, onClick, style, isExternalLink = false } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
|
8
9
|
const ref = useRef(null);
|
9
10
|
const isOnScreen = useOnScreen(ref);
|
10
11
|
const { popupAni } = useEditor();
|
11
12
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
13
|
+
const { jumpToWeb } = useEventReport();
|
12
14
|
useEffect(() => {
|
13
15
|
var _a, _b;
|
14
16
|
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
@@ -20,14 +22,24 @@ const EventProvider = (_a) => {
|
|
20
22
|
}
|
21
23
|
}, [isOnScreen, ref, rec, ctaEvent]);
|
22
24
|
const handleClick = throttle(() => {
|
23
|
-
var _a, _b;
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
24
26
|
const item = (_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;
|
25
27
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
26
28
|
eventSubject: 'clickCta',
|
27
29
|
eventDescription: 'User clicked the CTA'
|
28
30
|
}, rec, item);
|
29
31
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
|
30
|
-
|
32
|
+
if (isExternalLink) {
|
33
|
+
if ((_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) {
|
34
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
35
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
36
|
+
jumpToWeb(rec, product, cta);
|
37
|
+
window.location.href = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
42
|
+
}
|
31
43
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
32
44
|
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
33
45
|
};
|
@@ -8,7 +8,7 @@ const hooks_1 = require("../../../core/hooks");
|
|
8
8
|
const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
9
9
|
const { schema } = (0, hooks_1.useEditor)();
|
10
10
|
const renderComp = (0, react_1.useMemo)(() => {
|
11
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
12
12
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
13
13
|
return null;
|
14
14
|
let cta = null;
|
@@ -34,7 +34,8 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
|
34
34
|
const t = resolver[(_w = value === null || value === void 0 ? void 0 : value.item) === null || _w === void 0 ? void 0 : _w.type];
|
35
35
|
const Component = (0, withBindDataSource_1.default)(t);
|
36
36
|
const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
|
37
|
-
|
37
|
+
const isExternalLink = ((_0 = (_z = (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.event) === null || _z === void 0 ? void 0 : _z.onClick) === null || _0 === void 0 ? void 0 : _0.linkType) === 'externalLink';
|
38
|
+
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.textStyle), bindDatas: (_4 = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.bindDatas) !== null && _4 !== void 0 ? _4 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.props, { event: ((_6 = value === null || value === void 0 ? void 0 : value.item) === null || _6 === void 0 ? void 0 : _6.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink })));
|
38
39
|
}
|
39
40
|
else {
|
40
41
|
return null;
|
@@ -179,8 +179,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
179
179
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
180
180
|
react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
181
181
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
182
|
-
react_1.default.createElement(
|
183
|
-
react_1.default.createElement(ExpandableText_1.default, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle })),
|
182
|
+
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: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle }),
|
184
183
|
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
|
185
184
|
}
|
186
185
|
return null;
|
@@ -7,12 +7,12 @@ const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProv
|
|
7
7
|
const hooks_1 = require("../../../../core/hooks");
|
8
8
|
const Appoint = (_a) => {
|
9
9
|
var _b, _c, _d, _e;
|
10
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
10
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
11
11
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
12
12
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
13
|
-
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
13
|
+
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' } }, props),
|
14
14
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
15
|
-
react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), 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, alt: '' })),
|
15
|
+
react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), 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, alt: '' })),
|
16
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)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
|
17
17
|
};
|
18
18
|
exports.default = (0, react_1.memo)(Appoint);
|
@@ -8,11 +8,11 @@ const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less
|
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
9
|
const Commodity = (_a) => {
|
10
10
|
var _b, _c, _d, _e, _f, _g, _h;
|
11
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
11
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
12
12
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
13
13
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
14
14
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
15
|
-
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
15
|
+
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),
|
16
16
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
17
17
|
react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
18
18
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
@@ -8,11 +8,11 @@ const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less
|
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
9
|
const CommodityDiro = (_a) => {
|
10
10
|
var _b, _c, _d, _e, _f, _g, _h;
|
11
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
11
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
12
12
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
13
13
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
14
14
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
15
|
-
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
15
|
+
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),
|
16
16
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
17
17
|
react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
18
18
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
@@ -8,6 +8,7 @@ export interface ICommodityDiroNewProps {
|
|
8
8
|
recData?: RecItemType;
|
9
9
|
bottom_image?: string;
|
10
10
|
ctaTempStyles?: ICtaTempStylesType;
|
11
|
+
isExternalLink?: boolean;
|
11
12
|
}
|
12
13
|
declare const _default: React.NamedExoticComponent<ICommodityDiroNewProps>;
|
13
14
|
export default _default;
|
@@ -8,11 +8,11 @@ const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less
|
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
9
|
const CommodityDiroNew = (_a) => {
|
10
10
|
var _b, _c, _d, _e, _f, _g, _h;
|
11
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
11
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
12
12
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
13
13
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
14
14
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
15
|
-
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
15
|
+
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),
|
16
16
|
react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
17
17
|
react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
18
18
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
@@ -9,6 +9,7 @@ export interface IMultiCommodityProps {
|
|
9
9
|
onClick?: () => void;
|
10
10
|
bottom_image?: string;
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
|
+
isExternalLink?: boolean;
|
12
13
|
}
|
13
14
|
declare const _default: React.NamedExoticComponent<IMultiCommodityProps>;
|
14
15
|
export default _default;
|
@@ -9,20 +9,30 @@ const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
|
9
9
|
const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
|
10
10
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
11
11
|
const hooks_1 = require("../../../../core/hooks");
|
12
|
+
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
12
13
|
const MultiCommodity = (_a) => {
|
13
14
|
var _b, _c;
|
14
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
15
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
15
16
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
16
17
|
const { ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
|
17
18
|
const { popupAni } = (0, hooks_1.useEditor)();
|
18
19
|
const [products, setProducts] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
20
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
19
21
|
const handleClick = (0, lodash_1.throttle)((item) => {
|
20
22
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
21
23
|
eventSubject: 'clickCta',
|
22
24
|
eventDescription: 'User clicked the CTA'
|
23
25
|
}, recData, item);
|
24
26
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
25
|
-
|
27
|
+
if (isExternalLink) {
|
28
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
29
|
+
jumpToWeb(recData, item, item.bindCta);
|
30
|
+
window.location.href = item.link;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
else {
|
34
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
35
|
+
}
|
26
36
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
27
37
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
28
38
|
var _a, _b, _c, _d, _e, _f;
|
@@ -9,6 +9,7 @@ export interface IMultiCommodityDiroProps {
|
|
9
9
|
onClick?: () => void;
|
10
10
|
bottom_image?: string;
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
|
+
isExternalLink?: boolean;
|
12
13
|
}
|
13
14
|
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroProps>;
|
14
15
|
export default _default;
|
@@ -9,11 +9,13 @@ const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
|
|
9
9
|
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
10
10
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
11
11
|
const hooks_1 = require("../../../../core/hooks");
|
12
|
+
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
12
13
|
const MultiCommodityDiro = (_a) => {
|
13
14
|
var _b, _c;
|
14
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
15
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
15
16
|
const { ctaEvent, setPopupDetailData, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
16
17
|
const { popupAni } = (0, hooks_1.useEditor)();
|
18
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
17
19
|
const [products, setProducts] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
18
20
|
const handleClick = (0, lodash_1.throttle)((item) => {
|
19
21
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -21,7 +23,15 @@ const MultiCommodityDiro = (_a) => {
|
|
21
23
|
eventDescription: 'User clicked the CTA'
|
22
24
|
}, recData, item);
|
23
25
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
24
|
-
|
26
|
+
if (isExternalLink) {
|
27
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
28
|
+
jumpToWeb(recData, item, item.bindCta);
|
29
|
+
window.location.href = item.link;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
else {
|
33
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
34
|
+
}
|
25
35
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
26
36
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
27
37
|
var _a, _b, _c, _d, _e, _f;
|
@@ -9,6 +9,7 @@ export interface IMultiCommodityDiroNewProps {
|
|
9
9
|
onClick?: () => void;
|
10
10
|
bottom_image?: string;
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
|
+
isExternalLink?: boolean;
|
12
13
|
}
|
13
14
|
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroNewProps>;
|
14
15
|
export default _default;
|
@@ -9,11 +9,13 @@ const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
|
|
9
9
|
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
10
10
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
11
11
|
const hooks_1 = require("../../../../core/hooks");
|
12
|
+
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
12
13
|
const MultiCommodityDiroNew = (_a) => {
|
13
14
|
var _b, _c;
|
14
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
15
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
15
16
|
const { ctaEvent, setPopupDetailData, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
16
17
|
const { popupAni } = (0, hooks_1.useEditor)();
|
18
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
17
19
|
const [products, setProducts] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
18
20
|
const handleClick = (0, lodash_1.throttle)((item) => {
|
19
21
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -21,7 +23,15 @@ const MultiCommodityDiroNew = (_a) => {
|
|
21
23
|
eventDescription: 'User clicked the CTA'
|
22
24
|
}, recData, item);
|
23
25
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
24
|
-
|
26
|
+
if (isExternalLink) {
|
27
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
28
|
+
jumpToWeb(recData, item, item.bindCta);
|
29
|
+
window.location.href = item.link;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
else {
|
33
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
34
|
+
}
|
25
35
|
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
26
36
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
27
37
|
var _a, _b, _c, _d, _e, _f;
|