pb-sxp-ui 1.7.1 → 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 +222 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +222 -102
- 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 +222 -102
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/Modal/index.js +6 -3
- package/es/core/components/SxpPageRender/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 +22 -12
- 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/WaterFall/index.js +5 -2
- package/es/core/components/SxpPageRender/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/index.js +20 -25
- package/es/core/context/SxpDataSourceProvider.d.ts +2 -4
- package/es/core/context/SxpDataSourceProvider.js +53 -11
- 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.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +15 -9
- package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +18 -10
- package/es/materials/sxp/popup/CommodityList/index.js +12 -6
- 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/Modal/index.js +5 -2
- 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 +21 -12
- 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/WaterFall/index.js +5 -2
- package/lib/core/components/SxpPageRender/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/index.js +20 -25
- package/lib/core/context/SxpDataSourceProvider.d.ts +2 -4
- package/lib/core/context/SxpDataSourceProvider.js +53 -11
- 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.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +15 -9
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +18 -10
- package/lib/materials/sxp/popup/CommodityList/index.js +11 -5
- 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);
|
@@ -812,23 +822,65 @@
|
|
812
822
|
type: 'beacon'
|
813
823
|
});
|
814
824
|
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
815
|
-
const bffFbReport = React.useCallback((
|
816
|
-
var _b, _c, _d;
|
817
|
-
var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
|
825
|
+
const bffFbReport = React.useCallback(({ eventName, product }) => {
|
826
|
+
var _a, _b, _c, _d;
|
818
827
|
if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
819
828
|
return;
|
820
829
|
}
|
821
|
-
|
830
|
+
let jsonParams = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName];
|
822
831
|
const urlParams = new URLSearchParams(window.location.search);
|
823
|
-
const fbclid = urlParams.get('fbclid');
|
832
|
+
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
833
|
+
const fix_par = {
|
834
|
+
event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
|
835
|
+
external_id: storeAndLoadFeUserId(),
|
836
|
+
client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '',
|
837
|
+
fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
|
838
|
+
fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
|
839
|
+
time: new Date().getTime()
|
840
|
+
};
|
841
|
+
const regex = /\{\{(.*?)\}\}/g;
|
842
|
+
const getEventParams = (obj) => {
|
843
|
+
if (!obj)
|
844
|
+
return;
|
845
|
+
if (obj instanceof Array) {
|
846
|
+
obj === null || obj === void 0 ? void 0 : obj.map((item) => getEventParams(item));
|
847
|
+
}
|
848
|
+
else {
|
849
|
+
for (const key in obj) {
|
850
|
+
if (obj.hasOwnProperty(key)) {
|
851
|
+
const value = obj === null || obj === void 0 ? void 0 : obj[key];
|
852
|
+
if (typeof value === 'object') {
|
853
|
+
getEventParams(value);
|
854
|
+
}
|
855
|
+
else if (typeof value === 'string') {
|
856
|
+
const matches = value === null || value === void 0 ? void 0 : value.match(regex);
|
857
|
+
if (matches) {
|
858
|
+
matches.forEach((match) => {
|
859
|
+
const prop = match.substring(2, match.length - 2);
|
860
|
+
try {
|
861
|
+
const replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
862
|
+
if (replaceValue) {
|
863
|
+
obj[key] = replaceValue;
|
864
|
+
}
|
865
|
+
else {
|
866
|
+
delete obj[key];
|
867
|
+
}
|
868
|
+
}
|
869
|
+
catch (error) {
|
870
|
+
delete obj[key];
|
871
|
+
console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
|
872
|
+
}
|
873
|
+
});
|
874
|
+
}
|
875
|
+
}
|
876
|
+
}
|
877
|
+
}
|
878
|
+
}
|
879
|
+
};
|
880
|
+
getEventParams(jsonParams);
|
824
881
|
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
|
825
882
|
method: 'POST',
|
826
|
-
body:
|
827
|
-
eventName,
|
828
|
-
actionSource,
|
829
|
-
eventSourceUrl,
|
830
|
-
userData: Object.assign(Object.assign(Object.assign({ externalId: fakeUserId }, (fbclid && { fbc: `fb.2.${new Date().getTime()}.${fbclid}` })), (getCookie('_fbp') && { fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` })), { clientUserAgent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '' })
|
831
|
-
},
|
883
|
+
body: jsonParams,
|
832
884
|
type: 'beacon'
|
833
885
|
});
|
834
886
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
@@ -8927,7 +8979,7 @@
|
|
8927
8979
|
* @Author: binruan@chatlabs.com
|
8928
8980
|
* @Date: 2023-11-02 18:34:34
|
8929
8981
|
* @LastEditors: binruan@chatlabs.com
|
8930
|
-
* @LastEditTime: 2024-10-
|
8982
|
+
* @LastEditTime: 2024-10-23 16:44:34
|
8931
8983
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8932
8984
|
*
|
8933
8985
|
*/
|
@@ -8944,7 +8996,7 @@
|
|
8944
8996
|
const [isShow, setIsShow] = React.useState(false);
|
8945
8997
|
const modalEleRef = React.useRef(null);
|
8946
8998
|
const { globalConfig, popupDetailData } = useSxpDataSource();
|
8947
|
-
const { schema: _schema } = useEditor();
|
8999
|
+
const { schema: _schema, popup: _popup } = useEditor();
|
8948
9000
|
const [scrollTop, setScrollTop] = React.useState(15);
|
8949
9001
|
React.useEffect(() => {
|
8950
9002
|
const parentNode = document.getElementById('sxp-render');
|
@@ -8982,6 +9034,9 @@
|
|
8982
9034
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
8983
9035
|
}
|
8984
9036
|
}, [isOpen, popup]);
|
9037
|
+
const child = React.useCallback(() => {
|
9038
|
+
return children;
|
9039
|
+
}, [_popup]);
|
8985
9040
|
if (!modalEleRef.current)
|
8986
9041
|
return null;
|
8987
9042
|
const handleClose = lodash.debounce(() => {
|
@@ -9067,7 +9122,7 @@
|
|
9067
9122
|
var _a;
|
9068
9123
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
9069
9124
|
}
|
9070
|
-
})),
|
9125
|
+
})), child())))))), modalEleRef.current);
|
9071
9126
|
};
|
9072
9127
|
var Modal$1 = React.memo(Modal);
|
9073
9128
|
|
@@ -9238,7 +9293,7 @@
|
|
9238
9293
|
* @Author: binruan@chatlabs.com
|
9239
9294
|
* @Date: 2024-03-20 14:56:16
|
9240
9295
|
* @LastEditors: binruan@chatlabs.com
|
9241
|
-
* @LastEditTime: 2024-
|
9296
|
+
* @LastEditTime: 2024-10-24 17:51:19
|
9242
9297
|
* @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
|
9243
9298
|
*
|
9244
9299
|
*/
|
@@ -9265,8 +9320,8 @@
|
|
9265
9320
|
return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
|
9266
9321
|
}
|
9267
9322
|
};
|
9268
|
-
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
|
9269
|
-
var _a, _b, _c, _d, _e;
|
9323
|
+
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
|
9324
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9270
9325
|
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
9271
9326
|
return null;
|
9272
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;
|
@@ -9314,6 +9369,8 @@
|
|
9314
9369
|
}
|
9315
9370
|
});
|
9316
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);
|
9317
9374
|
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
|
9318
9375
|
text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
|
9319
9376
|
}
|
@@ -9325,7 +9382,7 @@
|
|
9325
9382
|
|
9326
9383
|
const CommodityDetail$1 = (_a) => {
|
9327
9384
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
9328
|
-
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
|
9385
|
+
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
9329
9386
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
9330
9387
|
const { jumpToWeb, productView } = useEventReport();
|
9331
9388
|
const curTimeRef = React.useRef(null);
|
@@ -9355,12 +9412,17 @@
|
|
9355
9412
|
}
|
9356
9413
|
};
|
9357
9414
|
React.useEffect(() => {
|
9358
|
-
if (!
|
9359
|
-
|
9360
|
-
|
9361
|
-
|
9362
|
-
|
9363
|
-
|
9415
|
+
if (!isActive)
|
9416
|
+
return;
|
9417
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9418
|
+
eventName: 'ProductView',
|
9419
|
+
product
|
9420
|
+
});
|
9421
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9422
|
+
eventName: 'PageView',
|
9423
|
+
product
|
9424
|
+
});
|
9425
|
+
}, [isActive, bffFbReport]);
|
9364
9426
|
React.useEffect(() => {
|
9365
9427
|
const initTime = () => {
|
9366
9428
|
curTimeRef.current = new Date();
|
@@ -9374,7 +9436,8 @@
|
|
9374
9436
|
const priceText = getPriceText({
|
9375
9437
|
product: product,
|
9376
9438
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
9377
|
-
globalConfig
|
9439
|
+
globalConfig,
|
9440
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
9378
9441
|
});
|
9379
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;
|
9380
9443
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -9388,7 +9451,7 @@
|
|
9388
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)
|
9389
9452
|
} }),
|
9390
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: {
|
9391
|
-
__html:
|
9454
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
9392
9455
|
} }),
|
9393
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: {
|
9394
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)
|
@@ -10202,7 +10265,7 @@
|
|
10202
10265
|
|
10203
10266
|
const CommodityDetailDiroNew$1 = (_a) => {
|
10204
10267
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
10205
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
|
10268
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
10206
10269
|
React.useState(true);
|
10207
10270
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
10208
10271
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -10236,14 +10299,21 @@
|
|
10236
10299
|
}
|
10237
10300
|
};
|
10238
10301
|
React.useEffect(() => {
|
10239
|
-
if (!
|
10240
|
-
|
10241
|
-
|
10242
|
-
|
10243
|
-
|
10244
|
-
|
10302
|
+
if (!isActive)
|
10303
|
+
return;
|
10304
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10305
|
+
eventName: 'ProductView',
|
10306
|
+
product
|
10307
|
+
});
|
10308
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10309
|
+
eventName: 'PageView',
|
10310
|
+
product
|
10311
|
+
});
|
10312
|
+
}, [isActive, bffFbReport]);
|
10245
10313
|
React.useEffect(() => {
|
10246
10314
|
const initTime = () => {
|
10315
|
+
if (!isActive)
|
10316
|
+
return;
|
10247
10317
|
curTimeRef.current = new Date();
|
10248
10318
|
};
|
10249
10319
|
initTime();
|
@@ -10251,11 +10321,12 @@
|
|
10251
10321
|
return () => {
|
10252
10322
|
window.removeEventListener('pageshow', initTime);
|
10253
10323
|
};
|
10254
|
-
}, []);
|
10324
|
+
}, [isActive]);
|
10255
10325
|
const priceText = getPriceText({
|
10256
10326
|
product,
|
10257
10327
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
10258
|
-
globalConfig
|
10328
|
+
globalConfig,
|
10329
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10259
10330
|
});
|
10260
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;
|
10261
10332
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -10416,7 +10487,7 @@ Made in Italy` })));
|
|
10416
10487
|
} })),
|
10417
10488
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
10418
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: {
|
10419
|
-
__html:
|
10490
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
10420
10491
|
} }),
|
10421
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: {
|
10422
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)
|
@@ -10863,7 +10934,7 @@ Made in Italy` })));
|
|
10863
10934
|
const CommodityList$1 = (_a) => {
|
10864
10935
|
var _b, _c, _d;
|
10865
10936
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
|
10866
|
-
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig } = useSxpDataSource();
|
10937
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig, bffFbReport } = useSxpDataSource();
|
10867
10938
|
const { jumpToWeb } = useEventReport();
|
10868
10939
|
const { popup } = useEditor();
|
10869
10940
|
const recData = isPost ? rec : popupDetailData;
|
@@ -10874,7 +10945,8 @@ Made in Italy` })));
|
|
10874
10945
|
return getPriceText({
|
10875
10946
|
product,
|
10876
10947
|
enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
10877
|
-
globalConfig
|
10948
|
+
globalConfig,
|
10949
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10878
10950
|
});
|
10879
10951
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
10880
10952
|
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
@@ -10893,8 +10965,13 @@ Made in Italy` })));
|
|
10893
10965
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10894
10966
|
}
|
10895
10967
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10968
|
+
React.useEffect(() => {
|
10969
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10970
|
+
eventName: 'PageView'
|
10971
|
+
});
|
10972
|
+
}, []);
|
10896
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) => {
|
10897
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10974
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10898
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({
|
10899
10976
|
display: 'flex'
|
10900
10977
|
}), onClick: () => handleClick(item, index) }),
|
@@ -10921,10 +10998,10 @@ Made in Italy` })));
|
|
10921
10998
|
}) },
|
10922
10999
|
React.createElement("div", null,
|
10923
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: {
|
10924
|
-
__html:
|
11001
|
+
__html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
|
10925
11002
|
} })),
|
10926
11003
|
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10927
|
-
__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)
|
10928
11005
|
} })))))));
|
10929
11006
|
})));
|
10930
11007
|
};
|
@@ -11072,7 +11149,7 @@ Made in Italy` })));
|
|
11072
11149
|
* @Author: binruan@chatlabs.com
|
11073
11150
|
* @Date: 2024-03-26 16:50:25
|
11074
11151
|
* @LastEditors: binruan@chatlabs.com
|
11075
|
-
* @LastEditTime: 2024-
|
11152
|
+
* @LastEditTime: 2024-10-24 19:04:37
|
11076
11153
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
|
11077
11154
|
*
|
11078
11155
|
*/
|
@@ -11118,6 +11195,12 @@ Made in Italy` })));
|
|
11118
11195
|
label: '背景色',
|
11119
11196
|
name: ['style', 'backgroundColor']
|
11120
11197
|
},
|
11198
|
+
{
|
11199
|
+
type: 'Number',
|
11200
|
+
label: '背景色毛玻璃',
|
11201
|
+
name: ['style', 'backdropFilter'],
|
11202
|
+
addonAfter: 'px'
|
11203
|
+
},
|
11121
11204
|
{
|
11122
11205
|
label: '内边距',
|
11123
11206
|
type: 'Number',
|
@@ -13901,7 +13984,8 @@ Made in Italy` })));
|
|
13901
13984
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
13902
13985
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
13903
13986
|
globalConfig,
|
13904
|
-
isHiddenDef: true
|
13987
|
+
isHiddenDef: true,
|
13988
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
13905
13989
|
});
|
13906
13990
|
React.useEffect(() => {
|
13907
13991
|
if (imgDom.current === null || src === '') {
|
@@ -13943,7 +14027,7 @@ Made in Italy` })));
|
|
13943
14027
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
13944
14028
|
} }),
|
13945
14029
|
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
|
13946
|
-
__html:
|
14030
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
13947
14031
|
} }))));
|
13948
14032
|
};
|
13949
14033
|
function WaterfallList$1(_a) {
|
@@ -14218,7 +14302,8 @@ Made in Italy` })));
|
|
14218
14302
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
14219
14303
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
14220
14304
|
globalConfig,
|
14221
|
-
isHiddenDef: true
|
14305
|
+
isHiddenDef: true,
|
14306
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
14222
14307
|
});
|
14223
14308
|
// useEffect(() => {
|
14224
14309
|
// if (imgDom.current === null || src === '') {
|
@@ -14305,7 +14390,7 @@ Made in Italy` })));
|
|
14305
14390
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
14306
14391
|
} }),
|
14307
14392
|
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
|
14308
|
-
__html:
|
14393
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
14309
14394
|
} }))));
|
14310
14395
|
};
|
14311
14396
|
function WaterfallList(_a) {
|
@@ -14410,13 +14495,13 @@ Made in Italy` })));
|
|
14410
14495
|
* @Author: binruan@chatlabs.com
|
14411
14496
|
* @Date: 2024-01-10 10:58:24
|
14412
14497
|
* @LastEditors: binruan@chatlabs.com
|
14413
|
-
* @LastEditTime: 2024-10-
|
14498
|
+
* @LastEditTime: 2024-10-23 16:58:01
|
14414
14499
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
14415
14500
|
*
|
14416
14501
|
*/
|
14417
14502
|
const WaterFall = (props) => {
|
14418
14503
|
var _a;
|
14419
|
-
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
|
14504
|
+
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
|
14420
14505
|
const { backMainFeed } = useEventReport();
|
14421
14506
|
React.useRef(null);
|
14422
14507
|
const modalEleRef = React.useRef(null);
|
@@ -14493,8 +14578,11 @@ Made in Italy` })));
|
|
14493
14578
|
React.useEffect(() => {
|
14494
14579
|
if (openHashtag) {
|
14495
14580
|
setViewTime(new Date());
|
14581
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
14582
|
+
eventName: 'PageView'
|
14583
|
+
});
|
14496
14584
|
}
|
14497
|
-
}, [openHashtag]);
|
14585
|
+
}, [openHashtag, bffFbReport]);
|
14498
14586
|
React.useEffect(() => {
|
14499
14587
|
const initTime = () => {
|
14500
14588
|
setViewTime(new Date());
|
@@ -14680,7 +14768,7 @@ Made in Italy` })));
|
|
14680
14768
|
* @Author: binruan@chatlabs.com
|
14681
14769
|
* @Date: 2024-07-02 14:51:32
|
14682
14770
|
* @LastEditors: binruan@chatlabs.com
|
14683
|
-
* @LastEditTime: 2024-
|
14771
|
+
* @LastEditTime: 2024-10-25 10:39:04
|
14684
14772
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\settingRender.tsx
|
14685
14773
|
*
|
14686
14774
|
*/
|
@@ -14726,6 +14814,12 @@ Made in Italy` })));
|
|
14726
14814
|
label: '背景色',
|
14727
14815
|
name: ['style', 'backgroundColor']
|
14728
14816
|
},
|
14817
|
+
{
|
14818
|
+
type: 'Number',
|
14819
|
+
label: '背景色毛玻璃',
|
14820
|
+
name: ['style', 'backdropFilter'],
|
14821
|
+
addonAfter: 'px'
|
14822
|
+
},
|
14729
14823
|
{
|
14730
14824
|
type: 'TextMargin',
|
14731
14825
|
name: ['style'],
|
@@ -15025,6 +15119,12 @@ Made in Italy` })));
|
|
15025
15119
|
label: '背景色',
|
15026
15120
|
name: ['style', 'backgroundColor']
|
15027
15121
|
},
|
15122
|
+
{
|
15123
|
+
type: 'Number',
|
15124
|
+
label: '背景色毛玻璃',
|
15125
|
+
name: ['style', 'backdropFilter'],
|
15126
|
+
addonAfter: 'px'
|
15127
|
+
},
|
15028
15128
|
{
|
15029
15129
|
label: '外边距',
|
15030
15130
|
type: 'Number',
|
@@ -15575,6 +15675,7 @@ Made in Italy` })));
|
|
15575
15675
|
const videoId = `pb-cache-video-${index}`;
|
15576
15676
|
const videoEleRef = React.useRef(null);
|
15577
15677
|
const hlsRef = React.useRef(null);
|
15678
|
+
const initTimeRef = React.useRef();
|
15578
15679
|
const blur = React.useMemo(() => {
|
15579
15680
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
15580
15681
|
}, [videoPostConfig]);
|
@@ -15620,8 +15721,8 @@ Made in Italy` })));
|
|
15620
15721
|
setWaiting(false);
|
15621
15722
|
setIsLoadFinish(true);
|
15622
15723
|
}, []);
|
15623
|
-
const handleStartPlay = React.useCallback(() => {
|
15624
|
-
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;
|
15625
15726
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15626
15727
|
return;
|
15627
15728
|
setIsPauseVideo(false);
|
@@ -15631,24 +15732,27 @@ Made in Italy` })));
|
|
15631
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);
|
15632
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);
|
15633
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);
|
15634
15736
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15635
15737
|
eventInfo: {
|
15636
15738
|
eventSubject: 'playVideo',
|
15637
15739
|
eventDescription: 'User played the video',
|
15638
|
-
contentId: (
|
15639
|
-
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 : '',
|
15640
15742
|
playType,
|
15641
15743
|
startTime: videoCurrentTime,
|
15642
15744
|
videoDuration,
|
15643
|
-
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 : []),
|
15644
15746
|
position: index + '',
|
15645
15747
|
contentFormat: 'video',
|
15646
|
-
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) + ''
|
15647
15751
|
}
|
15648
15752
|
});
|
15649
15753
|
setIsFirstPlay(false);
|
15650
15754
|
}
|
15651
|
-
}, [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]);
|
15652
15756
|
const handLoadeddata = React.useCallback(() => {
|
15653
15757
|
var _a;
|
15654
15758
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
@@ -15752,6 +15856,7 @@ Made in Italy` })));
|
|
15752
15856
|
videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
|
15753
15857
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15754
15858
|
return;
|
15859
|
+
initTimeRef.current = new Date();
|
15755
15860
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
15756
15861
|
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
15757
15862
|
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
@@ -15795,17 +15900,18 @@ Made in Italy` })));
|
|
15795
15900
|
};
|
15796
15901
|
}, [isActive]);
|
15797
15902
|
React.useEffect(() => {
|
15798
|
-
var _a, _b;
|
15903
|
+
var _a, _b, _c, _d;
|
15799
15904
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
15800
15905
|
return;
|
15801
15906
|
if (isActive) {
|
15802
15907
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15803
|
-
eventName: 'ViewContent'
|
15908
|
+
eventName: 'ViewContent',
|
15909
|
+
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
15804
15910
|
});
|
15805
|
-
(
|
15911
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
15806
15912
|
}
|
15807
15913
|
else {
|
15808
|
-
(
|
15914
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
15809
15915
|
}
|
15810
15916
|
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15811
15917
|
/*
|
@@ -15827,9 +15933,11 @@ Made in Italy` })));
|
|
15827
15933
|
if (!isActive)
|
15828
15934
|
return;
|
15829
15935
|
const onShow = () => {
|
15936
|
+
var _a, _b;
|
15830
15937
|
handleClickVideo('start')();
|
15831
15938
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15832
|
-
eventName: 'ViewContent'
|
15939
|
+
eventName: 'ViewContent',
|
15940
|
+
product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
|
15833
15941
|
});
|
15834
15942
|
};
|
15835
15943
|
const onHide = handleClickVideo('pause');
|
@@ -16001,19 +16109,14 @@ Made in Italy` })));
|
|
16001
16109
|
}, onLoad: onShowFirstImage }))));
|
16002
16110
|
};
|
16003
16111
|
|
16004
|
-
/*
|
16005
|
-
* @Author: lewinlu@chatlabs.com
|
16006
|
-
* @Date: 2024-01-03 14:39:09
|
16007
|
-
* @LastEditors: binruan@chatlabs.com
|
16008
|
-
* @LastEditTime: 2024-10-10 17:53:30
|
16009
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
16010
|
-
*/
|
16011
16112
|
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16012
16113
|
var _a, _b;
|
16013
16114
|
const ref = React.useRef();
|
16014
16115
|
const { isActive } = useSwiperSlide();
|
16015
16116
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
16016
16117
|
const [isLoad, setIsLoad] = React.useState(false);
|
16118
|
+
const [imgInfo, setImgInfo] = React.useState();
|
16119
|
+
const initTime = new Date();
|
16017
16120
|
React.useEffect(() => {
|
16018
16121
|
if (isLoad && isActive) {
|
16019
16122
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
|
@@ -16021,21 +16124,36 @@ Made in Italy` })));
|
|
16021
16124
|
onReportViewImageEnd(rec);
|
16022
16125
|
}
|
16023
16126
|
else {
|
16024
|
-
onViewImageStartEvent(index);
|
16127
|
+
onViewImageStartEvent(index, imgInfo);
|
16025
16128
|
}
|
16026
16129
|
}
|
16027
16130
|
else {
|
16028
16131
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
|
16029
16132
|
}
|
16030
|
-
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
16031
|
-
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* () {
|
16032
16135
|
if (!isLoad) {
|
16136
|
+
const contentSize = yield getResFileSizeFromSrc(e.src);
|
16137
|
+
setImgInfo({
|
16138
|
+
contentSize,
|
16139
|
+
loadTime: (new Date() - initTime).toFixed(2) + ''
|
16140
|
+
});
|
16033
16141
|
setIsLoad(true);
|
16034
16142
|
}
|
16035
|
-
}, [isLoad]);
|
16143
|
+
}), [isLoad]);
|
16036
16144
|
// if (!isActive) {
|
16037
16145
|
// return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
|
16038
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]);
|
16039
16157
|
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
16040
16158
|
clickable: true,
|
16041
16159
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -16174,7 +16292,7 @@ Made in Italy` })));
|
|
16174
16292
|
* @Author: binruan@chatlabs.com
|
16175
16293
|
* @Date: 2023-12-26 16:11:34
|
16176
16294
|
* @LastEditors: binruan@chatlabs.com
|
16177
|
-
* @LastEditTime: 2024-10-
|
16295
|
+
* @LastEditTime: 2024-10-25 10:36:59
|
16178
16296
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
16179
16297
|
*
|
16180
16298
|
*/
|
@@ -16223,7 +16341,12 @@ Made in Italy` })));
|
|
16223
16341
|
const Component = withBindDataSource(t);
|
16224
16342
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
16225
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';
|
16226
|
-
|
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 })));
|
16227
16350
|
}
|
16228
16351
|
else {
|
16229
16352
|
return null;
|
@@ -16316,7 +16439,7 @@ Made in Italy` })));
|
|
16316
16439
|
* @Author: binruan@chatlabs.com
|
16317
16440
|
* @Date: 2024-01-15 19:03:09
|
16318
16441
|
* @LastEditors: binruan@chatlabs.com
|
16319
|
-
* @LastEditTime: 2024-10-
|
16442
|
+
* @LastEditTime: 2024-10-25 15:41:58
|
16320
16443
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16321
16444
|
*
|
16322
16445
|
*/
|
@@ -16346,9 +16469,6 @@ Made in Italy` })));
|
|
16346
16469
|
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
16347
16470
|
const now = new Date();
|
16348
16471
|
viewTime.current = now;
|
16349
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16350
|
-
eventName: 'PageView'
|
16351
|
-
});
|
16352
16472
|
}
|
16353
16473
|
}, [data === null || data === void 0 ? void 0 : data.length]);
|
16354
16474
|
const handleH5EnterLink = React.useCallback(() => {
|
@@ -16357,11 +16477,8 @@ Made in Italy` })));
|
|
16357
16477
|
if (data.length > 0) {
|
16358
16478
|
const now = new Date();
|
16359
16479
|
viewTime.current = now;
|
16360
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16361
|
-
eventName: 'PageView'
|
16362
|
-
});
|
16363
16480
|
}
|
16364
|
-
}, [data.length,
|
16481
|
+
}, [data.length, h5EnterLink]);
|
16365
16482
|
React.useEffect(() => {
|
16366
16483
|
var _a;
|
16367
16484
|
if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
|
@@ -16392,7 +16509,7 @@ Made in Italy` })));
|
|
16392
16509
|
// 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
|
16393
16510
|
if (repCond) {
|
16394
16511
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
16395
|
-
handleReportViewImageEnd(item);
|
16512
|
+
// handleReportViewImageEnd(item);
|
16396
16513
|
handleReportProductView(item);
|
16397
16514
|
}
|
16398
16515
|
let fromKName = '';
|
@@ -16437,7 +16554,7 @@ Made in Italy` })));
|
|
16437
16554
|
// 页面可见时触发,注意页面初始化时不会触发
|
16438
16555
|
handleH5EnterLink();
|
16439
16556
|
if (repCond) {
|
16440
|
-
handleViewImageStartEvent(activeIndex);
|
16557
|
+
// handleViewImageStartEvent(activeIndex);
|
16441
16558
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
16442
16559
|
backMainFeed('external', selectTag);
|
16443
16560
|
}
|
@@ -16530,7 +16647,7 @@ Made in Italy` })));
|
|
16530
16647
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
16531
16648
|
const Component = withBindDataSource(t);
|
16532
16649
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
16533
|
-
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index })));
|
16650
|
+
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index, isActive: activeIndex === index })));
|
16534
16651
|
});
|
16535
16652
|
}
|
16536
16653
|
return null;
|
@@ -16686,7 +16803,8 @@ Made in Italy` })));
|
|
16686
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 : '',
|
16687
16804
|
requestId: null,
|
16688
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 : '',
|
16689
|
-
contentFormat
|
16806
|
+
contentFormat,
|
16807
|
+
position: ((_k = swiper.previousIndex) !== null && _k !== void 0 ? _k : 0) + ''
|
16690
16808
|
}
|
16691
16809
|
});
|
16692
16810
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16698,11 +16816,12 @@ Made in Italy` })));
|
|
16698
16816
|
eventInfo: {
|
16699
16817
|
eventSubject: 'scrollUp',
|
16700
16818
|
eventDescription: 'User scroll up',
|
16701
|
-
contentId: (
|
16702
|
-
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 : '',
|
16703
16821
|
requestId: null,
|
16704
|
-
traceInfo: (
|
16705
|
-
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) + ''
|
16706
16825
|
}
|
16707
16826
|
});
|
16708
16827
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16710,12 +16829,6 @@ Made in Italy` })));
|
|
16710
16829
|
}
|
16711
16830
|
// 商品浏览事件
|
16712
16831
|
handleReportProductView(item);
|
16713
|
-
const curItem = data[swiper.activeIndex];
|
16714
|
-
if (!((_r = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _r === void 0 ? void 0 : _r.url) && !((_s = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
|
16715
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16716
|
-
eventName: 'ProductView'
|
16717
|
-
});
|
16718
|
-
}
|
16719
16832
|
viewTime.current = new Date();
|
16720
16833
|
};
|
16721
16834
|
const handleReportProductView = (item) => {
|
@@ -16733,8 +16846,8 @@ Made in Italy` })));
|
|
16733
16846
|
viewTime.current = new Date();
|
16734
16847
|
}
|
16735
16848
|
}, [openHashtag, data, activeIndex]);
|
16736
|
-
const handleViewImageStartEvent = (activeIndex) => {
|
16737
|
-
var _a, _b, _c, _d, _e, _f;
|
16849
|
+
const handleViewImageStartEvent = (activeIndex, imgInfo) => {
|
16850
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16738
16851
|
const item = data[activeIndex];
|
16739
16852
|
// 如果是图片集则上报事件
|
16740
16853
|
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)) {
|
@@ -16750,11 +16863,18 @@ Made in Italy` })));
|
|
16750
16863
|
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
16751
16864
|
position: activeIndex + '',
|
16752
16865
|
contentFormat: 'image',
|
16753
|
-
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
|
16754
16869
|
}
|
16755
16870
|
});
|
16756
16871
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16757
|
-
eventName: 'ViewContent'
|
16872
|
+
eventName: 'ViewContent',
|
16873
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
16874
|
+
});
|
16875
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16876
|
+
eventName: 'PageView',
|
16877
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
16758
16878
|
});
|
16759
16879
|
}
|
16760
16880
|
};
|
@@ -17228,7 +17348,7 @@ Made in Italy` })));
|
|
17228
17348
|
* @Author: binruan@chatlabs.com
|
17229
17349
|
* @Date: 2023-10-31 10:56:01
|
17230
17350
|
* @LastEditors: binruan@chatlabs.com
|
17231
|
-
* @LastEditTime: 2024-
|
17351
|
+
* @LastEditTime: 2024-10-23 15:07:29
|
17232
17352
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
17233
17353
|
*
|
17234
17354
|
*/
|