pb-sxp-ui 1.2.4 → 1.2.6
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 +283 -175
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +11 -3
- package/dist/index.js +283 -175
- 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 +283 -175
- 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 +26 -13
- 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 +4 -4
- 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/core/hooks/useEventReport.js +4 -4
- 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.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +32 -15
- package/es/materials/sxp/popup/CommodityDetail/material.js +6 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +4 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +32 -18
- package/es/materials/sxp/popup/CommodityList/index.js +38 -20
- 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 +21 -14
- 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 +25 -12
- 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 +4 -4
- 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/core/hooks/useEventReport.js +4 -4
- 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.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +32 -15
- package/lib/materials/sxp/popup/CommodityDetail/material.js +6 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +4 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +32 -18
- package/lib/materials/sxp/popup/CommodityList/index.js +37 -19
- 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 +20 -13
- 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(-1);
|
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, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
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 =
|
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: (_1 = (_y = (_t = (_p = (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.bindCta) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : (_s = (_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.bindCta) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_x = (_w = (_v = (_u = rec === null || rec === void 0 ? void 0 : rec.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.product) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : '', fromKName, fromKPage: (_2 = location === null || location === void 0 ? void 0 : location.href) !== null && _2 !== void 0 ? _2 : '' })
|
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,
|
@@ -1285,14 +1289,14 @@ var settingRender$9 = [
|
|
1285
1289
|
* @Author: binruan@chatlabs.com
|
1286
1290
|
* @Date: 2024-03-12 10:59:06
|
1287
1291
|
* @LastEditors: binruan@chatlabs.com
|
1288
|
-
* @LastEditTime: 2024-
|
1292
|
+
* @LastEditTime: 2024-07-31 11:41:47
|
1289
1293
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1290
1294
|
*
|
1291
1295
|
*/
|
1292
1296
|
function useEventReport() {
|
1293
1297
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
1294
1298
|
const jumpToWeb = React.useCallback((data, product, cta, position) => {
|
1295
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1299
|
+
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;
|
1296
1300
|
let fromKName = '';
|
1297
1301
|
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
1298
1302
|
fromKName = 'pdpPage';
|
@@ -1323,12 +1327,12 @@ function useEventReport() {
|
|
1323
1327
|
position: position + '',
|
1324
1328
|
contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
1325
1329
|
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
1326
|
-
traceInfo: (_p =
|
1330
|
+
traceInfo: (_0 = (_x = (_v = (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProduct) === null || _q === void 0 ? void 0 : _q.traceInfo) !== null && _r !== void 0 ? _r : (_u = (_t = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = data === null || data === void 0 ? void 0 : data.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindCta) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : ''
|
1327
1331
|
}
|
1328
1332
|
});
|
1329
1333
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
1330
1334
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
1331
|
-
var _a, _b, _c, _d;
|
1335
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
1332
1336
|
let fromKName = '';
|
1333
1337
|
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
1334
1338
|
fromKName = 'pdpPage';
|
@@ -1348,7 +1352,7 @@ function useEventReport() {
|
|
1348
1352
|
position: position + '',
|
1349
1353
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1350
1354
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1351
|
-
traceInfo:
|
1355
|
+
traceInfo: (_o = (_l = (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.traceInfo) !== null && _g !== void 0 ? _g : (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_m = data === null || data === void 0 ? void 0 : data.product) === null || _m === void 0 ? void 0 : _m.traceInfo) !== null && _o !== void 0 ? _o : '',
|
1352
1356
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1353
1357
|
eventSubject: 'productView',
|
1354
1358
|
eventDescription: 'User browsed the product'
|
@@ -1624,6 +1628,10 @@ var settingRender$8 = [
|
|
1624
1628
|
{
|
1625
1629
|
label: '商品描述',
|
1626
1630
|
value: 'info'
|
1631
|
+
},
|
1632
|
+
{
|
1633
|
+
label: '税费说明',
|
1634
|
+
value: 'taxInfo'
|
1627
1635
|
}
|
1628
1636
|
],
|
1629
1637
|
name: ['props', 'commodityStyles', 'field'],
|
@@ -8605,7 +8613,7 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8605
8613
|
* @Author: binruan@chatlabs.com
|
8606
8614
|
* @Date: 2023-11-02 18:34:34
|
8607
8615
|
* @LastEditors: binruan@chatlabs.com
|
8608
|
-
* @LastEditTime: 2024-07-
|
8616
|
+
* @LastEditTime: 2024-07-29 16:20:40
|
8609
8617
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8610
8618
|
*
|
8611
8619
|
*/
|
@@ -8798,7 +8806,7 @@ var ExpandableText$1 = React.memo(ExpandableText);
|
|
8798
8806
|
* @Author: binruan@chatlabs.com
|
8799
8807
|
* @Date: 2024-03-20 10:27:31
|
8800
8808
|
* @LastEditors: binruan@chatlabs.com
|
8801
|
-
* @LastEditTime: 2024-
|
8809
|
+
* @LastEditTime: 2024-07-31 17:54:50
|
8802
8810
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
|
8803
8811
|
*
|
8804
8812
|
*/
|
@@ -8849,56 +8857,79 @@ const FormatImage = React.forwardRef((props, ref) => {
|
|
8849
8857
|
});
|
8850
8858
|
var FormatImage$1 = React.memo(FormatImage);
|
8851
8859
|
|
8852
|
-
|
8860
|
+
/*
|
8861
|
+
* @Author: binruan@chatlabs.com
|
8862
|
+
* @Date: 2024-03-20 10:27:32
|
8863
|
+
* @LastEditors: binruan@chatlabs.com
|
8864
|
+
* @LastEditTime: 2024-07-30 11:46:32
|
8865
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
|
8866
|
+
*
|
8867
|
+
*/
|
8868
|
+
const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
|
8853
8869
|
const ref = React.useRef();
|
8854
8870
|
const { popupDetailData } = useSxpDataSource();
|
8855
8871
|
React.useEffect(() => {
|
8856
|
-
var _a;
|
8857
|
-
|
8858
|
-
|
8872
|
+
var _a, _b;
|
8873
|
+
if (enableSlideActive)
|
8874
|
+
(_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);
|
8875
|
+
}, [popupDetailData, enableSlideActive]);
|
8859
8876
|
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
8877
|
};
|
8861
8878
|
var Scroll$1 = React.memo(Scroll);
|
8862
8879
|
|
8863
|
-
const CommodityGroup = ({ products, data, defImg, style }) => {
|
8864
|
-
var _a
|
8865
|
-
const {
|
8866
|
-
const
|
8867
|
-
const handleClick =
|
8868
|
-
|
8869
|
-
|
8870
|
-
|
8880
|
+
const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
|
8881
|
+
var _a;
|
8882
|
+
const { productView } = useEventReport();
|
8883
|
+
const { popupCurTimeRef } = useSxpDataSource();
|
8884
|
+
const handleClick = (item, index) => {
|
8885
|
+
if (check === index)
|
8886
|
+
return;
|
8887
|
+
productView(popupDetailData, item, item === null || item === void 0 ? void 0 : item.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
8888
|
+
onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
|
8889
|
+
};
|
8890
|
+
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
8891
|
var _a, _b, _c;
|
8872
|
-
return (React.createElement(SwiperSlide, { className: css.css({
|
8892
|
+
return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css.css({
|
8873
8893
|
width: '50px',
|
8874
8894
|
height: '50px',
|
8875
8895
|
marginRight: '10px'
|
8876
|
-
}), onClick: () =>
|
8896
|
+
}), onClick: () => {
|
8897
|
+
handleClick(item, index);
|
8898
|
+
}, key: index },
|
8877
8899
|
React.createElement(FormatImage$1, { style: {
|
8878
8900
|
height: '100%',
|
8879
8901
|
width: '100%',
|
8880
8902
|
objectFit: 'cover',
|
8881
8903
|
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
|
-
|
8904
|
+
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? (data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
|
8905
|
+
border: check === index ? '1px solid #000' : '1px solid #f2f2f2',
|
8906
|
+
boxSizing: 'border-box'
|
8907
|
+
}, 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
8908
|
})))));
|
8886
8909
|
};
|
8887
8910
|
var CommodityGroup$1 = React.memo(CommodityGroup);
|
8888
8911
|
|
8889
8912
|
const CommodityDetail$1 = (_a) => {
|
8890
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
8913
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
8891
8914
|
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
|
-
const { popupDetailData, bffEventReport, isPreview, bffFbReport } = useSxpDataSource();
|
8915
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
8894
8916
|
const { jumpToWeb, productView } = useEventReport();
|
8895
8917
|
const curTimeRef = React.useRef(null);
|
8896
8918
|
const [showModal, setShowModal] = React.useState(false);
|
8897
8919
|
const [show3DModal, setShow3DModal] = React.useState(false);
|
8920
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
8898
8921
|
const data = isPost ? rec : popupDetailData;
|
8899
|
-
|
8900
|
-
|
8922
|
+
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];
|
8923
|
+
let cta = isPost
|
8924
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
8925
|
+
: (_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
8926
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
8927
|
+
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) {
|
8928
|
+
checkCommodityIndexRef.current = checkCommodityIndex;
|
8929
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
8930
|
+
product = p;
|
8931
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
8932
|
+
}
|
8902
8933
|
const handleLink = () => {
|
8903
8934
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
8904
8935
|
jumpToWeb(data, product, cta, position);
|
@@ -8936,9 +8967,9 @@ const CommodityDetail$1 = (_a) => {
|
|
8936
8967
|
return '$7,000';
|
8937
8968
|
}
|
8938
8969
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8939
|
-
const width = isPreview ? 375 : (
|
8970
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
8940
8971
|
const renderContent = ({ isPost }) => {
|
8941
|
-
var _a, _b, _c;
|
8972
|
+
var _a, _b, _c, _d;
|
8942
8973
|
return (React.createElement("div", null,
|
8943
8974
|
React.createElement("div", { className: 'pb-commondity-content-collection', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), dangerouslySetInnerHTML: {
|
8944
8975
|
__html: setFontForText((_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -8949,8 +8980,11 @@ const CommodityDetail$1 = (_a) => {
|
|
8949
8980
|
React.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), dangerouslySetInnerHTML: {
|
8950
8981
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
8951
8982
|
} }),
|
8983
|
+
React.createElement("div", { hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
8984
|
+
__html: setFontForText((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
8985
|
+
} }),
|
8952
8986
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8953
|
-
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (
|
8987
|
+
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8954
8988
|
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8955
8989
|
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8956
8990
|
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
@@ -8969,15 +9003,20 @@ const CommodityDetail$1 = (_a) => {
|
|
8969
9003
|
}
|
8970
9004
|
return style;
|
8971
9005
|
}, []);
|
9006
|
+
const handleClick = React.useCallback((index) => {
|
9007
|
+
popupCurTimeRef.current = new Date();
|
9008
|
+
setCheckCommodityIndex(index);
|
9009
|
+
checkCommodityIndexRef.current = index;
|
9010
|
+
}, []);
|
8972
9011
|
const renderCommodityGroup = React.useCallback(() => {
|
8973
9012
|
var _a, _b, _c;
|
8974
9013
|
if (isPost)
|
8975
9014
|
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
|
-
}, []);
|
9015
|
+
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 }));
|
9016
|
+
}, [checkCommodityIndex]);
|
8978
9017
|
return (React.createElement(React.Fragment, null,
|
8979
9018
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8980
|
-
product && ((
|
9019
|
+
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
9020
|
React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8982
9021
|
clickable: true,
|
8983
9022
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -8987,7 +9026,8 @@ const CommodityDetail$1 = (_a) => {
|
|
8987
9026
|
}, loop: true, autoplay: {
|
8988
9027
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8989
9028
|
} },
|
8990
|
-
React.createElement(React.Fragment, null, (
|
9029
|
+
React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
9030
|
+
var _a;
|
8991
9031
|
return (React.createElement(SwiperSlide, { key: src },
|
8992
9032
|
React.createElement("div", { style: {
|
8993
9033
|
overflow: 'hidden',
|
@@ -9000,9 +9040,9 @@ const CommodityDetail$1 = (_a) => {
|
|
9000
9040
|
objectFit: 'cover',
|
9001
9041
|
display: 'block',
|
9002
9042
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
9003
|
-
}, src: src }))));
|
9043
|
+
}, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
|
9004
9044
|
}))))),
|
9005
|
-
!((
|
9045
|
+
!((_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
9046
|
position: 'relative',
|
9007
9047
|
height: 0,
|
9008
9048
|
width: '100%',
|
@@ -9015,7 +9055,7 @@ const CommodityDetail$1 = (_a) => {
|
|
9015
9055
|
top: 0,
|
9016
9056
|
objectFit: 'cover',
|
9017
9057
|
width: '100%'
|
9018
|
-
}), src: (
|
9058
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
9019
9059
|
renderCommodityGroup(),
|
9020
9060
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
9021
9061
|
renderBtn(),
|
@@ -9064,7 +9104,7 @@ var interactionRender$c = [
|
|
9064
9104
|
* @Author: binruan@chatlabs.com
|
9065
9105
|
* @Date: 2023-07-28 18:29:57
|
9066
9106
|
* @LastEditors: binruan@chatlabs.com
|
9067
|
-
* @LastEditTime: 2024-07-
|
9107
|
+
* @LastEditTime: 2024-07-31 13:58:45
|
9068
9108
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\material.tsx
|
9069
9109
|
*
|
9070
9110
|
*/
|
@@ -9102,6 +9142,12 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
|
9102
9142
|
info: {
|
9103
9143
|
color: 'gray',
|
9104
9144
|
fontSize: 12
|
9145
|
+
},
|
9146
|
+
taxInfo: {
|
9147
|
+
color: '#000',
|
9148
|
+
fontSize: 13,
|
9149
|
+
textAlign: 'left',
|
9150
|
+
marginBottom: '10px'
|
9105
9151
|
}
|
9106
9152
|
},
|
9107
9153
|
buttonStyle: {
|
@@ -9584,21 +9630,29 @@ var settingRender$6 = [
|
|
9584
9630
|
];
|
9585
9631
|
|
9586
9632
|
const CommodityDetailDiroNew$1 = (_a) => {
|
9587
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
9633
|
+
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
9634
|
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
9635
|
React.useState(true);
|
9590
|
-
const { sxpParameter } = useSxpDataSource();
|
9591
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
9636
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
|
9592
9637
|
const { jumpToWeb, productView } = useEventReport();
|
9593
9638
|
React.useState(false);
|
9594
9639
|
React.useState(false);
|
9595
9640
|
React.useState(true);
|
9596
9641
|
const [showModal, setShowModal] = React.useState(false);
|
9597
9642
|
const curTimeRef = React.useRef(null);
|
9643
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
9598
9644
|
const data = isPost ? rec : popupDetailData;
|
9599
|
-
|
9600
|
-
|
9645
|
+
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];
|
9646
|
+
let cta = isPost
|
9647
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
9648
|
+
: (_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
9649
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
9650
|
+
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) {
|
9651
|
+
checkCommodityIndexRef.current = checkCommodityIndex;
|
9652
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
9653
|
+
product = p;
|
9654
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
9655
|
+
}
|
9602
9656
|
const handleLink = () => {
|
9603
9657
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
9604
9658
|
jumpToWeb(data, product, cta, position);
|
@@ -9636,7 +9690,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
9636
9690
|
return '£102,300.00';
|
9637
9691
|
}
|
9638
9692
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
9639
|
-
const width = isPreview ? 375 : (
|
9693
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
9640
9694
|
// useEffect(() => {
|
9641
9695
|
// console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
|
9642
9696
|
// if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
|
@@ -9699,15 +9753,20 @@ Made in Italy` })));
|
|
9699
9753
|
}
|
9700
9754
|
return style;
|
9701
9755
|
}, []);
|
9756
|
+
const handleClick = React.useCallback((index) => {
|
9757
|
+
popupCurTimeRef.current = new Date();
|
9758
|
+
setCheckCommodityIndex(index);
|
9759
|
+
checkCommodityIndexRef.current = index;
|
9760
|
+
}, []);
|
9702
9761
|
const renderCommodityGroup = React.useCallback(() => {
|
9703
9762
|
var _a, _b, _c;
|
9704
9763
|
if (isPost)
|
9705
9764
|
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
|
-
}, []);
|
9765
|
+
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 }));
|
9766
|
+
}, [checkCommodityIndex]);
|
9708
9767
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
9709
|
-
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
9710
|
-
product && ((
|
9768
|
+
React.createElement("div", Object.assign({ className: css.css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
9769
|
+
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
9770
|
clickable: true,
|
9712
9771
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
9713
9772
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -9715,7 +9774,8 @@ Made in Italy` })));
|
|
9715
9774
|
: 'commondityDiroNew-swiper-clickable-center'
|
9716
9775
|
}, loop: true, autoplay: {
|
9717
9776
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
9718
|
-
} }, (
|
9777
|
+
} }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
9778
|
+
var _a;
|
9719
9779
|
return (React.createElement(SwiperSlide, { key: src },
|
9720
9780
|
React.createElement("div", { style: {
|
9721
9781
|
overflow: 'hidden',
|
@@ -9728,9 +9788,9 @@ Made in Italy` })));
|
|
9728
9788
|
objectFit: 'cover',
|
9729
9789
|
display: 'block',
|
9730
9790
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
9731
|
-
}, src: src }))));
|
9791
|
+
}, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
|
9732
9792
|
}))),
|
9733
|
-
!((
|
9793
|
+
!((_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
9794
|
position: 'relative',
|
9735
9795
|
height: 0,
|
9736
9796
|
width: '100%',
|
@@ -9743,13 +9803,13 @@ Made in Italy` })));
|
|
9743
9803
|
top: 0,
|
9744
9804
|
objectFit: 'cover',
|
9745
9805
|
width: '100%'
|
9746
|
-
}), src: (
|
9806
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
9747
9807
|
renderCommodityGroup(),
|
9748
9808
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
9749
9809
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
9750
9810
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
9751
9811
|
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((
|
9812
|
+
__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
9813
|
} }),
|
9754
9814
|
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
9815
|
__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 +9819,11 @@ Made in Italy` })));
|
|
9759
9819
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
9760
9820
|
} }),
|
9761
9821
|
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((
|
9822
|
+
__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
9823
|
} }))),
|
9764
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (
|
9824
|
+
(!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
9825
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
9766
|
-
__html: setFontForText((
|
9826
|
+
__html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
|
9767
9827
|
} }))),
|
9768
9828
|
productInfoText({ isPost }))),
|
9769
9829
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
@@ -10009,6 +10069,11 @@ var settingRender$5 = [
|
|
10009
10069
|
type: 'Group',
|
10010
10070
|
label: '尺寸',
|
10011
10071
|
child: [
|
10072
|
+
{
|
10073
|
+
type: 'Number',
|
10074
|
+
name: ['props', 'buttonStyle', 'width'],
|
10075
|
+
addonAfter: 'W'
|
10076
|
+
},
|
10012
10077
|
{
|
10013
10078
|
type: 'Number',
|
10014
10079
|
name: ['props', 'buttonStyle', 'height'],
|
@@ -10117,18 +10182,18 @@ function useOnScreen(ref) {
|
|
10117
10182
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10118
10183
|
*
|
10119
10184
|
*/
|
10120
|
-
const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
10185
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
|
10121
10186
|
const ref = React.useRef(null);
|
10122
10187
|
const isOnScreen = useOnScreen(ref);
|
10123
10188
|
const { ctaEvent } = useSxpDataSource();
|
10124
10189
|
React.useEffect(() => {
|
10125
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
10190
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
|
10126
10191
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10127
10192
|
eventSubject: 'ctaExposure',
|
10128
10193
|
eventDescription: 'The cta was shown to the user'
|
10129
10194
|
}, rec, item, index);
|
10130
10195
|
}
|
10131
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
10196
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
|
10132
10197
|
React.useMemo(() => {
|
10133
10198
|
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
|
10134
10199
|
}, [src]);
|
@@ -10138,41 +10203,12 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
|
10138
10203
|
};
|
10139
10204
|
var Img$1 = React.memo(Img);
|
10140
10205
|
|
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
10206
|
const CommodityList$1 = (_a) => {
|
10172
10207
|
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 {
|
10208
|
+
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"]);
|
10209
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10210
|
+
const { jumpToWeb } = useEventReport();
|
10211
|
+
const { popup } = useEditor();
|
10176
10212
|
const recData = isPost ? rec : popupDetailData;
|
10177
10213
|
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
10214
|
const priceText = React.useCallback((product) => {
|
@@ -10186,25 +10222,40 @@ const CommodityList$1 = (_a) => {
|
|
10186
10222
|
return '$7,000';
|
10187
10223
|
}
|
10188
10224
|
}, []);
|
10189
|
-
|
10190
|
-
|
10191
|
-
|
10225
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
10226
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10227
|
+
eventSubject: 'clickCta',
|
10228
|
+
eventDescription: 'User clicked the CTA'
|
10229
|
+
}, recData, item, index);
|
10230
|
+
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 }));
|
10231
|
+
if (isExternalLink) {
|
10232
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
10233
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
10234
|
+
window.location.href = window.getJointUtmLink(item.link);
|
10235
|
+
}
|
10236
|
+
}
|
10237
|
+
else {
|
10238
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10239
|
+
}
|
10240
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10241
|
+
return (React.createElement("div", { className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
10242
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10243
|
+
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
10244
|
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 }),
|
10245
|
+
}), onClick: () => handleClick(item, index) }),
|
10246
|
+
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
10247
|
React.createElement("div", { style: {
|
10196
|
-
|
10197
|
-
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)`,
|
10248
|
+
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)`,
|
10198
10249
|
display: 'flex',
|
10199
10250
|
flexDirection: 'column',
|
10200
10251
|
justifyContent: 'space-between'
|
10201
10252
|
} },
|
10202
10253
|
React.createElement("div", null,
|
10203
10254
|
React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
|
10204
|
-
__html: setFontForText((
|
10255
|
+
__html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
10205
10256
|
} }),
|
10206
10257
|
React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
|
10207
|
-
__html: setFontForText((
|
10258
|
+
__html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
10208
10259
|
} })),
|
10209
10260
|
React.createElement("div", { className: css.css({
|
10210
10261
|
display: 'flex',
|
@@ -10213,12 +10264,13 @@ const CommodityList$1 = (_a) => {
|
|
10213
10264
|
width: '100%',
|
10214
10265
|
overflow: 'hidden'
|
10215
10266
|
}) },
|
10216
|
-
React.createElement("div",
|
10217
|
-
|
10218
|
-
|
10219
|
-
|
10220
|
-
|
10221
|
-
|
10267
|
+
React.createElement("div", null,
|
10268
|
+
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: {
|
10269
|
+
__html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
10270
|
+
} })),
|
10271
|
+
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10272
|
+
__html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', buttonStyle)
|
10273
|
+
} })))))));
|
10222
10274
|
})));
|
10223
10275
|
};
|
10224
10276
|
var CommodityListComponent = React.memo(CommodityList$1);
|
@@ -10255,7 +10307,7 @@ var interactionRender$9 = [
|
|
10255
10307
|
* @Author: binruan@chatlabs.com
|
10256
10308
|
* @Date: 2024-03-20 10:27:31
|
10257
10309
|
* @LastEditors: binruan@chatlabs.com
|
10258
|
-
* @LastEditTime: 2024-07-
|
10310
|
+
* @LastEditTime: 2024-07-26 17:33:03
|
10259
10311
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\material.tsx
|
10260
10312
|
*
|
10261
10313
|
*/
|
@@ -10294,6 +10346,7 @@ const CommodityList = createMaterial(CommodityListComponent, {
|
|
10294
10346
|
backgroundColor: '#000',
|
10295
10347
|
fontSize: 12,
|
10296
10348
|
height: 30,
|
10349
|
+
width: 100,
|
10297
10350
|
textAlign: 'center',
|
10298
10351
|
color: '#fff',
|
10299
10352
|
lineHeight: 2.5
|
@@ -10577,6 +10630,36 @@ var interactionRender$8 = [
|
|
10577
10630
|
}
|
10578
10631
|
];
|
10579
10632
|
|
10633
|
+
const EventProvider = (_a) => {
|
10634
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
10635
|
+
const ref = React.useRef(null);
|
10636
|
+
const { popup } = useEditor();
|
10637
|
+
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10638
|
+
const { jumpToWeb } = useEventReport();
|
10639
|
+
const handleClick = lodash.throttle(() => {
|
10640
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
10641
|
+
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;
|
10642
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10643
|
+
eventSubject: 'clickCta',
|
10644
|
+
eventDescription: 'User clicked the CTA'
|
10645
|
+
}, rec, item, index);
|
10646
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
10647
|
+
if (isExternalLink) {
|
10648
|
+
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) {
|
10649
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
10650
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
10651
|
+
jumpToWeb(rec, product, cta, index);
|
10652
|
+
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);
|
10653
|
+
}
|
10654
|
+
}
|
10655
|
+
else {
|
10656
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10657
|
+
}
|
10658
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10659
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
10660
|
+
};
|
10661
|
+
var EventProvider$1 = React.memo(EventProvider);
|
10662
|
+
|
10580
10663
|
var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
10581
10664
|
|
10582
10665
|
const Commodity$1 = (_a) => {
|
@@ -11147,12 +11230,12 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
11147
11230
|
const { popup } = useEditor();
|
11148
11231
|
const { jumpToWeb } = useEventReport();
|
11149
11232
|
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) => {
|
11233
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
11151
11234
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11152
11235
|
eventSubject: 'clickCta',
|
11153
11236
|
eventDescription: 'User clicked the CTA'
|
11154
11237
|
}, 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 }));
|
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, multiCheckIndex }));
|
11156
11239
|
if (isExternalLink) {
|
11157
11240
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11158
11241
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11165,7 +11248,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
11165
11248
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11166
11249
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11167
11250
|
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) }),
|
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
11169
11252
|
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
11253
|
React.createElement("div", { className: css.css({
|
11171
11254
|
color: '#000',
|
@@ -11263,12 +11346,12 @@ const MultiCommodity$1 = (_a) => {
|
|
11263
11346
|
const { popup } = useEditor();
|
11264
11347
|
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
11348
|
const { jumpToWeb } = useEventReport();
|
11266
|
-
const handleClick = lodash.throttle((item) => {
|
11349
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
11267
11350
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11268
11351
|
eventSubject: 'clickCta',
|
11269
11352
|
eventDescription: 'User clicked the CTA'
|
11270
11353
|
}, 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 }));
|
11354
|
+
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
11355
|
if (isExternalLink) {
|
11273
11356
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11274
11357
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11281,7 +11364,7 @@ const MultiCommodity$1 = (_a) => {
|
|
11281
11364
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11282
11365
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11283
11366
|
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) }),
|
11367
|
+
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
11368
|
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
11369
|
React.createElement("div", { className: css.css({
|
11287
11370
|
color: '#fff',
|
@@ -13997,11 +14080,12 @@ const AniLink$1 = (_a) => {
|
|
13997
14080
|
}
|
13998
14081
|
}, [event === null || event === void 0 ? void 0 : event.animation]);
|
13999
14082
|
React.useEffect(() => {
|
14083
|
+
var _a, _b, _c;
|
14000
14084
|
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
14001
14085
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
14002
14086
|
eventSubject: 'ctaExposure',
|
14003
14087
|
eventDescription: 'The cta was shown to the user'
|
14004
|
-
}, recData,
|
14088
|
+
}, 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
14089
|
}
|
14006
14090
|
}, [isOnScreen]);
|
14007
14091
|
React.useEffect(() => {
|
@@ -14387,14 +14471,11 @@ var styles = {"aniLinkPopup":"index-module_aniLinkPopup__YT7kj","animated-fadeIn
|
|
14387
14471
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
14388
14472
|
const AniLinkPopup$1 = (_a) => {
|
14389
14473
|
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"]);
|
14474
|
+
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
14475
|
style === null || style === void 0 ? true : delete style.transform;
|
14392
14476
|
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
14393
14477
|
const { jumpToWeb } = useEventReport();
|
14394
|
-
const
|
14395
|
-
const isOnScreen = useOnScreen(ref);
|
14396
|
-
const [visible, setVisible] = React.useState(false);
|
14397
|
-
const [startAni, setStartAni] = React.useState(true);
|
14478
|
+
const [visible, setVisible] = React.useState(true);
|
14398
14479
|
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
14480
|
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
14481
|
const handleTo = () => {
|
@@ -14430,26 +14511,21 @@ const AniLinkPopup$1 = (_a) => {
|
|
14430
14511
|
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
14512
|
const onClose = (event) => {
|
14432
14513
|
event.stopPropagation();
|
14433
|
-
|
14514
|
+
setVisible(false);
|
14434
14515
|
};
|
14435
14516
|
React.useEffect(() => {
|
14436
|
-
|
14437
|
-
|
14438
|
-
}
|
14439
|
-
else {
|
14440
|
-
setVisible(false);
|
14441
|
-
}
|
14442
|
-
}, [isOnScreen]);
|
14517
|
+
setVisible(true);
|
14518
|
+
}, [isActive]);
|
14443
14519
|
const aniNamStyle = React.useMemo(() => {
|
14444
|
-
if (!
|
14520
|
+
if (!isActive)
|
14445
14521
|
return null;
|
14446
|
-
return
|
14447
|
-
}, [
|
14522
|
+
return visible ? styles['animated-fadeIn'] : null;
|
14523
|
+
}, [isActive, visible]);
|
14448
14524
|
return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
|
14449
14525
|
height: '40px',
|
14450
14526
|
lineHeight: '40px',
|
14451
14527
|
paddingLeft: '6px'
|
14452
|
-
} }, "Cta Title")) : (React.createElement(
|
14528
|
+
} }, "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
14529
|
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
14530
|
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
14531
|
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 +14534,7 @@ const AniLinkPopup$1 = (_a) => {
|
|
14458
14534
|
} })),
|
14459
14535
|
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
14536
|
__html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
14461
|
-
} })))
|
14537
|
+
} })))));
|
14462
14538
|
};
|
14463
14539
|
var AniLinkPopupComponent = React.memo(AniLinkPopup$1);
|
14464
14540
|
|
@@ -14610,52 +14686,71 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
14610
14686
|
const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
14611
14687
|
const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
14612
14688
|
const LikeButton = (_a) => {
|
14689
|
+
var _b;
|
14613
14690
|
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(
|
14691
|
+
const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
|
14692
|
+
const [state, setState] = React.useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
|
14616
14693
|
const likeIcon = useIconLink(defaultLikeIconPath$1);
|
14617
14694
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
|
14618
14695
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
14619
|
-
var
|
14696
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
14620
14697
|
if (state) {
|
14621
14698
|
// 先设置状态
|
14622
14699
|
setState(false);
|
14623
|
-
const result = (
|
14700
|
+
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
14701
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14625
14702
|
eventInfo: {
|
14626
14703
|
eventSubject: 'favoriteContentCanceled',
|
14627
14704
|
eventDescription: 'This content was unfavorite by the user',
|
14628
|
-
contentId: (
|
14629
|
-
contentName: (
|
14630
|
-
contentTags: JSON.stringify((
|
14705
|
+
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 : '',
|
14706
|
+
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 : '',
|
14707
|
+
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
14708
|
position: position + '',
|
14632
|
-
contentFormat: ((
|
14633
|
-
traceInfo: (
|
14709
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
14710
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
14634
14711
|
}
|
14635
14712
|
});
|
14636
14713
|
// 如果接口调用失败,则回滚状态
|
14637
14714
|
if (!result) {
|
14638
14715
|
setState(true);
|
14639
14716
|
}
|
14717
|
+
else {
|
14718
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
14719
|
+
if (index === position) {
|
14720
|
+
item.isCollected = false;
|
14721
|
+
}
|
14722
|
+
return item;
|
14723
|
+
})) !== null && _p !== void 0 ? _p : [];
|
14724
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
14725
|
+
}
|
14640
14726
|
}
|
14641
14727
|
else {
|
14642
14728
|
setState(true);
|
14643
|
-
const result = (
|
14729
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
14644
14730
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14645
14731
|
eventInfo: {
|
14646
14732
|
eventSubject: 'favoriteContent',
|
14647
14733
|
eventDescription: 'This content was favorite by the user',
|
14648
|
-
contentId: (
|
14649
|
-
contentName: (
|
14650
|
-
contentTags: JSON.stringify((
|
14734
|
+
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 : '',
|
14735
|
+
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 : '',
|
14736
|
+
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
14737
|
position: position + '',
|
14652
|
-
contentFormat: ((
|
14653
|
-
traceInfo: (
|
14738
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
14739
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
14654
14740
|
}
|
14655
14741
|
});
|
14656
14742
|
if (!result) {
|
14657
14743
|
setState(false);
|
14658
14744
|
}
|
14745
|
+
else {
|
14746
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
14747
|
+
if (index === position) {
|
14748
|
+
item.isCollected = true;
|
14749
|
+
}
|
14750
|
+
return item;
|
14751
|
+
})) !== null && _z !== void 0 ? _z : [];
|
14752
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
14753
|
+
}
|
14659
14754
|
}
|
14660
14755
|
}), 200);
|
14661
14756
|
return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
@@ -15291,11 +15386,11 @@ function withBindDataSource(Component) {
|
|
15291
15386
|
* @Author: binruan@chatlabs.com
|
15292
15387
|
* @Date: 2023-12-26 16:11:34
|
15293
15388
|
* @LastEditors: binruan@chatlabs.com
|
15294
|
-
* @LastEditTime: 2024-07-
|
15389
|
+
* @LastEditTime: 2024-07-29 10:07:08
|
15295
15390
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
15296
15391
|
*
|
15297
15392
|
*/
|
15298
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
15393
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
|
15299
15394
|
var _a, _b, _c, _d, _e;
|
15300
15395
|
const { schema } = useEditor();
|
15301
15396
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
@@ -15340,12 +15435,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
|
15340
15435
|
const Component = withBindDataSource(t);
|
15341
15436
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
15342
15437
|
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 })));
|
15438
|
+
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
15439
|
}
|
15345
15440
|
else {
|
15346
15441
|
return null;
|
15347
15442
|
}
|
15348
|
-
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id]);
|
15443
|
+
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
|
15349
15444
|
return React.createElement(React.Fragment, null, renderComp);
|
15350
15445
|
};
|
15351
15446
|
var RenderCard$1 = React.memo(RenderCard);
|
@@ -15433,7 +15528,7 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
15433
15528
|
* @Author: binruan@chatlabs.com
|
15434
15529
|
* @Date: 2024-01-15 19:03:09
|
15435
15530
|
* @LastEditors: binruan@chatlabs.com
|
15436
|
-
* @LastEditTime: 2024-07-
|
15531
|
+
* @LastEditTime: 2024-07-31 11:33:42
|
15437
15532
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
15438
15533
|
*
|
15439
15534
|
*/
|
@@ -15651,7 +15746,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15651
15746
|
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
15747
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
15653
15748
|
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'] })));
|
15749
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
15655
15750
|
}
|
15656
15751
|
return null;
|
15657
15752
|
}, [
|
@@ -15705,8 +15800,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15705
15800
|
}
|
15706
15801
|
};
|
15707
15802
|
const handleSlideSkip = (item, position) => {
|
15708
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
15709
|
-
if (isPreview)
|
15803
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
15804
|
+
if (isPreview || waterFallData)
|
15710
15805
|
return;
|
15711
15806
|
const t = new Date() - curTime.current;
|
15712
15807
|
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) {
|
@@ -15724,7 +15819,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15724
15819
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
15725
15820
|
position: position + '',
|
15726
15821
|
contentId: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
15727
|
-
traceInfo: (_r =
|
15822
|
+
traceInfo: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : ''
|
15728
15823
|
}
|
15729
15824
|
});
|
15730
15825
|
setSlideSkipState();
|
@@ -16255,19 +16350,18 @@ var index$1 = React.memo(DiyPortalPreview);
|
|
16255
16350
|
* @Author: binruan@chatlabs.com
|
16256
16351
|
* @Date: 2023-10-31 10:56:01
|
16257
16352
|
* @LastEditors: binruan@chatlabs.com
|
16258
|
-
* @LastEditTime: 2024-07-
|
16353
|
+
* @LastEditTime: 2024-07-31 18:54:49
|
16259
16354
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
16260
16355
|
*
|
16261
16356
|
*/
|
16262
16357
|
const Popup = () => {
|
16263
16358
|
const { schema, resolver, popup } = useEditor();
|
16264
|
-
const { setPopupDetailData, popupDetailData,
|
16359
|
+
const { setPopupDetailData, popupDetailData, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
16265
16360
|
const { productView } = useEventReport();
|
16266
16361
|
const [visible, setVisible] = React.useState();
|
16267
|
-
const curTimeRef = React.useRef(null);
|
16268
16362
|
React.useEffect(() => {
|
16269
16363
|
const initTime = () => {
|
16270
|
-
|
16364
|
+
popupCurTimeRef.current = new Date();
|
16271
16365
|
};
|
16272
16366
|
initTime();
|
16273
16367
|
window.addEventListener('pageshow', initTime);
|
@@ -16277,25 +16371,39 @@ const Popup = () => {
|
|
16277
16371
|
}, []);
|
16278
16372
|
React.useEffect(() => {
|
16279
16373
|
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
16280
|
-
|
16374
|
+
popupCurTimeRef.current = new Date();
|
16281
16375
|
setVisible(popup);
|
16282
16376
|
}
|
16283
16377
|
}, [popup]);
|
16284
16378
|
const handleClose = () => {
|
16285
|
-
var _a, _b, _c, _d;
|
16286
|
-
if (!popup ||
|
16379
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
16380
|
+
if (!popup ||
|
16381
|
+
(popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
|
16382
|
+
!visible ||
|
16383
|
+
new Date() - popupCurTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
|
16287
16384
|
return;
|
16288
16385
|
}
|
16289
16386
|
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
16290
|
-
const
|
16291
|
-
|
16292
|
-
|
16293
|
-
|
16294
|
-
|
16387
|
+
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));
|
16388
|
+
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') {
|
16389
|
+
const data = popupDetailData;
|
16390
|
+
let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
|
16391
|
+
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;
|
16392
|
+
if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
|
16393
|
+
const p = (_l = (_k = data === null || data === void 0 ? void 0 : data.video) === null || _k === void 0 ? void 0 : _k.bindProducts) === null || _l === void 0 ? void 0 : _l[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
|
16394
|
+
if (p) {
|
16395
|
+
product = p;
|
16396
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
16397
|
+
}
|
16398
|
+
}
|
16399
|
+
if (product && cta) {
|
16400
|
+
productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
16401
|
+
}
|
16295
16402
|
}
|
16296
16403
|
setTimeout(() => {
|
16297
16404
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
16298
16405
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
16406
|
+
checkCommodityIndexRef.current = -1;
|
16299
16407
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
16300
16408
|
};
|
16301
16409
|
const renderPopupDetail = React.useMemo(() => {
|
@@ -16308,7 +16416,7 @@ const Popup = () => {
|
|
16308
16416
|
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';
|
16309
16417
|
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';
|
16310
16418
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
16311
|
-
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 })));
|
16419
|
+
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, index: index })));
|
16312
16420
|
}
|
16313
16421
|
else {
|
16314
16422
|
return React.createElement(React.Fragment, null);
|