pb-sxp-ui 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +231 -151
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.js +231 -151
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +231 -151
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/LikeButton/index.js +34 -15
- package/es/core/components/SxpPageRender/Popup/index.js +23 -12
- package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/es/core/components/SxpPageRender/RenderCard.js +3 -3
- package/es/core/components/SxpPageRender/index.js +2 -2
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -3
- package/es/core/context/SxpDataSourceProvider.js +7 -3
- package/es/materials/sxp/cta/AniLink/index.js +2 -1
- package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
- package/es/materials/sxp/cta/AniLinkPopup/index.js +11 -20
- package/es/materials/sxp/popup/CommodityDetail/index.js +25 -13
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
- package/es/materials/sxp/popup/CommodityList/index.js +28 -10
- package/es/materials/sxp/popup/CommodityList/material.js +1 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +5 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +3 -3
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
- package/es/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
- package/es/materials/sxp/template/components/CommodityGroup.js +12 -15
- package/es/materials/sxp/template/components/Img.d.ts +1 -0
- package/es/materials/sxp/template/components/Img.js +3 -3
- package/es/materials/sxp/template/components/Scroll.d.ts +1 -0
- package/es/materials/sxp/template/components/Scroll.js +5 -4
- package/lib/core/components/SxpPageRender/LikeButton/index.js +34 -15
- package/lib/core/components/SxpPageRender/Popup/index.js +22 -11
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +3 -3
- package/lib/core/components/SxpPageRender/index.js +2 -2
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -3
- package/lib/core/context/SxpDataSourceProvider.js +7 -3
- package/lib/materials/sxp/cta/AniLink/index.js +2 -1
- package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +10 -19
- package/lib/materials/sxp/popup/CommodityDetail/index.js +24 -12
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
- package/lib/materials/sxp/popup/CommodityList/index.js +27 -9
- package/lib/materials/sxp/popup/CommodityList/material.js +1 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +5 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +3 -3
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
- package/lib/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
- package/lib/materials/sxp/template/components/CommodityGroup.js +11 -14
- package/lib/materials/sxp/template/components/Img.d.ts +1 -0
- package/lib/materials/sxp/template/components/Img.js +3 -3
- package/lib/materials/sxp/template/components/Scroll.d.ts +1 -0
- package/lib/materials/sxp/template/components/Scroll.js +5 -4
- package/package.json +1 -1
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
|
*/
|
@@ -8849,56 +8853,71 @@ const FormatImage = React.forwardRef((props, ref) => {
|
|
8849
8853
|
});
|
8850
8854
|
var FormatImage$1 = React.memo(FormatImage);
|
8851
8855
|
|
8852
|
-
|
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 }) => {
|
8853
8865
|
const ref = React.useRef();
|
8854
8866
|
const { popupDetailData } = useSxpDataSource();
|
8855
8867
|
React.useEffect(() => {
|
8856
|
-
var _a;
|
8857
|
-
|
8858
|
-
|
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]);
|
8859
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));
|
8860
8873
|
};
|
8861
8874
|
var Scroll$1 = React.memo(Scroll);
|
8862
8875
|
|
8863
|
-
const CommodityGroup = ({ products, data, defImg, style }) => {
|
8864
|
-
var _a
|
8865
|
-
|
8866
|
-
const [check, setCheck] = React.useState((_a = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _a !== void 0 ? _a : 0);
|
8867
|
-
const handleClick = React.useCallback((index) => {
|
8868
|
-
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 })));
|
8869
|
-
}, []);
|
8870
|
-
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) => {
|
8871
8879
|
var _a, _b, _c;
|
8872
|
-
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({
|
8873
8881
|
width: '50px',
|
8874
8882
|
height: '50px',
|
8875
8883
|
marginRight: '10px'
|
8876
|
-
}), onClick: () =>
|
8884
|
+
}), onClick: () => {
|
8885
|
+
onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
|
8886
|
+
}, key: index },
|
8877
8887
|
React.createElement(FormatImage$1, { style: {
|
8878
8888
|
height: '100%',
|
8879
8889
|
width: '100%',
|
8880
8890
|
objectFit: 'cover',
|
8881
8891
|
display: 'block',
|
8882
|
-
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ?
|
8883
|
-
border: check === index ? '1px solid #000' : '1px solid #f2f2f2'
|
8884
|
-
|
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));
|
8885
8896
|
})))));
|
8886
8897
|
};
|
8887
8898
|
var CommodityGroup$1 = React.memo(CommodityGroup);
|
8888
8899
|
|
8889
8900
|
const CommodityDetail$1 = (_a) => {
|
8890
|
-
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;
|
8891
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"]);
|
8892
|
-
const { sxpParameter } = useSxpDataSource();
|
8893
|
-
|
8903
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = useSxpDataSource();
|
8904
|
+
useEditor();
|
8894
8905
|
const { jumpToWeb, productView } = useEventReport();
|
8895
8906
|
const curTimeRef = React.useRef(null);
|
8896
8907
|
const [showModal, setShowModal] = React.useState(false);
|
8897
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);
|
8898
8910
|
const data = isPost ? rec : popupDetailData;
|
8899
|
-
|
8900
|
-
|
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;
|
8901
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
|
+
}
|
8902
8921
|
const handleLink = () => {
|
8903
8922
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
8904
8923
|
jumpToWeb(data, product, cta, position);
|
@@ -8936,7 +8955,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8936
8955
|
return '$7,000';
|
8937
8956
|
}
|
8938
8957
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8939
|
-
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;
|
8940
8959
|
const renderContent = ({ isPost }) => {
|
8941
8960
|
var _a, _b, _c;
|
8942
8961
|
return (React.createElement("div", null,
|
@@ -8969,15 +8988,19 @@ const CommodityDetail$1 = (_a) => {
|
|
8969
8988
|
}
|
8970
8989
|
return style;
|
8971
8990
|
}, []);
|
8991
|
+
const handleClick = React.useCallback((index) => {
|
8992
|
+
popupCurTimeRef.current = new Date();
|
8993
|
+
setCheckCommodityIndex(index);
|
8994
|
+
}, []);
|
8972
8995
|
const renderCommodityGroup = React.useCallback(() => {
|
8973
8996
|
var _a, _b, _c;
|
8974
8997
|
if (isPost)
|
8975
8998
|
return;
|
8976
|
-
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' } }));
|
8977
|
-
}, []);
|
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]);
|
8978
9001
|
return (React.createElement(React.Fragment, null,
|
8979
9002
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8980
|
-
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' } },
|
8981
9004
|
React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8982
9005
|
clickable: true,
|
8983
9006
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -8987,7 +9010,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8987
9010
|
}, loop: true, autoplay: {
|
8988
9011
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8989
9012
|
} },
|
8990
|
-
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) => {
|
8991
9014
|
return (React.createElement(SwiperSlide, { key: src },
|
8992
9015
|
React.createElement("div", { style: {
|
8993
9016
|
overflow: 'hidden',
|
@@ -9002,7 +9025,7 @@ const CommodityDetail$1 = (_a) => {
|
|
9002
9025
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
9003
9026
|
}, src: src }))));
|
9004
9027
|
}))))),
|
9005
|
-
!((
|
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({
|
9006
9029
|
position: 'relative',
|
9007
9030
|
height: 0,
|
9008
9031
|
width: '100%',
|
@@ -9015,7 +9038,7 @@ const CommodityDetail$1 = (_a) => {
|
|
9015
9038
|
top: 0,
|
9016
9039
|
objectFit: 'cover',
|
9017
9040
|
width: '100%'
|
9018
|
-
}), src: (
|
9041
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
9019
9042
|
renderCommodityGroup(),
|
9020
9043
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
9021
9044
|
renderBtn(),
|
@@ -9584,21 +9607,28 @@ var settingRender$6 = [
|
|
9584
9607
|
];
|
9585
9608
|
|
9586
9609
|
const CommodityDetailDiroNew$1 = (_a) => {
|
9587
|
-
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;
|
9588
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"]);
|
9589
9612
|
React.useState(true);
|
9590
|
-
const { sxpParameter } = useSxpDataSource();
|
9591
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
9613
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport } = useSxpDataSource();
|
9592
9614
|
const { jumpToWeb, productView } = useEventReport();
|
9593
9615
|
React.useState(false);
|
9594
9616
|
React.useState(false);
|
9595
9617
|
React.useState(true);
|
9596
9618
|
const [showModal, setShowModal] = React.useState(false);
|
9597
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);
|
9598
9621
|
const data = isPost ? rec : popupDetailData;
|
9599
|
-
|
9600
|
-
|
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;
|
9601
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
|
+
}
|
9602
9632
|
const handleLink = () => {
|
9603
9633
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
9604
9634
|
jumpToWeb(data, product, cta, position);
|
@@ -9636,7 +9666,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
9636
9666
|
return '£102,300.00';
|
9637
9667
|
}
|
9638
9668
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
9639
|
-
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;
|
9640
9670
|
// useEffect(() => {
|
9641
9671
|
// console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
|
9642
9672
|
// if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
|
@@ -9699,15 +9729,19 @@ Made in Italy` })));
|
|
9699
9729
|
}
|
9700
9730
|
return style;
|
9701
9731
|
}, []);
|
9732
|
+
const handleClick = React.useCallback((index) => {
|
9733
|
+
popupCurTimeRef.current = new Date();
|
9734
|
+
setCheckCommodityIndex(index);
|
9735
|
+
}, []);
|
9702
9736
|
const renderCommodityGroup = React.useCallback(() => {
|
9703
9737
|
var _a, _b, _c;
|
9704
9738
|
if (isPost)
|
9705
9739
|
return;
|
9706
|
-
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' } }));
|
9707
|
-
}, []);
|
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]);
|
9708
9742
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
9709
|
-
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
9710
|
-
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: {
|
9711
9745
|
clickable: true,
|
9712
9746
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
9713
9747
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -9715,7 +9749,7 @@ Made in Italy` })));
|
|
9715
9749
|
: 'commondityDiroNew-swiper-clickable-center'
|
9716
9750
|
}, loop: true, autoplay: {
|
9717
9751
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
9718
|
-
} }, (
|
9752
|
+
} }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
9719
9753
|
return (React.createElement(SwiperSlide, { key: src },
|
9720
9754
|
React.createElement("div", { style: {
|
9721
9755
|
overflow: 'hidden',
|
@@ -9730,7 +9764,7 @@ Made in Italy` })));
|
|
9730
9764
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
9731
9765
|
}, src: src }))));
|
9732
9766
|
}))),
|
9733
|
-
!((
|
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({
|
9734
9768
|
position: 'relative',
|
9735
9769
|
height: 0,
|
9736
9770
|
width: '100%',
|
@@ -9743,13 +9777,13 @@ Made in Italy` })));
|
|
9743
9777
|
top: 0,
|
9744
9778
|
objectFit: 'cover',
|
9745
9779
|
width: '100%'
|
9746
|
-
}), src: (
|
9780
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
9747
9781
|
renderCommodityGroup(),
|
9748
9782
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
9749
9783
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
9750
9784
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
9751
9785
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
|
9752
|
-
__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)
|
9753
9787
|
} }),
|
9754
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: {
|
9755
9789
|
__html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -9759,11 +9793,11 @@ Made in Italy` })));
|
|
9759
9793
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
9760
9794
|
} }),
|
9761
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: {
|
9762
|
-
__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)
|
9763
9797
|
} }))),
|
9764
|
-
(!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 },
|
9765
9799
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
9766
|
-
__html: setFontForText((
|
9800
|
+
__html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
|
9767
9801
|
} }))),
|
9768
9802
|
productInfoText({ isPost }))),
|
9769
9803
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
@@ -10009,6 +10043,11 @@ var settingRender$5 = [
|
|
10009
10043
|
type: 'Group',
|
10010
10044
|
label: '尺寸',
|
10011
10045
|
child: [
|
10046
|
+
{
|
10047
|
+
type: 'Number',
|
10048
|
+
name: ['props', 'buttonStyle', 'width'],
|
10049
|
+
addonAfter: 'W'
|
10050
|
+
},
|
10012
10051
|
{
|
10013
10052
|
type: 'Number',
|
10014
10053
|
name: ['props', 'buttonStyle', 'height'],
|
@@ -10117,18 +10156,18 @@ function useOnScreen(ref) {
|
|
10117
10156
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10118
10157
|
*
|
10119
10158
|
*/
|
10120
|
-
const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
10159
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
|
10121
10160
|
const ref = React.useRef(null);
|
10122
10161
|
const isOnScreen = useOnScreen(ref);
|
10123
10162
|
const { ctaEvent } = useSxpDataSource();
|
10124
10163
|
React.useEffect(() => {
|
10125
|
-
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) {
|
10126
10165
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10127
10166
|
eventSubject: 'ctaExposure',
|
10128
10167
|
eventDescription: 'The cta was shown to the user'
|
10129
10168
|
}, rec, item, index);
|
10130
10169
|
}
|
10131
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
10170
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
|
10132
10171
|
React.useMemo(() => {
|
10133
10172
|
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
|
10134
10173
|
}, [src]);
|
@@ -10138,41 +10177,12 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
|
10138
10177
|
};
|
10139
10178
|
var Img$1 = React.memo(Img);
|
10140
10179
|
|
10141
|
-
const EventProvider = (_a) => {
|
10142
|
-
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
10143
|
-
const ref = React.useRef(null);
|
10144
|
-
const { popup } = useEditor();
|
10145
|
-
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10146
|
-
const { jumpToWeb } = useEventReport();
|
10147
|
-
const handleClick = lodash.throttle(() => {
|
10148
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
10149
|
-
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;
|
10150
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10151
|
-
eventSubject: 'clickCta',
|
10152
|
-
eventDescription: 'User clicked the CTA'
|
10153
|
-
}, rec, item, index);
|
10154
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
10155
|
-
if (isExternalLink) {
|
10156
|
-
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) {
|
10157
|
-
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
10158
|
-
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
10159
|
-
jumpToWeb(rec, product, cta, index);
|
10160
|
-
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);
|
10161
|
-
}
|
10162
|
-
}
|
10163
|
-
else {
|
10164
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10165
|
-
}
|
10166
|
-
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10167
|
-
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
10168
|
-
};
|
10169
|
-
var EventProvider$1 = React.memo(EventProvider);
|
10170
|
-
|
10171
10180
|
const CommodityList$1 = (_a) => {
|
10172
10181
|
var _b, _c;
|
10173
|
-
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"]);
|
10174
|
-
const { sxpParameter } = useSxpDataSource();
|
10175
|
-
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();
|
10176
10186
|
const recData = isPost ? rec : popupDetailData;
|
10177
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];
|
10178
10188
|
const priceText = React.useCallback((product) => {
|
@@ -10186,12 +10196,28 @@ const CommodityList$1 = (_a) => {
|
|
10186
10196
|
return '$7,000';
|
10187
10197
|
}
|
10188
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);
|
10189
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) => {
|
10190
10216
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10191
|
-
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({
|
10192
10218
|
display: 'flex'
|
10193
|
-
}) }),
|
10194
|
-
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 }),
|
10195
10221
|
React.createElement("div", { style: {
|
10196
10222
|
flex: 1,
|
10197
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)`,
|
@@ -10216,9 +10242,9 @@ const CommodityList$1 = (_a) => {
|
|
10216
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: {
|
10217
10243
|
__html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
10218
10244
|
} }),
|
10219
|
-
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: {
|
10220
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)
|
10221
|
-
} })))));
|
10247
|
+
} })))))));
|
10222
10248
|
})));
|
10223
10249
|
};
|
10224
10250
|
var CommodityListComponent = React.memo(CommodityList$1);
|
@@ -10255,7 +10281,7 @@ var interactionRender$9 = [
|
|
10255
10281
|
* @Author: binruan@chatlabs.com
|
10256
10282
|
* @Date: 2024-03-20 10:27:31
|
10257
10283
|
* @LastEditors: binruan@chatlabs.com
|
10258
|
-
* @LastEditTime: 2024-07-
|
10284
|
+
* @LastEditTime: 2024-07-26 17:33:03
|
10259
10285
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\material.tsx
|
10260
10286
|
*
|
10261
10287
|
*/
|
@@ -10294,6 +10320,7 @@ const CommodityList = createMaterial(CommodityListComponent, {
|
|
10294
10320
|
backgroundColor: '#000',
|
10295
10321
|
fontSize: 12,
|
10296
10322
|
height: 30,
|
10323
|
+
width: 100,
|
10297
10324
|
textAlign: 'center',
|
10298
10325
|
color: '#fff',
|
10299
10326
|
lineHeight: 2.5
|
@@ -10577,6 +10604,36 @@ var interactionRender$8 = [
|
|
10577
10604
|
}
|
10578
10605
|
];
|
10579
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
|
+
|
10580
10637
|
var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
10581
10638
|
|
10582
10639
|
const Commodity$1 = (_a) => {
|
@@ -11147,12 +11204,12 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
11147
11204
|
const { popup } = useEditor();
|
11148
11205
|
const { jumpToWeb } = useEventReport();
|
11149
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]);
|
11150
|
-
const handleClick = lodash.throttle((item) => {
|
11207
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
11151
11208
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11152
11209
|
eventSubject: 'clickCta',
|
11153
11210
|
eventDescription: 'User clicked the CTA'
|
11154
11211
|
}, recData, item, index);
|
11155
|
-
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 }));
|
11156
11213
|
if (isExternalLink) {
|
11157
11214
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11158
11215
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11165,7 +11222,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
11165
11222
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11166
11223
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11167
11224
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
11168
|
-
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) }),
|
11169
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 }),
|
11170
11227
|
React.createElement("div", { className: css.css({
|
11171
11228
|
color: '#000',
|
@@ -11263,12 +11320,12 @@ const MultiCommodity$1 = (_a) => {
|
|
11263
11320
|
const { popup } = useEditor();
|
11264
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]);
|
11265
11322
|
const { jumpToWeb } = useEventReport();
|
11266
|
-
const handleClick = lodash.throttle((item) => {
|
11323
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
11267
11324
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11268
11325
|
eventSubject: 'clickCta',
|
11269
11326
|
eventDescription: 'User clicked the CTA'
|
11270
11327
|
}, recData, item, index);
|
11271
|
-
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 }));
|
11272
11329
|
if (isExternalLink) {
|
11273
11330
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11274
11331
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11281,7 +11338,7 @@ const MultiCommodity$1 = (_a) => {
|
|
11281
11338
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11282
11339
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11283
11340
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
11284
|
-
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) }),
|
11285
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 }),
|
11286
11343
|
React.createElement("div", { className: css.css({
|
11287
11344
|
color: '#fff',
|
@@ -13997,11 +14054,12 @@ const AniLink$1 = (_a) => {
|
|
13997
14054
|
}
|
13998
14055
|
}, [event === null || event === void 0 ? void 0 : event.animation]);
|
13999
14056
|
React.useEffect(() => {
|
14057
|
+
var _a, _b, _c;
|
14000
14058
|
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
14001
14059
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
14002
14060
|
eventSubject: 'ctaExposure',
|
14003
14061
|
eventDescription: 'The cta was shown to the user'
|
14004
|
-
}, 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);
|
14005
14063
|
}
|
14006
14064
|
}, [isOnScreen]);
|
14007
14065
|
React.useEffect(() => {
|
@@ -14387,14 +14445,11 @@ var styles = {"aniLinkPopup":"index-module_aniLinkPopup__YT7kj","animated-fadeIn
|
|
14387
14445
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
14388
14446
|
const AniLinkPopup$1 = (_a) => {
|
14389
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;
|
14390
|
-
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"]);
|
14391
14449
|
style === null || style === void 0 ? true : delete style.transform;
|
14392
14450
|
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
14393
14451
|
const { jumpToWeb } = useEventReport();
|
14394
|
-
const
|
14395
|
-
const isOnScreen = useOnScreen(ref);
|
14396
|
-
const [visible, setVisible] = React.useState(false);
|
14397
|
-
const [startAni, setStartAni] = React.useState(true);
|
14452
|
+
const [visible, setVisible] = React.useState(true);
|
14398
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);
|
14399
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);
|
14400
14455
|
const handleTo = () => {
|
@@ -14430,26 +14485,21 @@ const AniLinkPopup$1 = (_a) => {
|
|
14430
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;
|
14431
14486
|
const onClose = (event) => {
|
14432
14487
|
event.stopPropagation();
|
14433
|
-
|
14488
|
+
setVisible(false);
|
14434
14489
|
};
|
14435
14490
|
React.useEffect(() => {
|
14436
|
-
|
14437
|
-
|
14438
|
-
}
|
14439
|
-
else {
|
14440
|
-
setVisible(false);
|
14441
|
-
}
|
14442
|
-
}, [isOnScreen]);
|
14491
|
+
setVisible(true);
|
14492
|
+
}, [isActive]);
|
14443
14493
|
const aniNamStyle = React.useMemo(() => {
|
14444
|
-
if (!
|
14494
|
+
if (!isActive)
|
14445
14495
|
return null;
|
14446
|
-
return
|
14447
|
-
}, [
|
14496
|
+
return visible ? styles['animated-fadeIn'] : null;
|
14497
|
+
}, [isActive, visible]);
|
14448
14498
|
return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
|
14449
14499
|
height: '40px',
|
14450
14500
|
lineHeight: '40px',
|
14451
14501
|
paddingLeft: '6px'
|
14452
|
-
} }, "Cta Title")) : (React.createElement(
|
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 }),
|
14453
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 } },
|
14454
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'] })),
|
14455
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 }),
|
@@ -14458,7 +14508,7 @@ const AniLinkPopup$1 = (_a) => {
|
|
14458
14508
|
} })),
|
14459
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: {
|
14460
14510
|
__html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
14461
|
-
} })))
|
14511
|
+
} })))));
|
14462
14512
|
};
|
14463
14513
|
var AniLinkPopupComponent = React.memo(AniLinkPopup$1);
|
14464
14514
|
|
@@ -14610,52 +14660,71 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
14610
14660
|
const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
14611
14661
|
const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
14612
14662
|
const LikeButton = (_a) => {
|
14663
|
+
var _b;
|
14613
14664
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
14614
|
-
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
14615
|
-
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);
|
14616
14667
|
const likeIcon = useIconLink(defaultLikeIconPath$1);
|
14617
14668
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
|
14618
14669
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
14619
|
-
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;
|
14620
14671
|
if (state) {
|
14621
14672
|
// 先设置状态
|
14622
14673
|
setState(false);
|
14623
|
-
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;
|
14624
14675
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14625
14676
|
eventInfo: {
|
14626
14677
|
eventSubject: 'favoriteContentCanceled',
|
14627
14678
|
eventDescription: 'This content was unfavorite by the user',
|
14628
|
-
contentId: (
|
14629
|
-
contentName: (
|
14630
|
-
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 : []),
|
14631
14682
|
position: position + '',
|
14632
|
-
contentFormat: ((
|
14633
|
-
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
|
14634
14685
|
}
|
14635
14686
|
});
|
14636
14687
|
// 如果接口调用失败,则回滚状态
|
14637
14688
|
if (!result) {
|
14638
14689
|
setState(true);
|
14639
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
|
+
}
|
14640
14700
|
}
|
14641
14701
|
else {
|
14642
14702
|
setState(true);
|
14643
|
-
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;
|
14644
14704
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14645
14705
|
eventInfo: {
|
14646
14706
|
eventSubject: 'favoriteContent',
|
14647
14707
|
eventDescription: 'This content was favorite by the user',
|
14648
|
-
contentId: (
|
14649
|
-
contentName: (
|
14650
|
-
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 : []),
|
14651
14711
|
position: position + '',
|
14652
|
-
contentFormat: ((
|
14653
|
-
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
|
14654
14714
|
}
|
14655
14715
|
});
|
14656
14716
|
if (!result) {
|
14657
14717
|
setState(false);
|
14658
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
|
+
}
|
14659
14728
|
}
|
14660
14729
|
}), 200);
|
14661
14730
|
return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
@@ -15291,11 +15360,11 @@ function withBindDataSource(Component) {
|
|
15291
15360
|
* @Author: binruan@chatlabs.com
|
15292
15361
|
* @Date: 2023-12-26 16:11:34
|
15293
15362
|
* @LastEditors: binruan@chatlabs.com
|
15294
|
-
* @LastEditTime: 2024-07-
|
15363
|
+
* @LastEditTime: 2024-07-29 10:07:08
|
15295
15364
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
15296
15365
|
*
|
15297
15366
|
*/
|
15298
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
15367
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
|
15299
15368
|
var _a, _b, _c, _d, _e;
|
15300
15369
|
const { schema } = useEditor();
|
15301
15370
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
@@ -15340,12 +15409,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
|
15340
15409
|
const Component = withBindDataSource(t);
|
15341
15410
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
15342
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';
|
15343
|
-
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 })));
|
15344
15413
|
}
|
15345
15414
|
else {
|
15346
15415
|
return null;
|
15347
15416
|
}
|
15348
|
-
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id]);
|
15417
|
+
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
|
15349
15418
|
return React.createElement(React.Fragment, null, renderComp);
|
15350
15419
|
};
|
15351
15420
|
var RenderCard$1 = React.memo(RenderCard);
|
@@ -15433,7 +15502,7 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
15433
15502
|
* @Author: binruan@chatlabs.com
|
15434
15503
|
* @Date: 2024-01-15 19:03:09
|
15435
15504
|
* @LastEditors: binruan@chatlabs.com
|
15436
|
-
* @LastEditTime: 2024-07-
|
15505
|
+
* @LastEditTime: 2024-07-29 10:02:52
|
15437
15506
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
15438
15507
|
*
|
15439
15508
|
*/
|
@@ -15651,7 +15720,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15651
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 }),
|
15652
15721
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
15653
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 }))),
|
15654
|
-
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 })));
|
15655
15724
|
}
|
15656
15725
|
return null;
|
15657
15726
|
}, [
|
@@ -15706,7 +15775,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15706
15775
|
};
|
15707
15776
|
const handleSlideSkip = (item, position) => {
|
15708
15777
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
15709
|
-
if (isPreview)
|
15778
|
+
if (isPreview || waterFallData)
|
15710
15779
|
return;
|
15711
15780
|
const t = new Date() - curTime.current;
|
15712
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) {
|
@@ -16255,19 +16324,18 @@ var index$1 = React.memo(DiyPortalPreview);
|
|
16255
16324
|
* @Author: binruan@chatlabs.com
|
16256
16325
|
* @Date: 2023-10-31 10:56:01
|
16257
16326
|
* @LastEditors: binruan@chatlabs.com
|
16258
|
-
* @LastEditTime: 2024-07-
|
16327
|
+
* @LastEditTime: 2024-07-29 18:06:11
|
16259
16328
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
16260
16329
|
*
|
16261
16330
|
*/
|
16262
16331
|
const Popup = () => {
|
16263
16332
|
const { schema, resolver, popup } = useEditor();
|
16264
|
-
const { setPopupDetailData, popupDetailData,
|
16333
|
+
const { setPopupDetailData, popupDetailData, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
16265
16334
|
const { productView } = useEventReport();
|
16266
16335
|
const [visible, setVisible] = React.useState();
|
16267
|
-
const curTimeRef = React.useRef(null);
|
16268
16336
|
React.useEffect(() => {
|
16269
16337
|
const initTime = () => {
|
16270
|
-
|
16338
|
+
popupCurTimeRef.current = new Date();
|
16271
16339
|
};
|
16272
16340
|
initTime();
|
16273
16341
|
window.addEventListener('pageshow', initTime);
|
@@ -16277,25 +16345,37 @@ const Popup = () => {
|
|
16277
16345
|
}, []);
|
16278
16346
|
React.useEffect(() => {
|
16279
16347
|
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
16280
|
-
|
16348
|
+
popupCurTimeRef.current = new Date();
|
16281
16349
|
setVisible(popup);
|
16282
16350
|
}
|
16283
16351
|
}, [popup]);
|
16284
16352
|
const handleClose = () => {
|
16285
|
-
var _a, _b, _c, _d;
|
16286
|
-
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)) {
|
16287
16358
|
return;
|
16288
16359
|
}
|
16289
16360
|
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
16290
|
-
const
|
16291
|
-
|
16292
|
-
|
16293
|
-
|
16294
|
-
|
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
|
+
}
|
16295
16374
|
}
|
16296
16375
|
setTimeout(() => {
|
16297
16376
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
16298
16377
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
16378
|
+
checkCommodityIndexRef.current = -1;
|
16299
16379
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
16300
16380
|
};
|
16301
16381
|
const renderPopupDetail = React.useMemo(() => {
|