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.js
CHANGED
@@ -552,6 +552,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
552
552
|
const themeTag = useRef();
|
553
553
|
const curTime = useRef();
|
554
554
|
const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
|
555
|
+
const checkCommodityIndexRef = useRef();
|
556
|
+
const popupCurTimeRef = useRef(null);
|
555
557
|
const isShowConsent = useMemo(() => {
|
556
558
|
var _a, _b, _c, _d;
|
557
559
|
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;
|
@@ -719,7 +721,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
719
721
|
}
|
720
722
|
}), [bffFetch, utmVal, isShowTag]);
|
721
723
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
722
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
724
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
723
725
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
724
726
|
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);
|
725
727
|
let fromKName = '';
|
@@ -733,7 +735,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
733
735
|
fromKName = 'imagePage';
|
734
736
|
}
|
735
737
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
736
|
-
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 })
|
738
|
+
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 : '' })
|
737
739
|
});
|
738
740
|
}, [bffEventReport, isFromHashtag]);
|
739
741
|
const h5EnterLink = useCallback(() => {
|
@@ -848,7 +850,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
848
850
|
isShowConsent,
|
849
851
|
selectTag,
|
850
852
|
setSelectTag,
|
851
|
-
globalConfig
|
853
|
+
globalConfig,
|
854
|
+
popupCurTimeRef,
|
855
|
+
checkCommodityIndexRef
|
852
856
|
} }, 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({
|
853
857
|
rtcList,
|
854
858
|
mutateLike: bffMutateLike,
|
@@ -8583,7 +8587,7 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8583
8587
|
* @Author: binruan@chatlabs.com
|
8584
8588
|
* @Date: 2023-11-02 18:34:34
|
8585
8589
|
* @LastEditors: binruan@chatlabs.com
|
8586
|
-
* @LastEditTime: 2024-07-
|
8590
|
+
* @LastEditTime: 2024-07-29 16:20:40
|
8587
8591
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8588
8592
|
*
|
8589
8593
|
*/
|
@@ -8639,19 +8643,25 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
8639
8643
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
8640
8644
|
}, 300);
|
8641
8645
|
const handleTouchStart = (event) => {
|
8642
|
-
event.stopPropagation();
|
8643
|
-
touchRef.current = event.touches[0]
|
8644
|
-
fTouchRef.current = event.touches[0]
|
8646
|
+
// event.stopPropagation();
|
8647
|
+
touchRef.current = event.touches[0];
|
8648
|
+
fTouchRef.current = event.touches[0];
|
8645
8649
|
touchMoveRef.current = true;
|
8646
8650
|
};
|
8647
8651
|
const handleTouchMove = (event) => {
|
8648
|
-
event.stopPropagation();
|
8652
|
+
// event.stopPropagation();
|
8649
8653
|
requestAnimationFrame(() => {
|
8650
8654
|
var _a;
|
8651
8655
|
if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
|
8652
8656
|
const currentY = event.touches[0].clientY;
|
8653
|
-
const
|
8654
|
-
touchRef.current
|
8657
|
+
const currentX = event.touches[0].clientX;
|
8658
|
+
const diff = touchRef.current.clientY - currentY;
|
8659
|
+
touchRef.current = event.touches[0];
|
8660
|
+
const diffY = currentY - fTouchRef.current.clientY;
|
8661
|
+
const diffX = currentX - fTouchRef.current.clientX;
|
8662
|
+
if (Math.abs(diffX) > Math.abs(diffY)) {
|
8663
|
+
return;
|
8664
|
+
}
|
8655
8665
|
const ts = modalTrans - diff;
|
8656
8666
|
if (ts > 0) {
|
8657
8667
|
setModalTrans(ts);
|
@@ -8661,9 +8671,14 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
8661
8671
|
};
|
8662
8672
|
const handleTouchEnd = (event) => {
|
8663
8673
|
var _a;
|
8664
|
-
event.stopPropagation();
|
8674
|
+
// event.stopPropagation();
|
8665
8675
|
if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
|
8666
|
-
const
|
8676
|
+
const diffY = event.changedTouches[0].clientY - fTouchRef.current.clientY;
|
8677
|
+
const diffX = event.changedTouches[0].clientX - fTouchRef.current.clientX;
|
8678
|
+
if (Math.abs(diffX) > Math.abs(diffY)) {
|
8679
|
+
return;
|
8680
|
+
}
|
8681
|
+
const diff = fTouchRef.current.clientY - touchRef.current.clientY;
|
8667
8682
|
if (diff > 0) {
|
8668
8683
|
setModalTrans(0);
|
8669
8684
|
}
|
@@ -8816,56 +8831,71 @@ const FormatImage = forwardRef((props, ref) => {
|
|
8816
8831
|
});
|
8817
8832
|
var FormatImage$1 = memo(FormatImage);
|
8818
8833
|
|
8819
|
-
|
8834
|
+
/*
|
8835
|
+
* @Author: binruan@chatlabs.com
|
8836
|
+
* @Date: 2024-03-20 10:27:32
|
8837
|
+
* @LastEditors: binruan@chatlabs.com
|
8838
|
+
* @LastEditTime: 2024-07-30 11:46:32
|
8839
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
|
8840
|
+
*
|
8841
|
+
*/
|
8842
|
+
const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
|
8820
8843
|
const ref = useRef();
|
8821
8844
|
const { popupDetailData } = useSxpDataSource();
|
8822
8845
|
useEffect(() => {
|
8823
|
-
var _a;
|
8824
|
-
|
8825
|
-
|
8846
|
+
var _a, _b;
|
8847
|
+
if (enableSlideActive)
|
8848
|
+
(_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);
|
8849
|
+
}, [popupDetailData, enableSlideActive]);
|
8826
8850
|
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));
|
8827
8851
|
};
|
8828
8852
|
var Scroll$1 = memo(Scroll);
|
8829
8853
|
|
8830
|
-
const CommodityGroup = ({ products, data, defImg, style }) => {
|
8831
|
-
var _a
|
8832
|
-
|
8833
|
-
const [check, setCheck] = useState((_a = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _a !== void 0 ? _a : 0);
|
8834
|
-
const handleClick = useCallback((index) => {
|
8835
|
-
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 })));
|
8836
|
-
}, []);
|
8837
|
-
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) => {
|
8854
|
+
const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
|
8855
|
+
var _a;
|
8856
|
+
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) => {
|
8838
8857
|
var _a, _b, _c;
|
8839
|
-
return (React.createElement(SwiperSlide, { className: css({
|
8858
|
+
return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css({
|
8840
8859
|
width: '50px',
|
8841
8860
|
height: '50px',
|
8842
8861
|
marginRight: '10px'
|
8843
|
-
}), onClick: () =>
|
8862
|
+
}), onClick: () => {
|
8863
|
+
onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
|
8864
|
+
}, key: index },
|
8844
8865
|
React.createElement(FormatImage$1, { style: {
|
8845
8866
|
height: '100%',
|
8846
8867
|
width: '100%',
|
8847
8868
|
objectFit: 'cover',
|
8848
8869
|
display: 'block',
|
8849
|
-
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ?
|
8850
|
-
border: check === index ? '1px solid #000' : '1px solid #f2f2f2'
|
8851
|
-
|
8870
|
+
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? (data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
|
8871
|
+
border: check === index ? '1px solid #000' : '1px solid #f2f2f2',
|
8872
|
+
boxSizing: 'border-box'
|
8873
|
+
}, 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));
|
8852
8874
|
})))));
|
8853
8875
|
};
|
8854
8876
|
var CommodityGroup$1 = memo(CommodityGroup);
|
8855
8877
|
|
8856
8878
|
const CommodityDetail$1 = (_a) => {
|
8857
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
8879
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
8858
8880
|
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"]);
|
8859
|
-
const { sxpParameter } = useSxpDataSource();
|
8860
|
-
|
8881
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = useSxpDataSource();
|
8882
|
+
useEditor();
|
8861
8883
|
const { jumpToWeb, productView } = useEventReport();
|
8862
8884
|
const curTimeRef = useRef(null);
|
8863
8885
|
const [showModal, setShowModal] = useState(false);
|
8864
8886
|
const [show3DModal, setShow3DModal] = useState(false);
|
8887
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
8865
8888
|
const data = isPost ? rec : popupDetailData;
|
8866
|
-
|
8867
|
-
|
8889
|
+
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];
|
8890
|
+
let cta = isPost
|
8891
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
8892
|
+
: (_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;
|
8868
8893
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
8894
|
+
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) {
|
8895
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
8896
|
+
product = p;
|
8897
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
8898
|
+
}
|
8869
8899
|
const handleLink = () => {
|
8870
8900
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
8871
8901
|
jumpToWeb(data, product, cta, position);
|
@@ -8903,7 +8933,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8903
8933
|
return '$7,000';
|
8904
8934
|
}
|
8905
8935
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8906
|
-
const width = isPreview ? 375 : (
|
8936
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
8907
8937
|
const renderContent = ({ isPost }) => {
|
8908
8938
|
var _a, _b, _c;
|
8909
8939
|
return (React.createElement("div", null,
|
@@ -8936,15 +8966,19 @@ const CommodityDetail$1 = (_a) => {
|
|
8936
8966
|
}
|
8937
8967
|
return style;
|
8938
8968
|
}, []);
|
8969
|
+
const handleClick = useCallback((index) => {
|
8970
|
+
popupCurTimeRef.current = new Date();
|
8971
|
+
setCheckCommodityIndex(index);
|
8972
|
+
}, []);
|
8939
8973
|
const renderCommodityGroup = useCallback(() => {
|
8940
8974
|
var _a, _b, _c;
|
8941
8975
|
if (isPost)
|
8942
8976
|
return;
|
8943
|
-
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' } }));
|
8944
|
-
}, []);
|
8977
|
+
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 }));
|
8978
|
+
}, [checkCommodityIndex]);
|
8945
8979
|
return (React.createElement(React.Fragment, null,
|
8946
8980
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
8947
|
-
product && ((
|
8981
|
+
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' } },
|
8948
8982
|
React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8949
8983
|
clickable: true,
|
8950
8984
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -8954,7 +8988,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8954
8988
|
}, loop: true, autoplay: {
|
8955
8989
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8956
8990
|
} },
|
8957
|
-
React.createElement(React.Fragment, null, (
|
8991
|
+
React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
8958
8992
|
return (React.createElement(SwiperSlide, { key: src },
|
8959
8993
|
React.createElement("div", { style: {
|
8960
8994
|
overflow: 'hidden',
|
@@ -8969,7 +9003,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8969
9003
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
8970
9004
|
}, src: src }))));
|
8971
9005
|
}))))),
|
8972
|
-
!((
|
9006
|
+
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
|
8973
9007
|
position: 'relative',
|
8974
9008
|
height: 0,
|
8975
9009
|
width: '100%',
|
@@ -8982,7 +9016,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8982
9016
|
top: 0,
|
8983
9017
|
objectFit: 'cover',
|
8984
9018
|
width: '100%'
|
8985
|
-
}), src: (
|
9019
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
8986
9020
|
renderCommodityGroup(),
|
8987
9021
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
8988
9022
|
renderBtn(),
|
@@ -9551,21 +9585,28 @@ var settingRender$6 = [
|
|
9551
9585
|
];
|
9552
9586
|
|
9553
9587
|
const CommodityDetailDiroNew$1 = (_a) => {
|
9554
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
9588
|
+
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;
|
9555
9589
|
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"]);
|
9556
9590
|
useState(true);
|
9557
|
-
const { sxpParameter } = useSxpDataSource();
|
9558
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
9591
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport } = useSxpDataSource();
|
9559
9592
|
const { jumpToWeb, productView } = useEventReport();
|
9560
9593
|
useState(false);
|
9561
9594
|
useState(false);
|
9562
9595
|
useState(true);
|
9563
9596
|
const [showModal, setShowModal] = useState(false);
|
9564
9597
|
const curTimeRef = useRef(null);
|
9598
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
9565
9599
|
const data = isPost ? rec : popupDetailData;
|
9566
|
-
|
9567
|
-
|
9600
|
+
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];
|
9601
|
+
let cta = isPost
|
9602
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
9603
|
+
: (_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;
|
9568
9604
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
9605
|
+
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) {
|
9606
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
9607
|
+
product = p;
|
9608
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
9609
|
+
}
|
9569
9610
|
const handleLink = () => {
|
9570
9611
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
9571
9612
|
jumpToWeb(data, product, cta, position);
|
@@ -9603,7 +9644,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
9603
9644
|
return '£102,300.00';
|
9604
9645
|
}
|
9605
9646
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
9606
|
-
const width = isPreview ? 375 : (
|
9647
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
9607
9648
|
// useEffect(() => {
|
9608
9649
|
// console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
|
9609
9650
|
// if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
|
@@ -9666,15 +9707,19 @@ Made in Italy` })));
|
|
9666
9707
|
}
|
9667
9708
|
return style;
|
9668
9709
|
}, []);
|
9710
|
+
const handleClick = useCallback((index) => {
|
9711
|
+
popupCurTimeRef.current = new Date();
|
9712
|
+
setCheckCommodityIndex(index);
|
9713
|
+
}, []);
|
9669
9714
|
const renderCommodityGroup = useCallback(() => {
|
9670
9715
|
var _a, _b, _c;
|
9671
9716
|
if (isPost)
|
9672
9717
|
return;
|
9673
|
-
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' } }));
|
9674
|
-
}, []);
|
9718
|
+
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 }));
|
9719
|
+
}, [checkCommodityIndex]);
|
9675
9720
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
9676
|
-
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
9677
|
-
product && ((
|
9721
|
+
React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
9722
|
+
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: {
|
9678
9723
|
clickable: true,
|
9679
9724
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
9680
9725
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -9682,7 +9727,7 @@ Made in Italy` })));
|
|
9682
9727
|
: 'commondityDiroNew-swiper-clickable-center'
|
9683
9728
|
}, loop: true, autoplay: {
|
9684
9729
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
9685
|
-
} }, (
|
9730
|
+
} }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
9686
9731
|
return (React.createElement(SwiperSlide, { key: src },
|
9687
9732
|
React.createElement("div", { style: {
|
9688
9733
|
overflow: 'hidden',
|
@@ -9697,7 +9742,7 @@ Made in Italy` })));
|
|
9697
9742
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
9698
9743
|
}, src: src }))));
|
9699
9744
|
}))),
|
9700
|
-
!((
|
9745
|
+
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
|
9701
9746
|
position: 'relative',
|
9702
9747
|
height: 0,
|
9703
9748
|
width: '100%',
|
@@ -9710,13 +9755,13 @@ Made in Italy` })));
|
|
9710
9755
|
top: 0,
|
9711
9756
|
objectFit: 'cover',
|
9712
9757
|
width: '100%'
|
9713
|
-
}), src: (
|
9758
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
9714
9759
|
renderCommodityGroup(),
|
9715
9760
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
9716
9761
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
9717
9762
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
9718
9763
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
|
9719
|
-
__html: setFontForText((
|
9764
|
+
__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)
|
9720
9765
|
} }),
|
9721
9766
|
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: {
|
9722
9767
|
__html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -9726,11 +9771,11 @@ Made in Italy` })));
|
|
9726
9771
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
9727
9772
|
} }),
|
9728
9773
|
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: {
|
9729
|
-
__html: setFontForText((
|
9774
|
+
__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)
|
9730
9775
|
} }))),
|
9731
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (
|
9776
|
+
(!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 },
|
9732
9777
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
9733
|
-
__html: setFontForText((
|
9778
|
+
__html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
|
9734
9779
|
} }))),
|
9735
9780
|
productInfoText({ isPost }))),
|
9736
9781
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
@@ -9976,6 +10021,11 @@ var settingRender$5 = [
|
|
9976
10021
|
type: 'Group',
|
9977
10022
|
label: '尺寸',
|
9978
10023
|
child: [
|
10024
|
+
{
|
10025
|
+
type: 'Number',
|
10026
|
+
name: ['props', 'buttonStyle', 'width'],
|
10027
|
+
addonAfter: 'W'
|
10028
|
+
},
|
9979
10029
|
{
|
9980
10030
|
type: 'Number',
|
9981
10031
|
name: ['props', 'buttonStyle', 'height'],
|
@@ -10084,18 +10134,18 @@ function useOnScreen(ref) {
|
|
10084
10134
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10085
10135
|
*
|
10086
10136
|
*/
|
10087
|
-
const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
10137
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
|
10088
10138
|
const ref = useRef(null);
|
10089
10139
|
const isOnScreen = useOnScreen(ref);
|
10090
10140
|
const { ctaEvent } = useSxpDataSource();
|
10091
10141
|
useEffect(() => {
|
10092
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
10142
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
|
10093
10143
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10094
10144
|
eventSubject: 'ctaExposure',
|
10095
10145
|
eventDescription: 'The cta was shown to the user'
|
10096
10146
|
}, rec, item, index);
|
10097
10147
|
}
|
10098
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
10148
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
|
10099
10149
|
useMemo(() => {
|
10100
10150
|
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
|
10101
10151
|
}, [src]);
|
@@ -10105,41 +10155,12 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
|
10105
10155
|
};
|
10106
10156
|
var Img$1 = memo(Img);
|
10107
10157
|
|
10108
|
-
const EventProvider = (_a) => {
|
10109
|
-
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
10110
|
-
const ref = useRef(null);
|
10111
|
-
const { popup } = useEditor();
|
10112
|
-
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10113
|
-
const { jumpToWeb } = useEventReport();
|
10114
|
-
const handleClick = throttle(() => {
|
10115
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
10116
|
-
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;
|
10117
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10118
|
-
eventSubject: 'clickCta',
|
10119
|
-
eventDescription: 'User clicked the CTA'
|
10120
|
-
}, rec, item, index);
|
10121
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
10122
|
-
if (isExternalLink) {
|
10123
|
-
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) {
|
10124
|
-
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
10125
|
-
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
10126
|
-
jumpToWeb(rec, product, cta, index);
|
10127
|
-
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);
|
10128
|
-
}
|
10129
|
-
}
|
10130
|
-
else {
|
10131
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10132
|
-
}
|
10133
|
-
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10134
|
-
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
10135
|
-
};
|
10136
|
-
var EventProvider$1 = memo(EventProvider);
|
10137
|
-
|
10138
10158
|
const CommodityList$1 = (_a) => {
|
10139
10159
|
var _b, _c;
|
10140
|
-
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"]);
|
10141
|
-
const { sxpParameter } = useSxpDataSource();
|
10142
|
-
const {
|
10160
|
+
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"]);
|
10161
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10162
|
+
const { jumpToWeb } = useEventReport();
|
10163
|
+
const { popup } = useEditor();
|
10143
10164
|
const recData = isPost ? rec : popupDetailData;
|
10144
10165
|
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];
|
10145
10166
|
const priceText = useCallback((product) => {
|
@@ -10153,12 +10174,28 @@ const CommodityList$1 = (_a) => {
|
|
10153
10174
|
return '$7,000';
|
10154
10175
|
}
|
10155
10176
|
}, []);
|
10177
|
+
const handleClick = throttle((item, multiCheckIndex) => {
|
10178
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10179
|
+
eventSubject: 'clickCta',
|
10180
|
+
eventDescription: 'User clicked the CTA'
|
10181
|
+
}, recData, item, index);
|
10182
|
+
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 }));
|
10183
|
+
if (isExternalLink) {
|
10184
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
10185
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
10186
|
+
window.location.href = window.getJointUtmLink(item.link);
|
10187
|
+
}
|
10188
|
+
}
|
10189
|
+
else {
|
10190
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10191
|
+
}
|
10192
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10156
10193
|
return (React.createElement("div", { className: 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) => {
|
10157
10194
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10158
|
-
return (React.createElement(
|
10195
|
+
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({
|
10159
10196
|
display: 'flex'
|
10160
|
-
}) }),
|
10161
|
-
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 }),
|
10197
|
+
}), onClick: () => handleClick(item, index) }),
|
10198
|
+
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 }),
|
10162
10199
|
React.createElement("div", { style: {
|
10163
10200
|
flex: 1,
|
10164
10201
|
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)`,
|
@@ -10183,9 +10220,9 @@ const CommodityList$1 = (_a) => {
|
|
10183
10220
|
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: {
|
10184
10221
|
__html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
10185
10222
|
} }),
|
10186
|
-
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px'
|
10223
|
+
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10187
10224
|
__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)
|
10188
|
-
} })))));
|
10225
|
+
} })))))));
|
10189
10226
|
})));
|
10190
10227
|
};
|
10191
10228
|
var CommodityListComponent = memo(CommodityList$1);
|
@@ -10222,7 +10259,7 @@ var interactionRender$9 = [
|
|
10222
10259
|
* @Author: binruan@chatlabs.com
|
10223
10260
|
* @Date: 2024-03-20 10:27:31
|
10224
10261
|
* @LastEditors: binruan@chatlabs.com
|
10225
|
-
* @LastEditTime: 2024-07-
|
10262
|
+
* @LastEditTime: 2024-07-26 17:33:03
|
10226
10263
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\material.tsx
|
10227
10264
|
*
|
10228
10265
|
*/
|
@@ -10261,6 +10298,7 @@ const CommodityList = createMaterial(CommodityListComponent, {
|
|
10261
10298
|
backgroundColor: '#000',
|
10262
10299
|
fontSize: 12,
|
10263
10300
|
height: 30,
|
10301
|
+
width: 100,
|
10264
10302
|
textAlign: 'center',
|
10265
10303
|
color: '#fff',
|
10266
10304
|
lineHeight: 2.5
|
@@ -10544,6 +10582,36 @@ var interactionRender$8 = [
|
|
10544
10582
|
}
|
10545
10583
|
];
|
10546
10584
|
|
10585
|
+
const EventProvider = (_a) => {
|
10586
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
10587
|
+
const ref = useRef(null);
|
10588
|
+
const { popup } = useEditor();
|
10589
|
+
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10590
|
+
const { jumpToWeb } = useEventReport();
|
10591
|
+
const handleClick = throttle(() => {
|
10592
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
10593
|
+
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;
|
10594
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10595
|
+
eventSubject: 'clickCta',
|
10596
|
+
eventDescription: 'User clicked the CTA'
|
10597
|
+
}, rec, item, index);
|
10598
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
10599
|
+
if (isExternalLink) {
|
10600
|
+
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) {
|
10601
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
10602
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
10603
|
+
jumpToWeb(rec, product, cta, index);
|
10604
|
+
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);
|
10605
|
+
}
|
10606
|
+
}
|
10607
|
+
else {
|
10608
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10609
|
+
}
|
10610
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10611
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
10612
|
+
};
|
10613
|
+
var EventProvider$1 = memo(EventProvider);
|
10614
|
+
|
10547
10615
|
var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
10548
10616
|
|
10549
10617
|
const Commodity$1 = (_a) => {
|
@@ -11114,12 +11182,12 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
11114
11182
|
const { popup } = useEditor();
|
11115
11183
|
const { jumpToWeb } = useEventReport();
|
11116
11184
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
11117
|
-
const handleClick = throttle((item) => {
|
11185
|
+
const handleClick = throttle((item, multiCheckIndex) => {
|
11118
11186
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11119
11187
|
eventSubject: 'clickCta',
|
11120
11188
|
eventDescription: 'User clicked the CTA'
|
11121
11189
|
}, recData, item, index);
|
11122
|
-
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 }));
|
11190
|
+
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 }));
|
11123
11191
|
if (isExternalLink) {
|
11124
11192
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11125
11193
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11132,7 +11200,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
11132
11200
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11133
11201
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11134
11202
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
11135
|
-
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(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
11203
|
+
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(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
11136
11204
|
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 }),
|
11137
11205
|
React.createElement("div", { className: css({
|
11138
11206
|
color: '#000',
|
@@ -11230,12 +11298,12 @@ const MultiCommodity$1 = (_a) => {
|
|
11230
11298
|
const { popup } = useEditor();
|
11231
11299
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
11232
11300
|
const { jumpToWeb } = useEventReport();
|
11233
|
-
const handleClick = throttle((item) => {
|
11301
|
+
const handleClick = throttle((item, multiCheckIndex) => {
|
11234
11302
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11235
11303
|
eventSubject: 'clickCta',
|
11236
11304
|
eventDescription: 'User clicked the CTA'
|
11237
11305
|
}, recData, item, index);
|
11238
|
-
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 }));
|
11306
|
+
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 }));
|
11239
11307
|
if (isExternalLink) {
|
11240
11308
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11241
11309
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11248,7 +11316,7 @@ const MultiCommodity$1 = (_a) => {
|
|
11248
11316
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11249
11317
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11250
11318
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
11251
|
-
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(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
11319
|
+
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(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
11252
11320
|
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 }),
|
11253
11321
|
React.createElement("div", { className: css({
|
11254
11322
|
color: '#fff',
|
@@ -13964,17 +14032,21 @@ const AniLink$1 = (_a) => {
|
|
13964
14032
|
}
|
13965
14033
|
}, [event === null || event === void 0 ? void 0 : event.animation]);
|
13966
14034
|
useEffect(() => {
|
14035
|
+
var _a, _b, _c;
|
13967
14036
|
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
13968
14037
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
13969
14038
|
eventSubject: 'ctaExposure',
|
13970
14039
|
eventDescription: 'The cta was shown to the user'
|
13971
|
-
}, recData,
|
14040
|
+
}, 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);
|
13972
14041
|
}
|
13973
14042
|
}, [isOnScreen]);
|
13974
14043
|
useEffect(() => {
|
13975
14044
|
if (isOnScreen) {
|
13976
14045
|
setVisible(true);
|
13977
14046
|
}
|
14047
|
+
else {
|
14048
|
+
setVisible(false);
|
14049
|
+
}
|
13978
14050
|
}, [isOnScreen]);
|
13979
14051
|
const aniNamStyle = useMemo(() => {
|
13980
14052
|
if (!visible)
|
@@ -14092,7 +14164,7 @@ const AniLink = createMaterial(AniLinkComponent, {
|
|
14092
14164
|
* @Author: binruan@chatlabs.com
|
14093
14165
|
* @Date: 2024-03-26 16:50:25
|
14094
14166
|
* @LastEditors: binruan@chatlabs.com
|
14095
|
-
* @LastEditTime: 2024-07-
|
14167
|
+
* @LastEditTime: 2024-07-25 15:02:45
|
14096
14168
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\settingRender.tsx
|
14097
14169
|
*
|
14098
14170
|
*/
|
@@ -14294,7 +14366,7 @@ var settingRender = [
|
|
14294
14366
|
},
|
14295
14367
|
{
|
14296
14368
|
type: 'TextSpace',
|
14297
|
-
name: ['props', 'ctaTempStyles', '
|
14369
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle']
|
14298
14370
|
},
|
14299
14371
|
{
|
14300
14372
|
type: 'Color',
|
@@ -14351,14 +14423,11 @@ var styles = {"aniLinkPopup":"index-module_aniLinkPopup__YT7kj","animated-fadeIn
|
|
14351
14423
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
14352
14424
|
const AniLinkPopup$1 = (_a) => {
|
14353
14425
|
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;
|
14354
|
-
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"]);
|
14426
|
+
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"]);
|
14355
14427
|
style === null || style === void 0 ? true : delete style.transform;
|
14356
14428
|
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
14357
14429
|
const { jumpToWeb } = useEventReport();
|
14358
|
-
const
|
14359
|
-
const isOnScreen = useOnScreen(ref);
|
14360
|
-
const [visible, setVisible] = useState(false);
|
14361
|
-
const [startAni, setStartAni] = useState(true);
|
14430
|
+
const [visible, setVisible] = useState(true);
|
14362
14431
|
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);
|
14363
14432
|
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);
|
14364
14433
|
const handleTo = () => {
|
@@ -14394,29 +14463,27 @@ const AniLinkPopup$1 = (_a) => {
|
|
14394
14463
|
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;
|
14395
14464
|
const onClose = (event) => {
|
14396
14465
|
event.stopPropagation();
|
14397
|
-
|
14466
|
+
setVisible(false);
|
14398
14467
|
};
|
14399
14468
|
useEffect(() => {
|
14400
|
-
|
14401
|
-
|
14402
|
-
}
|
14403
|
-
}, [isOnScreen]);
|
14469
|
+
setVisible(true);
|
14470
|
+
}, [isActive]);
|
14404
14471
|
const aniNamStyle = useMemo(() => {
|
14405
|
-
if (!
|
14472
|
+
if (!isActive)
|
14406
14473
|
return null;
|
14407
|
-
return
|
14408
|
-
}, [
|
14474
|
+
return visible ? styles['animated-fadeIn'] : null;
|
14475
|
+
}, [isActive, visible]);
|
14409
14476
|
return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
|
14410
14477
|
height: '40px',
|
14411
14478
|
lineHeight: '40px',
|
14412
14479
|
paddingLeft: '6px'
|
14413
|
-
} }, "Cta Title")) : (React.createElement("div", Object.assign({
|
14480
|
+
} }, "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 }),
|
14414
14481
|
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 } },
|
14415
14482
|
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'] })),
|
14416
14483
|
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 }),
|
14417
|
-
|
14484
|
+
(!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: {
|
14418
14485
|
__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)
|
14419
|
-
} }),
|
14486
|
+
} })),
|
14420
14487
|
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: {
|
14421
14488
|
__html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
14422
14489
|
} })))));
|
@@ -14571,52 +14638,71 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
14571
14638
|
const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
14572
14639
|
const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
14573
14640
|
const LikeButton = (_a) => {
|
14641
|
+
var _b;
|
14574
14642
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
14575
|
-
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
14576
|
-
const [state, setState] = useState(
|
14643
|
+
const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
|
14644
|
+
const [state, setState] = useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
|
14577
14645
|
const likeIcon = useIconLink(defaultLikeIconPath$1);
|
14578
14646
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
|
14579
14647
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
14580
|
-
var
|
14648
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
14581
14649
|
if (state) {
|
14582
14650
|
// 先设置状态
|
14583
14651
|
setState(false);
|
14584
|
-
const result = (
|
14652
|
+
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;
|
14585
14653
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14586
14654
|
eventInfo: {
|
14587
14655
|
eventSubject: 'favoriteContentCanceled',
|
14588
14656
|
eventDescription: 'This content was unfavorite by the user',
|
14589
|
-
contentId: (
|
14590
|
-
contentName: (
|
14591
|
-
contentTags: JSON.stringify((
|
14657
|
+
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 : '',
|
14658
|
+
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 : '',
|
14659
|
+
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 : []),
|
14592
14660
|
position: position + '',
|
14593
|
-
contentFormat: ((
|
14594
|
-
traceInfo: (
|
14661
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
14662
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
14595
14663
|
}
|
14596
14664
|
});
|
14597
14665
|
// 如果接口调用失败,则回滚状态
|
14598
14666
|
if (!result) {
|
14599
14667
|
setState(true);
|
14600
14668
|
}
|
14669
|
+
else {
|
14670
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
14671
|
+
if (index === position) {
|
14672
|
+
item.isCollected = false;
|
14673
|
+
}
|
14674
|
+
return item;
|
14675
|
+
})) !== null && _p !== void 0 ? _p : [];
|
14676
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
14677
|
+
}
|
14601
14678
|
}
|
14602
14679
|
else {
|
14603
14680
|
setState(true);
|
14604
|
-
const result = (
|
14681
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
14605
14682
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14606
14683
|
eventInfo: {
|
14607
14684
|
eventSubject: 'favoriteContent',
|
14608
14685
|
eventDescription: 'This content was favorite by the user',
|
14609
|
-
contentId: (
|
14610
|
-
contentName: (
|
14611
|
-
contentTags: JSON.stringify((
|
14686
|
+
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 : '',
|
14687
|
+
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 : '',
|
14688
|
+
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 : []),
|
14612
14689
|
position: position + '',
|
14613
|
-
contentFormat: ((
|
14614
|
-
traceInfo: (
|
14690
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
14691
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
14615
14692
|
}
|
14616
14693
|
});
|
14617
14694
|
if (!result) {
|
14618
14695
|
setState(false);
|
14619
14696
|
}
|
14697
|
+
else {
|
14698
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
14699
|
+
if (index === position) {
|
14700
|
+
item.isCollected = true;
|
14701
|
+
}
|
14702
|
+
return item;
|
14703
|
+
})) !== null && _z !== void 0 ? _z : [];
|
14704
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
14705
|
+
}
|
14620
14706
|
}
|
14621
14707
|
}), 200);
|
14622
14708
|
return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
@@ -15145,7 +15231,7 @@ var PictureGroup$3 = memo(PictureGroup$2);
|
|
15145
15231
|
* @Author: binruan@chatlabs.com
|
15146
15232
|
* @Date: 2024-01-15 19:03:09
|
15147
15233
|
* @LastEditors: binruan@chatlabs.com
|
15148
|
-
* @LastEditTime: 2024-07-
|
15234
|
+
* @LastEditTime: 2024-07-25 18:14:29
|
15149
15235
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
|
15150
15236
|
*
|
15151
15237
|
*/
|
@@ -15182,7 +15268,6 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
|
|
15182
15268
|
}
|
15183
15269
|
return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
|
15184
15270
|
}, [isShowMore, tags]);
|
15185
|
-
console.log(hashTagStyle, '111');
|
15186
15271
|
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` } },
|
15187
15272
|
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) },
|
15188
15273
|
React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
|
@@ -15253,27 +15338,35 @@ function withBindDataSource(Component) {
|
|
15253
15338
|
* @Author: binruan@chatlabs.com
|
15254
15339
|
* @Date: 2023-12-26 16:11:34
|
15255
15340
|
* @LastEditors: binruan@chatlabs.com
|
15256
|
-
* @LastEditTime: 2024-07-
|
15341
|
+
* @LastEditTime: 2024-07-29 10:07:08
|
15257
15342
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
15258
15343
|
*
|
15259
15344
|
*/
|
15260
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
15345
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
|
15346
|
+
var _a, _b, _c, _d, _e;
|
15261
15347
|
const { schema } = useEditor();
|
15348
|
+
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
15349
|
+
return null;
|
15350
|
+
let cta = null;
|
15351
|
+
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) {
|
15352
|
+
cta = '多商品CTA';
|
15353
|
+
}
|
15354
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
15355
|
+
cta = '商品CTA';
|
15356
|
+
}
|
15357
|
+
else {
|
15358
|
+
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;
|
15359
|
+
}
|
15360
|
+
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
15262
15361
|
const renderComp = useMemo(() => {
|
15263
15362
|
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;
|
15264
15363
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
15265
15364
|
return null;
|
15266
|
-
|
15267
|
-
if ((
|
15268
|
-
cta = '多商品CTA';
|
15269
|
-
}
|
15270
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
15271
|
-
cta = '商品CTA';
|
15272
|
-
}
|
15365
|
+
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) ;
|
15366
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) ;
|
15273
15367
|
else {
|
15274
|
-
|
15368
|
+
(_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;
|
15275
15369
|
}
|
15276
|
-
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
15277
15370
|
//如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
|
15278
15371
|
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)))
|
15279
15372
|
return;
|
@@ -15294,12 +15387,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
|
15294
15387
|
const Component = withBindDataSource(t);
|
15295
15388
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
15296
15389
|
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';
|
15297
|
-
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 })));
|
15390
|
+
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 })));
|
15298
15391
|
}
|
15299
15392
|
else {
|
15300
15393
|
return null;
|
15301
15394
|
}
|
15302
|
-
}, [rec, resolver, tempMap, schema]);
|
15395
|
+
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
|
15303
15396
|
return React.createElement(React.Fragment, null, renderComp);
|
15304
15397
|
};
|
15305
15398
|
var RenderCard$1 = memo(RenderCard);
|
@@ -15387,7 +15480,7 @@ var Tagbar$1 = memo(Tagbar);
|
|
15387
15480
|
* @Author: binruan@chatlabs.com
|
15388
15481
|
* @Date: 2024-01-15 19:03:09
|
15389
15482
|
* @LastEditors: binruan@chatlabs.com
|
15390
|
-
* @LastEditTime: 2024-07-
|
15483
|
+
* @LastEditTime: 2024-07-29 10:02:52
|
15391
15484
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
15392
15485
|
*
|
15393
15486
|
*/
|
@@ -15605,7 +15698,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15605
15698
|
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 }),
|
15606
15699
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
15607
15700
|
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 }))),
|
15608
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'] })));
|
15701
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
15609
15702
|
}
|
15610
15703
|
return null;
|
15611
15704
|
}, [
|
@@ -15660,11 +15753,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15660
15753
|
};
|
15661
15754
|
const handleSlideSkip = (item, position) => {
|
15662
15755
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
15663
|
-
if (isPreview)
|
15756
|
+
if (isPreview || waterFallData)
|
15664
15757
|
return;
|
15665
15758
|
const t = new Date() - curTime.current;
|
15666
15759
|
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) {
|
15667
|
-
const link = ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.
|
15760
|
+
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);
|
15668
15761
|
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]);
|
15669
15762
|
if (link) {
|
15670
15763
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
@@ -16209,19 +16302,18 @@ var index$1 = memo(DiyPortalPreview);
|
|
16209
16302
|
* @Author: binruan@chatlabs.com
|
16210
16303
|
* @Date: 2023-10-31 10:56:01
|
16211
16304
|
* @LastEditors: binruan@chatlabs.com
|
16212
|
-
* @LastEditTime: 2024-07-
|
16305
|
+
* @LastEditTime: 2024-07-29 18:06:11
|
16213
16306
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
16214
16307
|
*
|
16215
16308
|
*/
|
16216
16309
|
const Popup = () => {
|
16217
16310
|
const { schema, resolver, popup } = useEditor();
|
16218
|
-
const { setPopupDetailData, popupDetailData,
|
16311
|
+
const { setPopupDetailData, popupDetailData, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
16219
16312
|
const { productView } = useEventReport();
|
16220
16313
|
const [visible, setVisible] = useState();
|
16221
|
-
const curTimeRef = useRef(null);
|
16222
16314
|
useEffect(() => {
|
16223
16315
|
const initTime = () => {
|
16224
|
-
|
16316
|
+
popupCurTimeRef.current = new Date();
|
16225
16317
|
};
|
16226
16318
|
initTime();
|
16227
16319
|
window.addEventListener('pageshow', initTime);
|
@@ -16231,25 +16323,37 @@ const Popup = () => {
|
|
16231
16323
|
}, []);
|
16232
16324
|
useEffect(() => {
|
16233
16325
|
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
16234
|
-
|
16326
|
+
popupCurTimeRef.current = new Date();
|
16235
16327
|
setVisible(popup);
|
16236
16328
|
}
|
16237
16329
|
}, [popup]);
|
16238
16330
|
const handleClose = () => {
|
16239
|
-
var _a, _b, _c, _d;
|
16240
|
-
if (!popup ||
|
16331
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
16332
|
+
if (!popup ||
|
16333
|
+
(popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
|
16334
|
+
!visible ||
|
16335
|
+
new Date() - popupCurTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
|
16241
16336
|
return;
|
16242
16337
|
}
|
16243
16338
|
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
16244
|
-
const
|
16245
|
-
|
16246
|
-
|
16247
|
-
|
16248
|
-
|
16339
|
+
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));
|
16340
|
+
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') {
|
16341
|
+
const data = popupDetailData;
|
16342
|
+
let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
|
16343
|
+
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;
|
16344
|
+
if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
|
16345
|
+
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];
|
16346
|
+
product = p;
|
16347
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
16348
|
+
}
|
16349
|
+
if (product && cta) {
|
16350
|
+
productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
16351
|
+
}
|
16249
16352
|
}
|
16250
16353
|
setTimeout(() => {
|
16251
16354
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
16252
16355
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
16356
|
+
checkCommodityIndexRef.current = -1;
|
16253
16357
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
16254
16358
|
};
|
16255
16359
|
const renderPopupDetail = useMemo(() => {
|
@@ -16262,7 +16366,7 @@ const Popup = () => {
|
|
16262
16366
|
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';
|
16263
16367
|
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';
|
16264
16368
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
16265
|
-
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 })));
|
16369
|
+
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 })));
|
16266
16370
|
}
|
16267
16371
|
else {
|
16268
16372
|
return React.createElement(React.Fragment, null);
|