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/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);
|
@@ -819,23 +829,65 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
819
829
|
type: 'beacon'
|
820
830
|
});
|
821
831
|
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
822
|
-
const bffFbReport = React.useCallback((
|
823
|
-
var _b, _c, _d;
|
824
|
-
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;
|
832
|
+
const bffFbReport = React.useCallback(({ eventName, product }) => {
|
833
|
+
var _a, _b, _c, _d;
|
825
834
|
if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
826
835
|
return;
|
827
836
|
}
|
828
|
-
|
837
|
+
let jsonParams = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName];
|
829
838
|
const urlParams = new URLSearchParams(window.location.search);
|
830
|
-
const fbclid = urlParams.get('fbclid');
|
839
|
+
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
840
|
+
const fix_par = {
|
841
|
+
event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
|
842
|
+
external_id: storeAndLoadFeUserId(),
|
843
|
+
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 : '',
|
844
|
+
fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
|
845
|
+
fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
|
846
|
+
time: new Date().getTime()
|
847
|
+
};
|
848
|
+
const regex = /\{\{(.*?)\}\}/g;
|
849
|
+
const getEventParams = (obj) => {
|
850
|
+
if (!obj)
|
851
|
+
return;
|
852
|
+
if (obj instanceof Array) {
|
853
|
+
obj === null || obj === void 0 ? void 0 : obj.map((item) => getEventParams(item));
|
854
|
+
}
|
855
|
+
else {
|
856
|
+
for (const key in obj) {
|
857
|
+
if (obj.hasOwnProperty(key)) {
|
858
|
+
const value = obj === null || obj === void 0 ? void 0 : obj[key];
|
859
|
+
if (typeof value === 'object') {
|
860
|
+
getEventParams(value);
|
861
|
+
}
|
862
|
+
else if (typeof value === 'string') {
|
863
|
+
const matches = value === null || value === void 0 ? void 0 : value.match(regex);
|
864
|
+
if (matches) {
|
865
|
+
matches.forEach((match) => {
|
866
|
+
const prop = match.substring(2, match.length - 2);
|
867
|
+
try {
|
868
|
+
const replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
869
|
+
if (replaceValue) {
|
870
|
+
obj[key] = replaceValue;
|
871
|
+
}
|
872
|
+
else {
|
873
|
+
delete obj[key];
|
874
|
+
}
|
875
|
+
}
|
876
|
+
catch (error) {
|
877
|
+
delete obj[key];
|
878
|
+
console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
|
879
|
+
}
|
880
|
+
});
|
881
|
+
}
|
882
|
+
}
|
883
|
+
}
|
884
|
+
}
|
885
|
+
}
|
886
|
+
};
|
887
|
+
getEventParams(jsonParams);
|
831
888
|
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
|
832
889
|
method: 'POST',
|
833
|
-
body:
|
834
|
-
eventName,
|
835
|
-
actionSource,
|
836
|
-
eventSourceUrl,
|
837
|
-
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 : '' })
|
838
|
-
},
|
890
|
+
body: jsonParams,
|
839
891
|
type: 'beacon'
|
840
892
|
});
|
841
893
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
@@ -8934,7 +8986,7 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8934
8986
|
* @Author: binruan@chatlabs.com
|
8935
8987
|
* @Date: 2023-11-02 18:34:34
|
8936
8988
|
* @LastEditors: binruan@chatlabs.com
|
8937
|
-
* @LastEditTime: 2024-10-
|
8989
|
+
* @LastEditTime: 2024-10-23 16:44:34
|
8938
8990
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8939
8991
|
*
|
8940
8992
|
*/
|
@@ -8951,7 +9003,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
8951
9003
|
const [isShow, setIsShow] = React.useState(false);
|
8952
9004
|
const modalEleRef = React.useRef(null);
|
8953
9005
|
const { globalConfig, popupDetailData } = useSxpDataSource();
|
8954
|
-
const { schema: _schema } = useEditor();
|
9006
|
+
const { schema: _schema, popup: _popup } = useEditor();
|
8955
9007
|
const [scrollTop, setScrollTop] = React.useState(15);
|
8956
9008
|
React.useEffect(() => {
|
8957
9009
|
const parentNode = document.getElementById('sxp-render');
|
@@ -8989,6 +9041,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
8989
9041
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
8990
9042
|
}
|
8991
9043
|
}, [isOpen, popup]);
|
9044
|
+
const child = React.useCallback(() => {
|
9045
|
+
return children;
|
9046
|
+
}, [_popup]);
|
8992
9047
|
if (!modalEleRef.current)
|
8993
9048
|
return null;
|
8994
9049
|
const handleClose = lodash.debounce(() => {
|
@@ -9074,7 +9129,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9074
9129
|
var _a;
|
9075
9130
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
9076
9131
|
}
|
9077
|
-
})),
|
9132
|
+
})), child())))))), modalEleRef.current);
|
9078
9133
|
};
|
9079
9134
|
var Modal$1 = React.memo(Modal);
|
9080
9135
|
|
@@ -9245,7 +9300,7 @@ var CommodityGroup$1 = React.memo(CommodityGroup);
|
|
9245
9300
|
* @Author: binruan@chatlabs.com
|
9246
9301
|
* @Date: 2024-03-20 14:56:16
|
9247
9302
|
* @LastEditors: binruan@chatlabs.com
|
9248
|
-
* @LastEditTime: 2024-
|
9303
|
+
* @LastEditTime: 2024-10-24 17:51:19
|
9249
9304
|
* @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
|
9250
9305
|
*
|
9251
9306
|
*/
|
@@ -9272,8 +9327,8 @@ const getMediaValueByMode = (obj) => {
|
|
9272
9327
|
return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
|
9273
9328
|
}
|
9274
9329
|
};
|
9275
|
-
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
|
9276
|
-
var _a, _b, _c, _d, _e;
|
9330
|
+
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
|
9331
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9277
9332
|
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
9278
9333
|
return null;
|
9279
9334
|
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;
|
@@ -9321,6 +9376,8 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
9321
9376
|
}
|
9322
9377
|
});
|
9323
9378
|
}
|
9379
|
+
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>`;
|
9380
|
+
text = setFontForText(text, style);
|
9324
9381
|
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
|
9325
9382
|
text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
|
9326
9383
|
}
|
@@ -9332,7 +9389,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
9332
9389
|
|
9333
9390
|
const CommodityDetail$1 = (_a) => {
|
9334
9391
|
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;
|
9335
|
-
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"]);
|
9392
|
+
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"]);
|
9336
9393
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
9337
9394
|
const { jumpToWeb, productView } = useEventReport();
|
9338
9395
|
const curTimeRef = React.useRef(null);
|
@@ -9362,12 +9419,17 @@ const CommodityDetail$1 = (_a) => {
|
|
9362
9419
|
}
|
9363
9420
|
};
|
9364
9421
|
React.useEffect(() => {
|
9365
|
-
if (!
|
9366
|
-
|
9367
|
-
|
9368
|
-
|
9369
|
-
|
9370
|
-
|
9422
|
+
if (!isActive)
|
9423
|
+
return;
|
9424
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9425
|
+
eventName: 'ProductView',
|
9426
|
+
product
|
9427
|
+
});
|
9428
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9429
|
+
eventName: 'PageView',
|
9430
|
+
product
|
9431
|
+
});
|
9432
|
+
}, [isActive, bffFbReport]);
|
9371
9433
|
React.useEffect(() => {
|
9372
9434
|
const initTime = () => {
|
9373
9435
|
curTimeRef.current = new Date();
|
@@ -9381,7 +9443,8 @@ const CommodityDetail$1 = (_a) => {
|
|
9381
9443
|
const priceText = getPriceText({
|
9382
9444
|
product: product,
|
9383
9445
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
9384
|
-
globalConfig
|
9446
|
+
globalConfig,
|
9447
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
9385
9448
|
});
|
9386
9449
|
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;
|
9387
9450
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -9395,7 +9458,7 @@ const CommodityDetail$1 = (_a) => {
|
|
9395
9458
|
__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)
|
9396
9459
|
} }),
|
9397
9460
|
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: {
|
9398
|
-
__html:
|
9461
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
9399
9462
|
} }),
|
9400
9463
|
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: {
|
9401
9464
|
__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)
|
@@ -10209,7 +10272,7 @@ var settingRender$7 = [
|
|
10209
10272
|
|
10210
10273
|
const CommodityDetailDiroNew$1 = (_a) => {
|
10211
10274
|
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;
|
10212
|
-
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"]);
|
10275
|
+
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"]);
|
10213
10276
|
React.useState(true);
|
10214
10277
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
10215
10278
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -10243,14 +10306,21 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
10243
10306
|
}
|
10244
10307
|
};
|
10245
10308
|
React.useEffect(() => {
|
10246
|
-
if (!
|
10247
|
-
|
10248
|
-
|
10249
|
-
|
10250
|
-
|
10251
|
-
|
10309
|
+
if (!isActive)
|
10310
|
+
return;
|
10311
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10312
|
+
eventName: 'ProductView',
|
10313
|
+
product
|
10314
|
+
});
|
10315
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10316
|
+
eventName: 'PageView',
|
10317
|
+
product
|
10318
|
+
});
|
10319
|
+
}, [isActive, bffFbReport]);
|
10252
10320
|
React.useEffect(() => {
|
10253
10321
|
const initTime = () => {
|
10322
|
+
if (!isActive)
|
10323
|
+
return;
|
10254
10324
|
curTimeRef.current = new Date();
|
10255
10325
|
};
|
10256
10326
|
initTime();
|
@@ -10258,11 +10328,12 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
10258
10328
|
return () => {
|
10259
10329
|
window.removeEventListener('pageshow', initTime);
|
10260
10330
|
};
|
10261
|
-
}, []);
|
10331
|
+
}, [isActive]);
|
10262
10332
|
const priceText = getPriceText({
|
10263
10333
|
product,
|
10264
10334
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
10265
|
-
globalConfig
|
10335
|
+
globalConfig,
|
10336
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10266
10337
|
});
|
10267
10338
|
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;
|
10268
10339
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -10423,7 +10494,7 @@ Made in Italy` })));
|
|
10423
10494
|
} })),
|
10424
10495
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
10425
10496
|
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: {
|
10426
|
-
__html:
|
10497
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
10427
10498
|
} }),
|
10428
10499
|
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: {
|
10429
10500
|
__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)
|
@@ -10870,7 +10941,7 @@ var Img$1 = React.memo(Img);
|
|
10870
10941
|
const CommodityList$1 = (_a) => {
|
10871
10942
|
var _b, _c, _d;
|
10872
10943
|
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"]);
|
10873
|
-
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig } = useSxpDataSource();
|
10944
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig, bffFbReport } = useSxpDataSource();
|
10874
10945
|
const { jumpToWeb } = useEventReport();
|
10875
10946
|
const { popup } = useEditor();
|
10876
10947
|
const recData = isPost ? rec : popupDetailData;
|
@@ -10881,7 +10952,8 @@ const CommodityList$1 = (_a) => {
|
|
10881
10952
|
return getPriceText({
|
10882
10953
|
product,
|
10883
10954
|
enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
10884
|
-
globalConfig
|
10955
|
+
globalConfig,
|
10956
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
10885
10957
|
});
|
10886
10958
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
10887
10959
|
const handleClick = lodash.throttle((item, multiCheckIndex) => {
|
@@ -10900,8 +10972,13 @@ const CommodityList$1 = (_a) => {
|
|
10900
10972
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
10901
10973
|
}
|
10902
10974
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10975
|
+
React.useEffect(() => {
|
10976
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10977
|
+
eventName: 'PageView'
|
10978
|
+
});
|
10979
|
+
}, []);
|
10903
10980
|
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) => {
|
10904
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10981
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10905
10982
|
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({
|
10906
10983
|
display: 'flex'
|
10907
10984
|
}), onClick: () => handleClick(item, index) }),
|
@@ -10928,10 +11005,10 @@ const CommodityList$1 = (_a) => {
|
|
10928
11005
|
}) },
|
10929
11006
|
React.createElement("div", null,
|
10930
11007
|
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: {
|
10931
|
-
__html:
|
11008
|
+
__html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
|
10932
11009
|
} })),
|
10933
11010
|
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
10934
|
-
__html: setFontForText((
|
11011
|
+
__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)
|
10935
11012
|
} })))))));
|
10936
11013
|
})));
|
10937
11014
|
};
|
@@ -11079,7 +11156,7 @@ const Iframe = createMaterial(IframeComponent, {
|
|
11079
11156
|
* @Author: binruan@chatlabs.com
|
11080
11157
|
* @Date: 2024-03-26 16:50:25
|
11081
11158
|
* @LastEditors: binruan@chatlabs.com
|
11082
|
-
* @LastEditTime: 2024-
|
11159
|
+
* @LastEditTime: 2024-10-24 19:04:37
|
11083
11160
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
|
11084
11161
|
*
|
11085
11162
|
*/
|
@@ -11125,6 +11202,12 @@ var settingRender$4 = [
|
|
11125
11202
|
label: '背景色',
|
11126
11203
|
name: ['style', 'backgroundColor']
|
11127
11204
|
},
|
11205
|
+
{
|
11206
|
+
type: 'Number',
|
11207
|
+
label: '背景色毛玻璃',
|
11208
|
+
name: ['style', 'backdropFilter'],
|
11209
|
+
addonAfter: 'px'
|
11210
|
+
},
|
11128
11211
|
{
|
11129
11212
|
label: '内边距',
|
11130
11213
|
type: 'Number',
|
@@ -13908,7 +13991,8 @@ const WaterfallFlowItem$1 = (props) => {
|
|
13908
13991
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
13909
13992
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
13910
13993
|
globalConfig,
|
13911
|
-
isHiddenDef: true
|
13994
|
+
isHiddenDef: true,
|
13995
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
13912
13996
|
});
|
13913
13997
|
React.useEffect(() => {
|
13914
13998
|
if (imgDom.current === null || src === '') {
|
@@ -13950,7 +14034,7 @@ const WaterfallFlowItem$1 = (props) => {
|
|
13950
14034
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
13951
14035
|
} }),
|
13952
14036
|
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
|
13953
|
-
__html:
|
14037
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
13954
14038
|
} }))));
|
13955
14039
|
};
|
13956
14040
|
function WaterfallList$1(_a) {
|
@@ -14225,7 +14309,8 @@ const WaterfallFlowItem = (props) => {
|
|
14225
14309
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
14226
14310
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
14227
14311
|
globalConfig,
|
14228
|
-
isHiddenDef: true
|
14312
|
+
isHiddenDef: true,
|
14313
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
14229
14314
|
});
|
14230
14315
|
// useEffect(() => {
|
14231
14316
|
// if (imgDom.current === null || src === '') {
|
@@ -14312,7 +14397,7 @@ const WaterfallFlowItem = (props) => {
|
|
14312
14397
|
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
14313
14398
|
} }),
|
14314
14399
|
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
|
14315
|
-
__html:
|
14400
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
14316
14401
|
} }))));
|
14317
14402
|
};
|
14318
14403
|
function WaterfallList(_a) {
|
@@ -14417,13 +14502,13 @@ function WaterfallList(_a) {
|
|
14417
14502
|
* @Author: binruan@chatlabs.com
|
14418
14503
|
* @Date: 2024-01-10 10:58:24
|
14419
14504
|
* @LastEditors: binruan@chatlabs.com
|
14420
|
-
* @LastEditTime: 2024-10-
|
14505
|
+
* @LastEditTime: 2024-10-23 16:58:01
|
14421
14506
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
14422
14507
|
*
|
14423
14508
|
*/
|
14424
14509
|
const WaterFall = (props) => {
|
14425
14510
|
var _a;
|
14426
|
-
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
|
14511
|
+
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
|
14427
14512
|
const { backMainFeed } = useEventReport();
|
14428
14513
|
React.useRef(null);
|
14429
14514
|
const modalEleRef = React.useRef(null);
|
@@ -14500,8 +14585,11 @@ const WaterFall = (props) => {
|
|
14500
14585
|
React.useEffect(() => {
|
14501
14586
|
if (openHashtag) {
|
14502
14587
|
setViewTime(new Date());
|
14588
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
14589
|
+
eventName: 'PageView'
|
14590
|
+
});
|
14503
14591
|
}
|
14504
|
-
}, [openHashtag]);
|
14592
|
+
}, [openHashtag, bffFbReport]);
|
14505
14593
|
React.useEffect(() => {
|
14506
14594
|
const initTime = () => {
|
14507
14595
|
setViewTime(new Date());
|
@@ -14687,7 +14775,7 @@ const Consent = createMaterial(ConsentComponent, {
|
|
14687
14775
|
* @Author: binruan@chatlabs.com
|
14688
14776
|
* @Date: 2024-07-02 14:51:32
|
14689
14777
|
* @LastEditors: binruan@chatlabs.com
|
14690
|
-
* @LastEditTime: 2024-
|
14778
|
+
* @LastEditTime: 2024-10-25 10:39:04
|
14691
14779
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\settingRender.tsx
|
14692
14780
|
*
|
14693
14781
|
*/
|
@@ -14733,6 +14821,12 @@ var settingRender$1 = [
|
|
14733
14821
|
label: '背景色',
|
14734
14822
|
name: ['style', 'backgroundColor']
|
14735
14823
|
},
|
14824
|
+
{
|
14825
|
+
type: 'Number',
|
14826
|
+
label: '背景色毛玻璃',
|
14827
|
+
name: ['style', 'backdropFilter'],
|
14828
|
+
addonAfter: 'px'
|
14829
|
+
},
|
14736
14830
|
{
|
14737
14831
|
type: 'TextMargin',
|
14738
14832
|
name: ['style'],
|
@@ -15032,6 +15126,12 @@ var settingRender = [
|
|
15032
15126
|
label: '背景色',
|
15033
15127
|
name: ['style', 'backgroundColor']
|
15034
15128
|
},
|
15129
|
+
{
|
15130
|
+
type: 'Number',
|
15131
|
+
label: '背景色毛玻璃',
|
15132
|
+
name: ['style', 'backdropFilter'],
|
15133
|
+
addonAfter: 'px'
|
15134
|
+
},
|
15035
15135
|
{
|
15036
15136
|
label: '外边距',
|
15037
15137
|
type: 'Number',
|
@@ -15582,6 +15682,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15582
15682
|
const videoId = `pb-cache-video-${index}`;
|
15583
15683
|
const videoEleRef = React.useRef(null);
|
15584
15684
|
const hlsRef = React.useRef(null);
|
15685
|
+
const initTimeRef = React.useRef();
|
15585
15686
|
const blur = React.useMemo(() => {
|
15586
15687
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
15587
15688
|
}, [videoPostConfig]);
|
@@ -15627,8 +15728,8 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15627
15728
|
setWaiting(false);
|
15628
15729
|
setIsLoadFinish(true);
|
15629
15730
|
}, []);
|
15630
|
-
const handleStartPlay = React.useCallback(() => {
|
15631
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
15731
|
+
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
15732
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
15632
15733
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15633
15734
|
return;
|
15634
15735
|
setIsPauseVideo(false);
|
@@ -15638,24 +15739,27 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15638
15739
|
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);
|
15639
15740
|
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);
|
15640
15741
|
const playType = isFirstPlay ? '0' : '1';
|
15742
|
+
const contentSize = yield getResFileSizeFromSrc((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url);
|
15641
15743
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15642
15744
|
eventInfo: {
|
15643
15745
|
eventSubject: 'playVideo',
|
15644
15746
|
eventDescription: 'User played the video',
|
15645
|
-
contentId: (
|
15646
|
-
contentName: (
|
15747
|
+
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 : '',
|
15748
|
+
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 : '',
|
15647
15749
|
playType,
|
15648
15750
|
startTime: videoCurrentTime,
|
15649
15751
|
videoDuration,
|
15650
|
-
contentTags: JSON.stringify((
|
15752
|
+
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 : []),
|
15651
15753
|
position: index + '',
|
15652
15754
|
contentFormat: 'video',
|
15653
|
-
traceInfo: (
|
15755
|
+
traceInfo: (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo,
|
15756
|
+
contentSize,
|
15757
|
+
loadTime: (new Date() - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
|
15654
15758
|
}
|
15655
15759
|
});
|
15656
15760
|
setIsFirstPlay(false);
|
15657
15761
|
}
|
15658
|
-
}, [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15762
|
+
}), [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15659
15763
|
const handLoadeddata = React.useCallback(() => {
|
15660
15764
|
var _a;
|
15661
15765
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
@@ -15759,6 +15863,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15759
15863
|
videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
|
15760
15864
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
15761
15865
|
return;
|
15866
|
+
initTimeRef.current = new Date();
|
15762
15867
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
15763
15868
|
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
15764
15869
|
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
@@ -15802,17 +15907,18 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15802
15907
|
};
|
15803
15908
|
}, [isActive]);
|
15804
15909
|
React.useEffect(() => {
|
15805
|
-
var _a, _b;
|
15910
|
+
var _a, _b, _c, _d;
|
15806
15911
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
15807
15912
|
return;
|
15808
15913
|
if (isActive) {
|
15809
15914
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15810
|
-
eventName: 'ViewContent'
|
15915
|
+
eventName: 'ViewContent',
|
15916
|
+
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
|
15811
15917
|
});
|
15812
|
-
(
|
15918
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
15813
15919
|
}
|
15814
15920
|
else {
|
15815
|
-
(
|
15921
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
15816
15922
|
}
|
15817
15923
|
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
15818
15924
|
/*
|
@@ -15834,9 +15940,11 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15834
15940
|
if (!isActive)
|
15835
15941
|
return;
|
15836
15942
|
const onShow = () => {
|
15943
|
+
var _a, _b;
|
15837
15944
|
handleClickVideo('start')();
|
15838
15945
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
15839
|
-
eventName: 'ViewContent'
|
15946
|
+
eventName: 'ViewContent',
|
15947
|
+
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
|
15840
15948
|
});
|
15841
15949
|
};
|
15842
15950
|
const onHide = handleClickVideo('pause');
|
@@ -16008,19 +16116,14 @@ const Picture = (props) => {
|
|
16008
16116
|
}, onLoad: onShowFirstImage }))));
|
16009
16117
|
};
|
16010
16118
|
|
16011
|
-
/*
|
16012
|
-
* @Author: lewinlu@chatlabs.com
|
16013
|
-
* @Date: 2024-01-03 14:39:09
|
16014
|
-
* @LastEditors: binruan@chatlabs.com
|
16015
|
-
* @LastEditTime: 2024-10-10 17:53:30
|
16016
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
16017
|
-
*/
|
16018
16119
|
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16019
16120
|
var _a, _b;
|
16020
16121
|
const ref = React.useRef();
|
16021
16122
|
const { isActive } = useSwiperSlide();
|
16022
16123
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
16023
16124
|
const [isLoad, setIsLoad] = React.useState(false);
|
16125
|
+
const [imgInfo, setImgInfo] = React.useState();
|
16126
|
+
const initTime = new Date();
|
16024
16127
|
React.useEffect(() => {
|
16025
16128
|
if (isLoad && isActive) {
|
16026
16129
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
|
@@ -16028,21 +16131,36 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
|
|
16028
16131
|
onReportViewImageEnd(rec);
|
16029
16132
|
}
|
16030
16133
|
else {
|
16031
|
-
onViewImageStartEvent(index);
|
16134
|
+
onViewImageStartEvent(index, imgInfo);
|
16032
16135
|
}
|
16033
16136
|
}
|
16034
16137
|
else {
|
16035
16138
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
|
16036
16139
|
}
|
16037
|
-
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
16038
|
-
const showFirstImageFn = React.useCallback(() => {
|
16140
|
+
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
16141
|
+
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
16039
16142
|
if (!isLoad) {
|
16143
|
+
const contentSize = yield getResFileSizeFromSrc(e.src);
|
16144
|
+
setImgInfo({
|
16145
|
+
contentSize,
|
16146
|
+
loadTime: (new Date() - initTime).toFixed(2) + ''
|
16147
|
+
});
|
16040
16148
|
setIsLoad(true);
|
16041
16149
|
}
|
16042
|
-
}, [isLoad]);
|
16150
|
+
}), [isLoad]);
|
16043
16151
|
// if (!isActive) {
|
16044
16152
|
// return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
|
16045
16153
|
// }
|
16154
|
+
React.useEffect(() => {
|
16155
|
+
const onShow = () => onViewImageStartEvent(index, imgInfo);
|
16156
|
+
const onHide = () => onReportViewImageEnd(rec);
|
16157
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16158
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16159
|
+
return () => {
|
16160
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
16161
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16162
|
+
};
|
16163
|
+
}, [imgInfo]);
|
16046
16164
|
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
16047
16165
|
clickable: true,
|
16048
16166
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -16181,7 +16299,7 @@ function withBindDataSource(Component) {
|
|
16181
16299
|
* @Author: binruan@chatlabs.com
|
16182
16300
|
* @Date: 2023-12-26 16:11:34
|
16183
16301
|
* @LastEditors: binruan@chatlabs.com
|
16184
|
-
* @LastEditTime: 2024-10-
|
16302
|
+
* @LastEditTime: 2024-10-25 10:36:59
|
16185
16303
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
16186
16304
|
*
|
16187
16305
|
*/
|
@@ -16230,7 +16348,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
|
|
16230
16348
|
const Component = withBindDataSource(t);
|
16231
16349
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
16232
16350
|
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';
|
16233
|
-
|
16351
|
+
let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
|
16352
|
+
if (style.hasOwnProperty('backdropFilter')) {
|
16353
|
+
let sbf = style['backdropFilter'];
|
16354
|
+
style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
16355
|
+
}
|
16356
|
+
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 })));
|
16234
16357
|
}
|
16235
16358
|
else {
|
16236
16359
|
return null;
|
@@ -16323,7 +16446,7 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
16323
16446
|
* @Author: binruan@chatlabs.com
|
16324
16447
|
* @Date: 2024-01-15 19:03:09
|
16325
16448
|
* @LastEditors: binruan@chatlabs.com
|
16326
|
-
* @LastEditTime: 2024-10-
|
16449
|
+
* @LastEditTime: 2024-10-25 15:41:58
|
16327
16450
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16328
16451
|
*
|
16329
16452
|
*/
|
@@ -16353,9 +16476,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16353
16476
|
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
16354
16477
|
const now = new Date();
|
16355
16478
|
viewTime.current = now;
|
16356
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16357
|
-
eventName: 'PageView'
|
16358
|
-
});
|
16359
16479
|
}
|
16360
16480
|
}, [data === null || data === void 0 ? void 0 : data.length]);
|
16361
16481
|
const handleH5EnterLink = React.useCallback(() => {
|
@@ -16364,11 +16484,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16364
16484
|
if (data.length > 0) {
|
16365
16485
|
const now = new Date();
|
16366
16486
|
viewTime.current = now;
|
16367
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16368
|
-
eventName: 'PageView'
|
16369
|
-
});
|
16370
16487
|
}
|
16371
|
-
}, [data.length,
|
16488
|
+
}, [data.length, h5EnterLink]);
|
16372
16489
|
React.useEffect(() => {
|
16373
16490
|
var _a;
|
16374
16491
|
if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
|
@@ -16399,7 +16516,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16399
16516
|
// 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
|
16400
16517
|
if (repCond) {
|
16401
16518
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
16402
|
-
handleReportViewImageEnd(item);
|
16519
|
+
// handleReportViewImageEnd(item);
|
16403
16520
|
handleReportProductView(item);
|
16404
16521
|
}
|
16405
16522
|
let fromKName = '';
|
@@ -16444,7 +16561,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16444
16561
|
// 页面可见时触发,注意页面初始化时不会触发
|
16445
16562
|
handleH5EnterLink();
|
16446
16563
|
if (repCond) {
|
16447
|
-
handleViewImageStartEvent(activeIndex);
|
16564
|
+
// handleViewImageStartEvent(activeIndex);
|
16448
16565
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
16449
16566
|
backMainFeed('external', selectTag);
|
16450
16567
|
}
|
@@ -16537,7 +16654,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16537
16654
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
16538
16655
|
const Component = withBindDataSource(t);
|
16539
16656
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
16540
|
-
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 })));
|
16657
|
+
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 })));
|
16541
16658
|
});
|
16542
16659
|
}
|
16543
16660
|
return null;
|
@@ -16693,7 +16810,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16693
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 : '',
|
16694
16811
|
requestId: null,
|
16695
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 : '',
|
16696
|
-
contentFormat
|
16813
|
+
contentFormat,
|
16814
|
+
position: ((_k = swiper.previousIndex) !== null && _k !== void 0 ? _k : 0) + ''
|
16697
16815
|
}
|
16698
16816
|
});
|
16699
16817
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16705,11 +16823,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16705
16823
|
eventInfo: {
|
16706
16824
|
eventSubject: 'scrollUp',
|
16707
16825
|
eventDescription: 'User scroll up',
|
16708
|
-
contentId: (
|
16709
|
-
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 : '',
|
16710
16828
|
requestId: null,
|
16711
|
-
traceInfo: (
|
16712
|
-
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) + ''
|
16713
16832
|
}
|
16714
16833
|
});
|
16715
16834
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16717,12 +16836,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16717
16836
|
}
|
16718
16837
|
// 商品浏览事件
|
16719
16838
|
handleReportProductView(item);
|
16720
|
-
const curItem = data[swiper.activeIndex];
|
16721
|
-
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)) {
|
16722
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16723
|
-
eventName: 'ProductView'
|
16724
|
-
});
|
16725
|
-
}
|
16726
16839
|
viewTime.current = new Date();
|
16727
16840
|
};
|
16728
16841
|
const handleReportProductView = (item) => {
|
@@ -16740,8 +16853,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16740
16853
|
viewTime.current = new Date();
|
16741
16854
|
}
|
16742
16855
|
}, [openHashtag, data, activeIndex]);
|
16743
|
-
const handleViewImageStartEvent = (activeIndex) => {
|
16744
|
-
var _a, _b, _c, _d, _e, _f;
|
16856
|
+
const handleViewImageStartEvent = (activeIndex, imgInfo) => {
|
16857
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16745
16858
|
const item = data[activeIndex];
|
16746
16859
|
// 如果是图片集则上报事件
|
16747
16860
|
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)) {
|
@@ -16757,11 +16870,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16757
16870
|
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
16758
16871
|
position: activeIndex + '',
|
16759
16872
|
contentFormat: 'image',
|
16760
|
-
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
|
16761
16876
|
}
|
16762
16877
|
});
|
16763
16878
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16764
|
-
eventName: 'ViewContent'
|
16879
|
+
eventName: 'ViewContent',
|
16880
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
16881
|
+
});
|
16882
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16883
|
+
eventName: 'PageView',
|
16884
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
16765
16885
|
});
|
16766
16886
|
}
|
16767
16887
|
};
|
@@ -17235,7 +17355,7 @@ var index$1 = React.memo(DiyPortalPreview);
|
|
17235
17355
|
* @Author: binruan@chatlabs.com
|
17236
17356
|
* @Date: 2023-10-31 10:56:01
|
17237
17357
|
* @LastEditors: binruan@chatlabs.com
|
17238
|
-
* @LastEditTime: 2024-
|
17358
|
+
* @LastEditTime: 2024-10-23 15:07:29
|
17239
17359
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
17240
17360
|
*
|
17241
17361
|
*/
|