pb-sxp-ui 1.7.2 → 1.7.3
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 +107 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +107 -48
- 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 +107 -48
- 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 +4 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.js +24 -4
- package/es/core/components/SxpPageRender/RenderCard.js +6 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +14 -7
- 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 +12 -10
- 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 +4 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +23 -4
- package/lib/core/components/SxpPageRender/RenderCard.js +6 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +13 -7
- 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 +12 -10
- 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/pb-ui.js
CHANGED
@@ -313,6 +313,16 @@
|
|
313
313
|
});
|
314
314
|
return value !== null && value !== void 0 ? value : '';
|
315
315
|
}
|
316
|
+
const getResFileSizeFromSrc = (imageSrc) => {
|
317
|
+
if (!imageSrc)
|
318
|
+
return '';
|
319
|
+
return fetch(imageSrc)
|
320
|
+
.then((response) => response.blob())
|
321
|
+
.then((blob) => {
|
322
|
+
const fileSizeInMB = blob.size / (1024 * 1024); // 将文件大小转换为 MB
|
323
|
+
return fileSizeInMB.toFixed(2) + '';
|
324
|
+
});
|
325
|
+
};
|
316
326
|
|
317
327
|
function unzip(b64Data) {
|
318
328
|
const strData = atob(b64Data);
|
@@ -9283,7 +9293,7 @@
|
|
9283
9293
|
* @Author: binruan@chatlabs.com
|
9284
9294
|
* @Date: 2024-03-20 14:56:16
|
9285
9295
|
* @LastEditors: binruan@chatlabs.com
|
9286
|
-
* @LastEditTime: 2024-
|
9296
|
+
* @LastEditTime: 2024-10-24 17:51:19
|
9287
9297
|
* @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
|
9288
9298
|
*
|
9289
9299
|
*/
|
@@ -9310,8 +9320,8 @@
|
|
9310
9320
|
return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
|
9311
9321
|
}
|
9312
9322
|
};
|
9313
|
-
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
|
9314
|
-
var _a, _b, _c, _d, _e;
|
9323
|
+
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
|
9324
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9315
9325
|
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
9316
9326
|
return null;
|
9317
9327
|
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;
|
@@ -9359,6 +9369,8 @@
|
|
9359
9369
|
}
|
9360
9370
|
});
|
9361
9371
|
}
|
9372
|
+
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>`;
|
9373
|
+
text = setFontForText(text, style);
|
9362
9374
|
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
|
9363
9375
|
text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
|
9364
9376
|
}
|
@@ -9424,7 +9436,8 @@
|
|
9424
9436
|
const priceText = getPriceText({
|
9425
9437
|
product: product,
|
9426
9438
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
9427
|
-
globalConfig
|
9439
|
+
globalConfig,
|
9440
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
9428
9441
|
});
|
9429
9442
|
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;
|
9430
9443
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -9438,7 +9451,7 @@
|
|
9438
9451
|
__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)
|
9439
9452
|
} }),
|
9440
9453
|
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: {
|
9441
|
-
__html:
|
9454
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
9442
9455
|
} }),
|
9443
9456
|
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: {
|
9444
9457
|
__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)
|
@@ -10312,7 +10325,8 @@
|
|
10312
10325
|
const priceText = getPriceText({
|
10313
10326
|
product,
|
10314
10327
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
10315
|
-
globalConfig
|
10328
|
+
globalConfig,
|
10329
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10316
10330
|
});
|
10317
10331
|
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;
|
10318
10332
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -10473,7 +10487,7 @@ Made in Italy` })));
|
|
10473
10487
|
} })),
|
10474
10488
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
10475
10489
|
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: {
|
10476
|
-
__html:
|
10490
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
10477
10491
|
} }),
|
10478
10492
|
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: {
|
10479
10493
|
__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)
|
@@ -10931,7 +10945,8 @@ Made in Italy` })));
|
|
10931
10945
|
return getPriceText({
|
10932
10946
|
product,
|
10933
10947
|
enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
10934
|
-
globalConfig
|
10948
|
+
globalConfig,
|
10949
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10935
10950
|
});
|
10936
10951
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
10937
10952
|
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
@@ -10956,7 +10971,7 @@ Made in Italy` })));
|
|
10956
10971
|
});
|
10957
10972
|
}, []);
|
10958
10973
|
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) => {
|
10959
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10974
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10960
10975
|
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({
|
10961
10976
|
display: 'flex'
|
10962
10977
|
}), onClick: () => handleClick(item, index) }),
|
@@ -10983,10 +10998,10 @@ Made in Italy` })));
|
|
10983
10998
|
}) },
|
10984
10999
|
React.createElement("div", null,
|
10985
11000
|
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: {
|
10986
|
-
__html:
|
11001
|
+
__html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
|
10987
11002
|
} })),
|
10988
11003
|
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10989
|
-
__html: setFontForText((
|
11004
|
+
__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)
|
10990
11005
|
} })))))));
|
10991
11006
|
})));
|
10992
11007
|
};
|
@@ -11134,7 +11149,7 @@ Made in Italy` })));
|
|
11134
11149
|
* @Author: binruan@chatlabs.com
|
11135
11150
|
* @Date: 2024-03-26 16:50:25
|
11136
11151
|
* @LastEditors: binruan@chatlabs.com
|
11137
|
-
* @LastEditTime: 2024-
|
11152
|
+
* @LastEditTime: 2024-10-24 19:04:37
|
11138
11153
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
|
11139
11154
|
*
|
11140
11155
|
*/
|
@@ -11180,6 +11195,12 @@ Made in Italy` })));
|
|
11180
11195
|
label: '背景色',
|
11181
11196
|
name: ['style', 'backgroundColor']
|
11182
11197
|
},
|
11198
|
+
{
|
11199
|
+
type: 'Number',
|
11200
|
+
label: '背景色毛玻璃',
|
11201
|
+
name: ['style', 'backdropFilter'],
|
11202
|
+
addonAfter: 'px'
|
11203
|
+
},
|
11183
11204
|
{
|
11184
11205
|
label: '内边距',
|
11185
11206
|
type: 'Number',
|
@@ -13963,7 +13984,8 @@ Made in Italy` })));
|
|
13963
13984
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
13964
13985
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
13965
13986
|
globalConfig,
|
13966
|
-
isHiddenDef: true
|
13987
|
+
isHiddenDef: true,
|
13988
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
13967
13989
|
});
|
13968
13990
|
React.useEffect(() => {
|
13969
13991
|
if (imgDom.current === null || src === '') {
|
@@ -14005,7 +14027,7 @@ Made in Italy` })));
|
|
14005
14027
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
14006
14028
|
} }),
|
14007
14029
|
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
|
14008
|
-
__html:
|
14030
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
14009
14031
|
} }))));
|
14010
14032
|
};
|
14011
14033
|
function WaterfallList$1(_a) {
|
@@ -14280,7 +14302,8 @@ Made in Italy` })));
|
|
14280
14302
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
14281
14303
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
14282
14304
|
globalConfig,
|
14283
|
-
isHiddenDef: true
|
14305
|
+
isHiddenDef: true,
|
14306
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
14284
14307
|
});
|
14285
14308
|
// useEffect(() => {
|
14286
14309
|
// if (imgDom.current === null || src === '') {
|
@@ -14367,7 +14390,7 @@ Made in Italy` })));
|
|
14367
14390
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
14368
14391
|
} }),
|
14369
14392
|
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
|
14370
|
-
__html:
|
14393
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
14371
14394
|
} }))));
|
14372
14395
|
};
|
14373
14396
|
function WaterfallList(_a) {
|
@@ -14745,7 +14768,7 @@ Made in Italy` })));
|
|
14745
14768
|
* @Author: binruan@chatlabs.com
|
14746
14769
|
* @Date: 2024-07-02 14:51:32
|
14747
14770
|
* @LastEditors: binruan@chatlabs.com
|
14748
|
-
* @LastEditTime: 2024-
|
14771
|
+
* @LastEditTime: 2024-10-25 10:39:04
|
14749
14772
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\settingRender.tsx
|
14750
14773
|
*
|
14751
14774
|
*/
|
@@ -14791,6 +14814,12 @@ Made in Italy` })));
|
|
14791
14814
|
label: '背景色',
|
14792
14815
|
name: ['style', 'backgroundColor']
|
14793
14816
|
},
|
14817
|
+
{
|
14818
|
+
type: 'Number',
|
14819
|
+
label: '背景色毛玻璃',
|
14820
|
+
name: ['style', 'backdropFilter'],
|
14821
|
+
addonAfter: 'px'
|
14822
|
+
},
|
14794
14823
|
{
|
14795
14824
|
type: 'TextMargin',
|
14796
14825
|
name: ['style'],
|
@@ -15090,6 +15119,12 @@ Made in Italy` })));
|
|
15090
15119
|
label: '背景色',
|
15091
15120
|
name: ['style', 'backgroundColor']
|
15092
15121
|
},
|
15122
|
+
{
|
15123
|
+
type: 'Number',
|
15124
|
+
label: '背景色毛玻璃',
|
15125
|
+
name: ['style', 'backdropFilter'],
|
15126
|
+
addonAfter: 'px'
|
15127
|
+
},
|
15093
15128
|
{
|
15094
15129
|
label: '外边距',
|
15095
15130
|
type: 'Number',
|
@@ -15640,6 +15675,7 @@ Made in Italy` })));
|
|
15640
15675
|
const videoId = `pb-cache-video-${index}`;
|
15641
15676
|
const videoEleRef = React.useRef(null);
|
15642
15677
|
const hlsRef = React.useRef(null);
|
15678
|
+
const initTimeRef = React.useRef();
|
15643
15679
|
const blur = React.useMemo(() => {
|
15644
15680
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
15645
15681
|
}, [videoPostConfig]);
|
@@ -15685,8 +15721,8 @@ Made in Italy` })));
|
|
15685
15721
|
setWaiting(false);
|
15686
15722
|
setIsLoadFinish(true);
|
15687
15723
|
}, []);
|
15688
|
-
const handleStartPlay = React.useCallback(() => {
|
15689
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
15724
|
+
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
15725
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
15690
15726
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15691
15727
|
return;
|
15692
15728
|
setIsPauseVideo(false);
|
@@ -15696,24 +15732,27 @@ Made in Italy` })));
|
|
15696
15732
|
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);
|
15697
15733
|
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);
|
15698
15734
|
const playType = isFirstPlay ? '0' : '1';
|
15735
|
+
const contentSize = yield getResFileSizeFromSrc((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url);
|
15699
15736
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15700
15737
|
eventInfo: {
|
15701
15738
|
eventSubject: 'playVideo',
|
15702
15739
|
eventDescription: 'User played the video',
|
15703
|
-
contentId: (
|
15704
|
-
contentName: (
|
15740
|
+
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 : '',
|
15741
|
+
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 : '',
|
15705
15742
|
playType,
|
15706
15743
|
startTime: videoCurrentTime,
|
15707
15744
|
videoDuration,
|
15708
|
-
contentTags: JSON.stringify((
|
15745
|
+
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 : []),
|
15709
15746
|
position: index + '',
|
15710
15747
|
contentFormat: 'video',
|
15711
|
-
traceInfo: (
|
15748
|
+
traceInfo: (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo,
|
15749
|
+
contentSize,
|
15750
|
+
loadTime: (new Date() - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
|
15712
15751
|
}
|
15713
15752
|
});
|
15714
15753
|
setIsFirstPlay(false);
|
15715
15754
|
}
|
15716
|
-
}, [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15755
|
+
}), [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15717
15756
|
const handLoadeddata = React.useCallback(() => {
|
15718
15757
|
var _a;
|
15719
15758
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
@@ -15817,6 +15856,7 @@ Made in Italy` })));
|
|
15817
15856
|
videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
|
15818
15857
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15819
15858
|
return;
|
15859
|
+
initTimeRef.current = new Date();
|
15820
15860
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
15821
15861
|
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
15822
15862
|
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
@@ -16069,19 +16109,14 @@ Made in Italy` })));
|
|
16069
16109
|
}, onLoad: onShowFirstImage }))));
|
16070
16110
|
};
|
16071
16111
|
|
16072
|
-
/*
|
16073
|
-
* @Author: lewinlu@chatlabs.com
|
16074
|
-
* @Date: 2024-01-03 14:39:09
|
16075
|
-
* @LastEditors: binruan@chatlabs.com
|
16076
|
-
* @LastEditTime: 2024-10-10 17:53:30
|
16077
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
16078
|
-
*/
|
16079
16112
|
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16080
16113
|
var _a, _b;
|
16081
16114
|
const ref = React.useRef();
|
16082
16115
|
const { isActive } = useSwiperSlide();
|
16083
16116
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
16084
16117
|
const [isLoad, setIsLoad] = React.useState(false);
|
16118
|
+
const [imgInfo, setImgInfo] = React.useState();
|
16119
|
+
const initTime = new Date();
|
16085
16120
|
React.useEffect(() => {
|
16086
16121
|
if (isLoad && isActive) {
|
16087
16122
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
|
@@ -16089,21 +16124,36 @@ Made in Italy` })));
|
|
16089
16124
|
onReportViewImageEnd(rec);
|
16090
16125
|
}
|
16091
16126
|
else {
|
16092
|
-
onViewImageStartEvent(index);
|
16127
|
+
onViewImageStartEvent(index, imgInfo);
|
16093
16128
|
}
|
16094
16129
|
}
|
16095
16130
|
else {
|
16096
16131
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
|
16097
16132
|
}
|
16098
|
-
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
16099
|
-
const showFirstImageFn = React.useCallback(() => {
|
16133
|
+
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
16134
|
+
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
16100
16135
|
if (!isLoad) {
|
16136
|
+
const contentSize = yield getResFileSizeFromSrc(e.src);
|
16137
|
+
setImgInfo({
|
16138
|
+
contentSize,
|
16139
|
+
loadTime: (new Date() - initTime).toFixed(2) + ''
|
16140
|
+
});
|
16101
16141
|
setIsLoad(true);
|
16102
16142
|
}
|
16103
|
-
}, [isLoad]);
|
16143
|
+
}), [isLoad]);
|
16104
16144
|
// if (!isActive) {
|
16105
16145
|
// return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
|
16106
16146
|
// }
|
16147
|
+
React.useEffect(() => {
|
16148
|
+
const onShow = () => onViewImageStartEvent(index, imgInfo);
|
16149
|
+
const onHide = () => onReportViewImageEnd(rec);
|
16150
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16151
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16152
|
+
return () => {
|
16153
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16154
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16155
|
+
};
|
16156
|
+
}, [imgInfo]);
|
16107
16157
|
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
16108
16158
|
clickable: true,
|
16109
16159
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -16242,7 +16292,7 @@ Made in Italy` })));
|
|
16242
16292
|
* @Author: binruan@chatlabs.com
|
16243
16293
|
* @Date: 2023-12-26 16:11:34
|
16244
16294
|
* @LastEditors: binruan@chatlabs.com
|
16245
|
-
* @LastEditTime: 2024-10-
|
16295
|
+
* @LastEditTime: 2024-10-25 10:36:59
|
16246
16296
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
16247
16297
|
*
|
16248
16298
|
*/
|
@@ -16291,7 +16341,12 @@ Made in Italy` })));
|
|
16291
16341
|
const Component = withBindDataSource(t);
|
16292
16342
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
16293
16343
|
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';
|
16294
|
-
|
16344
|
+
let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
|
16345
|
+
if (style.hasOwnProperty('backdropFilter')) {
|
16346
|
+
let sbf = style['backdropFilter'];
|
16347
|
+
style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
16348
|
+
}
|
16349
|
+
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 })));
|
16295
16350
|
}
|
16296
16351
|
else {
|
16297
16352
|
return null;
|
@@ -16384,7 +16439,7 @@ Made in Italy` })));
|
|
16384
16439
|
* @Author: binruan@chatlabs.com
|
16385
16440
|
* @Date: 2024-01-15 19:03:09
|
16386
16441
|
* @LastEditors: binruan@chatlabs.com
|
16387
|
-
* @LastEditTime: 2024-10-
|
16442
|
+
* @LastEditTime: 2024-10-25 15:41:58
|
16388
16443
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16389
16444
|
*
|
16390
16445
|
*/
|
@@ -16454,7 +16509,7 @@ Made in Italy` })));
|
|
16454
16509
|
// 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
|
16455
16510
|
if (repCond) {
|
16456
16511
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
16457
|
-
handleReportViewImageEnd(item);
|
16512
|
+
// handleReportViewImageEnd(item);
|
16458
16513
|
handleReportProductView(item);
|
16459
16514
|
}
|
16460
16515
|
let fromKName = '';
|
@@ -16499,7 +16554,7 @@ Made in Italy` })));
|
|
16499
16554
|
// 页面可见时触发,注意页面初始化时不会触发
|
16500
16555
|
handleH5EnterLink();
|
16501
16556
|
if (repCond) {
|
16502
|
-
handleViewImageStartEvent(activeIndex);
|
16557
|
+
// handleViewImageStartEvent(activeIndex);
|
16503
16558
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
16504
16559
|
backMainFeed('external', selectTag);
|
16505
16560
|
}
|
@@ -16728,7 +16783,7 @@ Made in Italy` })));
|
|
16728
16783
|
}
|
16729
16784
|
};
|
16730
16785
|
const handleScrollEvent = (swiper) => {
|
16731
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
16786
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
16732
16787
|
const item = data[swiper.previousIndex];
|
16733
16788
|
if (!item)
|
16734
16789
|
return;
|
@@ -16748,7 +16803,8 @@ Made in Italy` })));
|
|
16748
16803
|
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 : '',
|
16749
16804
|
requestId: null,
|
16750
16805
|
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 : '',
|
16751
|
-
contentFormat
|
16806
|
+
contentFormat,
|
16807
|
+
position: ((_k = swiper.previousIndex) !== null && _k !== void 0 ? _k : 0) + ''
|
16752
16808
|
}
|
16753
16809
|
});
|
16754
16810
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16760,11 +16816,12 @@ Made in Italy` })));
|
|
16760
16816
|
eventInfo: {
|
16761
16817
|
eventSubject: 'scrollUp',
|
16762
16818
|
eventDescription: 'User scroll up',
|
16763
|
-
contentId: (
|
16764
|
-
productId: (
|
16819
|
+
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 : '',
|
16820
|
+
productId: (_p = (_o = item.product) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
16765
16821
|
requestId: null,
|
16766
|
-
traceInfo: (
|
16767
|
-
contentFormat
|
16822
|
+
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 : '',
|
16823
|
+
contentFormat,
|
16824
|
+
position: ((_s = swiper.previousIndex) !== null && _s !== void 0 ? _s : 0) + ''
|
16768
16825
|
}
|
16769
16826
|
});
|
16770
16827
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16789,7 +16846,7 @@ Made in Italy` })));
|
|
16789
16846
|
viewTime.current = new Date();
|
16790
16847
|
}
|
16791
16848
|
}, [openHashtag, data, activeIndex]);
|
16792
|
-
const handleViewImageStartEvent = (activeIndex) => {
|
16849
|
+
const handleViewImageStartEvent = (activeIndex, imgInfo) => {
|
16793
16850
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16794
16851
|
const item = data[activeIndex];
|
16795
16852
|
// 如果是图片集则上报事件
|
@@ -16806,7 +16863,9 @@ Made in Italy` })));
|
|
16806
16863
|
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
16807
16864
|
position: activeIndex + '',
|
16808
16865
|
contentFormat: 'image',
|
16809
|
-
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
16866
|
+
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
16867
|
+
contentSize: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.contentSize,
|
16868
|
+
loadTime: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.loadTime
|
16810
16869
|
}
|
16811
16870
|
});
|
16812
16871
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|