pb-sxp-ui 1.2.6 → 1.2.7
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 +53 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -3
- package/dist/index.js +53 -37
- 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 +53 -37
- 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/FormatImage.js +7 -3
- package/es/core/components/SxpPageRender/Popup/index.js +5 -5
- package/es/core/components/SxpPageRender/index.js +5 -5
- package/es/core/context/SxpDataSourceProvider.js +25 -15
- package/es/core/hooks/useEventReport.js +4 -4
- package/es/materials/sxp/popup/CommodityList/index.d.ts +0 -1
- package/es/materials/sxp/popup/CommodityList/index.js +2 -1
- package/es/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
- package/es/materials/sxp/template/components/CommodityGroup.js +2 -1
- package/lib/core/components/SxpPageRender/FormatImage.js +7 -3
- package/lib/core/components/SxpPageRender/Popup/index.js +5 -5
- package/lib/core/components/SxpPageRender/index.js +5 -5
- package/lib/core/context/SxpDataSourceProvider.js +25 -15
- package/lib/core/hooks/useEventReport.js +4 -4
- package/lib/materials/sxp/popup/CommodityList/index.d.ts +0 -1
- package/lib/materials/sxp/popup/CommodityList/index.js +2 -1
- package/lib/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
- package/lib/materials/sxp/template/components/CommodityGroup.js +2 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
@@ -1825,7 +1825,7 @@ button.swiper-pagination-bullet {
|
|
1825
1825
|
transform: translate3d(0px, 0px, 0px);
|
1826
1826
|
}
|
1827
1827
|
.clc-sxp-logo-banner {
|
1828
|
-
height:
|
1828
|
+
height: 56px;
|
1829
1829
|
width: 100%;
|
1830
1830
|
overflow: hidden;
|
1831
1831
|
display: -webkit-box;
|
@@ -1838,8 +1838,6 @@ button.swiper-pagination-bullet {
|
|
1838
1838
|
justify-content: center;
|
1839
1839
|
}
|
1840
1840
|
.clc-sxp-logo-banner img {
|
1841
|
-
height: 100%;
|
1842
|
-
width: 50%;
|
1843
1841
|
-o-object-fit: cover;
|
1844
1842
|
object-fit: cover;
|
1845
1843
|
display: block;
|
package/dist/index.js
CHANGED
@@ -558,6 +558,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
558
558
|
var _a, _b, _c, _d;
|
559
559
|
return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
|
560
560
|
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
|
561
|
+
const getFilterRecList = useCallback((data) => {
|
562
|
+
var _a;
|
563
|
+
const recList = data === null || data === void 0 ? void 0 : data.recList;
|
564
|
+
const nList = (_a = recList === null || recList === void 0 ? void 0 : recList.map((item) => {
|
565
|
+
var _a, _b, _c, _d, _e, _f;
|
566
|
+
if (((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) && ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
567
|
+
const bindProducts = (_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindProducts) === null || _e === void 0 ? void 0 : _e.filter((item) => !!(item === null || item === void 0 ? void 0 : item.bindCta))) !== null && _f !== void 0 ? _f : [];
|
568
|
+
return Object.assign(Object.assign({}, item), { video: Object.assign(Object.assign({}, item === null || item === void 0 ? void 0 : item.video), { bindProducts }) });
|
569
|
+
}
|
570
|
+
return item;
|
571
|
+
})) !== null && _a !== void 0 ? _a : [];
|
572
|
+
return nList;
|
573
|
+
}, []);
|
561
574
|
useEffect(() => {
|
562
575
|
const handleChangeThemeTag = (tag) => {
|
563
576
|
themeTag.current = tag;
|
@@ -629,7 +642,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
629
642
|
return result === null || result === void 0 ? void 0 : result.data;
|
630
643
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
631
644
|
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
632
|
-
var _j, _k;
|
633
645
|
if (rtcList.length <= 0) {
|
634
646
|
return;
|
635
647
|
}
|
@@ -639,8 +651,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
639
651
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
640
652
|
themeTag: themeTag.current
|
641
653
|
});
|
642
|
-
setRtcList(
|
643
|
-
setCacheRtcList(
|
654
|
+
setRtcList(getFilterRecList(data));
|
655
|
+
setCacheRtcList(getFilterRecList(data));
|
644
656
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
645
657
|
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
646
658
|
// 关闭 BFF 事件上报
|
@@ -704,24 +716,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
704
716
|
}), [bffFetch]);
|
705
717
|
// 获取 Tag
|
706
718
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
707
|
-
var
|
719
|
+
var _j, _k, _l, _m, _o;
|
708
720
|
if (!utmVal || !isShowTag)
|
709
721
|
return;
|
710
722
|
try {
|
711
|
-
const val = (
|
723
|
+
const val = (_l = (_k = (_j = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _j === void 0 ? void 0 : _j.filter((val) => {
|
712
724
|
var _a, _b;
|
713
725
|
const key = val.split('=')[0];
|
714
726
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
715
|
-
})) === null ||
|
727
|
+
})) === null || _k === void 0 ? void 0 : _k.join('&')) !== null && _l !== void 0 ? _l : '';
|
716
728
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
717
|
-
setTagList((
|
729
|
+
setTagList((_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.tags) !== null && _o !== void 0 ? _o : []);
|
718
730
|
}
|
719
731
|
catch (e) {
|
720
732
|
console.log('e', e);
|
721
733
|
}
|
722
734
|
}), [bffFetch, utmVal, isShowTag]);
|
723
735
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
724
|
-
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;
|
736
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
725
737
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
726
738
|
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);
|
727
739
|
let fromKName = '';
|
@@ -735,7 +747,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
735
747
|
fromKName = 'imagePage';
|
736
748
|
}
|
737
749
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
738
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (
|
750
|
+
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: (_2 = (_z = (_u = (_q = (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_t = (_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProduct) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : (_y = (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.bindProducts) === null || _w === void 0 ? void 0 : _w[0]) === null || _x === void 0 ? void 0 : _x.bindCta) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_1 = (_0 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : '', fromKName, fromKPage: (_3 = location === null || location === void 0 ? void 0 : location.href) !== null && _3 !== void 0 ? _3 : '' })
|
739
751
|
});
|
740
752
|
}, [bffEventReport, isFromHashtag]);
|
741
753
|
const h5EnterLink = useCallback(() => {
|
@@ -775,9 +787,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
775
787
|
bffGetTagList();
|
776
788
|
getRecommendVideos()
|
777
789
|
.then((data) => {
|
778
|
-
|
779
|
-
|
780
|
-
setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
|
790
|
+
setRtcList(getFilterRecList(data));
|
791
|
+
setCacheRtcList(getFilterRecList(data));
|
781
792
|
})
|
782
793
|
.finally(() => {
|
783
794
|
bffEventReport({
|
@@ -797,9 +808,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
797
808
|
bffGetTagList();
|
798
809
|
getRecommendVideos()
|
799
810
|
.then((data) => {
|
800
|
-
|
801
|
-
|
802
|
-
setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
|
811
|
+
setRtcList(getFilterRecList(data));
|
812
|
+
setCacheRtcList(getFilterRecList(data));
|
803
813
|
})
|
804
814
|
.finally(() => {
|
805
815
|
setLoading(false);
|
@@ -1267,14 +1277,14 @@ var settingRender$9 = [
|
|
1267
1277
|
* @Author: binruan@chatlabs.com
|
1268
1278
|
* @Date: 2024-03-12 10:59:06
|
1269
1279
|
* @LastEditors: binruan@chatlabs.com
|
1270
|
-
* @LastEditTime: 2024-
|
1280
|
+
* @LastEditTime: 2024-08-01 17:36:34
|
1271
1281
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1272
1282
|
*
|
1273
1283
|
*/
|
1274
1284
|
function useEventReport() {
|
1275
1285
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
1276
1286
|
const jumpToWeb = useCallback((data, product, cta, position) => {
|
1277
|
-
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;
|
1287
|
+
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;
|
1278
1288
|
let fromKName = '';
|
1279
1289
|
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))) {
|
1280
1290
|
fromKName = 'pdpPage';
|
@@ -1305,12 +1315,12 @@ function useEventReport() {
|
|
1305
1315
|
position: position + '',
|
1306
1316
|
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 : '',
|
1307
1317
|
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
1308
|
-
traceInfo: (
|
1318
|
+
traceInfo: (_1 = (_y = (_w = (_s = (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : (_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_v = (_u = (_t = data === null || data === void 0 ? void 0 : data.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = data === null || data === void 0 ? void 0 : data.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = data === null || data === void 0 ? void 0 : data.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : ''
|
1309
1319
|
}
|
1310
1320
|
});
|
1311
1321
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
1312
1322
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
1313
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
1323
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1314
1324
|
let fromKName = '';
|
1315
1325
|
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))) {
|
1316
1326
|
fromKName = 'pdpPage';
|
@@ -1330,7 +1340,7 @@ function useEventReport() {
|
|
1330
1340
|
position: position + '',
|
1331
1341
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1332
1342
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1333
|
-
traceInfo: (
|
1343
|
+
traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
1334
1344
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1335
1345
|
eventSubject: 'productView',
|
1336
1346
|
eventDescription: 'User browsed the product'
|
@@ -8791,6 +8801,7 @@ var ExpandableText$1 = memo(ExpandableText);
|
|
8791
8801
|
const FormatImage = forwardRef((props, ref) => {
|
8792
8802
|
const { src, onLoad, style, className, loading } = props;
|
8793
8803
|
const [imgSrc, setImgSrc] = useState();
|
8804
|
+
const imgRef = useRef(null);
|
8794
8805
|
useImperativeHandle(ref, () => ({
|
8795
8806
|
setSrc: (v) => {
|
8796
8807
|
setImgSrc(v);
|
@@ -8799,7 +8810,6 @@ const FormatImage = forwardRef((props, ref) => {
|
|
8799
8810
|
useEffect(() => {
|
8800
8811
|
setImgSrc(src);
|
8801
8812
|
}, [src]);
|
8802
|
-
useRef(null);
|
8803
8813
|
// useEffect(() => {
|
8804
8814
|
// let observer: any = null;
|
8805
8815
|
// const { current } = imgRef;
|
@@ -8827,9 +8837,13 @@ const FormatImage = forwardRef((props, ref) => {
|
|
8827
8837
|
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
8828
8838
|
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
|
8829
8839
|
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
|
8830
|
-
React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
|
8840
|
+
React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
|
8841
|
+
if (imgRef.current)
|
8842
|
+
imgRef.current.style.display = 'block';
|
8831
8843
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
8832
|
-
}, alt: 'image' }))) : (React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
|
8844
|
+
}, alt: 'image' }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
|
8845
|
+
if (imgRef.current)
|
8846
|
+
imgRef.current.style.display = 'block';
|
8833
8847
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
8834
8848
|
}, alt: 'image' }))));
|
8835
8849
|
});
|
@@ -8862,7 +8876,8 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
|
|
8862
8876
|
const handleClick = (item, index) => {
|
8863
8877
|
if (check === index)
|
8864
8878
|
return;
|
8865
|
-
|
8879
|
+
const prevItem = products === null || products === void 0 ? void 0 : products[check];
|
8880
|
+
productView(popupDetailData, prevItem, prevItem === null || prevItem === void 0 ? void 0 : prevItem.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
8866
8881
|
onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
|
8867
8882
|
};
|
8868
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) => {
|
@@ -10183,12 +10198,13 @@ var Img$1 = memo(Img);
|
|
10183
10198
|
|
10184
10199
|
const CommodityList$1 = (_a) => {
|
10185
10200
|
var _b, _c;
|
10186
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle,
|
10201
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
|
10187
10202
|
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
|
10188
10203
|
const { jumpToWeb } = useEventReport();
|
10189
10204
|
const { popup } = useEditor();
|
10190
10205
|
const recData = isPost ? rec : popupDetailData;
|
10191
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];
|
10207
|
+
const index = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
10192
10208
|
const priceText = useCallback((product) => {
|
10193
10209
|
var _a, _b, _c, _d, _e;
|
10194
10210
|
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
@@ -15506,7 +15522,7 @@ var Tagbar$1 = memo(Tagbar);
|
|
15506
15522
|
* @Author: binruan@chatlabs.com
|
15507
15523
|
* @Date: 2024-01-15 19:03:09
|
15508
15524
|
* @LastEditors: binruan@chatlabs.com
|
15509
|
-
* @LastEditTime: 2024-
|
15525
|
+
* @LastEditTime: 2024-08-01 17:42:09
|
15510
15526
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
15511
15527
|
*
|
15512
15528
|
*/
|
@@ -15567,7 +15583,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15567
15583
|
useEffect(() => {
|
15568
15584
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
15569
15585
|
const visibleChange = () => {
|
15570
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
15586
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
15571
15587
|
const repCond = !openHashtag && !isShowConsent;
|
15572
15588
|
if (document.visibilityState === 'hidden') {
|
15573
15589
|
// 当用户导航到新页面、切换标签页、关闭标签页、最小化或关闭浏览器、刷新原页面(即离开原页面时),或者在移动设备上从浏览器切换到不同的应用程序时
|
@@ -15607,7 +15623,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15607
15623
|
fromKName,
|
15608
15624
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
15609
15625
|
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
15610
|
-
traceInfo: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : ''
|
15626
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
|
15611
15627
|
}
|
15612
15628
|
});
|
15613
15629
|
}
|
@@ -15652,7 +15668,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15652
15668
|
const minusHeight = useMemo(() => {
|
15653
15669
|
let minusHeight = 0;
|
15654
15670
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
15655
|
-
minusHeight +=
|
15671
|
+
minusHeight += 56;
|
15656
15672
|
}
|
15657
15673
|
return minusHeight;
|
15658
15674
|
}, []);
|
@@ -15778,7 +15794,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15778
15794
|
}
|
15779
15795
|
};
|
15780
15796
|
const handleSlideSkip = (item, position) => {
|
15781
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
15797
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
15782
15798
|
if (isPreview || waterFallData)
|
15783
15799
|
return;
|
15784
15800
|
const t = new Date() - curTime.current;
|
@@ -15797,7 +15813,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15797
15813
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
15798
15814
|
position: position + '',
|
15799
15815
|
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 : '',
|
15800
|
-
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 : ''
|
15816
|
+
traceInfo: (_u = (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_t = item === null || item === void 0 ? void 0 : item.product) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : ''
|
15801
15817
|
}
|
15802
15818
|
});
|
15803
15819
|
setSlideSkipState();
|
@@ -16328,7 +16344,7 @@ var index$1 = memo(DiyPortalPreview);
|
|
16328
16344
|
* @Author: binruan@chatlabs.com
|
16329
16345
|
* @Date: 2023-10-31 10:56:01
|
16330
16346
|
* @LastEditors: binruan@chatlabs.com
|
16331
|
-
* @LastEditTime: 2024-
|
16347
|
+
* @LastEditTime: 2024-08-01 15:23:51
|
16332
16348
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
16333
16349
|
*
|
16334
16350
|
*/
|
@@ -16354,7 +16370,7 @@ const Popup = () => {
|
|
16354
16370
|
}
|
16355
16371
|
}, [popup]);
|
16356
16372
|
const handleClose = () => {
|
16357
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
16373
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
16358
16374
|
if (!popup ||
|
16359
16375
|
(popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
|
16360
16376
|
!visible ||
|
@@ -16365,10 +16381,10 @@ const Popup = () => {
|
|
16365
16381
|
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));
|
16366
16382
|
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') {
|
16367
16383
|
const data = popupDetailData;
|
16368
|
-
let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
|
16369
|
-
let cta = (
|
16384
|
+
let product = (_h = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0];
|
16385
|
+
let cta = (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProduct) === null || _m === void 0 ? void 0 : _m.bindCta) !== null && _o !== void 0 ? _o : (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.bindCta;
|
16370
16386
|
if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
|
16371
|
-
const p = (
|
16387
|
+
const p = (_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[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
|
16372
16388
|
if (p) {
|
16373
16389
|
product = p;
|
16374
16390
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
@@ -16394,7 +16410,7 @@ const Popup = () => {
|
|
16394
16410
|
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';
|
16395
16411
|
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';
|
16396
16412
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
16397
|
-
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
|
16413
|
+
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 })));
|
16398
16414
|
}
|
16399
16415
|
else {
|
16400
16416
|
return React.createElement(React.Fragment, null);
|