pb-sxp-ui 1.7.2 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +147 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +147 -82
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +147 -82
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -2
- package/es/core/components/SxpPageRender/PictureGroup/index.js +26 -6
- package/es/core/components/SxpPageRender/RenderCard.js +6 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +21 -15
- package/es/core/components/SxpPageRender/WaterFall/List.js +3 -2
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +36 -28
- package/es/core/context/SxpDataSourceProvider.js +9 -6
- package/es/core/utils/materials.d.ts +7 -1
- package/es/core/utils/materials.js +5 -2
- package/es/core/utils/tool.d.ts +2 -1
- package/es/core/utils/tool.js +11 -1
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
- package/es/materials/sxp/cta/AniLink/settingRender.js +6 -0
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +3 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
- package/es/materials/sxp/popup/CommodityList/index.js +5 -4
- package/es/materials/sxp/template/components/settingRender.d.ts +1 -1
- package/es/materials/sxp/template/components/settingRender.js +6 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -2
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +25 -6
- package/lib/core/components/SxpPageRender/RenderCard.js +6 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +20 -15
- package/lib/core/components/SxpPageRender/WaterFall/List.js +3 -2
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +36 -28
- package/lib/core/context/SxpDataSourceProvider.js +9 -6
- package/lib/core/utils/materials.d.ts +7 -1
- package/lib/core/utils/materials.js +5 -2
- package/lib/core/utils/tool.d.ts +2 -1
- package/lib/core/utils/tool.js +12 -1
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.js +6 -0
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +5 -4
- package/lib/materials/sxp/template/components/settingRender.d.ts +1 -1
- package/lib/materials/sxp/template/components/settingRender.js +6 -0
- package/package.json +1 -1
@@ -68,7 +68,8 @@ const CommodityDetail = (_a) => {
|
|
68
68
|
const priceText = getPriceText({
|
69
69
|
product: product,
|
70
70
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
71
|
-
globalConfig
|
71
|
+
globalConfig,
|
72
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
72
73
|
});
|
73
74
|
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;
|
74
75
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -82,7 +83,7 @@ const CommodityDetail = (_a) => {
|
|
82
83
|
__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)
|
83
84
|
} }),
|
84
85
|
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: {
|
85
|
-
__html:
|
86
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
86
87
|
} }),
|
87
88
|
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: {
|
88
89
|
__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)
|
@@ -74,7 +74,8 @@ const CommodityDetailDiroNew = (_a) => {
|
|
74
74
|
const priceText = getPriceText({
|
75
75
|
product,
|
76
76
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
77
|
-
globalConfig
|
77
|
+
globalConfig,
|
78
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
78
79
|
});
|
79
80
|
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;
|
80
81
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
@@ -188,7 +189,7 @@ Made in Italy` })));
|
|
188
189
|
} })),
|
189
190
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
190
191
|
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: {
|
191
|
-
__html:
|
192
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
192
193
|
} }),
|
193
194
|
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: {
|
194
195
|
__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)
|
@@ -22,7 +22,8 @@ const CommodityList = (_a) => {
|
|
22
22
|
return getPriceText({
|
23
23
|
product,
|
24
24
|
enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
25
|
-
globalConfig
|
25
|
+
globalConfig,
|
26
|
+
style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
|
26
27
|
});
|
27
28
|
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
28
29
|
const handleClick = throttle((item, multiCheckIndex) => {
|
@@ -47,7 +48,7 @@ const CommodityList = (_a) => {
|
|
47
48
|
});
|
48
49
|
}, []);
|
49
50
|
return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
50
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
51
52
|
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({
|
52
53
|
display: 'flex'
|
53
54
|
}), onClick: () => handleClick(item, index) }),
|
@@ -74,10 +75,10 @@ const CommodityList = (_a) => {
|
|
74
75
|
}) },
|
75
76
|
React.createElement("div", null,
|
76
77
|
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: {
|
77
|
-
__html:
|
78
|
+
__html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
|
78
79
|
} })),
|
79
80
|
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
80
|
-
__html: setFontForText((
|
81
|
+
__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)
|
81
82
|
} })))))));
|
82
83
|
})));
|
83
84
|
};
|
@@ -4,7 +4,7 @@ interface IPictureProps {
|
|
4
4
|
src: string;
|
5
5
|
height?: number;
|
6
6
|
imgUrlsPostConfig?: postConfigType;
|
7
|
-
onShowFirstImage?: () => void;
|
7
|
+
onShowFirstImage?: (e: any) => void;
|
8
8
|
}
|
9
9
|
declare const Picture: (props: IPictureProps) => React.JSX.Element;
|
10
10
|
export default Picture;
|
@@ -7,8 +7,11 @@ interface IPictureGroupProps {
|
|
7
7
|
height: number;
|
8
8
|
rec: RecItemType;
|
9
9
|
index: number;
|
10
|
-
|
11
|
-
onViewImageStartEvent: (index: number
|
10
|
+
onViewImageEndEvent: (rec: RecItemType) => void;
|
11
|
+
onViewImageStartEvent: (index: number, imgInfo?: {
|
12
|
+
contentSize: string;
|
13
|
+
loadTime: string;
|
14
|
+
}, enableCapi?: boolean) => void;
|
12
15
|
imgUrlsPostConfig?: postConfigType;
|
13
16
|
}
|
14
17
|
declare const _default: React.NamedExoticComponent<IPictureGroupProps>;
|
@@ -7,31 +7,50 @@ const react_2 = require("swiper/react");
|
|
7
7
|
const Picture_1 = tslib_1.__importDefault(require("./Picture"));
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
9
|
const css_1 = require("@emotion/css");
|
10
|
-
const
|
10
|
+
const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
11
|
+
const tool_1 = require("../../../../core/utils/tool");
|
12
|
+
const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
11
13
|
var _a, _b;
|
12
14
|
const ref = (0, react_1.useRef)();
|
13
15
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
14
16
|
const { sxpParameter, openHashtag } = (0, hooks_1.useSxpDataSource)();
|
15
17
|
const [isLoad, setIsLoad] = (0, react_1.useState)(false);
|
18
|
+
const [imgInfo, setImgInfo] = (0, react_1.useState)();
|
19
|
+
const initTime = new Date();
|
16
20
|
(0, react_1.useEffect)(() => {
|
17
21
|
if (isLoad && isActive) {
|
18
22
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
|
19
23
|
if (openHashtag) {
|
20
|
-
|
24
|
+
onViewImageEndEvent(rec);
|
21
25
|
}
|
22
26
|
else {
|
23
|
-
onViewImageStartEvent(index);
|
27
|
+
onViewImageStartEvent(index, imgInfo, true);
|
24
28
|
}
|
25
29
|
}
|
26
30
|
else {
|
27
31
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
|
28
32
|
}
|
29
|
-
}, [rec, isActive,
|
30
|
-
const showFirstImageFn = (0, react_1.useCallback)(() => {
|
33
|
+
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
34
|
+
const showFirstImageFn = (0, react_1.useCallback)((e) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
31
35
|
if (!isLoad) {
|
36
|
+
const contentSize = yield (0, tool_1.getResFileSizeFromSrc)(e.src);
|
37
|
+
setImgInfo({
|
38
|
+
contentSize,
|
39
|
+
loadTime: (new Date() - initTime).toFixed(2) + ''
|
40
|
+
});
|
32
41
|
setIsLoad(true);
|
33
42
|
}
|
34
|
-
}, [isLoad]);
|
43
|
+
}), [isLoad]);
|
44
|
+
(0, react_1.useEffect)(() => {
|
45
|
+
const onShow = () => onViewImageStartEvent(index, imgInfo);
|
46
|
+
const onHide = () => onViewImageEndEvent(rec);
|
47
|
+
event_1.default.on(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
48
|
+
event_1.default.on(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
49
|
+
return () => {
|
50
|
+
event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
51
|
+
event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
52
|
+
};
|
53
|
+
}, [imgInfo]);
|
35
54
|
return (react_1.default.createElement(react_2.Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
36
55
|
clickable: true,
|
37
56
|
bulletActiveClass: 'swipe-item-active-bullet',
|
@@ -52,7 +52,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
|
|
52
52
|
const Component = (0, withBindDataSource_1.default)(t);
|
53
53
|
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
54
54
|
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';
|
55
|
-
|
55
|
+
let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
|
56
|
+
if (style.hasOwnProperty('backdropFilter')) {
|
57
|
+
let sbf = style['backdropFilter'];
|
58
|
+
style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
59
|
+
}
|
60
|
+
return (react_1.default.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 })));
|
56
61
|
}
|
57
62
|
else {
|
58
63
|
return null;
|
@@ -9,6 +9,7 @@ const hooks_1 = require("../../../../core/hooks");
|
|
9
9
|
const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
10
10
|
const loading_gif_1 = tslib_1.__importDefault(require("./loading.gif"));
|
11
11
|
const VideoPlayer_1 = require("./VideoPlayer");
|
12
|
+
const tool_1 = require("../../../../core/utils/tool");
|
12
13
|
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
|
13
14
|
const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
|
14
15
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = (0, hooks_1.useSxpDataSource)();
|
@@ -23,6 +24,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
23
24
|
const videoId = `pb-cache-video-${index}`;
|
24
25
|
const videoEleRef = (0, react_1.useRef)(null);
|
25
26
|
const hlsRef = (0, react_1.useRef)(null);
|
27
|
+
const initTimeRef = (0, react_1.useRef)();
|
26
28
|
const blur = (0, react_1.useMemo)(() => {
|
27
29
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
28
30
|
}, [videoPostConfig]);
|
@@ -68,8 +70,8 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
68
70
|
setWaiting(false);
|
69
71
|
setIsLoadFinish(true);
|
70
72
|
}, []);
|
71
|
-
const handleStartPlay = (0, react_1.useCallback)(() => {
|
72
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
73
|
+
const handleStartPlay = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
74
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
73
75
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
74
76
|
return;
|
75
77
|
setIsPauseVideo(false);
|
@@ -79,24 +81,27 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
79
81
|
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);
|
80
82
|
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);
|
81
83
|
const playType = isFirstPlay ? '0' : '1';
|
84
|
+
const contentSize = yield (0, tool_1.getResFileSizeFromSrc)((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url);
|
82
85
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
83
86
|
eventInfo: {
|
84
87
|
eventSubject: 'playVideo',
|
85
88
|
eventDescription: 'User played the video',
|
86
|
-
contentId: (
|
87
|
-
contentName: (
|
89
|
+
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 : '',
|
90
|
+
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 : '',
|
88
91
|
playType,
|
89
92
|
startTime: videoCurrentTime,
|
90
93
|
videoDuration,
|
91
|
-
contentTags: JSON.stringify((
|
94
|
+
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 : []),
|
92
95
|
position: index + '',
|
93
96
|
contentFormat: 'video',
|
94
|
-
traceInfo: (
|
97
|
+
traceInfo: (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo,
|
98
|
+
contentSize,
|
99
|
+
loadTime: (new Date() - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
|
95
100
|
}
|
96
101
|
});
|
97
102
|
setIsFirstPlay(false);
|
98
103
|
}
|
99
|
-
}, [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
104
|
+
}), [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
100
105
|
const handLoadeddata = (0, react_1.useCallback)(() => {
|
101
106
|
var _a;
|
102
107
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
@@ -200,6 +205,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
200
205
|
videoRef.current = VideoPlayer_1.mountVideoPlayerAtNode === null || VideoPlayer_1.mountVideoPlayerAtNode === void 0 ? void 0 : (0, VideoPlayer_1.mountVideoPlayerAtNode)(videoPlayerWrapperNode);
|
201
206
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
202
207
|
return;
|
208
|
+
initTimeRef.current = new Date();
|
203
209
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
204
210
|
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
205
211
|
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
@@ -243,7 +249,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
243
249
|
};
|
244
250
|
}, [isActive]);
|
245
251
|
(0, react_1.useEffect)(() => {
|
246
|
-
var _a, _b, _c, _d;
|
252
|
+
var _a, _b, _c, _d, _e, _f;
|
247
253
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
248
254
|
return;
|
249
255
|
if (isActive) {
|
@@ -251,10 +257,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
251
257
|
eventName: 'ViewContent',
|
252
258
|
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
|
253
259
|
});
|
254
|
-
|
260
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
261
|
+
eventName: 'PageView',
|
262
|
+
product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProduct
|
263
|
+
});
|
264
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
255
265
|
}
|
256
266
|
else {
|
257
|
-
(
|
267
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
258
268
|
}
|
259
269
|
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
260
270
|
(0, react_1.useEffect)(() => {
|
@@ -273,12 +283,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
273
283
|
if (!isActive)
|
274
284
|
return;
|
275
285
|
const onShow = () => {
|
276
|
-
var _a, _b;
|
277
286
|
handleClickVideo('start')();
|
278
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
279
|
-
eventName: 'ViewContent',
|
280
|
-
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
|
281
|
-
});
|
282
287
|
};
|
283
288
|
const onHide = handleClickVideo('pause');
|
284
289
|
event_1.default.on(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
@@ -43,7 +43,8 @@ const WaterfallFlowItem = (props) => {
|
|
43
43
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
44
44
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
45
45
|
globalConfig,
|
46
|
-
isHiddenDef: true
|
46
|
+
isHiddenDef: true,
|
47
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
47
48
|
});
|
48
49
|
(0, react_1.useEffect)(() => {
|
49
50
|
const observer = new IntersectionObserver((entries) => {
|
@@ -115,7 +116,7 @@ const WaterfallFlowItem = (props) => {
|
|
115
116
|
__html: (0, tool_1.setFontForText)(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
116
117
|
} }),
|
117
118
|
react_1.default.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
|
118
|
-
__html:
|
119
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
119
120
|
} }))));
|
120
121
|
};
|
121
122
|
function WaterfallList(_a) {
|
@@ -66,7 +66,8 @@ const WaterfallFlowItem = (props) => {
|
|
66
66
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
67
67
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
68
68
|
globalConfig,
|
69
|
-
isHiddenDef: true
|
69
|
+
isHiddenDef: true,
|
70
|
+
style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
|
70
71
|
});
|
71
72
|
(0, react_1.useEffect)(() => {
|
72
73
|
if (imgDom.current === null || src === '') {
|
@@ -107,7 +108,7 @@ const WaterfallFlowItem = (props) => {
|
|
107
108
|
__html: (0, tool_1.setFontForText)(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
108
109
|
} }),
|
109
110
|
react_1.default.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
|
110
|
-
__html:
|
111
|
+
__html: priceText !== null && priceText !== void 0 ? priceText : ''
|
111
112
|
} }))));
|
112
113
|
};
|
113
114
|
function WaterfallList(_a) {
|
@@ -89,7 +89,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
89
89
|
if (document.visibilityState === 'hidden') {
|
90
90
|
if (repCond) {
|
91
91
|
event_1.default.emit(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
92
|
-
handleReportViewImageEnd(item);
|
93
92
|
handleReportProductView(item);
|
94
93
|
}
|
95
94
|
let fromKName = '';
|
@@ -133,7 +132,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
133
132
|
}
|
134
133
|
handleH5EnterLink();
|
135
134
|
if (repCond) {
|
136
|
-
handleViewImageStartEvent(activeIndex);
|
137
135
|
event_1.default.emit(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
138
136
|
backMainFeed('external', selectTag);
|
139
137
|
}
|
@@ -218,7 +216,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
218
216
|
return (react_1.default.createElement(VideoWidget_1.default, { key: isReload, rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
|
219
217
|
}
|
220
218
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
221
|
-
return (react_1.default.createElement(PictureGroup_1.default, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index,
|
219
|
+
return (react_1.default.createElement(PictureGroup_1.default, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
222
220
|
}
|
223
221
|
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
224
222
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -292,7 +290,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
292
290
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike) || !visible)
|
293
291
|
return;
|
294
292
|
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
295
|
-
if (waterFallData && top < 40) {
|
293
|
+
if (waterFallData && top < 40 && globalConfig.likeIconYPosit === 'top') {
|
296
294
|
top += 40;
|
297
295
|
}
|
298
296
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
@@ -304,7 +302,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
304
302
|
}
|
305
303
|
return null;
|
306
304
|
}, [globalConfig, waterFallData]);
|
307
|
-
const
|
305
|
+
const handleViewImageStartEnd = (item) => {
|
308
306
|
var _a, _b, _c, _d, _e, _f;
|
309
307
|
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)) {
|
310
308
|
const endTime = Date.now();
|
@@ -362,7 +360,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
362
360
|
}
|
363
361
|
};
|
364
362
|
const handleScrollEvent = (swiper) => {
|
365
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
363
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
366
364
|
const item = data[swiper.previousIndex];
|
367
365
|
if (!item)
|
368
366
|
return;
|
@@ -383,10 +381,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
383
381
|
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 : '',
|
384
382
|
requestId: null,
|
385
383
|
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 : '',
|
386
|
-
contentFormat
|
384
|
+
contentFormat,
|
385
|
+
position: ((_k = swiper.previousIndex) !== null && _k !== void 0 ? _k : 0) + ''
|
387
386
|
}
|
388
387
|
});
|
389
|
-
|
388
|
+
handleViewImageStartEnd(item);
|
390
389
|
handleSlideSkip(item, swiper.previousIndex);
|
391
390
|
}
|
392
391
|
else {
|
@@ -394,14 +393,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
394
393
|
eventInfo: {
|
395
394
|
eventSubject: 'scrollUp',
|
396
395
|
eventDescription: 'User scroll up',
|
397
|
-
contentId: (
|
398
|
-
productId: (
|
396
|
+
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 : '',
|
397
|
+
productId: (_p = (_o = item.product) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
399
398
|
requestId: null,
|
400
|
-
traceInfo: (
|
401
|
-
contentFormat
|
399
|
+
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 : '',
|
400
|
+
contentFormat,
|
401
|
+
position: ((_s = swiper.previousIndex) !== null && _s !== void 0 ? _s : 0) + ''
|
402
402
|
}
|
403
403
|
});
|
404
|
-
|
404
|
+
handleViewImageStartEnd(item);
|
405
405
|
}
|
406
406
|
handleReportProductView(item);
|
407
407
|
viewTime.current = new Date();
|
@@ -421,7 +421,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
421
421
|
viewTime.current = new Date();
|
422
422
|
}
|
423
423
|
}, [openHashtag, data, activeIndex]);
|
424
|
-
const handleViewImageStartEvent = (activeIndex) => {
|
424
|
+
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
425
425
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
426
426
|
const item = data[activeIndex];
|
427
427
|
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)) {
|
@@ -437,32 +437,40 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
437
437
|
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
438
438
|
position: activeIndex + '',
|
439
439
|
contentFormat: 'image',
|
440
|
-
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
440
|
+
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
441
|
+
contentSize: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.contentSize,
|
442
|
+
loadTime: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.loadTime
|
441
443
|
}
|
442
444
|
});
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
445
|
+
if (enableCapi) {
|
446
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
447
|
+
eventName: 'ViewContent',
|
448
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
449
|
+
});
|
450
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
451
|
+
eventName: 'PageView',
|
452
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
453
|
+
});
|
454
|
+
}
|
451
455
|
}
|
452
456
|
};
|
453
457
|
const renderToggleButton = (0, react_1.useCallback)((visible) => {
|
454
458
|
var _a, _b, _c, _d, _e, _f;
|
455
459
|
if (!visible)
|
456
460
|
return;
|
461
|
+
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
|
462
|
+
if (waterFallData && top < 40 && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
|
463
|
+
top += 40;
|
464
|
+
}
|
457
465
|
return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (react_1.default.createElement(ToggleButton_1.default, { style: {
|
458
466
|
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
|
459
|
-
visibility: ((
|
467
|
+
visibility: ((_c = (_b = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
460
468
|
zIndex: 999,
|
461
469
|
transform: 'translate3d(0px,0px,0px)',
|
462
|
-
[(
|
463
|
-
[(
|
470
|
+
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
|
471
|
+
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: top
|
464
472
|
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })));
|
465
|
-
}, [globalConfig, visList, activeIndex, isMuted]);
|
473
|
+
}, [globalConfig, visList, activeIndex, isMuted, waterFallData]);
|
466
474
|
const renderView = (0, react_1.useMemo)(() => {
|
467
475
|
if (loading) {
|
468
476
|
return (react_1.default.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -495,7 +503,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
495
503
|
renderToggleButton
|
496
504
|
]);
|
497
505
|
return (react_1.default.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
|
498
|
-
waterFallData && (react_1.default.createElement(Navbar_1.default, { icon: left_png_1.default, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
506
|
+
waterFallData && (react_1.default.createElement(Navbar_1.default, { icon: left_png_1.default, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
499
507
|
const isEq = (0, lodash_1.isEqual)(rtcList, cacheRtcList);
|
500
508
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
501
509
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|
@@ -193,17 +193,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
193
193
|
});
|
194
194
|
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
195
195
|
const bffFbReport = (0, react_1.useCallback)(({ eventName, product }) => {
|
196
|
-
var _a, _b, _c, _d;
|
197
|
-
if (!enableReportEvent ||
|
196
|
+
var _a, _b, _c, _d, _e;
|
197
|
+
if (!enableReportEvent ||
|
198
|
+
!enabledMetaConversionApi ||
|
199
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
|
200
|
+
!((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
|
198
201
|
return;
|
199
202
|
}
|
200
|
-
let jsonParams = (
|
203
|
+
let jsonParams = JSON.parse(JSON.stringify((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]));
|
201
204
|
const urlParams = new URLSearchParams(window.location.search);
|
202
205
|
const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
|
203
206
|
const fix_par = {
|
204
|
-
event_source_url: (
|
207
|
+
event_source_url: (_c = window === null || window === void 0 ? void 0 : window.location) === null || _c === void 0 ? void 0 : _c.href,
|
205
208
|
external_id: (0, localStore_1.storeAndLoadFeUserId)(),
|
206
|
-
client_user_agent: (
|
209
|
+
client_user_agent: (_e = (_d = window === null || window === void 0 ? void 0 : window.navigator) === null || _d === void 0 ? void 0 : _d.userAgent) !== null && _e !== void 0 ? _e : '',
|
207
210
|
fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
|
208
211
|
fbp: (0, tool_1.getCookie)('_fbp') ? `fb.2.${new Date().getTime()}.${(0, tool_1.getCookie)('_fbp')}` : '',
|
209
212
|
time: new Date().getTime()
|
@@ -228,7 +231,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
228
231
|
matches.forEach((match) => {
|
229
232
|
const prop = match.substring(2, match.length - 2);
|
230
233
|
try {
|
231
|
-
|
234
|
+
let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
|
232
235
|
if (replaceValue) {
|
233
236
|
obj[key] = replaceValue;
|
234
237
|
}
|
@@ -11,9 +11,15 @@ export declare const getBgStyleByImg: (data: any) => "" | {
|
|
11
11
|
backgroundRepeat: string;
|
12
12
|
backgroundSize: string;
|
13
13
|
};
|
14
|
-
|
14
|
+
interface IfontType {
|
15
|
+
'fontFamily-cn': string;
|
16
|
+
'fontFamily-en': string;
|
17
|
+
}
|
18
|
+
export declare const getPriceText: ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }: {
|
15
19
|
product: ProductInfoType | undefined | null;
|
16
20
|
enableFormattedPrice: boolean | undefined;
|
17
21
|
globalConfig: ISxpPageRenderProps['globalConfig'];
|
18
22
|
isHiddenDef?: boolean;
|
23
|
+
style?: IfontType | any;
|
19
24
|
}) => string | null;
|
25
|
+
export {};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getPriceText = exports.getBgStyleByImg = exports.getBgStyle = exports.getMediaValueByMode = void 0;
|
4
|
+
const tool_1 = require("./tool");
|
4
5
|
const getMediaValueByMode = (obj) => {
|
5
6
|
var _a;
|
6
7
|
if (!obj || typeof obj !== 'object') {
|
@@ -35,8 +36,8 @@ const getBgStyleByImg = (data) => {
|
|
35
36
|
return (0, exports.getBgStyle)(imgSrc);
|
36
37
|
};
|
37
38
|
exports.getBgStyleByImg = getBgStyleByImg;
|
38
|
-
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
|
39
|
-
var _a, _b, _c, _d, _e;
|
39
|
+
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
40
41
|
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
41
42
|
return null;
|
42
43
|
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;
|
@@ -83,6 +84,8 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
83
84
|
}
|
84
85
|
});
|
85
86
|
}
|
87
|
+
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>`;
|
88
|
+
text = (0, tool_1.setFontForText)(text, style);
|
86
89
|
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
|
87
90
|
text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
|
88
91
|
}
|