pb-sxp-ui 1.2.3 → 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 +276 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.js +276 -172
- 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 +276 -172
- 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/Hashtag/index.js +0 -1
- package/es/core/components/SxpPageRender/LikeButton/index.js +34 -15
- package/es/core/components/SxpPageRender/Modal/index.js +16 -8
- package/es/core/components/SxpPageRender/Popup/index.js +24 -13
- package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/es/core/components/SxpPageRender/RenderCard.js +17 -4
- package/es/core/components/SxpPageRender/index.js +3 -3
- 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 +5 -1
- package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
- package/es/materials/sxp/cta/AniLinkPopup/index.js +12 -18
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +1 -1
- 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/Hashtag/index.js +0 -1
- package/lib/core/components/SxpPageRender/LikeButton/index.js +34 -15
- package/lib/core/components/SxpPageRender/Modal/index.js +16 -8
- package/lib/core/components/SxpPageRender/Popup/index.js +23 -12
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +17 -4
- package/lib/core/components/SxpPageRender/index.js +3 -3
- 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 +5 -1
- package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +11 -17
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +1 -1
- 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
package/dist/index.cjs
CHANGED
@@ -574,6 +574,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
574
574
|
const themeTag = React.useRef();
|
575
575
|
const curTime = React.useRef();
|
576
576
|
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
577
|
+
const checkCommodityIndexRef = React.useRef();
|
578
|
+
const popupCurTimeRef = React.useRef(null);
|
577
579
|
const isShowConsent = React.useMemo(() => {
|
578
580
|
var _a, _b, _c, _d;
|
579
581
|
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;
|
@@ -741,7 +743,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
741
743
|
}
|
742
744
|
}), [bffFetch, utmVal, isShowTag]);
|
743
745
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
744
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
746
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
745
747
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
746
748
|
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);
|
747
749
|
let fromKName = '';
|
@@ -755,7 +757,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
755
757
|
fromKName = 'imagePage';
|
756
758
|
}
|
757
759
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
758
|
-
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 })
|
760
|
+
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 : '' })
|
759
761
|
});
|
760
762
|
}, [bffEventReport, isFromHashtag]);
|
761
763
|
const h5EnterLink = React.useCallback(() => {
|
@@ -870,7 +872,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
870
872
|
isShowConsent,
|
871
873
|
selectTag,
|
872
874
|
setSelectTag,
|
873
|
-
globalConfig
|
875
|
+
globalConfig,
|
876
|
+
popupCurTimeRef,
|
877
|
+
checkCommodityIndexRef
|
874
878
|
} }, isShowConsent ? (React.createElement(Consent$3, 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({
|
875
879
|
rtcList,
|
876
880
|
mutateLike: bffMutateLike,
|
@@ -8605,7 +8609,7 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8605
8609
|
* @Author: binruan@chatlabs.com
|
8606
8610
|
* @Date: 2023-11-02 18:34:34
|
8607
8611
|
* @LastEditors: binruan@chatlabs.com
|
8608
|
-
* @LastEditTime: 2024-07-
|
8612
|
+
* @LastEditTime: 2024-07-29 16:20:40
|
8609
8613
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8610
8614
|
*
|
8611
8615
|
*/
|
@@ -8661,19 +8665,25 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
8661
8665
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
8662
8666
|
}, 300);
|
8663
8667
|
const handleTouchStart = (event) => {
|
8664
|
-
event.stopPropagation();
|
8665
|
-
touchRef.current = event.touches[0]
|
8666
|
-
fTouchRef.current = event.touches[0]
|
8668
|
+
// event.stopPropagation();
|
8669
|
+
touchRef.current = event.touches[0];
|
8670
|
+
fTouchRef.current = event.touches[0];
|
8667
8671
|
touchMoveRef.current = true;
|
8668
8672
|
};
|
8669
8673
|
const handleTouchMove = (event) => {
|
8670
|
-
event.stopPropagation();
|
8674
|
+
// event.stopPropagation();
|
8671
8675
|
requestAnimationFrame(() => {
|
8672
8676
|
var _a;
|
8673
8677
|
if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
|
8674
8678
|
const currentY = event.touches[0].clientY;
|
8675
|
-
const
|
8676
|
-
touchRef.current
|
8679
|
+
const currentX = event.touches[0].clientX;
|
8680
|
+
const diff = touchRef.current.clientY - currentY;
|
8681
|
+
touchRef.current = event.touches[0];
|
8682
|
+
const diffY = currentY - fTouchRef.current.clientY;
|
8683
|
+
const diffX = currentX - fTouchRef.current.clientX;
|
8684
|
+
if (Math.abs(diffX) > Math.abs(diffY)) {
|
8685
|
+
return;
|
8686
|
+
}
|
8677
8687
|
const ts = modalTrans - diff;
|
8678
8688
|
if (ts > 0) {
|
8679
8689
|
setModalTrans(ts);
|
@@ -8683,9 +8693,14 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
8683
8693
|
};
|
8684
8694
|
const handleTouchEnd = (event) => {
|
8685
8695
|
var _a;
|
8686
|
-
event.stopPropagation();
|
8696
|
+
// event.stopPropagation();
|
8687
8697
|
if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
|
8688
|
-
const
|
8698
|
+
const diffY = event.changedTouches[0].clientY - fTouchRef.current.clientY;
|
8699
|
+
const diffX = event.changedTouches[0].clientX - fTouchRef.current.clientX;
|
8700
|
+
if (Math.abs(diffX) > Math.abs(diffY)) {
|
8701
|
+
return;
|
8702
|
+
}
|
8703
|
+
const diff = fTouchRef.current.clientY - touchRef.current.clientY;
|
8689
8704
|
if (diff > 0) {
|
8690
8705
|
setModalTrans(0);
|
8691
8706
|
}
|
@@ -8838,56 +8853,71 @@ const FormatImage = React.forwardRef((props, ref) => {
|
|
8838
8853
|
});
|
8839
8854
|
var FormatImage$1 = React.memo(FormatImage);
|
8840
8855
|
|
8841
|
-
|
8856
|
+
/*
|
8857
|
+
* @Author: binruan@chatlabs.com
|
8858
|
+
* @Date: 2024-03-20 10:27:32
|
8859
|
+
* @LastEditors: binruan@chatlabs.com
|
8860
|
+
* @LastEditTime: 2024-07-30 11:46:32
|
8861
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
|
8862
|
+
*
|
8863
|
+
*/
|
8864
|
+
const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
|
8842
8865
|
const ref = React.useRef();
|
8843
8866
|
const { popupDetailData } = useSxpDataSource();
|
8844
8867
|
React.useEffect(() => {
|
8845
|
-
var _a;
|
8846
|
-
|
8847
|
-
|
8868
|
+
var _a, _b;
|
8869
|
+
if (enableSlideActive)
|
8870
|
+
(_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
8871
|
+
}, [popupDetailData, enableSlideActive]);
|
8848
8872
|
return (React.createElement(Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
|
8849
8873
|
};
|
8850
8874
|
var Scroll$1 = React.memo(Scroll);
|
8851
8875
|
|
8852
|
-
const CommodityGroup = ({ products, data, defImg, style }) => {
|
8853
|
-
var _a
|
8854
|
-
|
8855
|
-
const [check, setCheck] = React.useState((_a = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _a !== void 0 ? _a : 0);
|
8856
|
-
const handleClick = React.useCallback((index) => {
|
8857
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData((val) => (Object.assign(Object.assign({}, val), { video: Object.assign(Object.assign({}, val === null || val === void 0 ? void 0 : val.video), { bindProduct: products === null || products === void 0 ? void 0 : products[index] }), multiCheckIndex: index })));
|
8858
|
-
}, []);
|
8859
|
-
return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.open) && ((products && (products === null || products === void 0 ? void 0 : products.length) > 0) || !popupDetailData) && (React.createElement(Scroll$1, { isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_b = (popupDetailData ? products : [0, 1, 2, 3])) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
|
8876
|
+
const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
|
8877
|
+
var _a;
|
8878
|
+
return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.open) && ((products && (products === null || products === void 0 ? void 0 : products.length) > 1) || !popupDetailData) && (React.createElement(Scroll$1, { enableSlideActive: true, isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_a = (popupDetailData ? products : [0, 1, 2, 3])) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
|
8860
8879
|
var _a, _b, _c;
|
8861
|
-
return (React.createElement(SwiperSlide, { className: css.css({
|
8880
|
+
return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css.css({
|
8862
8881
|
width: '50px',
|
8863
8882
|
height: '50px',
|
8864
8883
|
marginRight: '10px'
|
8865
|
-
}), onClick: () =>
|
8884
|
+
}), onClick: () => {
|
8885
|
+
onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
|
8886
|
+
}, key: index },
|
8866
8887
|
React.createElement(FormatImage$1, { style: {
|
8867
8888
|
height: '100%',
|
8868
8889
|
width: '100%',
|
8869
8890
|
objectFit: 'cover',
|
8870
8891
|
display: 'block',
|
8871
|
-
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ?
|
8872
|
-
border: check === index ? '1px solid #000' : '1px solid #f2f2f2'
|
8873
|
-
|
8892
|
+
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? (data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
|
8893
|
+
border: check === index ? '1px solid #000' : '1px solid #f2f2f2',
|
8894
|
+
boxSizing: 'border-box'
|
8895
|
+
}, src: (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : defImg }))) : null));
|
8874
8896
|
})))));
|
8875
8897
|
};
|
8876
8898
|
var CommodityGroup$1 = React.memo(CommodityGroup);
|
8877
8899
|
|
8878
8900
|
const CommodityDetail$1 = (_a) => {
|
8879
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
8901
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
8880
8902
|
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"]);
|
8881
|
-
const { sxpParameter } = useSxpDataSource();
|
8882
|
-
|
8903
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = useSxpDataSource();
|
8904
|
+
useEditor();
|
8883
8905
|
const { jumpToWeb, productView } = useEventReport();
|
8884
8906
|
const curTimeRef = React.useRef(null);
|
8885
8907
|
const [showModal, setShowModal] = React.useState(false);
|
8886
8908
|
const [show3DModal, setShow3DModal] = React.useState(false);
|
8909
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
8887
8910
|
const data = isPost ? rec : popupDetailData;
|
8888
|
-
|
8889
|
-
|
8911
|
+
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];
|
8912
|
+
let cta = isPost
|
8913
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
8914
|
+
: (_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;
|
8890
8915
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
8916
|
+
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) {
|
8917
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
8918
|
+
product = p;
|
8919
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
8920
|
+
}
|
8891
8921
|
const handleLink = () => {
|
8892
8922
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
8893
8923
|
jumpToWeb(data, product, cta, position);
|
@@ -8925,7 +8955,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8925
8955
|
return '$7,000';
|
8926
8956
|
}
|
8927
8957
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8928
|
-
const width = isPreview ? 375 : (
|
8958
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
8929
8959
|
const renderContent = ({ isPost }) => {
|
8930
8960
|
var _a, _b, _c;
|
8931
8961
|
return (React.createElement("div", null,
|
@@ -8958,15 +8988,19 @@ const CommodityDetail$1 = (_a) => {
|
|
8958
8988
|
}
|
8959
8989
|
return style;
|
8960
8990
|
}, []);
|
8991
|
+
const handleClick = React.useCallback((index) => {
|
8992
|
+
popupCurTimeRef.current = new Date();
|
8993
|
+
setCheckCommodityIndex(index);
|
8994
|
+
}, []);
|
8961
8995
|
const renderCommodityGroup = React.useCallback(() => {
|
8962
8996
|
var _a, _b, _c;
|
8963
8997
|
if (isPost)
|
8964
8998
|
return;
|
8965
|
-
return (React.createElement(CommodityGroup$1, { 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' } }));
|
8966
|
-
}, []);
|
8999
|
+
return (React.createElement(CommodityGroup$1, { 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 }));
|
9000
|
+
}, [checkCommodityIndex]);
|
8967
9001
|
return (React.createElement(React.Fragment, null,
|
8968
9002
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8969
|
-
product && ((
|
9003
|
+
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' } },
|
8970
9004
|
React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8971
9005
|
clickable: true,
|
8972
9006
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -8976,7 +9010,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8976
9010
|
}, loop: true, autoplay: {
|
8977
9011
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8978
9012
|
} },
|
8979
|
-
React.createElement(React.Fragment, null, (
|
9013
|
+
React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
8980
9014
|
return (React.createElement(SwiperSlide, { key: src },
|
8981
9015
|
React.createElement("div", { style: {
|
8982
9016
|
overflow: 'hidden',
|
@@ -8991,7 +9025,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8991
9025
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
8992
9026
|
}, src: src }))));
|
8993
9027
|
}))))),
|
8994
|
-
!((
|
9028
|
+
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
|
8995
9029
|
position: 'relative',
|
8996
9030
|
height: 0,
|
8997
9031
|
width: '100%',
|
@@ -9004,7 +9038,7 @@ const CommodityDetail$1 = (_a) => {
|
|
9004
9038
|
top: 0,
|
9005
9039
|
objectFit: 'cover',
|
9006
9040
|
width: '100%'
|
9007
|
-
}), src: (
|
9041
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
9008
9042
|
renderCommodityGroup(),
|
9009
9043
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
9010
9044
|
renderBtn(),
|
@@ -9573,21 +9607,28 @@ var settingRender$6 = [
|
|
9573
9607
|
];
|
9574
9608
|
|
9575
9609
|
const CommodityDetailDiroNew$1 = (_a) => {
|
9576
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
9610
|
+
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, _1;
|
9577
9611
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
|
9578
9612
|
React.useState(true);
|
9579
|
-
const { sxpParameter } = useSxpDataSource();
|
9580
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
9613
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport } = useSxpDataSource();
|
9581
9614
|
const { jumpToWeb, productView } = useEventReport();
|
9582
9615
|
React.useState(false);
|
9583
9616
|
React.useState(false);
|
9584
9617
|
React.useState(true);
|
9585
9618
|
const [showModal, setShowModal] = React.useState(false);
|
9586
9619
|
const curTimeRef = React.useRef(null);
|
9620
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
9587
9621
|
const data = isPost ? rec : popupDetailData;
|
9588
|
-
|
9589
|
-
|
9622
|
+
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];
|
9623
|
+
let cta = isPost
|
9624
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
9625
|
+
: (_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;
|
9590
9626
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
9627
|
+
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) {
|
9628
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
9629
|
+
product = p;
|
9630
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
9631
|
+
}
|
9591
9632
|
const handleLink = () => {
|
9592
9633
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
9593
9634
|
jumpToWeb(data, product, cta, position);
|
@@ -9625,7 +9666,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
9625
9666
|
return '£102,300.00';
|
9626
9667
|
}
|
9627
9668
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
9628
|
-
const width = isPreview ? 375 : (
|
9669
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
9629
9670
|
// useEffect(() => {
|
9630
9671
|
// console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
|
9631
9672
|
// if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
|
@@ -9688,15 +9729,19 @@ Made in Italy` })));
|
|
9688
9729
|
}
|
9689
9730
|
return style;
|
9690
9731
|
}, []);
|
9732
|
+
const handleClick = React.useCallback((index) => {
|
9733
|
+
popupCurTimeRef.current = new Date();
|
9734
|
+
setCheckCommodityIndex(index);
|
9735
|
+
}, []);
|
9691
9736
|
const renderCommodityGroup = React.useCallback(() => {
|
9692
9737
|
var _a, _b, _c;
|
9693
9738
|
if (isPost)
|
9694
9739
|
return;
|
9695
|
-
return (React.createElement(CommodityGroup$1, { 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' } }));
|
9696
|
-
}, []);
|
9740
|
+
return (React.createElement(CommodityGroup$1, { 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 }));
|
9741
|
+
}, [checkCommodityIndex]);
|
9697
9742
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
9698
|
-
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
9699
|
-
product && ((
|
9743
|
+
React.createElement("div", Object.assign({ className: css.css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
9744
|
+
product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
9700
9745
|
clickable: true,
|
9701
9746
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
9702
9747
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -9704,7 +9749,7 @@ Made in Italy` })));
|
|
9704
9749
|
: 'commondityDiroNew-swiper-clickable-center'
|
9705
9750
|
}, loop: true, autoplay: {
|
9706
9751
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
9707
|
-
} }, (
|
9752
|
+
} }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
9708
9753
|
return (React.createElement(SwiperSlide, { key: src },
|
9709
9754
|
React.createElement("div", { style: {
|
9710
9755
|
overflow: 'hidden',
|
@@ -9719,7 +9764,7 @@ Made in Italy` })));
|
|
9719
9764
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
9720
9765
|
}, src: src }))));
|
9721
9766
|
}))),
|
9722
|
-
!((
|
9767
|
+
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
|
9723
9768
|
position: 'relative',
|
9724
9769
|
height: 0,
|
9725
9770
|
width: '100%',
|
@@ -9732,13 +9777,13 @@ Made in Italy` })));
|
|
9732
9777
|
top: 0,
|
9733
9778
|
objectFit: 'cover',
|
9734
9779
|
width: '100%'
|
9735
|
-
}), src: (
|
9780
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
9736
9781
|
renderCommodityGroup(),
|
9737
9782
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
9738
9783
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
9739
9784
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
9740
9785
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
|
9741
|
-
__html: setFontForText((
|
9786
|
+
__html: setFontForText((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
9742
9787
|
} }),
|
9743
9788
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), dangerouslySetInnerHTML: {
|
9744
9789
|
__html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -9748,11 +9793,11 @@ Made in Italy` })));
|
|
9748
9793
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
9749
9794
|
} }),
|
9750
9795
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
9751
|
-
__html: setFontForText((
|
9796
|
+
__html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _z !== void 0 ? _z : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
9752
9797
|
} }))),
|
9753
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (
|
9798
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_0 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _0 !== void 0 ? _0 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
|
9754
9799
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
9755
|
-
__html: setFontForText((
|
9800
|
+
__html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
|
9756
9801
|
} }))),
|
9757
9802
|
productInfoText({ isPost }))),
|
9758
9803
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
@@ -9998,6 +10043,11 @@ var settingRender$5 = [
|
|
9998
10043
|
type: 'Group',
|
9999
10044
|
label: '尺寸',
|
10000
10045
|
child: [
|
10046
|
+
{
|
10047
|
+
type: 'Number',
|
10048
|
+
name: ['props', 'buttonStyle', 'width'],
|
10049
|
+
addonAfter: 'W'
|
10050
|
+
},
|
10001
10051
|
{
|
10002
10052
|
type: 'Number',
|
10003
10053
|
name: ['props', 'buttonStyle', 'height'],
|
@@ -10106,18 +10156,18 @@ function useOnScreen(ref) {
|
|
10106
10156
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10107
10157
|
*
|
10108
10158
|
*/
|
10109
|
-
const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
10159
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
|
10110
10160
|
const ref = React.useRef(null);
|
10111
10161
|
const isOnScreen = useOnScreen(ref);
|
10112
10162
|
const { ctaEvent } = useSxpDataSource();
|
10113
10163
|
React.useEffect(() => {
|
10114
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
10164
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
|
10115
10165
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10116
10166
|
eventSubject: 'ctaExposure',
|
10117
10167
|
eventDescription: 'The cta was shown to the user'
|
10118
10168
|
}, rec, item, index);
|
10119
10169
|
}
|
10120
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
10170
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
|
10121
10171
|
React.useMemo(() => {
|
10122
10172
|
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
|
10123
10173
|
}, [src]);
|
@@ -10127,41 +10177,12 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
|
10127
10177
|
};
|
10128
10178
|
var Img$1 = React.memo(Img);
|
10129
10179
|
|
10130
|
-
const EventProvider = (_a) => {
|
10131
|
-
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
10132
|
-
const ref = React.useRef(null);
|
10133
|
-
const { popup } = useEditor();
|
10134
|
-
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10135
|
-
const { jumpToWeb } = useEventReport();
|
10136
|
-
const handleClick = lodash.throttle(() => {
|
10137
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
10138
|
-
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;
|
10139
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10140
|
-
eventSubject: 'clickCta',
|
10141
|
-
eventDescription: 'User clicked the CTA'
|
10142
|
-
}, rec, item, index);
|
10143
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
10144
|
-
if (isExternalLink) {
|
10145
|
-
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) {
|
10146
|
-
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
10147
|
-
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
10148
|
-
jumpToWeb(rec, product, cta, index);
|
10149
|
-
window.location.href = window.getJointUtmLink((_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);
|
10150
|
-
}
|
10151
|
-
}
|
10152
|
-
else {
|
10153
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10154
|
-
}
|
10155
|
-
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10156
|
-
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
10157
|
-
};
|
10158
|
-
var EventProvider$1 = React.memo(EventProvider);
|
10159
|
-
|
10160
10180
|
const CommodityList$1 = (_a) => {
|
10161
10181
|
var _b, _c;
|
10162
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink"]);
|
10163
|
-
const { sxpParameter } = useSxpDataSource();
|
10164
|
-
const {
|
10182
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
|
10183
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10184
|
+
const { jumpToWeb } = useEventReport();
|
10185
|
+
const { popup } = useEditor();
|
10165
10186
|
const recData = isPost ? rec : popupDetailData;
|
10166
10187
|
const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
|
10167
10188
|
const priceText = React.useCallback((product) => {
|
@@ -10175,12 +10196,28 @@ const CommodityList$1 = (_a) => {
|
|
10175
10196
|
return '$7,000';
|
10176
10197
|
}
|
10177
10198
|
}, []);
|
10199
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
10200
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10201
|
+
eventSubject: 'clickCta',
|
10202
|
+
eventDescription: 'User clicked the CTA'
|
10203
|
+
}, recData, item, index);
|
10204
|
+
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 }), index, multiCheckIndex }));
|
10205
|
+
if (isExternalLink) {
|
10206
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
10207
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
10208
|
+
window.location.href = window.getJointUtmLink(item.link);
|
10209
|
+
}
|
10210
|
+
}
|
10211
|
+
else {
|
10212
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10213
|
+
}
|
10214
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10178
10215
|
return (React.createElement("div", { className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
10179
10216
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10180
|
-
return (React.createElement(
|
10217
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css.css({
|
10181
10218
|
display: 'flex'
|
10182
|
-
}) }),
|
10183
|
-
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture }),
|
10219
|
+
}), onClick: () => handleClick(item, index) }),
|
10220
|
+
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
|
10184
10221
|
React.createElement("div", { style: {
|
10185
10222
|
flex: 1,
|
10186
10223
|
width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px - ${(_g = style === null || style === void 0 ? void 0 : style.padding) !== null && _g !== void 0 ? _g : 0}px)`,
|
@@ -10205,9 +10242,9 @@ const CommodityList$1 = (_a) => {
|
|
10205
10242
|
React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
|
10206
10243
|
__html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
10207
10244
|
} }),
|
10208
|
-
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px'
|
10245
|
+
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10209
10246
|
__html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
|
10210
|
-
} })))));
|
10247
|
+
} })))))));
|
10211
10248
|
})));
|
10212
10249
|
};
|
10213
10250
|
var CommodityListComponent = React.memo(CommodityList$1);
|
@@ -10244,7 +10281,7 @@ var interactionRender$9 = [
|
|
10244
10281
|
* @Author: binruan@chatlabs.com
|
10245
10282
|
* @Date: 2024-03-20 10:27:31
|
10246
10283
|
* @LastEditors: binruan@chatlabs.com
|
10247
|
-
* @LastEditTime: 2024-07-
|
10284
|
+
* @LastEditTime: 2024-07-26 17:33:03
|
10248
10285
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\material.tsx
|
10249
10286
|
*
|
10250
10287
|
*/
|
@@ -10283,6 +10320,7 @@ const CommodityList = createMaterial(CommodityListComponent, {
|
|
10283
10320
|
backgroundColor: '#000',
|
10284
10321
|
fontSize: 12,
|
10285
10322
|
height: 30,
|
10323
|
+
width: 100,
|
10286
10324
|
textAlign: 'center',
|
10287
10325
|
color: '#fff',
|
10288
10326
|
lineHeight: 2.5
|
@@ -10566,6 +10604,36 @@ var interactionRender$8 = [
|
|
10566
10604
|
}
|
10567
10605
|
];
|
10568
10606
|
|
10607
|
+
const EventProvider = (_a) => {
|
10608
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
10609
|
+
const ref = React.useRef(null);
|
10610
|
+
const { popup } = useEditor();
|
10611
|
+
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10612
|
+
const { jumpToWeb } = useEventReport();
|
10613
|
+
const handleClick = lodash.throttle(() => {
|
10614
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
10615
|
+
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;
|
10616
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10617
|
+
eventSubject: 'clickCta',
|
10618
|
+
eventDescription: 'User clicked the CTA'
|
10619
|
+
}, rec, item, index);
|
10620
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
10621
|
+
if (isExternalLink) {
|
10622
|
+
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) {
|
10623
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
10624
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
10625
|
+
jumpToWeb(rec, product, cta, index);
|
10626
|
+
window.location.href = window.getJointUtmLink((_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);
|
10627
|
+
}
|
10628
|
+
}
|
10629
|
+
else {
|
10630
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10631
|
+
}
|
10632
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10633
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
10634
|
+
};
|
10635
|
+
var EventProvider$1 = React.memo(EventProvider);
|
10636
|
+
|
10569
10637
|
var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
10570
10638
|
|
10571
10639
|
const Commodity$1 = (_a) => {
|
@@ -11136,12 +11204,12 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
11136
11204
|
const { popup } = useEditor();
|
11137
11205
|
const { jumpToWeb } = useEventReport();
|
11138
11206
|
const [products, setProducts] = React.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]);
|
11139
|
-
const handleClick = lodash.throttle((item) => {
|
11207
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
11140
11208
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11141
11209
|
eventSubject: 'clickCta',
|
11142
11210
|
eventDescription: 'User clicked the CTA'
|
11143
11211
|
}, recData, item, index);
|
11144
|
-
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 }), index }));
|
11212
|
+
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 }), index, multiCheckIndex }));
|
11145
11213
|
if (isExternalLink) {
|
11146
11214
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11147
11215
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11154,7 +11222,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
11154
11222
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11155
11223
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11156
11224
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
11157
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
11225
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
11158
11226
|
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
11159
11227
|
React.createElement("div", { className: css.css({
|
11160
11228
|
color: '#000',
|
@@ -11252,12 +11320,12 @@ const MultiCommodity$1 = (_a) => {
|
|
11252
11320
|
const { popup } = useEditor();
|
11253
11321
|
const [products, setProducts] = React.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]);
|
11254
11322
|
const { jumpToWeb } = useEventReport();
|
11255
|
-
const handleClick = lodash.throttle((item) => {
|
11323
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
11256
11324
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11257
11325
|
eventSubject: 'clickCta',
|
11258
11326
|
eventDescription: 'User clicked the CTA'
|
11259
11327
|
}, recData, item, index);
|
11260
|
-
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 }), index }));
|
11328
|
+
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 }), index, multiCheckIndex }));
|
11261
11329
|
if (isExternalLink) {
|
11262
11330
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11263
11331
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11270,7 +11338,7 @@ const MultiCommodity$1 = (_a) => {
|
|
11270
11338
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11271
11339
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11272
11340
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
11273
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
11341
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
11274
11342
|
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
11275
11343
|
React.createElement("div", { className: css.css({
|
11276
11344
|
color: '#fff',
|
@@ -13986,17 +14054,21 @@ const AniLink$1 = (_a) => {
|
|
13986
14054
|
}
|
13987
14055
|
}, [event === null || event === void 0 ? void 0 : event.animation]);
|
13988
14056
|
React.useEffect(() => {
|
14057
|
+
var _a, _b, _c;
|
13989
14058
|
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
13990
14059
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
13991
14060
|
eventSubject: 'ctaExposure',
|
13992
14061
|
eventDescription: 'The cta was shown to the user'
|
13993
|
-
}, recData,
|
14062
|
+
}, 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);
|
13994
14063
|
}
|
13995
14064
|
}, [isOnScreen]);
|
13996
14065
|
React.useEffect(() => {
|
13997
14066
|
if (isOnScreen) {
|
13998
14067
|
setVisible(true);
|
13999
14068
|
}
|
14069
|
+
else {
|
14070
|
+
setVisible(false);
|
14071
|
+
}
|
14000
14072
|
}, [isOnScreen]);
|
14001
14073
|
const aniNamStyle = React.useMemo(() => {
|
14002
14074
|
if (!visible)
|
@@ -14114,7 +14186,7 @@ const AniLink = createMaterial(AniLinkComponent, {
|
|
14114
14186
|
* @Author: binruan@chatlabs.com
|
14115
14187
|
* @Date: 2024-03-26 16:50:25
|
14116
14188
|
* @LastEditors: binruan@chatlabs.com
|
14117
|
-
* @LastEditTime: 2024-07-
|
14189
|
+
* @LastEditTime: 2024-07-25 15:02:45
|
14118
14190
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\settingRender.tsx
|
14119
14191
|
*
|
14120
14192
|
*/
|
@@ -14316,7 +14388,7 @@ var settingRender = [
|
|
14316
14388
|
},
|
14317
14389
|
{
|
14318
14390
|
type: 'TextSpace',
|
14319
|
-
name: ['props', 'ctaTempStyles', '
|
14391
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle']
|
14320
14392
|
},
|
14321
14393
|
{
|
14322
14394
|
type: 'Color',
|
@@ -14373,14 +14445,11 @@ var styles = {"aniLinkPopup":"index-module_aniLinkPopup__YT7kj","animated-fadeIn
|
|
14373
14445
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
14374
14446
|
const AniLinkPopup$1 = (_a) => {
|
14375
14447
|
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;
|
14376
|
-
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"]);
|
14448
|
+
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"]);
|
14377
14449
|
style === null || style === void 0 ? true : delete style.transform;
|
14378
14450
|
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
14379
14451
|
const { jumpToWeb } = useEventReport();
|
14380
|
-
const
|
14381
|
-
const isOnScreen = useOnScreen(ref);
|
14382
|
-
const [visible, setVisible] = React.useState(false);
|
14383
|
-
const [startAni, setStartAni] = React.useState(true);
|
14452
|
+
const [visible, setVisible] = React.useState(true);
|
14384
14453
|
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);
|
14385
14454
|
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);
|
14386
14455
|
const handleTo = () => {
|
@@ -14416,29 +14485,27 @@ const AniLinkPopup$1 = (_a) => {
|
|
14416
14485
|
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;
|
14417
14486
|
const onClose = (event) => {
|
14418
14487
|
event.stopPropagation();
|
14419
|
-
|
14488
|
+
setVisible(false);
|
14420
14489
|
};
|
14421
14490
|
React.useEffect(() => {
|
14422
|
-
|
14423
|
-
|
14424
|
-
}
|
14425
|
-
}, [isOnScreen]);
|
14491
|
+
setVisible(true);
|
14492
|
+
}, [isActive]);
|
14426
14493
|
const aniNamStyle = React.useMemo(() => {
|
14427
|
-
if (!
|
14494
|
+
if (!isActive)
|
14428
14495
|
return null;
|
14429
|
-
return
|
14430
|
-
}, [
|
14496
|
+
return visible ? styles['animated-fadeIn'] : null;
|
14497
|
+
}, [isActive, visible]);
|
14431
14498
|
return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
|
14432
14499
|
height: '40px',
|
14433
14500
|
lineHeight: '40px',
|
14434
14501
|
paddingLeft: '6px'
|
14435
|
-
} }, "Cta Title")) : (React.createElement("div", Object.assign({
|
14502
|
+
} }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css.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.css(aniTimStyle)}`, onClick: handleTo }),
|
14436
14503
|
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 } },
|
14437
14504
|
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'] })),
|
14438
14505
|
React.createElement(Img$1, { 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 }),
|
14439
|
-
|
14506
|
+
(!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
14440
14507
|
__html: 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)
|
14441
|
-
} }),
|
14508
|
+
} })),
|
14442
14509
|
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: {
|
14443
14510
|
__html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
14444
14511
|
} })))));
|
@@ -14593,52 +14660,71 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
14593
14660
|
const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
14594
14661
|
const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
14595
14662
|
const LikeButton = (_a) => {
|
14663
|
+
var _b;
|
14596
14664
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
14597
|
-
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
14598
|
-
const [state, setState] = React.useState(
|
14665
|
+
const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
|
14666
|
+
const [state, setState] = React.useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
|
14599
14667
|
const likeIcon = useIconLink(defaultLikeIconPath$1);
|
14600
14668
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
|
14601
14669
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
14602
|
-
var
|
14670
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
14603
14671
|
if (state) {
|
14604
14672
|
// 先设置状态
|
14605
14673
|
setState(false);
|
14606
|
-
const result = (
|
14674
|
+
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;
|
14607
14675
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14608
14676
|
eventInfo: {
|
14609
14677
|
eventSubject: 'favoriteContentCanceled',
|
14610
14678
|
eventDescription: 'This content was unfavorite by the user',
|
14611
|
-
contentId: (
|
14612
|
-
contentName: (
|
14613
|
-
contentTags: JSON.stringify((
|
14679
|
+
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 : '',
|
14680
|
+
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 : '',
|
14681
|
+
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 : []),
|
14614
14682
|
position: position + '',
|
14615
|
-
contentFormat: ((
|
14616
|
-
traceInfo: (
|
14683
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
14684
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
14617
14685
|
}
|
14618
14686
|
});
|
14619
14687
|
// 如果接口调用失败,则回滚状态
|
14620
14688
|
if (!result) {
|
14621
14689
|
setState(true);
|
14622
14690
|
}
|
14691
|
+
else {
|
14692
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
14693
|
+
if (index === position) {
|
14694
|
+
item.isCollected = false;
|
14695
|
+
}
|
14696
|
+
return item;
|
14697
|
+
})) !== null && _p !== void 0 ? _p : [];
|
14698
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
14699
|
+
}
|
14623
14700
|
}
|
14624
14701
|
else {
|
14625
14702
|
setState(true);
|
14626
|
-
const result = (
|
14703
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
14627
14704
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14628
14705
|
eventInfo: {
|
14629
14706
|
eventSubject: 'favoriteContent',
|
14630
14707
|
eventDescription: 'This content was favorite by the user',
|
14631
|
-
contentId: (
|
14632
|
-
contentName: (
|
14633
|
-
contentTags: JSON.stringify((
|
14708
|
+
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 : '',
|
14709
|
+
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 : '',
|
14710
|
+
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 : []),
|
14634
14711
|
position: position + '',
|
14635
|
-
contentFormat: ((
|
14636
|
-
traceInfo: (
|
14712
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
14713
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
14637
14714
|
}
|
14638
14715
|
});
|
14639
14716
|
if (!result) {
|
14640
14717
|
setState(false);
|
14641
14718
|
}
|
14719
|
+
else {
|
14720
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
14721
|
+
if (index === position) {
|
14722
|
+
item.isCollected = true;
|
14723
|
+
}
|
14724
|
+
return item;
|
14725
|
+
})) !== null && _z !== void 0 ? _z : [];
|
14726
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
14727
|
+
}
|
14642
14728
|
}
|
14643
14729
|
}), 200);
|
14644
14730
|
return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
@@ -15167,7 +15253,7 @@ var PictureGroup$3 = React.memo(PictureGroup$2);
|
|
15167
15253
|
* @Author: binruan@chatlabs.com
|
15168
15254
|
* @Date: 2024-01-15 19:03:09
|
15169
15255
|
* @LastEditors: binruan@chatlabs.com
|
15170
|
-
* @LastEditTime: 2024-07-
|
15256
|
+
* @LastEditTime: 2024-07-25 18:14:29
|
15171
15257
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
|
15172
15258
|
*
|
15173
15259
|
*/
|
@@ -15204,7 +15290,6 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
|
|
15204
15290
|
}
|
15205
15291
|
return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
|
15206
15292
|
}, [isShowMore, tags]);
|
15207
|
-
console.log(hashTagStyle, '111');
|
15208
15293
|
return (React.createElement("div", { className: 'clc-sxp-bottom-hashtag', style: { marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px` } },
|
15209
15294
|
React.createElement(Scroll$1, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item) },
|
15210
15295
|
React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
|
@@ -15275,27 +15360,35 @@ function withBindDataSource(Component) {
|
|
15275
15360
|
* @Author: binruan@chatlabs.com
|
15276
15361
|
* @Date: 2023-12-26 16:11:34
|
15277
15362
|
* @LastEditors: binruan@chatlabs.com
|
15278
|
-
* @LastEditTime: 2024-07-
|
15363
|
+
* @LastEditTime: 2024-07-29 10:07:08
|
15279
15364
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
15280
15365
|
*
|
15281
15366
|
*/
|
15282
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
15367
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
|
15368
|
+
var _a, _b, _c, _d, _e;
|
15283
15369
|
const { schema } = useEditor();
|
15370
|
+
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
15371
|
+
return null;
|
15372
|
+
let cta = null;
|
15373
|
+
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
15374
|
+
cta = '多商品CTA';
|
15375
|
+
}
|
15376
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
15377
|
+
cta = '商品CTA';
|
15378
|
+
}
|
15379
|
+
else {
|
15380
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
15381
|
+
}
|
15382
|
+
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
15284
15383
|
const renderComp = React.useMemo(() => {
|
15285
15384
|
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, _7, _8;
|
15286
15385
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
15287
15386
|
return null;
|
15288
|
-
|
15289
|
-
if ((
|
15290
|
-
cta = '多商品CTA';
|
15291
|
-
}
|
15292
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
15293
|
-
cta = '商品CTA';
|
15294
|
-
}
|
15387
|
+
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) ;
|
15388
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) ;
|
15295
15389
|
else {
|
15296
|
-
|
15390
|
+
(_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
15297
15391
|
}
|
15298
|
-
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
15299
15392
|
//如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
|
15300
15393
|
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
|
15301
15394
|
return;
|
@@ -15316,12 +15409,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
|
15316
15409
|
const Component = withBindDataSource(t);
|
15317
15410
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
15318
15411
|
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';
|
15319
|
-
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 })));
|
15412
|
+
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 })));
|
15320
15413
|
}
|
15321
15414
|
else {
|
15322
15415
|
return null;
|
15323
15416
|
}
|
15324
|
-
}, [rec, resolver, tempMap, schema]);
|
15417
|
+
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
|
15325
15418
|
return React.createElement(React.Fragment, null, renderComp);
|
15326
15419
|
};
|
15327
15420
|
var RenderCard$1 = React.memo(RenderCard);
|
@@ -15409,7 +15502,7 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
15409
15502
|
* @Author: binruan@chatlabs.com
|
15410
15503
|
* @Date: 2024-01-15 19:03:09
|
15411
15504
|
* @LastEditors: binruan@chatlabs.com
|
15412
|
-
* @LastEditTime: 2024-07-
|
15505
|
+
* @LastEditTime: 2024-07-29 10:02:52
|
15413
15506
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
15414
15507
|
*
|
15415
15508
|
*/
|
@@ -15627,7 +15720,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15627
15720
|
React.createElement(ExpandableText$1, { 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 }),
|
15628
15721
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
15629
15722
|
React.createElement(Hashtag$1, { 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 }))),
|
15630
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'] })));
|
15723
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
15631
15724
|
}
|
15632
15725
|
return null;
|
15633
15726
|
}, [
|
@@ -15682,11 +15775,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15682
15775
|
};
|
15683
15776
|
const handleSlideSkip = (item, position) => {
|
15684
15777
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
15685
|
-
if (isPreview)
|
15778
|
+
if (isPreview || waterFallData)
|
15686
15779
|
return;
|
15687
15780
|
const t = new Date() - curTime.current;
|
15688
15781
|
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) {
|
15689
|
-
const link = ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.
|
15782
|
+
const link = ((_d = (_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.link) || ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.link) || ((_g = item === null || item === void 0 ? void 0 : item.product) === null || _g === void 0 ? void 0 : _g.link);
|
15690
15783
|
const product = (item === null || item === void 0 ? void 0 : item.product) || ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct) || ((_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]);
|
15691
15784
|
if (link) {
|
15692
15785
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
@@ -16231,19 +16324,18 @@ var index$1 = React.memo(DiyPortalPreview);
|
|
16231
16324
|
* @Author: binruan@chatlabs.com
|
16232
16325
|
* @Date: 2023-10-31 10:56:01
|
16233
16326
|
* @LastEditors: binruan@chatlabs.com
|
16234
|
-
* @LastEditTime: 2024-07-
|
16327
|
+
* @LastEditTime: 2024-07-29 18:06:11
|
16235
16328
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
16236
16329
|
*
|
16237
16330
|
*/
|
16238
16331
|
const Popup = () => {
|
16239
16332
|
const { schema, resolver, popup } = useEditor();
|
16240
|
-
const { setPopupDetailData, popupDetailData,
|
16333
|
+
const { setPopupDetailData, popupDetailData, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
16241
16334
|
const { productView } = useEventReport();
|
16242
16335
|
const [visible, setVisible] = React.useState();
|
16243
|
-
const curTimeRef = React.useRef(null);
|
16244
16336
|
React.useEffect(() => {
|
16245
16337
|
const initTime = () => {
|
16246
|
-
|
16338
|
+
popupCurTimeRef.current = new Date();
|
16247
16339
|
};
|
16248
16340
|
initTime();
|
16249
16341
|
window.addEventListener('pageshow', initTime);
|
@@ -16253,25 +16345,37 @@ const Popup = () => {
|
|
16253
16345
|
}, []);
|
16254
16346
|
React.useEffect(() => {
|
16255
16347
|
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
16256
|
-
|
16348
|
+
popupCurTimeRef.current = new Date();
|
16257
16349
|
setVisible(popup);
|
16258
16350
|
}
|
16259
16351
|
}, [popup]);
|
16260
16352
|
const handleClose = () => {
|
16261
|
-
var _a, _b, _c, _d;
|
16262
|
-
if (!popup ||
|
16353
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
16354
|
+
if (!popup ||
|
16355
|
+
(popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
|
16356
|
+
!visible ||
|
16357
|
+
new Date() - popupCurTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
|
16263
16358
|
return;
|
16264
16359
|
}
|
16265
16360
|
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
16266
|
-
const
|
16267
|
-
|
16268
|
-
|
16269
|
-
|
16270
|
-
|
16361
|
+
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));
|
16362
|
+
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') {
|
16363
|
+
const data = popupDetailData;
|
16364
|
+
let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
|
16365
|
+
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;
|
16366
|
+
if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
|
16367
|
+
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];
|
16368
|
+
product = p;
|
16369
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
16370
|
+
}
|
16371
|
+
if (product && cta) {
|
16372
|
+
productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
16373
|
+
}
|
16271
16374
|
}
|
16272
16375
|
setTimeout(() => {
|
16273
16376
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
16274
16377
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
16378
|
+
checkCommodityIndexRef.current = -1;
|
16275
16379
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
16276
16380
|
};
|
16277
16381
|
const renderPopupDetail = React.useMemo(() => {
|
@@ -16284,7 +16388,7 @@ const Popup = () => {
|
|
16284
16388
|
const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
16285
16389
|
const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
|
16286
16390
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
16287
|
-
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
|
16391
|
+
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
|
16288
16392
|
}
|
16289
16393
|
else {
|
16290
16394
|
return React.createElement(React.Fragment, null);
|