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.cjs
CHANGED
@@ -320,6 +320,16 @@ function getCookie(val) {
|
|
320
320
|
});
|
321
321
|
return value !== null && value !== void 0 ? value : '';
|
322
322
|
}
|
323
|
+
const getResFileSizeFromSrc = (imageSrc) => {
|
324
|
+
if (!imageSrc)
|
325
|
+
return '';
|
326
|
+
return fetch(imageSrc)
|
327
|
+
.then((response) => response.blob())
|
328
|
+
.then((blob) => {
|
329
|
+
const fileSizeInMB = blob.size / (1024 * 1024); // 将文件大小转换为 MB
|
330
|
+
return fileSizeInMB.toFixed(2) + '';
|
331
|
+
});
|
332
|
+
};
|
323
333
|
|
324
334
|
function unzip(b64Data) {
|
325
335
|
const strData = atob(b64Data);
|
@@ -820,17 +830,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
820
830
|
});
|
821
831
|
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
822
832
|
const bffFbReport = React.useCallback(({ eventName, product }) => {
|
823
|
-
var _a, _b, _c, _d;
|
824
|
-
if (!enableReportEvent ||
|
833
|
+
var _a, _b, _c, _d, _e;
|
834
|
+
if (!enableReportEvent ||
|
835
|
+
!enabledMetaConversionApi ||
|
836
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
|
837
|
+
!((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
|
825
838
|
return;
|
826
839
|
}
|
827
|
-
let jsonParams = (
|
840
|
+
let jsonParams = JSON.parse(JSON.stringify((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]));
|
828
841
|
const urlParams = new URLSearchParams(window.location.search);
|
829
842
|
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
830
843
|
const fix_par = {
|
831
|
-
event_source_url: (
|
844
|
+
event_source_url: (_c = window === null || window === void 0 ? void 0 : window.location) === null || _c === void 0 ? void 0 : _c.href,
|
832
845
|
external_id: storeAndLoadFeUserId(),
|
833
|
-
client_user_agent: (
|
846
|
+
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 : '',
|
834
847
|
fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
|
835
848
|
fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
|
836
849
|
time: new Date().getTime()
|
@@ -855,7 +868,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
855
868
|
matches.forEach((match) => {
|
856
869
|
const prop = match.substring(2, match.length - 2);
|
857
870
|
try {
|
858
|
-
|
871
|
+
let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
859
872
|
if (replaceValue) {
|
860
873
|
obj[key] = replaceValue;
|
861
874
|
}
|
@@ -9290,7 +9303,7 @@ var CommodityGroup$1 = React.memo(CommodityGroup);
|
|
9290
9303
|
* @Author: binruan@chatlabs.com
|
9291
9304
|
* @Date: 2024-03-20 14:56:16
|
9292
9305
|
* @LastEditors: binruan@chatlabs.com
|
9293
|
-
* @LastEditTime: 2024-
|
9306
|
+
* @LastEditTime: 2024-10-24 17:51:19
|
9294
9307
|
* @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
|
9295
9308
|
*
|
9296
9309
|
*/
|
@@ -9317,8 +9330,8 @@ const getMediaValueByMode = (obj) => {
|
|
9317
9330
|
return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
|
9318
9331
|
}
|
9319
9332
|
};
|
9320
|
-
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
|
9321
|
-
var _a, _b, _c, _d, _e;
|
9333
|
+
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
|
9334
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9322
9335
|
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
9323
9336
|
return null;
|
9324
9337
|
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;
|
@@ -9366,6 +9379,8 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
9366
9379
|
}
|
9367
9380
|
});
|
9368
9381
|
}
|
9382
|
+
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>`;
|
9383
|
+
text = setFontForText(text, style);
|
9369
9384
|
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
|
9370
9385
|
text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
|
9371
9386
|
}
|
@@ -9431,7 +9446,8 @@ const CommodityDetail$1 = (_a) => {
|
|
9431
9446
|
const priceText = getPriceText({
|
9432
9447
|
product: product,
|
9433
9448
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
9434
|
-
globalConfig
|
9449
|
+
globalConfig,
|
9450
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
9435
9451
|
});
|
9436
9452
|
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;
|
9437
9453
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -9445,7 +9461,7 @@ const CommodityDetail$1 = (_a) => {
|
|
9445
9461
|
__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)
|
9446
9462
|
} }),
|
9447
9463
|
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: {
|
9448
|
-
__html:
|
9464
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
9449
9465
|
} }),
|
9450
9466
|
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: {
|
9451
9467
|
__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)
|
@@ -10319,7 +10335,8 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
10319
10335
|
const priceText = getPriceText({
|
10320
10336
|
product,
|
10321
10337
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
10322
|
-
globalConfig
|
10338
|
+
globalConfig,
|
10339
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10323
10340
|
});
|
10324
10341
|
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;
|
10325
10342
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -10480,7 +10497,7 @@ Made in Italy` })));
|
|
10480
10497
|
} })),
|
10481
10498
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
10482
10499
|
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: {
|
10483
|
-
__html:
|
10500
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
10484
10501
|
} }),
|
10485
10502
|
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: {
|
10486
10503
|
__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)
|
@@ -10938,7 +10955,8 @@ const CommodityList$1 = (_a) => {
|
|
10938
10955
|
return getPriceText({
|
10939
10956
|
product,
|
10940
10957
|
enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
10941
|
-
globalConfig
|
10958
|
+
globalConfig,
|
10959
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10942
10960
|
});
|
10943
10961
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
10944
10962
|
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
@@ -10963,7 +10981,7 @@ const CommodityList$1 = (_a) => {
|
|
10963
10981
|
});
|
10964
10982
|
}, []);
|
10965
10983
|
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) => {
|
10966
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10984
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10967
10985
|
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({
|
10968
10986
|
display: 'flex'
|
10969
10987
|
}), onClick: () => handleClick(item, index) }),
|
@@ -10990,10 +11008,10 @@ const CommodityList$1 = (_a) => {
|
|
10990
11008
|
}) },
|
10991
11009
|
React.createElement("div", null,
|
10992
11010
|
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: {
|
10993
|
-
__html:
|
11011
|
+
__html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
|
10994
11012
|
} })),
|
10995
11013
|
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10996
|
-
__html: setFontForText((
|
11014
|
+
__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)
|
10997
11015
|
} })))))));
|
10998
11016
|
})));
|
10999
11017
|
};
|
@@ -11141,7 +11159,7 @@ const Iframe = createMaterial(IframeComponent, {
|
|
11141
11159
|
* @Author: binruan@chatlabs.com
|
11142
11160
|
* @Date: 2024-03-26 16:50:25
|
11143
11161
|
* @LastEditors: binruan@chatlabs.com
|
11144
|
-
* @LastEditTime: 2024-
|
11162
|
+
* @LastEditTime: 2024-10-24 19:04:37
|
11145
11163
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
|
11146
11164
|
*
|
11147
11165
|
*/
|
@@ -11187,6 +11205,12 @@ var settingRender$4 = [
|
|
11187
11205
|
label: '背景色',
|
11188
11206
|
name: ['style', 'backgroundColor']
|
11189
11207
|
},
|
11208
|
+
{
|
11209
|
+
type: 'Number',
|
11210
|
+
label: '背景色毛玻璃',
|
11211
|
+
name: ['style', 'backdropFilter'],
|
11212
|
+
addonAfter: 'px'
|
11213
|
+
},
|
11190
11214
|
{
|
11191
11215
|
label: '内边距',
|
11192
11216
|
type: 'Number',
|
@@ -13970,7 +13994,8 @@ const WaterfallFlowItem$1 = (props) => {
|
|
13970
13994
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
13971
13995
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
13972
13996
|
globalConfig,
|
13973
|
-
isHiddenDef: true
|
13997
|
+
isHiddenDef: true,
|
13998
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
13974
13999
|
});
|
13975
14000
|
React.useEffect(() => {
|
13976
14001
|
if (imgDom.current === null || src === '') {
|
@@ -14012,7 +14037,7 @@ const WaterfallFlowItem$1 = (props) => {
|
|
14012
14037
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
14013
14038
|
} }),
|
14014
14039
|
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
|
14015
|
-
__html:
|
14040
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
14016
14041
|
} }))));
|
14017
14042
|
};
|
14018
14043
|
function WaterfallList$1(_a) {
|
@@ -14287,7 +14312,8 @@ const WaterfallFlowItem = (props) => {
|
|
14287
14312
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
14288
14313
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
14289
14314
|
globalConfig,
|
14290
|
-
isHiddenDef: true
|
14315
|
+
isHiddenDef: true,
|
14316
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
14291
14317
|
});
|
14292
14318
|
// useEffect(() => {
|
14293
14319
|
// if (imgDom.current === null || src === '') {
|
@@ -14374,7 +14400,7 @@ const WaterfallFlowItem = (props) => {
|
|
14374
14400
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
14375
14401
|
} }),
|
14376
14402
|
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
|
14377
|
-
__html:
|
14403
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
14378
14404
|
} }))));
|
14379
14405
|
};
|
14380
14406
|
function WaterfallList(_a) {
|
@@ -14752,7 +14778,7 @@ const Consent = createMaterial(ConsentComponent, {
|
|
14752
14778
|
* @Author: binruan@chatlabs.com
|
14753
14779
|
* @Date: 2024-07-02 14:51:32
|
14754
14780
|
* @LastEditors: binruan@chatlabs.com
|
14755
|
-
* @LastEditTime: 2024-
|
14781
|
+
* @LastEditTime: 2024-10-25 10:39:04
|
14756
14782
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\settingRender.tsx
|
14757
14783
|
*
|
14758
14784
|
*/
|
@@ -14798,6 +14824,12 @@ var settingRender$1 = [
|
|
14798
14824
|
label: '背景色',
|
14799
14825
|
name: ['style', 'backgroundColor']
|
14800
14826
|
},
|
14827
|
+
{
|
14828
|
+
type: 'Number',
|
14829
|
+
label: '背景色毛玻璃',
|
14830
|
+
name: ['style', 'backdropFilter'],
|
14831
|
+
addonAfter: 'px'
|
14832
|
+
},
|
14801
14833
|
{
|
14802
14834
|
type: 'TextMargin',
|
14803
14835
|
name: ['style'],
|
@@ -15097,6 +15129,12 @@ var settingRender = [
|
|
15097
15129
|
label: '背景色',
|
15098
15130
|
name: ['style', 'backgroundColor']
|
15099
15131
|
},
|
15132
|
+
{
|
15133
|
+
type: 'Number',
|
15134
|
+
label: '背景色毛玻璃',
|
15135
|
+
name: ['style', 'backdropFilter'],
|
15136
|
+
addonAfter: 'px'
|
15137
|
+
},
|
15100
15138
|
{
|
15101
15139
|
label: '外边距',
|
15102
15140
|
type: 'Number',
|
@@ -15647,6 +15685,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15647
15685
|
const videoId = `pb-cache-video-${index}`;
|
15648
15686
|
const videoEleRef = React.useRef(null);
|
15649
15687
|
const hlsRef = React.useRef(null);
|
15688
|
+
const initTimeRef = React.useRef();
|
15650
15689
|
const blur = React.useMemo(() => {
|
15651
15690
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
15652
15691
|
}, [videoPostConfig]);
|
@@ -15692,8 +15731,8 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15692
15731
|
setWaiting(false);
|
15693
15732
|
setIsLoadFinish(true);
|
15694
15733
|
}, []);
|
15695
|
-
const handleStartPlay = React.useCallback(() => {
|
15696
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
15734
|
+
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
15735
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
15697
15736
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15698
15737
|
return;
|
15699
15738
|
setIsPauseVideo(false);
|
@@ -15703,24 +15742,27 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15703
15742
|
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);
|
15704
15743
|
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);
|
15705
15744
|
const playType = isFirstPlay ? '0' : '1';
|
15745
|
+
const contentSize = yield getResFileSizeFromSrc((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url);
|
15706
15746
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15707
15747
|
eventInfo: {
|
15708
15748
|
eventSubject: 'playVideo',
|
15709
15749
|
eventDescription: 'User played the video',
|
15710
|
-
contentId: (
|
15711
|
-
contentName: (
|
15750
|
+
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 : '',
|
15751
|
+
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 : '',
|
15712
15752
|
playType,
|
15713
15753
|
startTime: videoCurrentTime,
|
15714
15754
|
videoDuration,
|
15715
|
-
contentTags: JSON.stringify((
|
15755
|
+
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 : []),
|
15716
15756
|
position: index + '',
|
15717
15757
|
contentFormat: 'video',
|
15718
|
-
traceInfo: (
|
15758
|
+
traceInfo: (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo,
|
15759
|
+
contentSize,
|
15760
|
+
loadTime: (new Date() - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
|
15719
15761
|
}
|
15720
15762
|
});
|
15721
15763
|
setIsFirstPlay(false);
|
15722
15764
|
}
|
15723
|
-
}, [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15765
|
+
}), [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15724
15766
|
const handLoadeddata = React.useCallback(() => {
|
15725
15767
|
var _a;
|
15726
15768
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
@@ -15824,6 +15866,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15824
15866
|
videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
|
15825
15867
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15826
15868
|
return;
|
15869
|
+
initTimeRef.current = new Date();
|
15827
15870
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
15828
15871
|
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
15829
15872
|
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
@@ -15867,7 +15910,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15867
15910
|
};
|
15868
15911
|
}, [isActive]);
|
15869
15912
|
React.useEffect(() => {
|
15870
|
-
var _a, _b, _c, _d;
|
15913
|
+
var _a, _b, _c, _d, _e, _f;
|
15871
15914
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
15872
15915
|
return;
|
15873
15916
|
if (isActive) {
|
@@ -15875,10 +15918,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15875
15918
|
eventName: 'ViewContent',
|
15876
15919
|
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
|
15877
15920
|
});
|
15878
|
-
|
15921
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15922
|
+
eventName: 'PageView',
|
15923
|
+
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
|
15924
|
+
});
|
15925
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
15879
15926
|
}
|
15880
15927
|
else {
|
15881
|
-
(
|
15928
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
15882
15929
|
}
|
15883
15930
|
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15884
15931
|
/*
|
@@ -15900,12 +15947,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15900
15947
|
if (!isActive)
|
15901
15948
|
return;
|
15902
15949
|
const onShow = () => {
|
15903
|
-
var _a, _b;
|
15904
15950
|
handleClickVideo('start')();
|
15905
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15906
|
-
eventName: 'ViewContent',
|
15907
|
-
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
|
15908
|
-
});
|
15909
15951
|
};
|
15910
15952
|
const onHide = handleClickVideo('pause');
|
15911
15953
|
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
@@ -16076,41 +16118,51 @@ const Picture = (props) => {
|
|
16076
16118
|
}, onLoad: onShowFirstImage }))));
|
16077
16119
|
};
|
16078
16120
|
|
16079
|
-
|
16080
|
-
* @Author: lewinlu@chatlabs.com
|
16081
|
-
* @Date: 2024-01-03 14:39:09
|
16082
|
-
* @LastEditors: binruan@chatlabs.com
|
16083
|
-
* @LastEditTime: 2024-10-10 17:53:30
|
16084
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
16085
|
-
*/
|
16086
|
-
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16121
|
+
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16087
16122
|
var _a, _b;
|
16088
16123
|
const ref = React.useRef();
|
16089
16124
|
const { isActive } = useSwiperSlide();
|
16090
16125
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
16091
16126
|
const [isLoad, setIsLoad] = React.useState(false);
|
16127
|
+
const [imgInfo, setImgInfo] = React.useState();
|
16128
|
+
const initTime = new Date();
|
16092
16129
|
React.useEffect(() => {
|
16093
16130
|
if (isLoad && isActive) {
|
16094
16131
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
|
16095
16132
|
if (openHashtag) {
|
16096
|
-
|
16133
|
+
onViewImageEndEvent(rec);
|
16097
16134
|
}
|
16098
16135
|
else {
|
16099
|
-
onViewImageStartEvent(index);
|
16136
|
+
onViewImageStartEvent(index, imgInfo, true);
|
16100
16137
|
}
|
16101
16138
|
}
|
16102
16139
|
else {
|
16103
16140
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
|
16104
16141
|
}
|
16105
|
-
}, [rec, isActive,
|
16106
|
-
const showFirstImageFn = React.useCallback(() => {
|
16142
|
+
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
16143
|
+
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
16107
16144
|
if (!isLoad) {
|
16145
|
+
const contentSize = yield getResFileSizeFromSrc(e.src);
|
16146
|
+
setImgInfo({
|
16147
|
+
contentSize,
|
16148
|
+
loadTime: (new Date() - initTime).toFixed(2) + ''
|
16149
|
+
});
|
16108
16150
|
setIsLoad(true);
|
16109
16151
|
}
|
16110
|
-
}, [isLoad]);
|
16152
|
+
}), [isLoad]);
|
16111
16153
|
// if (!isActive) {
|
16112
16154
|
// return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
|
16113
16155
|
// }
|
16156
|
+
React.useEffect(() => {
|
16157
|
+
const onShow = () => onViewImageStartEvent(index, imgInfo);
|
16158
|
+
const onHide = () => onViewImageEndEvent(rec);
|
16159
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16160
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16161
|
+
return () => {
|
16162
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16163
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16164
|
+
};
|
16165
|
+
}, [imgInfo]);
|
16114
16166
|
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
16115
16167
|
clickable: true,
|
16116
16168
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -16249,7 +16301,7 @@ function withBindDataSource(Component) {
|
|
16249
16301
|
* @Author: binruan@chatlabs.com
|
16250
16302
|
* @Date: 2023-12-26 16:11:34
|
16251
16303
|
* @LastEditors: binruan@chatlabs.com
|
16252
|
-
* @LastEditTime: 2024-10-
|
16304
|
+
* @LastEditTime: 2024-10-29 14:07:29
|
16253
16305
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
16254
16306
|
*
|
16255
16307
|
*/
|
@@ -16298,7 +16350,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
|
|
16298
16350
|
const Component = withBindDataSource(t);
|
16299
16351
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
16300
16352
|
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';
|
16301
|
-
|
16353
|
+
let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
|
16354
|
+
if (style.hasOwnProperty('backdropFilter')) {
|
16355
|
+
let sbf = style['backdropFilter'];
|
16356
|
+
style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
16357
|
+
}
|
16358
|
+
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 })));
|
16302
16359
|
}
|
16303
16360
|
else {
|
16304
16361
|
return null;
|
@@ -16391,7 +16448,7 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
16391
16448
|
* @Author: binruan@chatlabs.com
|
16392
16449
|
* @Date: 2024-01-15 19:03:09
|
16393
16450
|
* @LastEditors: binruan@chatlabs.com
|
16394
|
-
* @LastEditTime: 2024-10-
|
16451
|
+
* @LastEditTime: 2024-10-28 16:36:22
|
16395
16452
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16396
16453
|
*
|
16397
16454
|
*/
|
@@ -16461,7 +16518,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16461
16518
|
// 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
|
16462
16519
|
if (repCond) {
|
16463
16520
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
16464
|
-
handleReportViewImageEnd(item);
|
16465
16521
|
handleReportProductView(item);
|
16466
16522
|
}
|
16467
16523
|
let fromKName = '';
|
@@ -16506,7 +16562,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16506
16562
|
// 页面可见时触发,注意页面初始化时不会触发
|
16507
16563
|
handleH5EnterLink();
|
16508
16564
|
if (repCond) {
|
16509
|
-
handleViewImageStartEvent(activeIndex);
|
16510
16565
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
16511
16566
|
backMainFeed('external', selectTag);
|
16512
16567
|
}
|
@@ -16591,7 +16646,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16591
16646
|
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 }));
|
16592
16647
|
}
|
16593
16648
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
16594
|
-
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,
|
16649
|
+
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 }));
|
16595
16650
|
}
|
16596
16651
|
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) {
|
16597
16652
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -16665,7 +16720,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16665
16720
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike) || !visible)
|
16666
16721
|
return;
|
16667
16722
|
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
16668
|
-
if (waterFallData && top < 40) {
|
16723
|
+
if (waterFallData && top < 40 && globalConfig.likeIconYPosit === 'top') {
|
16669
16724
|
top += 40;
|
16670
16725
|
}
|
16671
16726
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
@@ -16677,7 +16732,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16677
16732
|
}
|
16678
16733
|
return null;
|
16679
16734
|
}, [globalConfig, waterFallData]);
|
16680
|
-
const
|
16735
|
+
const handleViewImageStartEnd = (item) => {
|
16681
16736
|
var _a, _b, _c, _d, _e, _f;
|
16682
16737
|
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)) {
|
16683
16738
|
const endTime = Date.now();
|
@@ -16735,7 +16790,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16735
16790
|
}
|
16736
16791
|
};
|
16737
16792
|
const handleScrollEvent = (swiper) => {
|
16738
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
16793
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
16739
16794
|
const item = data[swiper.previousIndex];
|
16740
16795
|
if (!item)
|
16741
16796
|
return;
|
@@ -16755,11 +16810,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16755
16810
|
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 : '',
|
16756
16811
|
requestId: null,
|
16757
16812
|
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 : '',
|
16758
|
-
contentFormat
|
16813
|
+
contentFormat,
|
16814
|
+
position: ((_k = swiper.previousIndex) !== null && _k !== void 0 ? _k : 0) + ''
|
16759
16815
|
}
|
16760
16816
|
});
|
16761
16817
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
16762
|
-
|
16818
|
+
handleViewImageStartEnd(item);
|
16763
16819
|
handleSlideSkip(item, swiper.previousIndex);
|
16764
16820
|
}
|
16765
16821
|
else {
|
@@ -16767,15 +16823,16 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16767
16823
|
eventInfo: {
|
16768
16824
|
eventSubject: 'scrollUp',
|
16769
16825
|
eventDescription: 'User scroll up',
|
16770
|
-
contentId: (
|
16771
|
-
productId: (
|
16826
|
+
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 : '',
|
16827
|
+
productId: (_p = (_o = item.product) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
16772
16828
|
requestId: null,
|
16773
|
-
traceInfo: (
|
16774
|
-
contentFormat
|
16829
|
+
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 : '',
|
16830
|
+
contentFormat,
|
16831
|
+
position: ((_s = swiper.previousIndex) !== null && _s !== void 0 ? _s : 0) + ''
|
16775
16832
|
}
|
16776
16833
|
});
|
16777
16834
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
16778
|
-
|
16835
|
+
handleViewImageStartEnd(item);
|
16779
16836
|
}
|
16780
16837
|
// 商品浏览事件
|
16781
16838
|
handleReportProductView(item);
|
@@ -16796,7 +16853,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16796
16853
|
viewTime.current = new Date();
|
16797
16854
|
}
|
16798
16855
|
}, [openHashtag, data, activeIndex]);
|
16799
|
-
const handleViewImageStartEvent = (activeIndex) => {
|
16856
|
+
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
16800
16857
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16801
16858
|
const item = data[activeIndex];
|
16802
16859
|
// 如果是图片集则上报事件
|
@@ -16813,32 +16870,40 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16813
16870
|
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
16814
16871
|
position: activeIndex + '',
|
16815
16872
|
contentFormat: 'image',
|
16816
|
-
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
16873
|
+
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
16874
|
+
contentSize: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.contentSize,
|
16875
|
+
loadTime: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.loadTime
|
16817
16876
|
}
|
16818
16877
|
});
|
16819
|
-
|
16820
|
-
|
16821
|
-
|
16822
|
-
|
16823
|
-
|
16824
|
-
|
16825
|
-
|
16826
|
-
|
16878
|
+
if (enableCapi) {
|
16879
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16880
|
+
eventName: 'ViewContent',
|
16881
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
16882
|
+
});
|
16883
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16884
|
+
eventName: 'PageView',
|
16885
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
16886
|
+
});
|
16887
|
+
}
|
16827
16888
|
}
|
16828
16889
|
};
|
16829
16890
|
const renderToggleButton = React.useCallback((visible) => {
|
16830
16891
|
var _a, _b, _c, _d, _e, _f;
|
16831
16892
|
if (!visible)
|
16832
16893
|
return;
|
16894
|
+
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
|
16895
|
+
if (waterFallData && top < 40 && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
|
16896
|
+
top += 40;
|
16897
|
+
}
|
16833
16898
|
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: {
|
16834
16899
|
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
|
16835
|
-
visibility: ((
|
16900
|
+
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',
|
16836
16901
|
zIndex: 999,
|
16837
16902
|
transform: 'translate3d(0px,0px,0px)',
|
16838
|
-
[(
|
16839
|
-
[(
|
16903
|
+
[(_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,
|
16904
|
+
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: top
|
16840
16905
|
}, 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 })));
|
16841
|
-
}, [globalConfig, visList, activeIndex, isMuted]);
|
16906
|
+
}, [globalConfig, visList, activeIndex, isMuted, waterFallData]);
|
16842
16907
|
const renderView = React.useMemo(() => {
|
16843
16908
|
if (loading) {
|
16844
16909
|
return (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -16871,7 +16936,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16871
16936
|
renderToggleButton
|
16872
16937
|
]);
|
16873
16938
|
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` })) },
|
16874
|
-
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: () => {
|
16939
|
+
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: () => {
|
16875
16940
|
const isEq = lodash.isEqual(rtcList, cacheRtcList);
|
16876
16941
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
16877
16942
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|