pb-sxp-ui 1.7.2 → 1.7.4
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 +147 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +147 -82
- 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 +147 -82
- 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/PictureGroup/Picture.d.ts +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -2
- package/es/core/components/SxpPageRender/PictureGroup/index.js +26 -6
- package/es/core/components/SxpPageRender/RenderCard.js +6 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +21 -15
- package/es/core/components/SxpPageRender/WaterFall/List.js +3 -2
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +36 -28
- package/es/core/context/SxpDataSourceProvider.js +9 -6
- package/es/core/utils/materials.d.ts +7 -1
- package/es/core/utils/materials.js +5 -2
- package/es/core/utils/tool.d.ts +2 -1
- package/es/core/utils/tool.js +11 -1
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
- package/es/materials/sxp/cta/AniLink/settingRender.js +6 -0
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +3 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
- package/es/materials/sxp/popup/CommodityList/index.js +5 -4
- package/es/materials/sxp/template/components/settingRender.d.ts +1 -1
- package/es/materials/sxp/template/components/settingRender.js +6 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -2
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +25 -6
- package/lib/core/components/SxpPageRender/RenderCard.js +6 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +20 -15
- package/lib/core/components/SxpPageRender/WaterFall/List.js +3 -2
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +36 -28
- package/lib/core/context/SxpDataSourceProvider.js +9 -6
- package/lib/core/utils/materials.d.ts +7 -1
- package/lib/core/utils/materials.js +5 -2
- package/lib/core/utils/tool.d.ts +2 -1
- package/lib/core/utils/tool.js +12 -1
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.js +6 -0
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +5 -4
- package/lib/materials/sxp/template/components/settingRender.d.ts +1 -1
- package/lib/materials/sxp/template/components/settingRender.js +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -298,6 +298,16 @@ function getCookie(val) {
|
|
298
298
|
});
|
299
299
|
return value !== null && value !== void 0 ? value : '';
|
300
300
|
}
|
301
|
+
const getResFileSizeFromSrc = (imageSrc) => {
|
302
|
+
if (!imageSrc)
|
303
|
+
return '';
|
304
|
+
return fetch(imageSrc)
|
305
|
+
.then((response) => response.blob())
|
306
|
+
.then((blob) => {
|
307
|
+
const fileSizeInMB = blob.size / (1024 * 1024); // 将文件大小转换为 MB
|
308
|
+
return fileSizeInMB.toFixed(2) + '';
|
309
|
+
});
|
310
|
+
};
|
301
311
|
|
302
312
|
function unzip(b64Data) {
|
303
313
|
const strData = atob(b64Data);
|
@@ -798,17 +808,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
798
808
|
});
|
799
809
|
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
800
810
|
const bffFbReport = useCallback(({ eventName, product }) => {
|
801
|
-
var _a, _b, _c, _d;
|
802
|
-
if (!enableReportEvent ||
|
811
|
+
var _a, _b, _c, _d, _e;
|
812
|
+
if (!enableReportEvent ||
|
813
|
+
!enabledMetaConversionApi ||
|
814
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
|
815
|
+
!((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
|
803
816
|
return;
|
804
817
|
}
|
805
|
-
let jsonParams = (
|
818
|
+
let jsonParams = JSON.parse(JSON.stringify((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]));
|
806
819
|
const urlParams = new URLSearchParams(window.location.search);
|
807
820
|
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
808
821
|
const fix_par = {
|
809
|
-
event_source_url: (
|
822
|
+
event_source_url: (_c = window === null || window === void 0 ? void 0 : window.location) === null || _c === void 0 ? void 0 : _c.href,
|
810
823
|
external_id: storeAndLoadFeUserId(),
|
811
|
-
client_user_agent: (
|
824
|
+
client_user_agent: (_e = (_d = window === null || window === void 0 ? void 0 : window.navigator) === null || _d === void 0 ? void 0 : _d.userAgent) !== null && _e !== void 0 ? _e : '',
|
812
825
|
fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
|
813
826
|
fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
|
814
827
|
time: new Date().getTime()
|
@@ -833,7 +846,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
833
846
|
matches.forEach((match) => {
|
834
847
|
const prop = match.substring(2, match.length - 2);
|
835
848
|
try {
|
836
|
-
|
849
|
+
let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
837
850
|
if (replaceValue) {
|
838
851
|
obj[key] = replaceValue;
|
839
852
|
}
|
@@ -9268,7 +9281,7 @@ var CommodityGroup$1 = memo(CommodityGroup);
|
|
9268
9281
|
* @Author: binruan@chatlabs.com
|
9269
9282
|
* @Date: 2024-03-20 14:56:16
|
9270
9283
|
* @LastEditors: binruan@chatlabs.com
|
9271
|
-
* @LastEditTime: 2024-
|
9284
|
+
* @LastEditTime: 2024-10-24 17:51:19
|
9272
9285
|
* @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
|
9273
9286
|
*
|
9274
9287
|
*/
|
@@ -9295,8 +9308,8 @@ const getMediaValueByMode = (obj) => {
|
|
9295
9308
|
return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
|
9296
9309
|
}
|
9297
9310
|
};
|
9298
|
-
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
|
9299
|
-
var _a, _b, _c, _d, _e;
|
9311
|
+
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
|
9312
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9300
9313
|
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
9301
9314
|
return null;
|
9302
9315
|
let price = (product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price) ? product === null || product === void 0 ? void 0 : product.price : 7000;
|
@@ -9344,6 +9357,8 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
9344
9357
|
}
|
9345
9358
|
});
|
9346
9359
|
}
|
9360
|
+
currency = `<span style="font-family:${(_h = (_g = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol) === null || _f === void 0 ? void 0 : _f.fontFamily) !== null && _g !== void 0 ? _g : style === null || style === void 0 ? void 0 : style['fontFamily-en']) !== null && _h !== void 0 ? _h : 'inherit'}">${currency}</span>`;
|
9361
|
+
text = setFontForText(text, style);
|
9347
9362
|
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
|
9348
9363
|
text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
|
9349
9364
|
}
|
@@ -9409,7 +9424,8 @@ const CommodityDetail$1 = (_a) => {
|
|
9409
9424
|
const priceText = getPriceText({
|
9410
9425
|
product: product,
|
9411
9426
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
9412
|
-
globalConfig
|
9427
|
+
globalConfig,
|
9428
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
9413
9429
|
});
|
9414
9430
|
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
9415
9431
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -9423,7 +9439,7 @@ const CommodityDetail$1 = (_a) => {
|
|
9423
9439
|
__html: setFontForText((_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
9424
9440
|
} }),
|
9425
9441
|
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: {
|
9426
|
-
__html:
|
9442
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
9427
9443
|
} }),
|
9428
9444
|
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: {
|
9429
9445
|
__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)
|
@@ -10297,7 +10313,8 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
10297
10313
|
const priceText = getPriceText({
|
10298
10314
|
product,
|
10299
10315
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
10300
|
-
globalConfig
|
10316
|
+
globalConfig,
|
10317
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10301
10318
|
});
|
10302
10319
|
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
10303
10320
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -10458,7 +10475,7 @@ Made in Italy` })));
|
|
10458
10475
|
} })),
|
10459
10476
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
10460
10477
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), dangerouslySetInnerHTML: {
|
10461
|
-
__html:
|
10478
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
10462
10479
|
} }),
|
10463
10480
|
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: {
|
10464
10481
|
__html: setFontForText((_2 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _2 !== void 0 ? _2 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
@@ -10916,7 +10933,8 @@ const CommodityList$1 = (_a) => {
|
|
10916
10933
|
return getPriceText({
|
10917
10934
|
product,
|
10918
10935
|
enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
10919
|
-
globalConfig
|
10936
|
+
globalConfig,
|
10937
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10920
10938
|
});
|
10921
10939
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
10922
10940
|
const handleClick = throttle((item, multiCheckIndex) => {
|
@@ -10941,7 +10959,7 @@ const CommodityList$1 = (_a) => {
|
|
10941
10959
|
});
|
10942
10960
|
}, []);
|
10943
10961
|
return (React.createElement("div", { className: 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) => {
|
10944
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10962
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10945
10963
|
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({
|
10946
10964
|
display: 'flex'
|
10947
10965
|
}), onClick: () => handleClick(item, index) }),
|
@@ -10968,10 +10986,10 @@ const CommodityList$1 = (_a) => {
|
|
10968
10986
|
}) },
|
10969
10987
|
React.createElement("div", null,
|
10970
10988
|
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: {
|
10971
|
-
__html:
|
10989
|
+
__html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
|
10972
10990
|
} })),
|
10973
10991
|
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10974
|
-
__html: setFontForText((
|
10992
|
+
__html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
|
10975
10993
|
} })))))));
|
10976
10994
|
})));
|
10977
10995
|
};
|
@@ -11119,7 +11137,7 @@ const Iframe = createMaterial(IframeComponent, {
|
|
11119
11137
|
* @Author: binruan@chatlabs.com
|
11120
11138
|
* @Date: 2024-03-26 16:50:25
|
11121
11139
|
* @LastEditors: binruan@chatlabs.com
|
11122
|
-
* @LastEditTime: 2024-
|
11140
|
+
* @LastEditTime: 2024-10-24 19:04:37
|
11123
11141
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
|
11124
11142
|
*
|
11125
11143
|
*/
|
@@ -11165,6 +11183,12 @@ var settingRender$4 = [
|
|
11165
11183
|
label: '背景色',
|
11166
11184
|
name: ['style', 'backgroundColor']
|
11167
11185
|
},
|
11186
|
+
{
|
11187
|
+
type: 'Number',
|
11188
|
+
label: '背景色毛玻璃',
|
11189
|
+
name: ['style', 'backdropFilter'],
|
11190
|
+
addonAfter: 'px'
|
11191
|
+
},
|
11168
11192
|
{
|
11169
11193
|
label: '内边距',
|
11170
11194
|
type: 'Number',
|
@@ -13948,7 +13972,8 @@ const WaterfallFlowItem$1 = (props) => {
|
|
13948
13972
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
13949
13973
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
13950
13974
|
globalConfig,
|
13951
|
-
isHiddenDef: true
|
13975
|
+
isHiddenDef: true,
|
13976
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
13952
13977
|
});
|
13953
13978
|
useEffect(() => {
|
13954
13979
|
if (imgDom.current === null || src === '') {
|
@@ -13990,7 +14015,7 @@ const WaterfallFlowItem$1 = (props) => {
|
|
13990
14015
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
13991
14016
|
} }),
|
13992
14017
|
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
|
13993
|
-
__html:
|
14018
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
13994
14019
|
} }))));
|
13995
14020
|
};
|
13996
14021
|
function WaterfallList$1(_a) {
|
@@ -14265,7 +14290,8 @@ const WaterfallFlowItem = (props) => {
|
|
14265
14290
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
14266
14291
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
14267
14292
|
globalConfig,
|
14268
|
-
isHiddenDef: true
|
14293
|
+
isHiddenDef: true,
|
14294
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
14269
14295
|
});
|
14270
14296
|
// useEffect(() => {
|
14271
14297
|
// if (imgDom.current === null || src === '') {
|
@@ -14352,7 +14378,7 @@ const WaterfallFlowItem = (props) => {
|
|
14352
14378
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
14353
14379
|
} }),
|
14354
14380
|
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
|
14355
|
-
__html:
|
14381
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
14356
14382
|
} }))));
|
14357
14383
|
};
|
14358
14384
|
function WaterfallList(_a) {
|
@@ -14730,7 +14756,7 @@ const Consent = createMaterial(ConsentComponent, {
|
|
14730
14756
|
* @Author: binruan@chatlabs.com
|
14731
14757
|
* @Date: 2024-07-02 14:51:32
|
14732
14758
|
* @LastEditors: binruan@chatlabs.com
|
14733
|
-
* @LastEditTime: 2024-
|
14759
|
+
* @LastEditTime: 2024-10-25 10:39:04
|
14734
14760
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\settingRender.tsx
|
14735
14761
|
*
|
14736
14762
|
*/
|
@@ -14776,6 +14802,12 @@ var settingRender$1 = [
|
|
14776
14802
|
label: '背景色',
|
14777
14803
|
name: ['style', 'backgroundColor']
|
14778
14804
|
},
|
14805
|
+
{
|
14806
|
+
type: 'Number',
|
14807
|
+
label: '背景色毛玻璃',
|
14808
|
+
name: ['style', 'backdropFilter'],
|
14809
|
+
addonAfter: 'px'
|
14810
|
+
},
|
14779
14811
|
{
|
14780
14812
|
type: 'TextMargin',
|
14781
14813
|
name: ['style'],
|
@@ -15075,6 +15107,12 @@ var settingRender = [
|
|
15075
15107
|
label: '背景色',
|
15076
15108
|
name: ['style', 'backgroundColor']
|
15077
15109
|
},
|
15110
|
+
{
|
15111
|
+
type: 'Number',
|
15112
|
+
label: '背景色毛玻璃',
|
15113
|
+
name: ['style', 'backdropFilter'],
|
15114
|
+
addonAfter: 'px'
|
15115
|
+
},
|
15078
15116
|
{
|
15079
15117
|
label: '外边距',
|
15080
15118
|
type: 'Number',
|
@@ -15625,6 +15663,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15625
15663
|
const videoId = `pb-cache-video-${index}`;
|
15626
15664
|
const videoEleRef = useRef(null);
|
15627
15665
|
const hlsRef = useRef(null);
|
15666
|
+
const initTimeRef = useRef();
|
15628
15667
|
const blur = useMemo(() => {
|
15629
15668
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
15630
15669
|
}, [videoPostConfig]);
|
@@ -15670,8 +15709,8 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15670
15709
|
setWaiting(false);
|
15671
15710
|
setIsLoadFinish(true);
|
15672
15711
|
}, []);
|
15673
|
-
const handleStartPlay = useCallback(() => {
|
15674
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
15712
|
+
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
15713
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
15675
15714
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15676
15715
|
return;
|
15677
15716
|
setIsPauseVideo(false);
|
@@ -15681,24 +15720,27 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15681
15720
|
const videoDuration = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
15682
15721
|
const videoCurrentTime = ((_f = (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
15683
15722
|
const playType = isFirstPlay ? '0' : '1';
|
15723
|
+
const contentSize = yield getResFileSizeFromSrc((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url);
|
15684
15724
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15685
15725
|
eventInfo: {
|
15686
15726
|
eventSubject: 'playVideo',
|
15687
15727
|
eventDescription: 'User played the video',
|
15688
|
-
contentId: (
|
15689
|
-
contentName: (
|
15728
|
+
contentId: (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.itemId) !== null && _j !== void 0 ? _j : '',
|
15729
|
+
contentName: (_l = (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '',
|
15690
15730
|
playType,
|
15691
15731
|
startTime: videoCurrentTime,
|
15692
15732
|
videoDuration,
|
15693
|
-
contentTags: JSON.stringify((
|
15733
|
+
contentTags: JSON.stringify((_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.tags) !== null && _o !== void 0 ? _o : []),
|
15694
15734
|
position: index + '',
|
15695
15735
|
contentFormat: 'video',
|
15696
|
-
traceInfo: (
|
15736
|
+
traceInfo: (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo,
|
15737
|
+
contentSize,
|
15738
|
+
loadTime: (new Date() - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
|
15697
15739
|
}
|
15698
15740
|
});
|
15699
15741
|
setIsFirstPlay(false);
|
15700
15742
|
}
|
15701
|
-
}, [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15743
|
+
}), [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15702
15744
|
const handLoadeddata = useCallback(() => {
|
15703
15745
|
var _a;
|
15704
15746
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
@@ -15802,6 +15844,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15802
15844
|
videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
|
15803
15845
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15804
15846
|
return;
|
15847
|
+
initTimeRef.current = new Date();
|
15805
15848
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
15806
15849
|
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
15807
15850
|
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
@@ -15845,7 +15888,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15845
15888
|
};
|
15846
15889
|
}, [isActive]);
|
15847
15890
|
useEffect(() => {
|
15848
|
-
var _a, _b, _c, _d;
|
15891
|
+
var _a, _b, _c, _d, _e, _f;
|
15849
15892
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
15850
15893
|
return;
|
15851
15894
|
if (isActive) {
|
@@ -15853,10 +15896,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15853
15896
|
eventName: 'ViewContent',
|
15854
15897
|
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
|
15855
15898
|
});
|
15856
|
-
|
15899
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15900
|
+
eventName: 'PageView',
|
15901
|
+
product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProduct
|
15902
|
+
});
|
15903
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
15857
15904
|
}
|
15858
15905
|
else {
|
15859
|
-
(
|
15906
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
15860
15907
|
}
|
15861
15908
|
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15862
15909
|
/*
|
@@ -15878,12 +15925,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15878
15925
|
if (!isActive)
|
15879
15926
|
return;
|
15880
15927
|
const onShow = () => {
|
15881
|
-
var _a, _b;
|
15882
15928
|
handleClickVideo('start')();
|
15883
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15884
|
-
eventName: 'ViewContent',
|
15885
|
-
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
|
15886
|
-
});
|
15887
15929
|
};
|
15888
15930
|
const onHide = handleClickVideo('pause');
|
15889
15931
|
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
@@ -16054,41 +16096,51 @@ const Picture = (props) => {
|
|
16054
16096
|
}, onLoad: onShowFirstImage }))));
|
16055
16097
|
};
|
16056
16098
|
|
16057
|
-
|
16058
|
-
* @Author: lewinlu@chatlabs.com
|
16059
|
-
* @Date: 2024-01-03 14:39:09
|
16060
|
-
* @LastEditors: binruan@chatlabs.com
|
16061
|
-
* @LastEditTime: 2024-10-10 17:53:30
|
16062
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
16063
|
-
*/
|
16064
|
-
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16099
|
+
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16065
16100
|
var _a, _b;
|
16066
16101
|
const ref = useRef();
|
16067
16102
|
const { isActive } = useSwiperSlide();
|
16068
16103
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
16069
16104
|
const [isLoad, setIsLoad] = useState(false);
|
16105
|
+
const [imgInfo, setImgInfo] = useState();
|
16106
|
+
const initTime = new Date();
|
16070
16107
|
useEffect(() => {
|
16071
16108
|
if (isLoad && isActive) {
|
16072
16109
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
|
16073
16110
|
if (openHashtag) {
|
16074
|
-
|
16111
|
+
onViewImageEndEvent(rec);
|
16075
16112
|
}
|
16076
16113
|
else {
|
16077
|
-
onViewImageStartEvent(index);
|
16114
|
+
onViewImageStartEvent(index, imgInfo, true);
|
16078
16115
|
}
|
16079
16116
|
}
|
16080
16117
|
else {
|
16081
16118
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
|
16082
16119
|
}
|
16083
|
-
}, [rec, isActive,
|
16084
|
-
const showFirstImageFn = useCallback(() => {
|
16120
|
+
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
16121
|
+
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
16085
16122
|
if (!isLoad) {
|
16123
|
+
const contentSize = yield getResFileSizeFromSrc(e.src);
|
16124
|
+
setImgInfo({
|
16125
|
+
contentSize,
|
16126
|
+
loadTime: (new Date() - initTime).toFixed(2) + ''
|
16127
|
+
});
|
16086
16128
|
setIsLoad(true);
|
16087
16129
|
}
|
16088
|
-
}, [isLoad]);
|
16130
|
+
}), [isLoad]);
|
16089
16131
|
// if (!isActive) {
|
16090
16132
|
// return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
|
16091
16133
|
// }
|
16134
|
+
useEffect(() => {
|
16135
|
+
const onShow = () => onViewImageStartEvent(index, imgInfo);
|
16136
|
+
const onHide = () => onViewImageEndEvent(rec);
|
16137
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16138
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16139
|
+
return () => {
|
16140
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16141
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16142
|
+
};
|
16143
|
+
}, [imgInfo]);
|
16092
16144
|
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
16093
16145
|
clickable: true,
|
16094
16146
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -16227,7 +16279,7 @@ function withBindDataSource(Component) {
|
|
16227
16279
|
* @Author: binruan@chatlabs.com
|
16228
16280
|
* @Date: 2023-12-26 16:11:34
|
16229
16281
|
* @LastEditors: binruan@chatlabs.com
|
16230
|
-
* @LastEditTime: 2024-10-
|
16282
|
+
* @LastEditTime: 2024-10-29 14:07:29
|
16231
16283
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
16232
16284
|
*
|
16233
16285
|
*/
|
@@ -16276,7 +16328,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
|
|
16276
16328
|
const Component = withBindDataSource(t);
|
16277
16329
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
16278
16330
|
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';
|
16279
|
-
|
16331
|
+
let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
|
16332
|
+
if (style.hasOwnProperty('backdropFilter')) {
|
16333
|
+
let sbf = style['backdropFilter'];
|
16334
|
+
style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
16335
|
+
}
|
16336
|
+
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), 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 })));
|
16280
16337
|
}
|
16281
16338
|
else {
|
16282
16339
|
return null;
|
@@ -16369,7 +16426,7 @@ var Tagbar$1 = memo(Tagbar);
|
|
16369
16426
|
* @Author: binruan@chatlabs.com
|
16370
16427
|
* @Date: 2024-01-15 19:03:09
|
16371
16428
|
* @LastEditors: binruan@chatlabs.com
|
16372
|
-
* @LastEditTime: 2024-10-
|
16429
|
+
* @LastEditTime: 2024-10-28 16:36:22
|
16373
16430
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16374
16431
|
*
|
16375
16432
|
*/
|
@@ -16439,7 +16496,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16439
16496
|
// 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
|
16440
16497
|
if (repCond) {
|
16441
16498
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
16442
|
-
handleReportViewImageEnd(item);
|
16443
16499
|
handleReportProductView(item);
|
16444
16500
|
}
|
16445
16501
|
let fromKName = '';
|
@@ -16484,7 +16540,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16484
16540
|
// 页面可见时触发,注意页面初始化时不会触发
|
16485
16541
|
handleH5EnterLink();
|
16486
16542
|
if (repCond) {
|
16487
|
-
handleViewImageStartEvent(activeIndex);
|
16488
16543
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
16489
16544
|
backMainFeed('external', selectTag);
|
16490
16545
|
}
|
@@ -16569,7 +16624,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16569
16624
|
return (React.createElement(VideoWidget$3, { key: isReload, rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
|
16570
16625
|
}
|
16571
16626
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
16572
|
-
return (React.createElement(PictureGroup$3, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index,
|
16627
|
+
return (React.createElement(PictureGroup$3, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
16573
16628
|
}
|
16574
16629
|
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
16575
16630
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -16643,7 +16698,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16643
16698
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike) || !visible)
|
16644
16699
|
return;
|
16645
16700
|
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
16646
|
-
if (waterFallData && top < 40) {
|
16701
|
+
if (waterFallData && top < 40 && globalConfig.likeIconYPosit === 'top') {
|
16647
16702
|
top += 40;
|
16648
16703
|
}
|
16649
16704
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
@@ -16655,7 +16710,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16655
16710
|
}
|
16656
16711
|
return null;
|
16657
16712
|
}, [globalConfig, waterFallData]);
|
16658
|
-
const
|
16713
|
+
const handleViewImageStartEnd = (item) => {
|
16659
16714
|
var _a, _b, _c, _d, _e, _f;
|
16660
16715
|
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)) {
|
16661
16716
|
const endTime = Date.now();
|
@@ -16713,7 +16768,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16713
16768
|
}
|
16714
16769
|
};
|
16715
16770
|
const handleScrollEvent = (swiper) => {
|
16716
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
16771
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
16717
16772
|
const item = data[swiper.previousIndex];
|
16718
16773
|
if (!item)
|
16719
16774
|
return;
|
@@ -16733,11 +16788,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16733
16788
|
productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
16734
16789
|
requestId: null,
|
16735
16790
|
traceInfo: (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : '',
|
16736
|
-
contentFormat
|
16791
|
+
contentFormat,
|
16792
|
+
position: ((_k = swiper.previousIndex) !== null && _k !== void 0 ? _k : 0) + ''
|
16737
16793
|
}
|
16738
16794
|
});
|
16739
16795
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
16740
|
-
|
16796
|
+
handleViewImageStartEnd(item);
|
16741
16797
|
handleSlideSkip(item, swiper.previousIndex);
|
16742
16798
|
}
|
16743
16799
|
else {
|
@@ -16745,15 +16801,16 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16745
16801
|
eventInfo: {
|
16746
16802
|
eventSubject: 'scrollUp',
|
16747
16803
|
eventDescription: 'User scroll up',
|
16748
|
-
contentId: (
|
16749
|
-
productId: (
|
16804
|
+
contentId: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
16805
|
+
productId: (_p = (_o = item.product) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
16750
16806
|
requestId: null,
|
16751
|
-
traceInfo: (
|
16752
|
-
contentFormat
|
16807
|
+
traceInfo: (_r = (_q = item === null || item === void 0 ? void 0 : item.video) === null || _q === void 0 ? void 0 : _q.traceInfo) !== null && _r !== void 0 ? _r : '',
|
16808
|
+
contentFormat,
|
16809
|
+
position: ((_s = swiper.previousIndex) !== null && _s !== void 0 ? _s : 0) + ''
|
16753
16810
|
}
|
16754
16811
|
});
|
16755
16812
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
16756
|
-
|
16813
|
+
handleViewImageStartEnd(item);
|
16757
16814
|
}
|
16758
16815
|
// 商品浏览事件
|
16759
16816
|
handleReportProductView(item);
|
@@ -16774,7 +16831,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16774
16831
|
viewTime.current = new Date();
|
16775
16832
|
}
|
16776
16833
|
}, [openHashtag, data, activeIndex]);
|
16777
|
-
const handleViewImageStartEvent = (activeIndex) => {
|
16834
|
+
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
16778
16835
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16779
16836
|
const item = data[activeIndex];
|
16780
16837
|
// 如果是图片集则上报事件
|
@@ -16791,32 +16848,40 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16791
16848
|
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
16792
16849
|
position: activeIndex + '',
|
16793
16850
|
contentFormat: 'image',
|
16794
|
-
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
16851
|
+
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
16852
|
+
contentSize: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.contentSize,
|
16853
|
+
loadTime: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.loadTime
|
16795
16854
|
}
|
16796
16855
|
});
|
16797
|
-
|
16798
|
-
|
16799
|
-
|
16800
|
-
|
16801
|
-
|
16802
|
-
|
16803
|
-
|
16804
|
-
|
16856
|
+
if (enableCapi) {
|
16857
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16858
|
+
eventName: 'ViewContent',
|
16859
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
16860
|
+
});
|
16861
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16862
|
+
eventName: 'PageView',
|
16863
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
16864
|
+
});
|
16865
|
+
}
|
16805
16866
|
}
|
16806
16867
|
};
|
16807
16868
|
const renderToggleButton = useCallback((visible) => {
|
16808
16869
|
var _a, _b, _c, _d, _e, _f;
|
16809
16870
|
if (!visible)
|
16810
16871
|
return;
|
16872
|
+
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
|
16873
|
+
if (waterFallData && top < 40 && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
|
16874
|
+
top += 40;
|
16875
|
+
}
|
16811
16876
|
return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (React.createElement(ToggleButton$1, { style: {
|
16812
16877
|
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
|
16813
|
-
visibility: ((
|
16878
|
+
visibility: ((_c = (_b = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
16814
16879
|
zIndex: 999,
|
16815
16880
|
transform: 'translate3d(0px,0px,0px)',
|
16816
|
-
[(
|
16817
|
-
[(
|
16881
|
+
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
|
16882
|
+
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: top
|
16818
16883
|
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })));
|
16819
|
-
}, [globalConfig, visList, activeIndex, isMuted]);
|
16884
|
+
}, [globalConfig, visList, activeIndex, isMuted, waterFallData]);
|
16820
16885
|
const renderView = useMemo(() => {
|
16821
16886
|
if (loading) {
|
16822
16887
|
return (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -16849,7 +16914,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16849
16914
|
renderToggleButton
|
16850
16915
|
]);
|
16851
16916
|
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
|
16852
|
-
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === 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.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
16917
|
+
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === 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.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
16853
16918
|
const isEq = isEqual(rtcList, cacheRtcList);
|
16854
16919
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
16855
16920
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|