pb-sxp-ui 1.2.4 → 1.2.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 +231 -151
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.js +231 -151
- 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 +231 -151
- 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/LikeButton/index.js +34 -15
- package/es/core/components/SxpPageRender/Popup/index.js +23 -12
- package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/es/core/components/SxpPageRender/RenderCard.js +3 -3
- package/es/core/components/SxpPageRender/index.js +2 -2
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -3
- package/es/core/context/SxpDataSourceProvider.js +7 -3
- package/es/materials/sxp/cta/AniLink/index.js +2 -1
- package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
- package/es/materials/sxp/cta/AniLinkPopup/index.js +11 -20
- package/es/materials/sxp/popup/CommodityDetail/index.js +25 -13
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
- package/es/materials/sxp/popup/CommodityList/index.js +28 -10
- package/es/materials/sxp/popup/CommodityList/material.js +1 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +5 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +3 -3
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
- package/es/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
- package/es/materials/sxp/template/components/CommodityGroup.js +12 -15
- package/es/materials/sxp/template/components/Img.d.ts +1 -0
- package/es/materials/sxp/template/components/Img.js +3 -3
- package/es/materials/sxp/template/components/Scroll.d.ts +1 -0
- package/es/materials/sxp/template/components/Scroll.js +5 -4
- package/lib/core/components/SxpPageRender/LikeButton/index.js +34 -15
- package/lib/core/components/SxpPageRender/Popup/index.js +22 -11
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +3 -3
- package/lib/core/components/SxpPageRender/index.js +2 -2
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -3
- package/lib/core/context/SxpDataSourceProvider.js +7 -3
- package/lib/materials/sxp/cta/AniLink/index.js +2 -1
- package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +10 -19
- package/lib/materials/sxp/popup/CommodityDetail/index.js +24 -12
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
- package/lib/materials/sxp/popup/CommodityList/index.js +27 -9
- package/lib/materials/sxp/popup/CommodityList/material.js +1 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +5 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +3 -3
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
- package/lib/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
- package/lib/materials/sxp/template/components/CommodityGroup.js +11 -14
- package/lib/materials/sxp/template/components/Img.d.ts +1 -0
- package/lib/materials/sxp/template/components/Img.js +3 -3
- package/lib/materials/sxp/template/components/Scroll.d.ts +1 -0
- package/lib/materials/sxp/template/components/Scroll.js +5 -4
- package/package.json +1 -1
@@ -6,50 +6,69 @@ import { useSxpDataSource } from '../../../../core/hooks';
|
|
6
6
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
7
7
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
8
8
|
const LikeButton = (_a) => {
|
9
|
+
var _b;
|
9
10
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
10
|
-
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
11
|
-
const [state, setState] = useState(
|
11
|
+
const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
|
12
|
+
const [state, setState] = useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
|
12
13
|
const likeIcon = useIconLink(defaultLikeIconPath);
|
13
14
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath);
|
14
15
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
15
|
-
var
|
16
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
16
17
|
if (state) {
|
17
18
|
setState(false);
|
18
|
-
const result = (
|
19
|
+
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
19
20
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
20
21
|
eventInfo: {
|
21
22
|
eventSubject: 'favoriteContentCanceled',
|
22
23
|
eventDescription: 'This content was unfavorite by the user',
|
23
|
-
contentId: (
|
24
|
-
contentName: (
|
25
|
-
contentTags: JSON.stringify((
|
24
|
+
contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
25
|
+
contentName: (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '',
|
26
|
+
contentTags: JSON.stringify((_l = (_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.tags) !== null && _l !== void 0 ? _l : []),
|
26
27
|
position: position + '',
|
27
|
-
contentFormat: ((
|
28
|
-
traceInfo: (
|
28
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
29
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
29
30
|
}
|
30
31
|
});
|
31
32
|
if (!result) {
|
32
33
|
setState(true);
|
33
34
|
}
|
35
|
+
else {
|
36
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
37
|
+
if (index === position) {
|
38
|
+
item.isCollected = false;
|
39
|
+
}
|
40
|
+
return item;
|
41
|
+
})) !== null && _p !== void 0 ? _p : [];
|
42
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
43
|
+
}
|
34
44
|
}
|
35
45
|
else {
|
36
46
|
setState(true);
|
37
|
-
const result = (
|
47
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
38
48
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
39
49
|
eventInfo: {
|
40
50
|
eventSubject: 'favoriteContent',
|
41
51
|
eventDescription: 'This content was favorite by the user',
|
42
|
-
contentId: (
|
43
|
-
contentName: (
|
44
|
-
contentTags: JSON.stringify((
|
52
|
+
contentId: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
53
|
+
contentName: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.title) !== null && _u !== void 0 ? _u : '',
|
54
|
+
contentTags: JSON.stringify((_w = (_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.tags) !== null && _w !== void 0 ? _w : []),
|
45
55
|
position: position + '',
|
46
|
-
contentFormat: ((
|
47
|
-
traceInfo: (
|
56
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
57
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
48
58
|
}
|
49
59
|
});
|
50
60
|
if (!result) {
|
51
61
|
setState(false);
|
52
62
|
}
|
63
|
+
else {
|
64
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
65
|
+
if (index === position) {
|
66
|
+
item.isCollected = true;
|
67
|
+
}
|
68
|
+
return item;
|
69
|
+
})) !== null && _z !== void 0 ? _z : [];
|
70
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
71
|
+
}
|
53
72
|
}
|
54
73
|
}), 200);
|
55
74
|
return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
@@ -1,17 +1,16 @@
|
|
1
|
-
import React, { useEffect, useMemo,
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
2
2
|
import Modal from '../Modal';
|
3
3
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
4
4
|
import withBindDataSource from '../../../../core/hoc/withBindDataSource';
|
5
5
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
6
6
|
const Popup = () => {
|
7
7
|
const { schema, resolver, popup } = useEditor();
|
8
|
-
const { setPopupDetailData, popupDetailData,
|
8
|
+
const { setPopupDetailData, popupDetailData, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
9
9
|
const { productView } = useEventReport();
|
10
10
|
const [visible, setVisible] = useState();
|
11
|
-
const curTimeRef = useRef(null);
|
12
11
|
useEffect(() => {
|
13
12
|
const initTime = () => {
|
14
|
-
|
13
|
+
popupCurTimeRef.current = new Date();
|
15
14
|
};
|
16
15
|
initTime();
|
17
16
|
window.addEventListener('pageshow', initTime);
|
@@ -21,25 +20,37 @@ const Popup = () => {
|
|
21
20
|
}, []);
|
22
21
|
useEffect(() => {
|
23
22
|
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
24
|
-
|
23
|
+
popupCurTimeRef.current = new Date();
|
25
24
|
setVisible(popup);
|
26
25
|
}
|
27
26
|
}, [popup]);
|
28
27
|
const handleClose = () => {
|
29
|
-
var _a, _b, _c, _d;
|
30
|
-
if (!popup ||
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
29
|
+
if (!popup ||
|
30
|
+
(popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
|
31
|
+
!visible ||
|
32
|
+
new Date() - popupCurTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
|
31
33
|
return;
|
32
34
|
}
|
33
35
|
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
34
|
-
const
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
const value = (_d = (_c = (_b = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig) === null || _c === void 0 ? void 0 : _c.popupList) === null || _d === void 0 ? void 0 : _d.find((item) => (item === null || item === void 0 ? void 0 : item.id) === (popup === null || popup === void 0 ? void 0 : popup.id));
|
37
|
+
if (((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'CommodityDetail' || ((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type) === 'CommodityDetailDiroNew') {
|
38
|
+
const data = popupDetailData;
|
39
|
+
let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
|
40
|
+
let cta = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta;
|
41
|
+
if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
|
42
|
+
const p = (_k = data === null || data === void 0 ? void 0 : data.video) === null || _k === void 0 ? void 0 : _k.bindProducts[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
|
43
|
+
product = p;
|
44
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
45
|
+
}
|
46
|
+
if (product && cta) {
|
47
|
+
productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
48
|
+
}
|
39
49
|
}
|
40
50
|
setTimeout(() => {
|
41
51
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
42
52
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
53
|
+
checkCommodityIndexRef.current = -1;
|
43
54
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
44
55
|
};
|
45
56
|
const renderPopupDetail = useMemo(() => {
|
@@ -2,7 +2,7 @@ import React, { memo, useMemo } from 'react';
|
|
2
2
|
import './index.less';
|
3
3
|
import withBindDataSource from '../../../core/hoc/withBindDataSource';
|
4
4
|
import { useEditor } from '../../../core/hooks';
|
5
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
5
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
|
6
6
|
var _a, _b, _c, _d, _e;
|
7
7
|
const { schema } = useEditor();
|
8
8
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
@@ -49,12 +49,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
|
49
49
|
const Component = withBindDataSource(t);
|
50
50
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
51
51
|
const isExternalLink = ((_2 = (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.event) === null || _1 === void 0 ? void 0 : _1.onClick) === null || _2 === void 0 ? void 0 : _2.linkType) === 'externalLink';
|
52
|
-
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.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, index: index })));
|
52
|
+
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.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, index: index, isActive: isActive })));
|
53
53
|
}
|
54
54
|
else {
|
55
55
|
return null;
|
56
56
|
}
|
57
|
-
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id]);
|
57
|
+
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
|
58
58
|
return React.createElement(React.Fragment, null, renderComp);
|
59
59
|
};
|
60
60
|
export default memo(RenderCard);
|
@@ -232,7 +232,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
232
232
|
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: (_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 }),
|
233
233
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
234
234
|
React.createElement(Hashtag, { 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 }))),
|
235
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'] })));
|
235
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
236
236
|
}
|
237
237
|
return null;
|
238
238
|
}, [
|
@@ -287,7 +287,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
287
287
|
};
|
288
288
|
const handleSlideSkip = (item, position) => {
|
289
289
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
290
|
-
if (isPreview)
|
290
|
+
if (isPreview || waterFallData)
|
291
291
|
return;
|
292
292
|
const t = new Date() - curTime.current;
|
293
293
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.openSlideSkip) && t >= ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.slideSkipStartTime) !== null && _a !== void 0 ? _a : 0) && getSlideSkipState() && item) {
|
@@ -23,9 +23,7 @@ export interface ISxpDataSourceContext {
|
|
23
23
|
mutateLike?: (body: {
|
24
24
|
content: string;
|
25
25
|
}) => Promise<boolean>;
|
26
|
-
popupDetailData?: RecItemType
|
27
|
-
index: number;
|
28
|
-
};
|
26
|
+
popupDetailData?: RecItemType;
|
29
27
|
setPopupDetailData?: React.Dispatch<React.SetStateAction<any | null>>;
|
30
28
|
loadVideos?: (page: number) => Promise<void>;
|
31
29
|
getRecommendVideos?: (query?: {
|
@@ -81,6 +79,8 @@ export interface ISxpDataSourceContext {
|
|
81
79
|
selectTag?: string;
|
82
80
|
setSelectTag?: React.Dispatch<React.SetStateAction<string>>;
|
83
81
|
globalConfig?: ISxpPageRenderProps['globalConfig'];
|
82
|
+
popupCurTimeRef?: any;
|
83
|
+
checkCommodityIndexRef?: any;
|
84
84
|
}
|
85
85
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
86
86
|
export interface SxpDataSourceProviderProps {
|
@@ -34,6 +34,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
34
34
|
const themeTag = useRef();
|
35
35
|
const curTime = useRef();
|
36
36
|
const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
|
37
|
+
const checkCommodityIndexRef = useRef();
|
38
|
+
const popupCurTimeRef = useRef(null);
|
37
39
|
const isShowConsent = useMemo(() => {
|
38
40
|
var _a, _b, _c, _d;
|
39
41
|
return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
|
@@ -190,7 +192,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
190
192
|
}
|
191
193
|
}), [bffFetch, utmVal, isShowTag]);
|
192
194
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
193
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
195
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
194
196
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
195
197
|
const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
|
196
198
|
let fromKName = '';
|
@@ -204,7 +206,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
204
206
|
fromKName = 'imagePage';
|
205
207
|
}
|
206
208
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
207
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
|
209
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName, fromKPage: (_o = location === null || location === void 0 ? void 0 : location.href) !== null && _o !== void 0 ? _o : '' })
|
208
210
|
});
|
209
211
|
}, [bffEventReport, isFromHashtag]);
|
210
212
|
const h5EnterLink = useCallback(() => {
|
@@ -319,7 +321,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
319
321
|
isShowConsent,
|
320
322
|
selectTag,
|
321
323
|
setSelectTag,
|
322
|
-
globalConfig
|
324
|
+
globalConfig,
|
325
|
+
popupCurTimeRef,
|
326
|
+
checkCommodityIndexRef
|
323
327
|
} }, isShowConsent ? (React.createElement(Consent, 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({
|
324
328
|
rtcList,
|
325
329
|
mutateLike: bffMutateLike,
|
@@ -51,11 +51,12 @@ const AniLink = (_a) => {
|
|
51
51
|
}
|
52
52
|
}, [event === null || event === void 0 ? void 0 : event.animation]);
|
53
53
|
useEffect(() => {
|
54
|
+
var _a, _b, _c;
|
54
55
|
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
55
56
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
56
57
|
eventSubject: 'ctaExposure',
|
57
58
|
eventDescription: 'The cta was shown to the user'
|
58
|
-
}, recData,
|
59
|
+
}, recData, ((_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), index);
|
59
60
|
}
|
60
61
|
}, [isOnScreen]);
|
61
62
|
useEffect(() => {
|
@@ -1,23 +1,19 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
|
-
import React, { memo, useEffect, useMemo,
|
3
|
+
import React, { memo, useEffect, useMemo, useState } from 'react';
|
4
4
|
import { useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
6
6
|
import Img from '../../template/components/Img';
|
7
7
|
import { setFontForText } from '../../../../core/utils/tool';
|
8
8
|
import styles from './index.module.less';
|
9
|
-
import useOnScreen from '../../../../core/hooks/useOnScreen';
|
10
9
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
11
10
|
const AniLinkPopup = (_a) => {
|
12
11
|
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;
|
13
|
-
var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink"]);
|
12
|
+
var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink", "isActive"]);
|
14
13
|
style === null || style === void 0 ? true : delete style.transform;
|
15
14
|
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
16
15
|
const { jumpToWeb } = useEventReport();
|
17
|
-
const
|
18
|
-
const isOnScreen = useOnScreen(ref);
|
19
|
-
const [visible, setVisible] = useState(false);
|
20
|
-
const [startAni, setStartAni] = useState(true);
|
16
|
+
const [visible, setVisible] = useState(true);
|
21
17
|
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);
|
22
18
|
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);
|
23
19
|
const handleTo = () => {
|
@@ -53,26 +49,21 @@ const AniLinkPopup = (_a) => {
|
|
53
49
|
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;
|
54
50
|
const onClose = (event) => {
|
55
51
|
event.stopPropagation();
|
56
|
-
|
52
|
+
setVisible(false);
|
57
53
|
};
|
58
54
|
useEffect(() => {
|
59
|
-
|
60
|
-
|
61
|
-
}
|
62
|
-
else {
|
63
|
-
setVisible(false);
|
64
|
-
}
|
65
|
-
}, [isOnScreen]);
|
55
|
+
setVisible(true);
|
56
|
+
}, [isActive]);
|
66
57
|
const aniNamStyle = useMemo(() => {
|
67
|
-
if (!
|
58
|
+
if (!isActive)
|
68
59
|
return null;
|
69
|
-
return
|
70
|
-
}, [
|
60
|
+
return visible ? styles['animated-fadeIn'] : null;
|
61
|
+
}, [isActive, visible]);
|
71
62
|
return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
|
72
63
|
height: '40px',
|
73
64
|
lineHeight: '40px',
|
74
65
|
paddingLeft: '6px'
|
75
|
-
} }, "Cta Title")) : (React.createElement(
|
66
|
+
} }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${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))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css(aniTimStyle)}`, onClick: handleTo }),
|
76
67
|
React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
|
77
68
|
React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
|
78
69
|
React.createElement(Img, { 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 }),
|
@@ -81,6 +72,6 @@ const AniLinkPopup = (_a) => {
|
|
81
72
|
} })),
|
82
73
|
React.createElement("div", { className: styles['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: {
|
83
74
|
__html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
84
|
-
} })))
|
75
|
+
} })))));
|
85
76
|
};
|
86
77
|
export default memo(AniLinkPopup);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
3
|
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
4
|
-
import { useSxpDataSource } from '../../../../core/hooks';
|
4
|
+
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import './index.less';
|
6
6
|
import { Autoplay, Pagination } from 'swiper/modules';
|
7
7
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
@@ -12,18 +12,26 @@ import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
|
12
12
|
import { setFontForText } from '../../../../core/utils/tool';
|
13
13
|
import CommodityGroup from '../../template/components/CommodityGroup';
|
14
14
|
const CommodityDetail = (_a) => {
|
15
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
15
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
16
16
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
|
17
|
-
const { sxpParameter } = useSxpDataSource();
|
18
|
-
const {
|
17
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = useSxpDataSource();
|
18
|
+
const { popup } = useEditor();
|
19
19
|
const { jumpToWeb, productView } = useEventReport();
|
20
20
|
const curTimeRef = useRef(null);
|
21
21
|
const [showModal, setShowModal] = useState(false);
|
22
22
|
const [show3DModal, setShow3DModal] = useState(false);
|
23
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
23
24
|
const data = isPost ? rec : popupDetailData;
|
24
|
-
|
25
|
-
|
25
|
+
let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
|
26
|
+
let cta = isPost
|
27
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
28
|
+
: (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta) !== null && _k !== void 0 ? _k : (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta;
|
26
29
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
30
|
+
if (!isPost && (commodityGroup === null || commodityGroup === void 0 ? void 0 : commodityGroup.open) && ((_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) && ((_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length) > 0) {
|
31
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
32
|
+
product = p;
|
33
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
34
|
+
}
|
27
35
|
const handleLink = () => {
|
28
36
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
29
37
|
jumpToWeb(data, product, cta, position);
|
@@ -61,7 +69,7 @@ const CommodityDetail = (_a) => {
|
|
61
69
|
return '$7,000';
|
62
70
|
}
|
63
71
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
64
|
-
const width = isPreview ? 375 : (
|
72
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
65
73
|
const renderContent = ({ isPost }) => {
|
66
74
|
var _a, _b, _c;
|
67
75
|
return (React.createElement("div", null,
|
@@ -94,15 +102,19 @@ const CommodityDetail = (_a) => {
|
|
94
102
|
}
|
95
103
|
return style;
|
96
104
|
}, []);
|
105
|
+
const handleClick = useCallback((index) => {
|
106
|
+
popupCurTimeRef.current = new Date();
|
107
|
+
setCheckCommodityIndex(index);
|
108
|
+
}, []);
|
97
109
|
const renderCommodityGroup = useCallback(() => {
|
98
110
|
var _a, _b, _c;
|
99
111
|
if (isPost)
|
100
112
|
return;
|
101
|
-
return (React.createElement(CommodityGroup, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' } }));
|
102
|
-
}, []);
|
113
|
+
return (React.createElement(CommodityGroup, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
|
114
|
+
}, [checkCommodityIndex]);
|
103
115
|
return (React.createElement(React.Fragment, null,
|
104
116
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
105
|
-
product && ((
|
117
|
+
product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (React.createElement("div", { style: { position: 'relative' } },
|
106
118
|
React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
107
119
|
clickable: true,
|
108
120
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -112,7 +124,7 @@ const CommodityDetail = (_a) => {
|
|
112
124
|
}, loop: true, autoplay: {
|
113
125
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
114
126
|
} },
|
115
|
-
React.createElement(React.Fragment, null, (
|
127
|
+
React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
116
128
|
return (React.createElement(SwiperSlide, { key: src },
|
117
129
|
React.createElement("div", { style: {
|
118
130
|
overflow: 'hidden',
|
@@ -127,7 +139,7 @@ const CommodityDetail = (_a) => {
|
|
127
139
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
128
140
|
}, src: src }))));
|
129
141
|
}))))),
|
130
|
-
!((
|
142
|
+
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
|
131
143
|
position: 'relative',
|
132
144
|
height: 0,
|
133
145
|
width: '100%',
|
@@ -140,7 +152,7 @@ const CommodityDetail = (_a) => {
|
|
140
152
|
top: 0,
|
141
153
|
objectFit: 'cover',
|
142
154
|
width: '100%'
|
143
|
-
}), src: (
|
155
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
144
156
|
renderCommodityGroup(),
|
145
157
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
146
158
|
renderBtn(),
|