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/pb-ui.js
CHANGED
@@ -567,6 +567,8 @@
|
|
567
567
|
const themeTag = React.useRef();
|
568
568
|
const curTime = React.useRef();
|
569
569
|
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
570
|
+
const checkCommodityIndexRef = React.useRef(-1);
|
571
|
+
const popupCurTimeRef = React.useRef(null);
|
570
572
|
const isShowConsent = React.useMemo(() => {
|
571
573
|
var _a, _b, _c, _d;
|
572
574
|
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;
|
@@ -734,7 +736,7 @@
|
|
734
736
|
}
|
735
737
|
}), [bffFetch, utmVal, isShowTag]);
|
736
738
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
737
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
739
|
+
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;
|
738
740
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
739
741
|
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);
|
740
742
|
let fromKName = '';
|
@@ -748,7 +750,7 @@
|
|
748
750
|
fromKName = 'imagePage';
|
749
751
|
}
|
750
752
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
751
|
-
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 =
|
753
|
+
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 : '' })
|
752
754
|
});
|
753
755
|
}, [bffEventReport, isFromHashtag]);
|
754
756
|
const h5EnterLink = React.useCallback(() => {
|
@@ -863,7 +865,9 @@
|
|
863
865
|
isShowConsent,
|
864
866
|
selectTag,
|
865
867
|
setSelectTag,
|
866
|
-
globalConfig
|
868
|
+
globalConfig,
|
869
|
+
popupCurTimeRef,
|
870
|
+
checkCommodityIndexRef
|
867
871
|
} }, 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({
|
868
872
|
rtcList,
|
869
873
|
mutateLike: bffMutateLike,
|
@@ -1278,14 +1282,14 @@
|
|
1278
1282
|
* @Author: binruan@chatlabs.com
|
1279
1283
|
* @Date: 2024-03-12 10:59:06
|
1280
1284
|
* @LastEditors: binruan@chatlabs.com
|
1281
|
-
* @LastEditTime: 2024-
|
1285
|
+
* @LastEditTime: 2024-07-31 11:41:47
|
1282
1286
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1283
1287
|
*
|
1284
1288
|
*/
|
1285
1289
|
function useEventReport() {
|
1286
1290
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
1287
1291
|
const jumpToWeb = React.useCallback((data, product, cta, position) => {
|
1288
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1292
|
+
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;
|
1289
1293
|
let fromKName = '';
|
1290
1294
|
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))) {
|
1291
1295
|
fromKName = 'pdpPage';
|
@@ -1316,12 +1320,12 @@
|
|
1316
1320
|
position: position + '',
|
1317
1321
|
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 : '',
|
1318
1322
|
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
1319
|
-
traceInfo: (_p =
|
1323
|
+
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 : ''
|
1320
1324
|
}
|
1321
1325
|
});
|
1322
1326
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
1323
1327
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
1324
|
-
var _a, _b, _c, _d;
|
1328
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
1325
1329
|
let fromKName = '';
|
1326
1330
|
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))) {
|
1327
1331
|
fromKName = 'pdpPage';
|
@@ -1341,7 +1345,7 @@
|
|
1341
1345
|
position: position + '',
|
1342
1346
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1343
1347
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1344
|
-
traceInfo:
|
1348
|
+
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 : '',
|
1345
1349
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1346
1350
|
eventSubject: 'productView',
|
1347
1351
|
eventDescription: 'User browsed the product'
|
@@ -1617,6 +1621,10 @@
|
|
1617
1621
|
{
|
1618
1622
|
label: '商品描述',
|
1619
1623
|
value: 'info'
|
1624
|
+
},
|
1625
|
+
{
|
1626
|
+
label: '税费说明',
|
1627
|
+
value: 'taxInfo'
|
1620
1628
|
}
|
1621
1629
|
],
|
1622
1630
|
name: ['props', 'commodityStyles', 'field'],
|
@@ -8598,7 +8606,7 @@
|
|
8598
8606
|
* @Author: binruan@chatlabs.com
|
8599
8607
|
* @Date: 2023-11-02 18:34:34
|
8600
8608
|
* @LastEditors: binruan@chatlabs.com
|
8601
|
-
* @LastEditTime: 2024-07-
|
8609
|
+
* @LastEditTime: 2024-07-29 16:20:40
|
8602
8610
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8603
8611
|
*
|
8604
8612
|
*/
|
@@ -8791,7 +8799,7 @@
|
|
8791
8799
|
* @Author: binruan@chatlabs.com
|
8792
8800
|
* @Date: 2024-03-20 10:27:31
|
8793
8801
|
* @LastEditors: binruan@chatlabs.com
|
8794
|
-
* @LastEditTime: 2024-
|
8802
|
+
* @LastEditTime: 2024-07-31 17:54:50
|
8795
8803
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
|
8796
8804
|
*
|
8797
8805
|
*/
|
@@ -8842,56 +8850,79 @@
|
|
8842
8850
|
});
|
8843
8851
|
var FormatImage$1 = React.memo(FormatImage);
|
8844
8852
|
|
8845
|
-
|
8853
|
+
/*
|
8854
|
+
* @Author: binruan@chatlabs.com
|
8855
|
+
* @Date: 2024-03-20 10:27:32
|
8856
|
+
* @LastEditors: binruan@chatlabs.com
|
8857
|
+
* @LastEditTime: 2024-07-30 11:46:32
|
8858
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
|
8859
|
+
*
|
8860
|
+
*/
|
8861
|
+
const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
|
8846
8862
|
const ref = React.useRef();
|
8847
8863
|
const { popupDetailData } = useSxpDataSource();
|
8848
8864
|
React.useEffect(() => {
|
8849
|
-
var _a;
|
8850
|
-
|
8851
|
-
|
8865
|
+
var _a, _b;
|
8866
|
+
if (enableSlideActive)
|
8867
|
+
(_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);
|
8868
|
+
}, [popupDetailData, enableSlideActive]);
|
8852
8869
|
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));
|
8853
8870
|
};
|
8854
8871
|
var Scroll$1 = React.memo(Scroll);
|
8855
8872
|
|
8856
|
-
const CommodityGroup = ({ products, data, defImg, style }) => {
|
8857
|
-
var _a
|
8858
|
-
const {
|
8859
|
-
const
|
8860
|
-
const handleClick =
|
8861
|
-
|
8862
|
-
|
8863
|
-
|
8873
|
+
const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
|
8874
|
+
var _a;
|
8875
|
+
const { productView } = useEventReport();
|
8876
|
+
const { popupCurTimeRef } = useSxpDataSource();
|
8877
|
+
const handleClick = (item, index) => {
|
8878
|
+
if (check === index)
|
8879
|
+
return;
|
8880
|
+
productView(popupDetailData, item, item === null || item === void 0 ? void 0 : item.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
8881
|
+
onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
|
8882
|
+
};
|
8883
|
+
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) => {
|
8864
8884
|
var _a, _b, _c;
|
8865
|
-
return (React.createElement(SwiperSlide, { className: css.css({
|
8885
|
+
return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css.css({
|
8866
8886
|
width: '50px',
|
8867
8887
|
height: '50px',
|
8868
8888
|
marginRight: '10px'
|
8869
|
-
}), onClick: () =>
|
8889
|
+
}), onClick: () => {
|
8890
|
+
handleClick(item, index);
|
8891
|
+
}, key: index },
|
8870
8892
|
React.createElement(FormatImage$1, { style: {
|
8871
8893
|
height: '100%',
|
8872
8894
|
width: '100%',
|
8873
8895
|
objectFit: 'cover',
|
8874
8896
|
display: 'block',
|
8875
|
-
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ?
|
8876
|
-
border: check === index ? '1px solid #000' : '1px solid #f2f2f2'
|
8877
|
-
|
8897
|
+
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? (data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
|
8898
|
+
border: check === index ? '1px solid #000' : '1px solid #f2f2f2',
|
8899
|
+
boxSizing: 'border-box'
|
8900
|
+
}, 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));
|
8878
8901
|
})))));
|
8879
8902
|
};
|
8880
8903
|
var CommodityGroup$1 = React.memo(CommodityGroup);
|
8881
8904
|
|
8882
8905
|
const CommodityDetail$1 = (_a) => {
|
8883
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
8906
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
8884
8907
|
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"]);
|
8885
|
-
const { sxpParameter } = useSxpDataSource();
|
8886
|
-
const { popupDetailData, bffEventReport, isPreview, bffFbReport } = useSxpDataSource();
|
8908
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
8887
8909
|
const { jumpToWeb, productView } = useEventReport();
|
8888
8910
|
const curTimeRef = React.useRef(null);
|
8889
8911
|
const [showModal, setShowModal] = React.useState(false);
|
8890
8912
|
const [show3DModal, setShow3DModal] = React.useState(false);
|
8913
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
8891
8914
|
const data = isPost ? rec : popupDetailData;
|
8892
|
-
|
8893
|
-
|
8915
|
+
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];
|
8916
|
+
let cta = isPost
|
8917
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
8918
|
+
: (_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;
|
8894
8919
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
8920
|
+
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) {
|
8921
|
+
checkCommodityIndexRef.current = checkCommodityIndex;
|
8922
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
8923
|
+
product = p;
|
8924
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
8925
|
+
}
|
8895
8926
|
const handleLink = () => {
|
8896
8927
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
8897
8928
|
jumpToWeb(data, product, cta, position);
|
@@ -8929,9 +8960,9 @@
|
|
8929
8960
|
return '$7,000';
|
8930
8961
|
}
|
8931
8962
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8932
|
-
const width = isPreview ? 375 : (
|
8963
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
8933
8964
|
const renderContent = ({ isPost }) => {
|
8934
|
-
var _a, _b, _c;
|
8965
|
+
var _a, _b, _c, _d;
|
8935
8966
|
return (React.createElement("div", null,
|
8936
8967
|
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: {
|
8937
8968
|
__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)
|
@@ -8942,8 +8973,11 @@
|
|
8942
8973
|
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: {
|
8943
8974
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
8944
8975
|
} }),
|
8976
|
+
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: {
|
8977
|
+
__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)
|
8978
|
+
} }),
|
8945
8979
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8946
|
-
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: (
|
8980
|
+
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
|
8947
8981
|
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8948
8982
|
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8949
8983
|
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
@@ -8962,15 +8996,20 @@
|
|
8962
8996
|
}
|
8963
8997
|
return style;
|
8964
8998
|
}, []);
|
8999
|
+
const handleClick = React.useCallback((index) => {
|
9000
|
+
popupCurTimeRef.current = new Date();
|
9001
|
+
setCheckCommodityIndex(index);
|
9002
|
+
checkCommodityIndexRef.current = index;
|
9003
|
+
}, []);
|
8965
9004
|
const renderCommodityGroup = React.useCallback(() => {
|
8966
9005
|
var _a, _b, _c;
|
8967
9006
|
if (isPost)
|
8968
9007
|
return;
|
8969
|
-
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' } }));
|
8970
|
-
}, []);
|
9008
|
+
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 }));
|
9009
|
+
}, [checkCommodityIndex]);
|
8971
9010
|
return (React.createElement(React.Fragment, null,
|
8972
9011
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8973
|
-
product && ((
|
9012
|
+
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' } },
|
8974
9013
|
React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8975
9014
|
clickable: true,
|
8976
9015
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -8980,7 +9019,8 @@
|
|
8980
9019
|
}, loop: true, autoplay: {
|
8981
9020
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8982
9021
|
} },
|
8983
|
-
React.createElement(React.Fragment, null, (
|
9022
|
+
React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
9023
|
+
var _a;
|
8984
9024
|
return (React.createElement(SwiperSlide, { key: src },
|
8985
9025
|
React.createElement("div", { style: {
|
8986
9026
|
overflow: 'hidden',
|
@@ -8993,9 +9033,9 @@
|
|
8993
9033
|
objectFit: 'cover',
|
8994
9034
|
display: 'block',
|
8995
9035
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
8996
|
-
}, src: src }))));
|
9036
|
+
}, 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 }))));
|
8997
9037
|
}))))),
|
8998
|
-
!((
|
9038
|
+
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
|
8999
9039
|
position: 'relative',
|
9000
9040
|
height: 0,
|
9001
9041
|
width: '100%',
|
@@ -9008,7 +9048,7 @@
|
|
9008
9048
|
top: 0,
|
9009
9049
|
objectFit: 'cover',
|
9010
9050
|
width: '100%'
|
9011
|
-
}), src: (
|
9051
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
9012
9052
|
renderCommodityGroup(),
|
9013
9053
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
9014
9054
|
renderBtn(),
|
@@ -9057,7 +9097,7 @@
|
|
9057
9097
|
* @Author: binruan@chatlabs.com
|
9058
9098
|
* @Date: 2023-07-28 18:29:57
|
9059
9099
|
* @LastEditors: binruan@chatlabs.com
|
9060
|
-
* @LastEditTime: 2024-07-
|
9100
|
+
* @LastEditTime: 2024-07-31 13:58:45
|
9061
9101
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\material.tsx
|
9062
9102
|
*
|
9063
9103
|
*/
|
@@ -9095,6 +9135,12 @@
|
|
9095
9135
|
info: {
|
9096
9136
|
color: 'gray',
|
9097
9137
|
fontSize: 12
|
9138
|
+
},
|
9139
|
+
taxInfo: {
|
9140
|
+
color: '#000',
|
9141
|
+
fontSize: 13,
|
9142
|
+
textAlign: 'left',
|
9143
|
+
marginBottom: '10px'
|
9098
9144
|
}
|
9099
9145
|
},
|
9100
9146
|
buttonStyle: {
|
@@ -9577,21 +9623,29 @@
|
|
9577
9623
|
];
|
9578
9624
|
|
9579
9625
|
const CommodityDetailDiroNew$1 = (_a) => {
|
9580
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
9626
|
+
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;
|
9581
9627
|
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"]);
|
9582
9628
|
React.useState(true);
|
9583
|
-
const { sxpParameter } = useSxpDataSource();
|
9584
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
9629
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
|
9585
9630
|
const { jumpToWeb, productView } = useEventReport();
|
9586
9631
|
React.useState(false);
|
9587
9632
|
React.useState(false);
|
9588
9633
|
React.useState(true);
|
9589
9634
|
const [showModal, setShowModal] = React.useState(false);
|
9590
9635
|
const curTimeRef = React.useRef(null);
|
9636
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
9591
9637
|
const data = isPost ? rec : popupDetailData;
|
9592
|
-
|
9593
|
-
|
9638
|
+
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];
|
9639
|
+
let cta = isPost
|
9640
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
9641
|
+
: (_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;
|
9594
9642
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
9643
|
+
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) {
|
9644
|
+
checkCommodityIndexRef.current = checkCommodityIndex;
|
9645
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
9646
|
+
product = p;
|
9647
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
9648
|
+
}
|
9595
9649
|
const handleLink = () => {
|
9596
9650
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
9597
9651
|
jumpToWeb(data, product, cta, position);
|
@@ -9629,7 +9683,7 @@
|
|
9629
9683
|
return '£102,300.00';
|
9630
9684
|
}
|
9631
9685
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
9632
|
-
const width = isPreview ? 375 : (
|
9686
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
9633
9687
|
// useEffect(() => {
|
9634
9688
|
// console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
|
9635
9689
|
// if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
|
@@ -9692,15 +9746,20 @@ Made in Italy` })));
|
|
9692
9746
|
}
|
9693
9747
|
return style;
|
9694
9748
|
}, []);
|
9749
|
+
const handleClick = React.useCallback((index) => {
|
9750
|
+
popupCurTimeRef.current = new Date();
|
9751
|
+
setCheckCommodityIndex(index);
|
9752
|
+
checkCommodityIndexRef.current = index;
|
9753
|
+
}, []);
|
9695
9754
|
const renderCommodityGroup = React.useCallback(() => {
|
9696
9755
|
var _a, _b, _c;
|
9697
9756
|
if (isPost)
|
9698
9757
|
return;
|
9699
|
-
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' } }));
|
9700
|
-
}, []);
|
9758
|
+
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 }));
|
9759
|
+
}, [checkCommodityIndex]);
|
9701
9760
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
9702
|
-
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
9703
|
-
product && ((
|
9761
|
+
React.createElement("div", Object.assign({ className: css.css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
9762
|
+
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: {
|
9704
9763
|
clickable: true,
|
9705
9764
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
9706
9765
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -9708,7 +9767,8 @@ Made in Italy` })));
|
|
9708
9767
|
: 'commondityDiroNew-swiper-clickable-center'
|
9709
9768
|
}, loop: true, autoplay: {
|
9710
9769
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
9711
|
-
} }, (
|
9770
|
+
} }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
9771
|
+
var _a;
|
9712
9772
|
return (React.createElement(SwiperSlide, { key: src },
|
9713
9773
|
React.createElement("div", { style: {
|
9714
9774
|
overflow: 'hidden',
|
@@ -9721,9 +9781,9 @@ Made in Italy` })));
|
|
9721
9781
|
objectFit: 'cover',
|
9722
9782
|
display: 'block',
|
9723
9783
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
9724
|
-
}, src: src }))));
|
9784
|
+
}, 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 }))));
|
9725
9785
|
}))),
|
9726
|
-
!((
|
9786
|
+
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
|
9727
9787
|
position: 'relative',
|
9728
9788
|
height: 0,
|
9729
9789
|
width: '100%',
|
@@ -9736,13 +9796,13 @@ Made in Italy` })));
|
|
9736
9796
|
top: 0,
|
9737
9797
|
objectFit: 'cover',
|
9738
9798
|
width: '100%'
|
9739
|
-
}), src: (
|
9799
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
9740
9800
|
renderCommodityGroup(),
|
9741
9801
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
9742
9802
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
9743
9803
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
9744
9804
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
|
9745
|
-
__html: setFontForText((
|
9805
|
+
__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)
|
9746
9806
|
} }),
|
9747
9807
|
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: {
|
9748
9808
|
__html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -9752,11 +9812,11 @@ Made in Italy` })));
|
|
9752
9812
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
9753
9813
|
} }),
|
9754
9814
|
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: {
|
9755
|
-
__html: setFontForText((
|
9815
|
+
__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)
|
9756
9816
|
} }))),
|
9757
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (
|
9817
|
+
(!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 },
|
9758
9818
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
9759
|
-
__html: setFontForText((
|
9819
|
+
__html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
|
9760
9820
|
} }))),
|
9761
9821
|
productInfoText({ isPost }))),
|
9762
9822
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
@@ -10002,6 +10062,11 @@ Made in Italy` })));
|
|
10002
10062
|
type: 'Group',
|
10003
10063
|
label: '尺寸',
|
10004
10064
|
child: [
|
10065
|
+
{
|
10066
|
+
type: 'Number',
|
10067
|
+
name: ['props', 'buttonStyle', 'width'],
|
10068
|
+
addonAfter: 'W'
|
10069
|
+
},
|
10005
10070
|
{
|
10006
10071
|
type: 'Number',
|
10007
10072
|
name: ['props', 'buttonStyle', 'height'],
|
@@ -10110,18 +10175,18 @@ Made in Italy` })));
|
|
10110
10175
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10111
10176
|
*
|
10112
10177
|
*/
|
10113
|
-
const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
10178
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
|
10114
10179
|
const ref = React.useRef(null);
|
10115
10180
|
const isOnScreen = useOnScreen(ref);
|
10116
10181
|
const { ctaEvent } = useSxpDataSource();
|
10117
10182
|
React.useEffect(() => {
|
10118
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
10183
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
|
10119
10184
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10120
10185
|
eventSubject: 'ctaExposure',
|
10121
10186
|
eventDescription: 'The cta was shown to the user'
|
10122
10187
|
}, rec, item, index);
|
10123
10188
|
}
|
10124
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
10189
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
|
10125
10190
|
React.useMemo(() => {
|
10126
10191
|
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
|
10127
10192
|
}, [src]);
|
@@ -10131,41 +10196,12 @@ Made in Italy` })));
|
|
10131
10196
|
};
|
10132
10197
|
var Img$1 = React.memo(Img);
|
10133
10198
|
|
10134
|
-
const EventProvider = (_a) => {
|
10135
|
-
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
10136
|
-
const ref = React.useRef(null);
|
10137
|
-
const { popup } = useEditor();
|
10138
|
-
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10139
|
-
const { jumpToWeb } = useEventReport();
|
10140
|
-
const handleClick = lodash.throttle(() => {
|
10141
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
10142
|
-
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;
|
10143
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10144
|
-
eventSubject: 'clickCta',
|
10145
|
-
eventDescription: 'User clicked the CTA'
|
10146
|
-
}, rec, item, index);
|
10147
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
10148
|
-
if (isExternalLink) {
|
10149
|
-
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) {
|
10150
|
-
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
10151
|
-
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
10152
|
-
jumpToWeb(rec, product, cta, index);
|
10153
|
-
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);
|
10154
|
-
}
|
10155
|
-
}
|
10156
|
-
else {
|
10157
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10158
|
-
}
|
10159
|
-
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10160
|
-
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
10161
|
-
};
|
10162
|
-
var EventProvider$1 = React.memo(EventProvider);
|
10163
|
-
|
10164
10199
|
const CommodityList$1 = (_a) => {
|
10165
10200
|
var _b, _c;
|
10166
|
-
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"]);
|
10167
|
-
const { sxpParameter } = useSxpDataSource();
|
10168
|
-
const {
|
10201
|
+
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"]);
|
10202
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10203
|
+
const { jumpToWeb } = useEventReport();
|
10204
|
+
const { popup } = useEditor();
|
10169
10205
|
const recData = isPost ? rec : popupDetailData;
|
10170
10206
|
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];
|
10171
10207
|
const priceText = React.useCallback((product) => {
|
@@ -10179,25 +10215,40 @@ Made in Italy` })));
|
|
10179
10215
|
return '$7,000';
|
10180
10216
|
}
|
10181
10217
|
}, []);
|
10182
|
-
|
10183
|
-
|
10184
|
-
|
10218
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
10219
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10220
|
+
eventSubject: 'clickCta',
|
10221
|
+
eventDescription: 'User clicked the CTA'
|
10222
|
+
}, recData, item, index);
|
10223
|
+
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 }));
|
10224
|
+
if (isExternalLink) {
|
10225
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
10226
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
10227
|
+
window.location.href = window.getJointUtmLink(item.link);
|
10228
|
+
}
|
10229
|
+
}
|
10230
|
+
else {
|
10231
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10232
|
+
}
|
10233
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10234
|
+
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) => {
|
10235
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10236
|
+
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({
|
10185
10237
|
display: 'flex'
|
10186
|
-
}) }),
|
10187
|
-
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 }),
|
10238
|
+
}), onClick: () => handleClick(item, index) }),
|
10239
|
+
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 }),
|
10188
10240
|
React.createElement("div", { style: {
|
10189
|
-
|
10190
|
-
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)`,
|
10241
|
+
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)`,
|
10191
10242
|
display: 'flex',
|
10192
10243
|
flexDirection: 'column',
|
10193
10244
|
justifyContent: 'space-between'
|
10194
10245
|
} },
|
10195
10246
|
React.createElement("div", null,
|
10196
10247
|
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: {
|
10197
|
-
__html: setFontForText((
|
10248
|
+
__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)
|
10198
10249
|
} }),
|
10199
10250
|
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: {
|
10200
|
-
__html: setFontForText((
|
10251
|
+
__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)
|
10201
10252
|
} })),
|
10202
10253
|
React.createElement("div", { className: css.css({
|
10203
10254
|
display: 'flex',
|
@@ -10206,12 +10257,13 @@ Made in Italy` })));
|
|
10206
10257
|
width: '100%',
|
10207
10258
|
overflow: 'hidden'
|
10208
10259
|
}) },
|
10209
|
-
React.createElement("div",
|
10210
|
-
|
10211
|
-
|
10212
|
-
|
10213
|
-
|
10214
|
-
|
10260
|
+
React.createElement("div", null,
|
10261
|
+
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: {
|
10262
|
+
__html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
10263
|
+
} })),
|
10264
|
+
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10265
|
+
__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)
|
10266
|
+
} })))))));
|
10215
10267
|
})));
|
10216
10268
|
};
|
10217
10269
|
var CommodityListComponent = React.memo(CommodityList$1);
|
@@ -10248,7 +10300,7 @@ Made in Italy` })));
|
|
10248
10300
|
* @Author: binruan@chatlabs.com
|
10249
10301
|
* @Date: 2024-03-20 10:27:31
|
10250
10302
|
* @LastEditors: binruan@chatlabs.com
|
10251
|
-
* @LastEditTime: 2024-07-
|
10303
|
+
* @LastEditTime: 2024-07-26 17:33:03
|
10252
10304
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\material.tsx
|
10253
10305
|
*
|
10254
10306
|
*/
|
@@ -10287,6 +10339,7 @@ Made in Italy` })));
|
|
10287
10339
|
backgroundColor: '#000',
|
10288
10340
|
fontSize: 12,
|
10289
10341
|
height: 30,
|
10342
|
+
width: 100,
|
10290
10343
|
textAlign: 'center',
|
10291
10344
|
color: '#fff',
|
10292
10345
|
lineHeight: 2.5
|
@@ -10570,6 +10623,36 @@ Made in Italy` })));
|
|
10570
10623
|
}
|
10571
10624
|
];
|
10572
10625
|
|
10626
|
+
const EventProvider = (_a) => {
|
10627
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
10628
|
+
const ref = React.useRef(null);
|
10629
|
+
const { popup } = useEditor();
|
10630
|
+
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10631
|
+
const { jumpToWeb } = useEventReport();
|
10632
|
+
const handleClick = lodash.throttle(() => {
|
10633
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
10634
|
+
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;
|
10635
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10636
|
+
eventSubject: 'clickCta',
|
10637
|
+
eventDescription: 'User clicked the CTA'
|
10638
|
+
}, rec, item, index);
|
10639
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
10640
|
+
if (isExternalLink) {
|
10641
|
+
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) {
|
10642
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
10643
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
10644
|
+
jumpToWeb(rec, product, cta, index);
|
10645
|
+
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);
|
10646
|
+
}
|
10647
|
+
}
|
10648
|
+
else {
|
10649
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10650
|
+
}
|
10651
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10652
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
10653
|
+
};
|
10654
|
+
var EventProvider$1 = React.memo(EventProvider);
|
10655
|
+
|
10573
10656
|
var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
10574
10657
|
|
10575
10658
|
const Commodity$1 = (_a) => {
|
@@ -11140,12 +11223,12 @@ Made in Italy` })));
|
|
11140
11223
|
const { popup } = useEditor();
|
11141
11224
|
const { jumpToWeb } = useEventReport();
|
11142
11225
|
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]);
|
11143
|
-
const handleClick = lodash.throttle((item) => {
|
11226
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
11144
11227
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11145
11228
|
eventSubject: 'clickCta',
|
11146
11229
|
eventDescription: 'User clicked the CTA'
|
11147
11230
|
}, recData, item, index);
|
11148
|
-
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 }));
|
11231
|
+
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 }));
|
11149
11232
|
if (isExternalLink) {
|
11150
11233
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11151
11234
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11158,7 +11241,7 @@ Made in Italy` })));
|
|
11158
11241
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11159
11242
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11160
11243
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
11161
|
-
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) }),
|
11244
|
+
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) }),
|
11162
11245
|
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 }),
|
11163
11246
|
React.createElement("div", { className: css.css({
|
11164
11247
|
color: '#000',
|
@@ -11256,12 +11339,12 @@ Made in Italy` })));
|
|
11256
11339
|
const { popup } = useEditor();
|
11257
11340
|
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]);
|
11258
11341
|
const { jumpToWeb } = useEventReport();
|
11259
|
-
const handleClick = lodash.throttle((item) => {
|
11342
|
+
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
11260
11343
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11261
11344
|
eventSubject: 'clickCta',
|
11262
11345
|
eventDescription: 'User clicked the CTA'
|
11263
11346
|
}, recData, item, index);
|
11264
|
-
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 }));
|
11347
|
+
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 }));
|
11265
11348
|
if (isExternalLink) {
|
11266
11349
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
11267
11350
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -11274,7 +11357,7 @@ Made in Italy` })));
|
|
11274
11357
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11275
11358
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11276
11359
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
11277
|
-
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) }),
|
11360
|
+
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) }),
|
11278
11361
|
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 }),
|
11279
11362
|
React.createElement("div", { className: css.css({
|
11280
11363
|
color: '#fff',
|
@@ -13990,11 +14073,12 @@ Made in Italy` })));
|
|
13990
14073
|
}
|
13991
14074
|
}, [event === null || event === void 0 ? void 0 : event.animation]);
|
13992
14075
|
React.useEffect(() => {
|
14076
|
+
var _a, _b, _c;
|
13993
14077
|
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
13994
14078
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
13995
14079
|
eventSubject: 'ctaExposure',
|
13996
14080
|
eventDescription: 'The cta was shown to the user'
|
13997
|
-
}, recData,
|
14081
|
+
}, 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);
|
13998
14082
|
}
|
13999
14083
|
}, [isOnScreen]);
|
14000
14084
|
React.useEffect(() => {
|
@@ -14380,14 +14464,11 @@ Made in Italy` })));
|
|
14380
14464
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
14381
14465
|
const AniLinkPopup$1 = (_a) => {
|
14382
14466
|
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;
|
14383
|
-
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"]);
|
14467
|
+
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"]);
|
14384
14468
|
style === null || style === void 0 ? true : delete style.transform;
|
14385
14469
|
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
14386
14470
|
const { jumpToWeb } = useEventReport();
|
14387
|
-
const
|
14388
|
-
const isOnScreen = useOnScreen(ref);
|
14389
|
-
const [visible, setVisible] = React.useState(false);
|
14390
|
-
const [startAni, setStartAni] = React.useState(true);
|
14471
|
+
const [visible, setVisible] = React.useState(true);
|
14391
14472
|
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);
|
14392
14473
|
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);
|
14393
14474
|
const handleTo = () => {
|
@@ -14423,26 +14504,21 @@ Made in Italy` })));
|
|
14423
14504
|
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;
|
14424
14505
|
const onClose = (event) => {
|
14425
14506
|
event.stopPropagation();
|
14426
|
-
|
14507
|
+
setVisible(false);
|
14427
14508
|
};
|
14428
14509
|
React.useEffect(() => {
|
14429
|
-
|
14430
|
-
|
14431
|
-
}
|
14432
|
-
else {
|
14433
|
-
setVisible(false);
|
14434
|
-
}
|
14435
|
-
}, [isOnScreen]);
|
14510
|
+
setVisible(true);
|
14511
|
+
}, [isActive]);
|
14436
14512
|
const aniNamStyle = React.useMemo(() => {
|
14437
|
-
if (!
|
14513
|
+
if (!isActive)
|
14438
14514
|
return null;
|
14439
|
-
return
|
14440
|
-
}, [
|
14515
|
+
return visible ? styles['animated-fadeIn'] : null;
|
14516
|
+
}, [isActive, visible]);
|
14441
14517
|
return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
|
14442
14518
|
height: '40px',
|
14443
14519
|
lineHeight: '40px',
|
14444
14520
|
paddingLeft: '6px'
|
14445
|
-
} }, "Cta Title")) : (React.createElement(
|
14521
|
+
} }, "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 }),
|
14446
14522
|
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 } },
|
14447
14523
|
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'] })),
|
14448
14524
|
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 }),
|
@@ -14451,7 +14527,7 @@ Made in Italy` })));
|
|
14451
14527
|
} })),
|
14452
14528
|
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: {
|
14453
14529
|
__html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
14454
|
-
} })))
|
14530
|
+
} })))));
|
14455
14531
|
};
|
14456
14532
|
var AniLinkPopupComponent = React.memo(AniLinkPopup$1);
|
14457
14533
|
|
@@ -14603,52 +14679,71 @@ Made in Italy` })));
|
|
14603
14679
|
const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
14604
14680
|
const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
14605
14681
|
const LikeButton = (_a) => {
|
14682
|
+
var _b;
|
14606
14683
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
14607
|
-
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
14608
|
-
const [state, setState] = React.useState(
|
14684
|
+
const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
|
14685
|
+
const [state, setState] = React.useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
|
14609
14686
|
const likeIcon = useIconLink(defaultLikeIconPath$1);
|
14610
14687
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
|
14611
14688
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
14612
|
-
var
|
14689
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
14613
14690
|
if (state) {
|
14614
14691
|
// 先设置状态
|
14615
14692
|
setState(false);
|
14616
|
-
const result = (
|
14693
|
+
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;
|
14617
14694
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14618
14695
|
eventInfo: {
|
14619
14696
|
eventSubject: 'favoriteContentCanceled',
|
14620
14697
|
eventDescription: 'This content was unfavorite by the user',
|
14621
|
-
contentId: (
|
14622
|
-
contentName: (
|
14623
|
-
contentTags: JSON.stringify((
|
14698
|
+
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 : '',
|
14699
|
+
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 : '',
|
14700
|
+
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 : []),
|
14624
14701
|
position: position + '',
|
14625
|
-
contentFormat: ((
|
14626
|
-
traceInfo: (
|
14702
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
14703
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
14627
14704
|
}
|
14628
14705
|
});
|
14629
14706
|
// 如果接口调用失败,则回滚状态
|
14630
14707
|
if (!result) {
|
14631
14708
|
setState(true);
|
14632
14709
|
}
|
14710
|
+
else {
|
14711
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
14712
|
+
if (index === position) {
|
14713
|
+
item.isCollected = false;
|
14714
|
+
}
|
14715
|
+
return item;
|
14716
|
+
})) !== null && _p !== void 0 ? _p : [];
|
14717
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
14718
|
+
}
|
14633
14719
|
}
|
14634
14720
|
else {
|
14635
14721
|
setState(true);
|
14636
|
-
const result = (
|
14722
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
14637
14723
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14638
14724
|
eventInfo: {
|
14639
14725
|
eventSubject: 'favoriteContent',
|
14640
14726
|
eventDescription: 'This content was favorite by the user',
|
14641
|
-
contentId: (
|
14642
|
-
contentName: (
|
14643
|
-
contentTags: JSON.stringify((
|
14727
|
+
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 : '',
|
14728
|
+
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 : '',
|
14729
|
+
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 : []),
|
14644
14730
|
position: position + '',
|
14645
|
-
contentFormat: ((
|
14646
|
-
traceInfo: (
|
14731
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
14732
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
14647
14733
|
}
|
14648
14734
|
});
|
14649
14735
|
if (!result) {
|
14650
14736
|
setState(false);
|
14651
14737
|
}
|
14738
|
+
else {
|
14739
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
14740
|
+
if (index === position) {
|
14741
|
+
item.isCollected = true;
|
14742
|
+
}
|
14743
|
+
return item;
|
14744
|
+
})) !== null && _z !== void 0 ? _z : [];
|
14745
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
14746
|
+
}
|
14652
14747
|
}
|
14653
14748
|
}), 200);
|
14654
14749
|
return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
@@ -15284,11 +15379,11 @@ Made in Italy` })));
|
|
15284
15379
|
* @Author: binruan@chatlabs.com
|
15285
15380
|
* @Date: 2023-12-26 16:11:34
|
15286
15381
|
* @LastEditors: binruan@chatlabs.com
|
15287
|
-
* @LastEditTime: 2024-07-
|
15382
|
+
* @LastEditTime: 2024-07-29 10:07:08
|
15288
15383
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
15289
15384
|
*
|
15290
15385
|
*/
|
15291
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
15386
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
|
15292
15387
|
var _a, _b, _c, _d, _e;
|
15293
15388
|
const { schema } = useEditor();
|
15294
15389
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
@@ -15333,12 +15428,12 @@ Made in Italy` })));
|
|
15333
15428
|
const Component = withBindDataSource(t);
|
15334
15429
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
15335
15430
|
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';
|
15336
|
-
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 })));
|
15431
|
+
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 })));
|
15337
15432
|
}
|
15338
15433
|
else {
|
15339
15434
|
return null;
|
15340
15435
|
}
|
15341
|
-
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id]);
|
15436
|
+
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
|
15342
15437
|
return React.createElement(React.Fragment, null, renderComp);
|
15343
15438
|
};
|
15344
15439
|
var RenderCard$1 = React.memo(RenderCard);
|
@@ -15426,7 +15521,7 @@ Made in Italy` })));
|
|
15426
15521
|
* @Author: binruan@chatlabs.com
|
15427
15522
|
* @Date: 2024-01-15 19:03:09
|
15428
15523
|
* @LastEditors: binruan@chatlabs.com
|
15429
|
-
* @LastEditTime: 2024-07-
|
15524
|
+
* @LastEditTime: 2024-07-31 11:33:42
|
15430
15525
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
15431
15526
|
*
|
15432
15527
|
*/
|
@@ -15644,7 +15739,7 @@ Made in Italy` })));
|
|
15644
15739
|
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 }),
|
15645
15740
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
15646
15741
|
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 }))),
|
15647
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'] })));
|
15742
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
15648
15743
|
}
|
15649
15744
|
return null;
|
15650
15745
|
}, [
|
@@ -15698,8 +15793,8 @@ Made in Italy` })));
|
|
15698
15793
|
}
|
15699
15794
|
};
|
15700
15795
|
const handleSlideSkip = (item, position) => {
|
15701
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
15702
|
-
if (isPreview)
|
15796
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
15797
|
+
if (isPreview || waterFallData)
|
15703
15798
|
return;
|
15704
15799
|
const t = new Date() - curTime.current;
|
15705
15800
|
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) {
|
@@ -15717,7 +15812,7 @@ Made in Italy` })));
|
|
15717
15812
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
15718
15813
|
position: position + '',
|
15719
15814
|
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 : '',
|
15720
|
-
traceInfo: (_r =
|
15815
|
+
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 : ''
|
15721
15816
|
}
|
15722
15817
|
});
|
15723
15818
|
setSlideSkipState();
|
@@ -16248,19 +16343,18 @@ Made in Italy` })));
|
|
16248
16343
|
* @Author: binruan@chatlabs.com
|
16249
16344
|
* @Date: 2023-10-31 10:56:01
|
16250
16345
|
* @LastEditors: binruan@chatlabs.com
|
16251
|
-
* @LastEditTime: 2024-07-
|
16346
|
+
* @LastEditTime: 2024-07-31 18:54:49
|
16252
16347
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
16253
16348
|
*
|
16254
16349
|
*/
|
16255
16350
|
const Popup = () => {
|
16256
16351
|
const { schema, resolver, popup } = useEditor();
|
16257
|
-
const { setPopupDetailData, popupDetailData,
|
16352
|
+
const { setPopupDetailData, popupDetailData, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
16258
16353
|
const { productView } = useEventReport();
|
16259
16354
|
const [visible, setVisible] = React.useState();
|
16260
|
-
const curTimeRef = React.useRef(null);
|
16261
16355
|
React.useEffect(() => {
|
16262
16356
|
const initTime = () => {
|
16263
|
-
|
16357
|
+
popupCurTimeRef.current = new Date();
|
16264
16358
|
};
|
16265
16359
|
initTime();
|
16266
16360
|
window.addEventListener('pageshow', initTime);
|
@@ -16270,25 +16364,39 @@ Made in Italy` })));
|
|
16270
16364
|
}, []);
|
16271
16365
|
React.useEffect(() => {
|
16272
16366
|
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
16273
|
-
|
16367
|
+
popupCurTimeRef.current = new Date();
|
16274
16368
|
setVisible(popup);
|
16275
16369
|
}
|
16276
16370
|
}, [popup]);
|
16277
16371
|
const handleClose = () => {
|
16278
|
-
var _a, _b, _c, _d;
|
16279
|
-
if (!popup ||
|
16372
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
16373
|
+
if (!popup ||
|
16374
|
+
(popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
|
16375
|
+
!visible ||
|
16376
|
+
new Date() - popupCurTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
|
16280
16377
|
return;
|
16281
16378
|
}
|
16282
16379
|
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
16283
|
-
const
|
16284
|
-
|
16285
|
-
|
16286
|
-
|
16287
|
-
|
16380
|
+
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));
|
16381
|
+
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') {
|
16382
|
+
const data = popupDetailData;
|
16383
|
+
let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
|
16384
|
+
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;
|
16385
|
+
if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
|
16386
|
+
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];
|
16387
|
+
if (p) {
|
16388
|
+
product = p;
|
16389
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
16390
|
+
}
|
16391
|
+
}
|
16392
|
+
if (product && cta) {
|
16393
|
+
productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
16394
|
+
}
|
16288
16395
|
}
|
16289
16396
|
setTimeout(() => {
|
16290
16397
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
16291
16398
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
16399
|
+
checkCommodityIndexRef.current = -1;
|
16292
16400
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
16293
16401
|
};
|
16294
16402
|
const renderPopupDetail = React.useMemo(() => {
|
@@ -16301,7 +16409,7 @@ Made in Italy` })));
|
|
16301
16409
|
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';
|
16302
16410
|
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';
|
16303
16411
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
16304
|
-
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 })));
|
16412
|
+
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 })));
|
16305
16413
|
}
|
16306
16414
|
else {
|
16307
16415
|
return React.createElement(React.Fragment, null);
|