pb-sxp-ui 1.7.1 → 1.7.2
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 +118 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +118 -57
- 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 +118 -57
- 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/Modal/index.js +6 -3
- package/es/core/components/SxpPageRender/VideoWidget/index.js +8 -5
- package/es/core/components/SxpPageRender/WaterFall/index.js +5 -2
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +10 -17
- package/es/core/context/SxpDataSourceProvider.d.ts +2 -4
- package/es/core/context/SxpDataSourceProvider.js +53 -11
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +12 -7
- package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -8
- package/es/materials/sxp/popup/CommodityList/index.js +7 -2
- package/lib/core/components/SxpPageRender/Modal/index.js +5 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +8 -5
- package/lib/core/components/SxpPageRender/WaterFall/index.js +5 -2
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +10 -17
- package/lib/core/context/SxpDataSourceProvider.d.ts +2 -4
- package/lib/core/context/SxpDataSourceProvider.js +53 -11
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +12 -7
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -8
- package/lib/materials/sxp/popup/CommodityList/index.js +6 -1
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -812,23 +812,65 @@
|
|
812
812
|
type: 'beacon'
|
813
813
|
});
|
814
814
|
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
815
|
-
const bffFbReport = React.useCallback((
|
816
|
-
var _b, _c, _d;
|
817
|
-
var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
|
815
|
+
const bffFbReport = React.useCallback(({ eventName, product }) => {
|
816
|
+
var _a, _b, _c, _d;
|
818
817
|
if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
819
818
|
return;
|
820
819
|
}
|
821
|
-
|
820
|
+
let jsonParams = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName];
|
822
821
|
const urlParams = new URLSearchParams(window.location.search);
|
823
|
-
const fbclid = urlParams.get('fbclid');
|
822
|
+
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
823
|
+
const fix_par = {
|
824
|
+
event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
|
825
|
+
external_id: storeAndLoadFeUserId(),
|
826
|
+
client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '',
|
827
|
+
fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
|
828
|
+
fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
|
829
|
+
time: new Date().getTime()
|
830
|
+
};
|
831
|
+
const regex = /\{\{(.*?)\}\}/g;
|
832
|
+
const getEventParams = (obj) => {
|
833
|
+
if (!obj)
|
834
|
+
return;
|
835
|
+
if (obj instanceof Array) {
|
836
|
+
obj === null || obj === void 0 ? void 0 : obj.map((item) => getEventParams(item));
|
837
|
+
}
|
838
|
+
else {
|
839
|
+
for (const key in obj) {
|
840
|
+
if (obj.hasOwnProperty(key)) {
|
841
|
+
const value = obj === null || obj === void 0 ? void 0 : obj[key];
|
842
|
+
if (typeof value === 'object') {
|
843
|
+
getEventParams(value);
|
844
|
+
}
|
845
|
+
else if (typeof value === 'string') {
|
846
|
+
const matches = value === null || value === void 0 ? void 0 : value.match(regex);
|
847
|
+
if (matches) {
|
848
|
+
matches.forEach((match) => {
|
849
|
+
const prop = match.substring(2, match.length - 2);
|
850
|
+
try {
|
851
|
+
const replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
852
|
+
if (replaceValue) {
|
853
|
+
obj[key] = replaceValue;
|
854
|
+
}
|
855
|
+
else {
|
856
|
+
delete obj[key];
|
857
|
+
}
|
858
|
+
}
|
859
|
+
catch (error) {
|
860
|
+
delete obj[key];
|
861
|
+
console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
|
862
|
+
}
|
863
|
+
});
|
864
|
+
}
|
865
|
+
}
|
866
|
+
}
|
867
|
+
}
|
868
|
+
}
|
869
|
+
};
|
870
|
+
getEventParams(jsonParams);
|
824
871
|
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
|
825
872
|
method: 'POST',
|
826
|
-
body:
|
827
|
-
eventName,
|
828
|
-
actionSource,
|
829
|
-
eventSourceUrl,
|
830
|
-
userData: Object.assign(Object.assign(Object.assign({ externalId: fakeUserId }, (fbclid && { fbc: `fb.2.${new Date().getTime()}.${fbclid}` })), (getCookie('_fbp') && { fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` })), { clientUserAgent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '' })
|
831
|
-
},
|
873
|
+
body: jsonParams,
|
832
874
|
type: 'beacon'
|
833
875
|
});
|
834
876
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
@@ -8927,7 +8969,7 @@
|
|
8927
8969
|
* @Author: binruan@chatlabs.com
|
8928
8970
|
* @Date: 2023-11-02 18:34:34
|
8929
8971
|
* @LastEditors: binruan@chatlabs.com
|
8930
|
-
* @LastEditTime: 2024-10-
|
8972
|
+
* @LastEditTime: 2024-10-23 16:44:34
|
8931
8973
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8932
8974
|
*
|
8933
8975
|
*/
|
@@ -8944,7 +8986,7 @@
|
|
8944
8986
|
const [isShow, setIsShow] = React.useState(false);
|
8945
8987
|
const modalEleRef = React.useRef(null);
|
8946
8988
|
const { globalConfig, popupDetailData } = useSxpDataSource();
|
8947
|
-
const { schema: _schema } = useEditor();
|
8989
|
+
const { schema: _schema, popup: _popup } = useEditor();
|
8948
8990
|
const [scrollTop, setScrollTop] = React.useState(15);
|
8949
8991
|
React.useEffect(() => {
|
8950
8992
|
const parentNode = document.getElementById('sxp-render');
|
@@ -8982,6 +9024,9 @@
|
|
8982
9024
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
8983
9025
|
}
|
8984
9026
|
}, [isOpen, popup]);
|
9027
|
+
const child = React.useCallback(() => {
|
9028
|
+
return children;
|
9029
|
+
}, [_popup]);
|
8985
9030
|
if (!modalEleRef.current)
|
8986
9031
|
return null;
|
8987
9032
|
const handleClose = lodash.debounce(() => {
|
@@ -9067,7 +9112,7 @@
|
|
9067
9112
|
var _a;
|
9068
9113
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
9069
9114
|
}
|
9070
|
-
})),
|
9115
|
+
})), child())))))), modalEleRef.current);
|
9071
9116
|
};
|
9072
9117
|
var Modal$1 = React.memo(Modal);
|
9073
9118
|
|
@@ -9325,7 +9370,7 @@
|
|
9325
9370
|
|
9326
9371
|
const CommodityDetail$1 = (_a) => {
|
9327
9372
|
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;
|
9328
|
-
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
|
9373
|
+
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
9329
9374
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
9330
9375
|
const { jumpToWeb, productView } = useEventReport();
|
9331
9376
|
const curTimeRef = React.useRef(null);
|
@@ -9355,12 +9400,17 @@
|
|
9355
9400
|
}
|
9356
9401
|
};
|
9357
9402
|
React.useEffect(() => {
|
9358
|
-
if (!
|
9359
|
-
|
9360
|
-
|
9361
|
-
|
9362
|
-
|
9363
|
-
|
9403
|
+
if (!isActive)
|
9404
|
+
return;
|
9405
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9406
|
+
eventName: 'ProductView',
|
9407
|
+
product
|
9408
|
+
});
|
9409
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9410
|
+
eventName: 'PageView',
|
9411
|
+
product
|
9412
|
+
});
|
9413
|
+
}, [isActive, bffFbReport]);
|
9364
9414
|
React.useEffect(() => {
|
9365
9415
|
const initTime = () => {
|
9366
9416
|
curTimeRef.current = new Date();
|
@@ -10202,7 +10252,7 @@
|
|
10202
10252
|
|
10203
10253
|
const CommodityDetailDiroNew$1 = (_a) => {
|
10204
10254
|
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, _2, _3, _4;
|
10205
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
|
10255
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
10206
10256
|
React.useState(true);
|
10207
10257
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
10208
10258
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -10236,14 +10286,21 @@
|
|
10236
10286
|
}
|
10237
10287
|
};
|
10238
10288
|
React.useEffect(() => {
|
10239
|
-
if (!
|
10240
|
-
|
10241
|
-
|
10242
|
-
|
10243
|
-
|
10244
|
-
|
10289
|
+
if (!isActive)
|
10290
|
+
return;
|
10291
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10292
|
+
eventName: 'ProductView',
|
10293
|
+
product
|
10294
|
+
});
|
10295
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10296
|
+
eventName: 'PageView',
|
10297
|
+
product
|
10298
|
+
});
|
10299
|
+
}, [isActive, bffFbReport]);
|
10245
10300
|
React.useEffect(() => {
|
10246
10301
|
const initTime = () => {
|
10302
|
+
if (!isActive)
|
10303
|
+
return;
|
10247
10304
|
curTimeRef.current = new Date();
|
10248
10305
|
};
|
10249
10306
|
initTime();
|
@@ -10251,7 +10308,7 @@
|
|
10251
10308
|
return () => {
|
10252
10309
|
window.removeEventListener('pageshow', initTime);
|
10253
10310
|
};
|
10254
|
-
}, []);
|
10311
|
+
}, [isActive]);
|
10255
10312
|
const priceText = getPriceText({
|
10256
10313
|
product,
|
10257
10314
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
@@ -10863,7 +10920,7 @@ Made in Italy` })));
|
|
10863
10920
|
const CommodityList$1 = (_a) => {
|
10864
10921
|
var _b, _c, _d;
|
10865
10922
|
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"]);
|
10866
|
-
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig } = useSxpDataSource();
|
10923
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig, bffFbReport } = useSxpDataSource();
|
10867
10924
|
const { jumpToWeb } = useEventReport();
|
10868
10925
|
const { popup } = useEditor();
|
10869
10926
|
const recData = isPost ? rec : popupDetailData;
|
@@ -10893,6 +10950,11 @@ Made in Italy` })));
|
|
10893
10950
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10894
10951
|
}
|
10895
10952
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10953
|
+
React.useEffect(() => {
|
10954
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10955
|
+
eventName: 'PageView'
|
10956
|
+
});
|
10957
|
+
}, []);
|
10896
10958
|
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) => {
|
10897
10959
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10898
10960
|
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({
|
@@ -14410,13 +14472,13 @@ Made in Italy` })));
|
|
14410
14472
|
* @Author: binruan@chatlabs.com
|
14411
14473
|
* @Date: 2024-01-10 10:58:24
|
14412
14474
|
* @LastEditors: binruan@chatlabs.com
|
14413
|
-
* @LastEditTime: 2024-10-
|
14475
|
+
* @LastEditTime: 2024-10-23 16:58:01
|
14414
14476
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
14415
14477
|
*
|
14416
14478
|
*/
|
14417
14479
|
const WaterFall = (props) => {
|
14418
14480
|
var _a;
|
14419
|
-
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
|
14481
|
+
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
|
14420
14482
|
const { backMainFeed } = useEventReport();
|
14421
14483
|
React.useRef(null);
|
14422
14484
|
const modalEleRef = React.useRef(null);
|
@@ -14493,8 +14555,11 @@ Made in Italy` })));
|
|
14493
14555
|
React.useEffect(() => {
|
14494
14556
|
if (openHashtag) {
|
14495
14557
|
setViewTime(new Date());
|
14558
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
14559
|
+
eventName: 'PageView'
|
14560
|
+
});
|
14496
14561
|
}
|
14497
|
-
}, [openHashtag]);
|
14562
|
+
}, [openHashtag, bffFbReport]);
|
14498
14563
|
React.useEffect(() => {
|
14499
14564
|
const initTime = () => {
|
14500
14565
|
setViewTime(new Date());
|
@@ -15795,17 +15860,18 @@ Made in Italy` })));
|
|
15795
15860
|
};
|
15796
15861
|
}, [isActive]);
|
15797
15862
|
React.useEffect(() => {
|
15798
|
-
var _a, _b;
|
15863
|
+
var _a, _b, _c, _d;
|
15799
15864
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
15800
15865
|
return;
|
15801
15866
|
if (isActive) {
|
15802
15867
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15803
|
-
eventName: 'ViewContent'
|
15868
|
+
eventName: 'ViewContent',
|
15869
|
+
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
15804
15870
|
});
|
15805
|
-
(
|
15871
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
15806
15872
|
}
|
15807
15873
|
else {
|
15808
|
-
(
|
15874
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
15809
15875
|
}
|
15810
15876
|
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15811
15877
|
/*
|
@@ -15827,9 +15893,11 @@ Made in Italy` })));
|
|
15827
15893
|
if (!isActive)
|
15828
15894
|
return;
|
15829
15895
|
const onShow = () => {
|
15896
|
+
var _a, _b;
|
15830
15897
|
handleClickVideo('start')();
|
15831
15898
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15832
|
-
eventName: 'ViewContent'
|
15899
|
+
eventName: 'ViewContent',
|
15900
|
+
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
15833
15901
|
});
|
15834
15902
|
};
|
15835
15903
|
const onHide = handleClickVideo('pause');
|
@@ -16316,7 +16384,7 @@ Made in Italy` })));
|
|
16316
16384
|
* @Author: binruan@chatlabs.com
|
16317
16385
|
* @Date: 2024-01-15 19:03:09
|
16318
16386
|
* @LastEditors: binruan@chatlabs.com
|
16319
|
-
* @LastEditTime: 2024-10-
|
16387
|
+
* @LastEditTime: 2024-10-23 18:06:34
|
16320
16388
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16321
16389
|
*
|
16322
16390
|
*/
|
@@ -16346,9 +16414,6 @@ Made in Italy` })));
|
|
16346
16414
|
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
16347
16415
|
const now = new Date();
|
16348
16416
|
viewTime.current = now;
|
16349
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16350
|
-
eventName: 'PageView'
|
16351
|
-
});
|
16352
16417
|
}
|
16353
16418
|
}, [data === null || data === void 0 ? void 0 : data.length]);
|
16354
16419
|
const handleH5EnterLink = React.useCallback(() => {
|
@@ -16357,11 +16422,8 @@ Made in Italy` })));
|
|
16357
16422
|
if (data.length > 0) {
|
16358
16423
|
const now = new Date();
|
16359
16424
|
viewTime.current = now;
|
16360
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16361
|
-
eventName: 'PageView'
|
16362
|
-
});
|
16363
16425
|
}
|
16364
|
-
}, [data.length,
|
16426
|
+
}, [data.length, h5EnterLink]);
|
16365
16427
|
React.useEffect(() => {
|
16366
16428
|
var _a;
|
16367
16429
|
if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
|
@@ -16530,7 +16592,7 @@ Made in Italy` })));
|
|
16530
16592
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
16531
16593
|
const Component = withBindDataSource(t);
|
16532
16594
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
16533
|
-
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index })));
|
16595
|
+
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index, isActive: activeIndex === index })));
|
16534
16596
|
});
|
16535
16597
|
}
|
16536
16598
|
return null;
|
@@ -16666,7 +16728,7 @@ Made in Italy` })));
|
|
16666
16728
|
}
|
16667
16729
|
};
|
16668
16730
|
const handleScrollEvent = (swiper) => {
|
16669
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
16731
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
16670
16732
|
const item = data[swiper.previousIndex];
|
16671
16733
|
if (!item)
|
16672
16734
|
return;
|
@@ -16710,12 +16772,6 @@ Made in Italy` })));
|
|
16710
16772
|
}
|
16711
16773
|
// 商品浏览事件
|
16712
16774
|
handleReportProductView(item);
|
16713
|
-
const curItem = data[swiper.activeIndex];
|
16714
|
-
if (!((_r = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _r === void 0 ? void 0 : _r.url) && !((_s = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
|
16715
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16716
|
-
eventName: 'ProductView'
|
16717
|
-
});
|
16718
|
-
}
|
16719
16775
|
viewTime.current = new Date();
|
16720
16776
|
};
|
16721
16777
|
const handleReportProductView = (item) => {
|
@@ -16734,7 +16790,7 @@ Made in Italy` })));
|
|
16734
16790
|
}
|
16735
16791
|
}, [openHashtag, data, activeIndex]);
|
16736
16792
|
const handleViewImageStartEvent = (activeIndex) => {
|
16737
|
-
var _a, _b, _c, _d, _e, _f;
|
16793
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16738
16794
|
const item = data[activeIndex];
|
16739
16795
|
// 如果是图片集则上报事件
|
16740
16796
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
@@ -16754,7 +16810,12 @@ Made in Italy` })));
|
|
16754
16810
|
}
|
16755
16811
|
});
|
16756
16812
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16757
|
-
eventName: 'ViewContent'
|
16813
|
+
eventName: 'ViewContent',
|
16814
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
16815
|
+
});
|
16816
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16817
|
+
eventName: 'PageView',
|
16818
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
16758
16819
|
});
|
16759
16820
|
}
|
16760
16821
|
};
|
@@ -17228,7 +17289,7 @@ Made in Italy` })));
|
|
17228
17289
|
* @Author: binruan@chatlabs.com
|
17229
17290
|
* @Date: 2023-10-31 10:56:01
|
17230
17291
|
* @LastEditors: binruan@chatlabs.com
|
17231
|
-
* @LastEditTime: 2024-
|
17292
|
+
* @LastEditTime: 2024-10-23 15:07:29
|
17232
17293
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
17233
17294
|
*
|
17234
17295
|
*/
|