pb-sxp-ui 1.0.88 → 1.0.90

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.
Files changed (43) hide show
  1. package/dist/index.cjs +151 -211
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +151 -211
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +4 -3
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +4 -3
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +154 -214
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +4 -3
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/FormatImage.js +2 -7
  14. package/es/core/components/SxpPageRender/VideoWidget/index.js +39 -31
  15. package/es/core/components/SxpPageRender/index.js +20 -35
  16. package/es/materials/sxp/popup/AppointForm/index.js +1 -3
  17. package/es/materials/sxp/template/Appoint/index.js +7 -6
  18. package/es/materials/sxp/template/Commodity/index.js +7 -14
  19. package/es/materials/sxp/template/CommodityDiro/index.js +7 -14
  20. package/es/materials/sxp/template/CommodityDiroNew/index.js +7 -14
  21. package/es/materials/sxp/template/Link/index.js +5 -5
  22. package/es/materials/sxp/template/MultiCommodity/index.js +3 -6
  23. package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
  24. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
  25. package/es/materials/sxp/template/components/EventProvider.js +1 -13
  26. package/es/materials/sxp/template/components/Img.d.ts +5 -3
  27. package/es/materials/sxp/template/components/Img.js +4 -3
  28. package/lib/core/components/SxpPageRender/FormatImage.js +2 -7
  29. package/lib/core/components/SxpPageRender/VideoWidget/index.js +39 -31
  30. package/lib/core/components/SxpPageRender/index.js +20 -35
  31. package/lib/materials/sxp/popup/AppointForm/index.js +1 -3
  32. package/lib/materials/sxp/template/Appoint/index.js +7 -6
  33. package/lib/materials/sxp/template/Commodity/index.js +7 -14
  34. package/lib/materials/sxp/template/CommodityDiro/index.js +7 -14
  35. package/lib/materials/sxp/template/CommodityDiroNew/index.js +7 -14
  36. package/lib/materials/sxp/template/Link/index.js +5 -5
  37. package/lib/materials/sxp/template/MultiCommodity/index.js +3 -6
  38. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
  39. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
  40. package/lib/materials/sxp/template/components/EventProvider.js +0 -12
  41. package/lib/materials/sxp/template/components/Img.d.ts +5 -3
  42. package/lib/materials/sxp/template/components/Img.js +4 -3
  43. package/package.json +2 -4
@@ -1,11 +1,13 @@
1
1
  import React, { CSSProperties } from 'react';
2
- import { ProductInfoType, RecItemType } from '../../../../core/components/SxpPageRender/typing';
2
+ import { ProductInfoType, RecItemType, VideoInfoType } from '../../../../core/components/SxpPageRender/typing';
3
3
  export interface IImgProps {
4
- src: string;
4
+ src?: string;
5
5
  rec?: RecItemType;
6
- item?: ProductInfoType;
6
+ item?: ProductInfoType | VideoInfoType | null;
7
7
  index?: number;
8
8
  style?: CSSProperties;
9
+ translateY?: number;
10
+ imgStyle?: CSSProperties;
9
11
  }
10
12
  declare const _default: React.NamedExoticComponent<IImgProps>;
11
13
  export default _default;
@@ -3,7 +3,7 @@ import React, { memo, useEffect, useRef } from 'react';
3
3
  import useOnScreen from '../../../../core/hooks/useOnScreen';
4
4
  import { useSxpDataSource } from '../../../../core/hooks';
5
5
  import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
6
- const Img = ({ src, rec, item, index, style }) => {
6
+ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
7
7
  const ref = useRef(null);
8
8
  const isOnScreen = useOnScreen(ref);
9
9
  const { ctaEvent } = useSxpDataSource();
@@ -15,7 +15,8 @@ const Img = ({ src, rec, item, index, style }) => {
15
15
  }, rec, item, index);
16
16
  }
17
17
  }, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
18
- return (React.createElement("div", { ref: ref, hidden: !src, className: css({ width: '100%', height: '100%' }) },
19
- React.createElement(FormatImage, { className: css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }, style)), src: src })));
18
+ return (React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
19
+ React.createElement("div", { ref: ref, hidden: !src, className: css({ width: '100%', height: '100%' }) },
20
+ React.createElement(FormatImage, { className: css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? -translateY + 50 : 50}%` }, style)), src: `${src}?imrquality/rquality/40` }))));
20
21
  };
21
22
  export default memo(Img);
@@ -2,22 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
- const hooks_1 = require("../../../core/hooks");
6
5
  const FormatImage = (0, react_1.forwardRef)((props, ref) => {
7
6
  const { src, onLoad, style, className, loading } = props;
8
7
  const [imgSrc, setImgSrc] = (0, react_1.useState)();
9
- const { swiperRef } = (0, hooks_1.useSxpDataSource)();
10
8
  (0, react_1.useImperativeHandle)(ref, () => ({
11
9
  setSrc: (v) => {
12
10
  setImgSrc(v);
13
11
  }
14
12
  }));
15
13
  (0, react_1.useEffect)(() => {
16
- var _a, _b;
17
- const index = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
18
- if (index === 0 || index > 0)
19
- setImgSrc(src);
20
- }, [src, swiperRef]);
14
+ setImgSrc(src);
15
+ }, [src]);
21
16
  const imgRef = (0, react_1.useRef)(null);
22
17
  return (react_1.default.createElement(react_1.default.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (react_1.default.createElement("picture", null,
23
18
  react_1.default.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
@@ -7,6 +7,7 @@ const useIconLink_1 = require("../useIconLink");
7
7
  const FormatImage_1 = tslib_1.__importDefault(require("../FormatImage"));
8
8
  const hooks_1 = require("../../../../core/hooks");
9
9
  const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
10
+ const hls_js_1 = tslib_1.__importDefault(require("hls.js"));
10
11
  const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
11
12
  const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
12
13
  const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = (0, hooks_1.useSxpDataSource)();
@@ -48,7 +49,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
48
49
  (0, react_1.useEffect)(() => {
49
50
  if (!videoRef)
50
51
  return;
51
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.muted(muted);
52
+ videoRef.muted = muted;
52
53
  }, [muted, videoRef]);
53
54
  const handleEnded = (0, react_1.useCallback)(() => {
54
55
  if (!videoRef)
@@ -63,10 +64,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
63
64
  setIsLoadFinish(true);
64
65
  setIsPauseVideo(false);
65
66
  const item = data[index];
66
- if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration())) {
67
- videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) || 0;
68
- const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) !== null && _a !== void 0 ? _a : 0).toFixed(2);
69
- const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
67
+ if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
68
+ videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) || 0;
69
+ const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
70
+ const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
70
71
  const playType = isFirstPlay ? '0' : '1';
71
72
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
72
73
  eventInfo: {
@@ -90,21 +91,17 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
90
91
  var _a;
91
92
  if (!videoRef || firstFrameSrc || !blur)
92
93
  return;
93
- const videoDomRef = document.getElementById('player-container-id_html5_api');
94
- if (!videoDomRef)
95
- return;
96
- videoDomRef.style.objectFit = 'contain';
94
+ videoRef.style.objectFit = 'contain';
97
95
  if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
98
96
  return;
99
97
  const setFrameImg = () => {
100
- const video = videoDomRef;
101
98
  const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
102
99
  const ctx = canvas.getContext('2d');
103
100
  const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
104
101
  const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
105
102
  canvas.height = targetHeight;
106
103
  canvas.width = targetWidth;
107
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
104
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(videoRef, 0, 0, canvas.width, canvas.height);
108
105
  setFirstFrameSrc(canvas.toDataURL());
109
106
  };
110
107
  setFrameImg();
@@ -117,15 +114,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
117
114
  return;
118
115
  handLoadeddata();
119
116
  }, [videoRef, handLoadeddata]);
120
- const handleCanplay = (0, react_1.useCallback)(() => {
121
- setIsLoadFinish(true);
122
- }, []);
123
117
  const handleClickVideo = (0, react_1.useCallback)((type) => () => {
124
118
  if (!videoRef)
125
119
  return;
126
120
  if (!isLoadFinish)
127
121
  return;
128
- const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused();
122
+ const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
129
123
  switch (type) {
130
124
  case 'start':
131
125
  if (!isPause)
@@ -157,10 +151,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
157
151
  if (activeIndex !== index)
158
152
  return;
159
153
  const item = data[index];
160
- const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) !== null && _a !== void 0 ? _a : 0).toFixed(2);
161
- const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
162
- if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) {
163
- const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) - videoStartTime.current).toFixed(2);
154
+ const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
155
+ const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
156
+ if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) {
157
+ const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) - videoStartTime.current).toFixed(2);
164
158
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
165
159
  eventInfo: {
166
160
  eventSubject: 'playOverVideo',
@@ -184,7 +178,19 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
184
178
  const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
185
179
  if (!videoSrc)
186
180
  return;
187
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
181
+ if (videoSrc.includes('.m3u8')) {
182
+ if (hls_js_1.default.isSupported()) {
183
+ const hls = new hls_js_1.default();
184
+ hls.loadSource(videoSrc);
185
+ hls.attachMedia(videoRef);
186
+ }
187
+ else {
188
+ videoRef.src = videoSrc;
189
+ }
190
+ }
191
+ else {
192
+ videoRef.src = videoSrc;
193
+ }
188
194
  setIsPauseVideo(false);
189
195
  const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
190
196
  const dom = document.querySelector('#player-container-id');
@@ -192,18 +198,20 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
192
198
  if (!dom && !dom2)
193
199
  return;
194
200
  videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
195
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
196
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
197
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('playing', handlePlaying);
198
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('pause', handlePause);
199
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('ended', handleEnded);
201
+ videoRef.setAttribute('x5-playsinline', 'true');
202
+ videoRef.setAttribute('webkit-playsinline', 'true');
203
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadedmetadata', handleLoadedmetadata);
204
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
205
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
206
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
207
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handleEnded);
200
208
  return () => {
201
209
  dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
202
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadedmetadata', handleLoadedmetadata);
203
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadeddata', handLoadeddata);
204
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('playing', handlePlaying);
205
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('pause', handlePause);
206
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('ended', handleEnded);
210
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
211
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
212
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
213
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
214
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handleEnded);
207
215
  };
208
216
  }, [isActive, videoId, rec, videoRef]);
209
217
  (0, react_1.useEffect)(() => {
@@ -222,7 +230,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
222
230
  (0, react_1.useEffect)(() => {
223
231
  if (!isActive || !videoRef)
224
232
  return;
225
- const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused();
233
+ const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
226
234
  if (!isPause && openHashtag) {
227
235
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
228
236
  }
@@ -36,8 +36,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
36
36
  const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
37
37
  const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = (0, hooks_1.useSxpDataSource)();
38
38
  const { backMainFeed } = (0, useEventReport_1.useEventReport)();
39
- const [videoRef, setVideoRef] = (0, react_1.useState)(null);
40
- const playerRef = (0, react_1.useRef)();
39
+ const videoRef = (0, react_1.useRef)();
41
40
  const { productView } = (0, useEventReport_1.useEventReport)();
42
41
  const isShowFingerTip = (0, react_1.useMemo)(() => {
43
42
  return data.length > 0 && !loading && (0, localStore_1.getFeUserId)();
@@ -68,30 +67,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
68
67
  const firstRef = (0, react_1.useRef)();
69
68
  (0, react_1.useEffect)(() => {
70
69
  var _a, _b, _c, _d;
71
- if (!firstRef.current && !videoRef && (playerRef === null || playerRef === void 0 ? void 0 : playerRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
70
+ if (!firstRef.current && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
72
71
  firstRef.current = true;
73
- const player = TCPlayer('player-container-id', {
74
- licenseUrl,
75
- controls: false,
76
- loop: false,
77
- autoplay: true,
78
- muted: true,
79
- preload: 'auto',
80
- posterImage: false,
81
- bigPlayButton: true,
82
- sources: ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url)
83
- ? [
84
- {
85
- src: (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url
86
- }
87
- ]
88
- : []
89
- });
90
- player === null || player === void 0 ? void 0 : player.ready(() => {
91
- setVideoRef(player);
92
- });
72
+ if ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) {
73
+ videoRef.current.src = (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url;
74
+ }
93
75
  }
94
- }, [videoRef, licenseUrl, data]);
76
+ }, [videoRef, data]);
95
77
  (0, react_1.useEffect)(() => {
96
78
  var _a;
97
79
  const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
@@ -206,7 +188,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
206
188
  const renderContent = (0, react_1.useCallback)((rec, index) => {
207
189
  var _a, _b, _c, _d;
208
190
  if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
209
- return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef }));
191
+ return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef.current }));
210
192
  }
211
193
  if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
212
194
  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, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
@@ -232,7 +214,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
232
214
  tipText,
233
215
  resolver,
234
216
  schema,
235
- videoRef
217
+ videoRef.current
236
218
  ]);
237
219
  const onExpandableChange = (0, react_1.useCallback)((v) => {
238
220
  setIsShowMore(v);
@@ -386,14 +368,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
386
368
  }
387
369
  };
388
370
  const visList = (0, react_1.useMemo)(() => {
389
- const list = data === null || data === void 0 ? void 0 : data.map((item, index) => {
390
- if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
391
- return item;
392
- }
393
- else {
394
- return null;
395
- }
396
- });
371
+ var _a;
372
+ const list = activeIndex === 0
373
+ ? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
374
+ : data === null || data === void 0 ? void 0 : data.map((item, index) => {
375
+ if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
376
+ return item;
377
+ }
378
+ else {
379
+ return null;
380
+ }
381
+ });
397
382
  return !waterFallData ? list.concat([{ loading: true }]) : list;
398
383
  }, [data, activeIndex, waterFallData]);
399
384
  const renderView = (0, react_1.useMemo)(() => {
@@ -457,7 +442,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
457
442
  renderView),
458
443
  react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props)),
459
444
  react_1.default.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
460
- react_1.default.createElement("video", { ref: playerRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', style: {
445
+ react_1.default.createElement("video", { ref: videoRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
461
446
  backgroundColor: 'transparent',
462
447
  width: '100%',
463
448
  height: '100%',
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const css_1 = require("@emotion/css");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
- const pro_components_1 = require("@ant-design/pro-components");
7
6
  const lodash_1 = require("lodash");
8
7
  const hooks_1 = require("../../../../core/hooks");
9
8
  require("./index.less");
@@ -83,8 +82,7 @@ const AppointForm = (_a) => {
83
82
  return (react_1.default.createElement("div", { className: 'pb-appoint-form' },
84
83
  react_1.default.createElement("div", { className: `pb-appoint-form-title ${(0, css_1.css)(Object.assign({}, textStyle))}` }, title),
85
84
  react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign({}, style)) }, props),
86
- react_1.default.createElement("div", { className: 'pb-appoint-form-container' },
87
- react_1.default.createElement(pro_components_1.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
85
+ react_1.default.createElement("div", { className: 'pb-appoint-form-container' })),
88
86
  react_1.default.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
89
87
  react_1.default.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? react_1.default.createElement(react_1.default.Fragment, null, "loading...") : submitText))));
90
88
  };
@@ -5,14 +5,15 @@ const css_1 = require("@emotion/css");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
7
7
  const hooks_1 = require("../../../../core/hooks");
8
+ const Img_1 = tslib_1.__importDefault(require("../components/Img"));
8
9
  const Appoint = (_a) => {
9
- var _b, _c, _d, _e;
10
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
10
+ var _b, _c, _d, _e, _f, _g;
11
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
11
12
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
12
13
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
13
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
14
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
15
- react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: 'cta image' })),
16
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
14
+ const src = (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image;
15
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' }, index: index }, props),
16
+ react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) !== null && _f !== void 0 ? _f : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
17
+ react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _g !== void 0 ? _g : 'Product Name')));
17
18
  };
18
19
  exports.default = (0, react_1.memo)(Appoint);
@@ -6,22 +6,15 @@ const react_1 = tslib_1.__importStar(require("react"));
6
6
  const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
7
7
  const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
8
8
  const hooks_1 = require("../../../../core/hooks");
9
- const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
9
+ const Img_1 = tslib_1.__importDefault(require("../components/Img"));
10
10
  const Commodity = (_a) => {
11
- var _b, _c, _d, _e, _f, _g, _h, _j;
12
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
11
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
13
13
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
14
14
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
15
15
  const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
16
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
17
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
18
- react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({
19
- width: '100%',
20
- objectFit: 'cover',
21
- height: '100%',
22
- display: 'block',
23
- objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
24
- }), src: src })),
16
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
17
+ react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
25
18
  react_1.default.createElement("div", { className: (0, css_1.css)({
26
19
  color: '#fff',
27
20
  display: 'flex',
@@ -30,7 +23,7 @@ const Commodity = (_a) => {
30
23
  width: '100%',
31
24
  overflow: 'hidden'
32
25
  }) },
33
- react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_g = product === null || product === void 0 ? void 0 : product.title) !== null && _g !== void 0 ? _g : 'Product Name'),
34
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_j = (_h = product === null || product === void 0 ? void 0 : product.bindCta) === null || _h === void 0 ? void 0 : _h.enTitle) !== null && _j !== void 0 ? _j : 'Shop Now'))));
26
+ react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
27
+ react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now'))));
35
28
  };
36
29
  exports.default = (0, react_1.memo)(Commodity);
@@ -6,22 +6,15 @@ const react_1 = tslib_1.__importStar(require("react"));
6
6
  const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
7
7
  const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
8
8
  const hooks_1 = require("../../../../core/hooks");
9
- const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
9
+ const Img_1 = tslib_1.__importDefault(require("../components/Img"));
10
10
  const CommodityDiro = (_a) => {
11
- var _b, _c, _d, _e, _f, _g, _h, _j;
12
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
11
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
13
13
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
14
14
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
15
15
  const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
16
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
17
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
18
- react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({
19
- width: '100%',
20
- objectFit: 'cover',
21
- height: '100%',
22
- display: 'block',
23
- objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
24
- }), src: src })),
16
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
17
+ react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
25
18
  react_1.default.createElement("div", { className: (0, css_1.css)({
26
19
  color: '#fff',
27
20
  display: 'flex',
@@ -30,7 +23,7 @@ const CommodityDiro = (_a) => {
30
23
  width: '100%',
31
24
  overflow: 'hidden'
32
25
  }) },
33
- react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_g = product === null || product === void 0 ? void 0 : product.title) !== null && _g !== void 0 ? _g : 'Product Name'),
34
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_j = (_h = product === null || product === void 0 ? void 0 : product.bindCta) === null || _h === void 0 ? void 0 : _h.enTitle) !== null && _j !== void 0 ? _j : 'Shop Now'))));
26
+ react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
27
+ react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now'))));
35
28
  };
36
29
  exports.default = (0, react_1.memo)(CommodityDiro);
@@ -6,22 +6,15 @@ const react_1 = tslib_1.__importStar(require("react"));
6
6
  const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
7
7
  const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
8
8
  const hooks_1 = require("../../../../core/hooks");
9
- const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
9
+ const Img_1 = tslib_1.__importDefault(require("../components/Img"));
10
10
  const CommodityDiroNew = (_a) => {
11
- var _b, _c, _d, _e, _f, _g, _h, _j;
12
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
11
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
13
13
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
14
14
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
15
15
  const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
16
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
17
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
18
- react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({
19
- width: '100%',
20
- objectFit: 'cover',
21
- height: '100%',
22
- display: 'block',
23
- objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
24
- }), src: src })),
16
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
17
+ react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
25
18
  react_1.default.createElement("div", { className: (0, css_1.css)({
26
19
  color: '#fff',
27
20
  display: 'flex',
@@ -30,7 +23,7 @@ const CommodityDiroNew = (_a) => {
30
23
  width: '100%',
31
24
  overflow: 'hidden'
32
25
  }) },
33
- react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_g = product === null || product === void 0 ? void 0 : product.title) !== null && _g !== void 0 ? _g : 'Product Name'),
34
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_j = (_h = product === null || product === void 0 ? void 0 : product.bindCta) === null || _h === void 0 ? void 0 : _h.enTitle) !== null && _j !== void 0 ? _j : 'Shop now'))));
26
+ react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
27
+ react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop now'))));
35
28
  };
36
29
  exports.default = (0, react_1.memo)(CommodityDiroNew);
@@ -7,9 +7,9 @@ const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProv
7
7
  const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
8
8
  const hooks_1 = require("../../../../core/hooks");
9
9
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
10
- const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
10
+ const Img_1 = tslib_1.__importDefault(require("../components/Img"));
11
11
  const Link = (_a) => {
12
- var _b, _c, _d, _e, _f;
12
+ var _b, _c, _d, _e, _f, _g, _h;
13
13
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
14
14
  const { sxpParameter, bffEventReport } = (0, hooks_1.useSxpDataSource)();
15
15
  const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
@@ -21,15 +21,15 @@ const Link = (_a) => {
21
21
  window.location.href = window.getJointUtmLink(cta.link);
22
22
  }
23
23
  };
24
+ const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
24
25
  return (react_1.default.createElement(EventProvider_1.default, Object.assign({ index: index, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
25
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
26
- react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image })),
26
+ react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.bindProduct) !== null && _g !== void 0 ? _g : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
27
27
  react_1.default.createElement("div", { className: (0, css_1.css)({
28
28
  display: 'flex',
29
29
  alignItems: 'center',
30
30
  width: '100%',
31
31
  overflow: 'hidden'
32
32
  }) },
33
- react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (_f = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _f !== void 0 ? _f : 'Product Name'))));
33
+ react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (_h = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _h !== void 0 ? _h : 'Product Name'))));
34
34
  };
35
35
  exports.default = (0, react_1.memo)(Link);
@@ -36,11 +36,8 @@ const MultiCommodity = (_a) => {
36
36
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
37
37
  return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
38
38
  var _a, _b, _c, _d, _e, _f, _g;
39
- return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
40
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
41
- react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
42
- objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
43
- } })),
39
+ return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
40
+ react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
44
41
  react_1.default.createElement("div", { className: (0, css_1.css)({
45
42
  color: '#fff',
46
43
  display: 'flex',
@@ -50,7 +47,7 @@ const MultiCommodity = (_a) => {
50
47
  overflow: 'hidden'
51
48
  }) },
52
49
  react_1.default.createElement("div", { className: index_module_less_1.default['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
53
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
50
+ react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))))));
54
51
  })));
55
52
  };
56
53
  exports.default = (0, react_1.memo)(MultiCommodity);
@@ -35,11 +35,8 @@ const MultiCommodityDiro = (_a) => {
35
35
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
36
36
  return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
37
37
  var _a, _b, _c, _d, _e, _f, _g;
38
- return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
39
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
40
- react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
41
- objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
42
- } })),
38
+ return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
39
+ react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
43
40
  react_1.default.createElement("div", { className: (0, css_1.css)({
44
41
  color: '#000',
45
42
  display: 'flex',
@@ -49,7 +46,7 @@ const MultiCommodityDiro = (_a) => {
49
46
  overflow: 'hidden'
50
47
  }) },
51
48
  react_1.default.createElement("div", { className: index_module_less_1.default['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
52
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
49
+ react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))))));
53
50
  })));
54
51
  };
55
52
  exports.default = (0, react_1.memo)(MultiCommodityDiro);