pb-sxp-ui 1.2.4 → 1.2.6
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 +283 -175
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +11 -3
- package/dist/index.js +283 -175
- 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 +283 -175
- 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/LikeButton/index.js +34 -15
- package/es/core/components/SxpPageRender/Popup/index.js +26 -13
- package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/es/core/components/SxpPageRender/RenderCard.js +3 -3
- package/es/core/components/SxpPageRender/index.js +4 -4
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -3
- package/es/core/context/SxpDataSourceProvider.js +7 -3
- package/es/core/hooks/useEventReport.js +4 -4
- package/es/materials/sxp/cta/AniLink/index.js +2 -1
- package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
- package/es/materials/sxp/cta/AniLinkPopup/index.js +11 -20
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +32 -15
- package/es/materials/sxp/popup/CommodityDetail/material.js +6 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +4 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +32 -18
- package/es/materials/sxp/popup/CommodityList/index.js +38 -20
- package/es/materials/sxp/popup/CommodityList/material.js +1 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +5 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +3 -3
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
- package/es/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
- package/es/materials/sxp/template/components/CommodityGroup.js +21 -14
- package/es/materials/sxp/template/components/Img.d.ts +1 -0
- package/es/materials/sxp/template/components/Img.js +3 -3
- package/es/materials/sxp/template/components/Scroll.d.ts +1 -0
- package/es/materials/sxp/template/components/Scroll.js +5 -4
- package/lib/core/components/SxpPageRender/LikeButton/index.js +34 -15
- package/lib/core/components/SxpPageRender/Popup/index.js +25 -12
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +3 -3
- package/lib/core/components/SxpPageRender/index.js +4 -4
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -3
- package/lib/core/context/SxpDataSourceProvider.js +7 -3
- package/lib/core/hooks/useEventReport.js +4 -4
- package/lib/materials/sxp/cta/AniLink/index.js +2 -1
- package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +10 -19
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +32 -15
- package/lib/materials/sxp/popup/CommodityDetail/material.js +6 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +4 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +32 -18
- package/lib/materials/sxp/popup/CommodityList/index.js +37 -19
- package/lib/materials/sxp/popup/CommodityList/material.js +1 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +5 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +3 -3
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
- package/lib/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
- package/lib/materials/sxp/template/components/CommodityGroup.js +20 -13
- package/lib/materials/sxp/template/components/Img.d.ts +1 -0
- package/lib/materials/sxp/template/components/Img.js +3 -3
- package/lib/materials/sxp/template/components/Scroll.d.ts +1 -0
- package/lib/materials/sxp/template/components/Scroll.js +5 -4
- package/package.json +1 -1
@@ -12,21 +12,29 @@ import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
|
12
12
|
import { setFontForText } from '../../../../core/utils/tool';
|
13
13
|
import CommodityGroup from '../../template/components/CommodityGroup';
|
14
14
|
const CommodityDetailDiroNew = (_a) => {
|
15
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
15
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
16
16
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
|
17
17
|
const [spread, setSpread] = useState(true);
|
18
|
-
const { sxpParameter } = useSxpDataSource();
|
19
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
|
18
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
|
20
19
|
const { jumpToWeb, productView } = useEventReport();
|
21
20
|
const [stopSlide, setStopSlide] = useState(false);
|
22
21
|
const [isBottom, setIsBottom] = useState(false);
|
23
22
|
const [isTop, setIsTop] = useState(true);
|
24
23
|
const [showModal, setShowModal] = useState(false);
|
25
24
|
const curTimeRef = useRef(null);
|
25
|
+
const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
26
26
|
const data = isPost ? rec : popupDetailData;
|
27
|
-
|
28
|
-
|
27
|
+
let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
|
28
|
+
let cta = isPost
|
29
|
+
? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
|
30
|
+
: (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta) !== null && _k !== void 0 ? _k : (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta;
|
29
31
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
32
|
+
if (!isPost && (commodityGroup === null || commodityGroup === void 0 ? void 0 : commodityGroup.open) && ((_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) && ((_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length) > 0) {
|
33
|
+
checkCommodityIndexRef.current = checkCommodityIndex;
|
34
|
+
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
35
|
+
product = p;
|
36
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
37
|
+
}
|
30
38
|
const handleLink = () => {
|
31
39
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
32
40
|
jumpToWeb(data, product, cta, position);
|
@@ -64,7 +72,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
64
72
|
return '£102,300.00';
|
65
73
|
}
|
66
74
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
67
|
-
const width = isPreview ? 375 : (
|
75
|
+
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
68
76
|
const handleClickCollapse = () => {
|
69
77
|
setSpread(!spread);
|
70
78
|
};
|
@@ -80,15 +88,20 @@ Made in Italy` })));
|
|
80
88
|
}
|
81
89
|
return style;
|
82
90
|
}, []);
|
91
|
+
const handleClick = useCallback((index) => {
|
92
|
+
popupCurTimeRef.current = new Date();
|
93
|
+
setCheckCommodityIndex(index);
|
94
|
+
checkCommodityIndexRef.current = index;
|
95
|
+
}, []);
|
83
96
|
const renderCommodityGroup = useCallback(() => {
|
84
97
|
var _a, _b, _c;
|
85
98
|
if (isPost)
|
86
99
|
return;
|
87
|
-
return (React.createElement(CommodityGroup, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' } }));
|
88
|
-
}, []);
|
100
|
+
return (React.createElement(CommodityGroup, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
|
101
|
+
}, [checkCommodityIndex]);
|
89
102
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
90
|
-
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
91
|
-
product && ((
|
103
|
+
React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
104
|
+
product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
92
105
|
clickable: true,
|
93
106
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
94
107
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -96,7 +109,8 @@ Made in Italy` })));
|
|
96
109
|
: 'commondityDiroNew-swiper-clickable-center'
|
97
110
|
}, loop: true, autoplay: {
|
98
111
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
99
|
-
} }, (
|
112
|
+
} }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
113
|
+
var _a;
|
100
114
|
return (React.createElement(SwiperSlide, { key: src },
|
101
115
|
React.createElement("div", { style: {
|
102
116
|
overflow: 'hidden',
|
@@ -109,9 +123,9 @@ Made in Italy` })));
|
|
109
123
|
objectFit: 'cover',
|
110
124
|
display: 'block',
|
111
125
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
112
|
-
}, src: src }))));
|
126
|
+
}, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
|
113
127
|
}))),
|
114
|
-
!((
|
128
|
+
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
|
115
129
|
position: 'relative',
|
116
130
|
height: 0,
|
117
131
|
width: '100%',
|
@@ -124,13 +138,13 @@ Made in Italy` })));
|
|
124
138
|
top: 0,
|
125
139
|
objectFit: 'cover',
|
126
140
|
width: '100%'
|
127
|
-
}), src: (
|
141
|
+
}), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
|
128
142
|
renderCommodityGroup(),
|
129
143
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
130
144
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
131
145
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
132
146
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
|
133
|
-
__html: setFontForText((
|
147
|
+
__html: setFontForText((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
134
148
|
} }),
|
135
149
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), dangerouslySetInnerHTML: {
|
136
150
|
__html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -140,11 +154,11 @@ Made in Italy` })));
|
|
140
154
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
141
155
|
} }),
|
142
156
|
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: {
|
143
|
-
__html: setFontForText((
|
157
|
+
__html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _z !== void 0 ? _z : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
144
158
|
} }))),
|
145
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (
|
159
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_0 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _0 !== void 0 ? _0 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
|
146
160
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
147
|
-
__html: setFontForText((
|
161
|
+
__html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
|
148
162
|
} }))),
|
149
163
|
productInfoText({ isPost }))),
|
150
164
|
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
@@ -1,16 +1,18 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
3
|
import React, { memo, useCallback } from 'react';
|
4
|
-
import { useSxpDataSource } from '../../../../core/hooks';
|
4
|
+
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import './index.less';
|
6
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
6
7
|
import { setFontForText } from '../../../../core/utils/tool';
|
7
8
|
import Img from '../../template/components/Img';
|
8
|
-
import
|
9
|
+
import { throttle } from 'lodash';
|
9
10
|
const CommodityList = (_a) => {
|
10
11
|
var _b, _c;
|
11
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink"]);
|
12
|
-
const { sxpParameter } = useSxpDataSource();
|
13
|
-
const {
|
12
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
|
13
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
|
14
|
+
const { jumpToWeb } = useEventReport();
|
15
|
+
const { popup } = useEditor();
|
14
16
|
const recData = isPost ? rec : popupDetailData;
|
15
17
|
const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
|
16
18
|
const priceText = useCallback((product) => {
|
@@ -24,25 +26,40 @@ const CommodityList = (_a) => {
|
|
24
26
|
return '$7,000';
|
25
27
|
}
|
26
28
|
}, []);
|
27
|
-
|
28
|
-
|
29
|
-
|
29
|
+
const handleClick = throttle((item, multiCheckIndex) => {
|
30
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
31
|
+
eventSubject: 'clickCta',
|
32
|
+
eventDescription: 'User clicked the CTA'
|
33
|
+
}, recData, item, index);
|
34
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
|
35
|
+
if (isExternalLink) {
|
36
|
+
if (item === null || item === void 0 ? void 0 : item.link) {
|
37
|
+
jumpToWeb(recData, item, item.bindCta, index);
|
38
|
+
window.location.href = window.getJointUtmLink(item.link);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
else {
|
42
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
43
|
+
}
|
44
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
45
|
+
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) => {
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
47
|
+
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({
|
30
48
|
display: 'flex'
|
31
|
-
}) }),
|
32
|
-
React.createElement(Img, { 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: commodityPicture }),
|
49
|
+
}), onClick: () => handleClick(item, index) }),
|
50
|
+
React.createElement(Img, { 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: commodityPicture, enableEventReport: false }),
|
33
51
|
React.createElement("div", { style: {
|
34
|
-
|
35
|
-
width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px - ${(_g = style === null || style === void 0 ? void 0 : style.padding) !== null && _g !== void 0 ? _g : 0}px)`,
|
52
|
+
width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px)`,
|
36
53
|
display: 'flex',
|
37
54
|
flexDirection: 'column',
|
38
55
|
justifyContent: 'space-between'
|
39
56
|
} },
|
40
57
|
React.createElement("div", null,
|
41
58
|
React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
|
42
|
-
__html: setFontForText((
|
59
|
+
__html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
43
60
|
} }),
|
44
61
|
React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
|
45
|
-
__html: setFontForText((
|
62
|
+
__html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
46
63
|
} })),
|
47
64
|
React.createElement("div", { className: css({
|
48
65
|
display: 'flex',
|
@@ -51,12 +68,13 @@ const CommodityList = (_a) => {
|
|
51
68
|
width: '100%',
|
52
69
|
overflow: 'hidden'
|
53
70
|
}) },
|
54
|
-
React.createElement("div",
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
71
|
+
React.createElement("div", null,
|
72
|
+
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: {
|
73
|
+
__html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
74
|
+
} })),
|
75
|
+
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
76
|
+
__html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', buttonStyle)
|
77
|
+
} })))))));
|
60
78
|
})));
|
61
79
|
};
|
62
80
|
export default memo(CommodityList);
|
@@ -17,12 +17,12 @@ const MultiCommodity = (_a) => {
|
|
17
17
|
const { popup } = useEditor();
|
18
18
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
19
19
|
const { jumpToWeb } = useEventReport();
|
20
|
-
const handleClick = throttle((item) => {
|
20
|
+
const handleClick = throttle((item, multiCheckIndex) => {
|
21
21
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
22
22
|
eventSubject: 'clickCta',
|
23
23
|
eventDescription: 'User clicked the CTA'
|
24
24
|
}, recData, item, index);
|
25
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index }));
|
25
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
|
26
26
|
if (isExternalLink) {
|
27
27
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
28
28
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -35,7 +35,7 @@ const MultiCommodity = (_a) => {
|
|
35
35
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
36
36
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
37
37
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
38
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
38
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
39
39
|
React.createElement(Img, { 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 }),
|
40
40
|
React.createElement("div", { className: css({
|
41
41
|
color: '#fff',
|
@@ -16,12 +16,12 @@ const MultiCommodityDiro = (_a) => {
|
|
16
16
|
const { popup } = useEditor();
|
17
17
|
const { jumpToWeb } = useEventReport();
|
18
18
|
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
19
|
-
const handleClick = throttle((item) => {
|
19
|
+
const handleClick = throttle((item, multiCheckIndex) => {
|
20
20
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
21
21
|
eventSubject: 'clickCta',
|
22
22
|
eventDescription: 'User clicked the CTA'
|
23
23
|
}, recData, item, index);
|
24
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index }));
|
24
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
|
25
25
|
if (isExternalLink) {
|
26
26
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
27
27
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -34,7 +34,7 @@ const MultiCommodityDiro = (_a) => {
|
|
34
34
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
35
35
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
36
36
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
37
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
37
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
38
38
|
React.createElement(Img, { 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 }),
|
39
39
|
React.createElement("div", { className: css({
|
40
40
|
color: '#000',
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { VideoInfoType } from '../../../../core/components/SxpPageRender/typing';
|
2
2
|
import React, { CSSProperties } from 'react';
|
3
|
+
import { ISxpDataSourceContext } from '../../../../core/context/SxpDataSourceProvider';
|
3
4
|
interface ICommodityGroupProps {
|
4
5
|
products?: VideoInfoType['bindProducts'];
|
5
6
|
data?: {
|
@@ -9,6 +10,9 @@ interface ICommodityGroupProps {
|
|
9
10
|
};
|
10
11
|
defImg: string;
|
11
12
|
style?: CSSProperties;
|
13
|
+
onCLick?: (i: number) => void;
|
14
|
+
popupDetailData?: ISxpDataSourceContext['popupDetailData'];
|
15
|
+
check?: number;
|
12
16
|
}
|
13
17
|
declare const _default: React.NamedExoticComponent<ICommodityGroupProps>;
|
14
18
|
export default _default;
|
@@ -1,31 +1,38 @@
|
|
1
|
-
import React, { memo
|
1
|
+
import React, { memo } from 'react';
|
2
2
|
import Scroll from './Scroll';
|
3
3
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
4
4
|
import { useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import { SwiperSlide } from 'swiper/react';
|
6
6
|
import { css } from '@emotion/css';
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
const
|
11
|
-
const
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
8
|
+
const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
|
9
|
+
var _a;
|
10
|
+
const { productView } = useEventReport();
|
11
|
+
const { popupCurTimeRef } = useSxpDataSource();
|
12
|
+
const handleClick = (item, index) => {
|
13
|
+
if (check === index)
|
14
|
+
return;
|
15
|
+
productView(popupDetailData, item, item === null || item === void 0 ? void 0 : item.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
16
|
+
onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
|
17
|
+
};
|
18
|
+
return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.open) && ((products && (products === null || products === void 0 ? void 0 : products.length) > 1) || !popupDetailData) && (React.createElement(Scroll, { enableSlideActive: true, isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_a = (popupDetailData ? products : [0, 1, 2, 3])) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
|
15
19
|
var _a, _b, _c;
|
16
|
-
return (React.createElement(SwiperSlide, { className: css({
|
20
|
+
return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css({
|
17
21
|
width: '50px',
|
18
22
|
height: '50px',
|
19
23
|
marginRight: '10px'
|
20
|
-
}), onClick: () =>
|
24
|
+
}), onClick: () => {
|
25
|
+
handleClick(item, index);
|
26
|
+
}, key: index },
|
21
27
|
React.createElement(FormatImage, { style: {
|
22
28
|
height: '100%',
|
23
29
|
width: '100%',
|
24
30
|
objectFit: 'cover',
|
25
31
|
display: 'block',
|
26
|
-
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ?
|
27
|
-
border: check === index ? '1px solid #000' : '1px solid #f2f2f2'
|
28
|
-
|
32
|
+
objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? (data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
|
33
|
+
border: check === index ? '1px solid #000' : '1px solid #f2f2f2',
|
34
|
+
boxSizing: 'border-box'
|
35
|
+
}, src: (_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 : defImg }))) : null));
|
29
36
|
})))));
|
30
37
|
};
|
31
38
|
export default memo(CommodityGroup);
|
@@ -3,18 +3,18 @@ import React, { memo, useEffect, useMemo, 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, translateY, imgStyle }) => {
|
6
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
|
7
7
|
const ref = useRef(null);
|
8
8
|
const isOnScreen = useOnScreen(ref);
|
9
9
|
const { ctaEvent } = useSxpDataSource();
|
10
10
|
useEffect(() => {
|
11
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
11
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
|
12
12
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
13
13
|
eventSubject: 'ctaExposure',
|
14
14
|
eventDescription: 'The cta was shown to the user'
|
15
15
|
}, rec, item, index);
|
16
16
|
}
|
17
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
17
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
|
18
18
|
const imgSrc = useMemo(() => {
|
19
19
|
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
|
20
20
|
}, [src]);
|
@@ -5,13 +5,14 @@ import 'swiper/css/free-mode';
|
|
5
5
|
import 'swiper/css/scrollbar';
|
6
6
|
import { FreeMode, Scrollbar, Mousewheel } from 'swiper/modules';
|
7
7
|
import { useSxpDataSource } from '../../../../core/hooks';
|
8
|
-
const Scroll = ({ children, isPadding = true, style }) => {
|
8
|
+
const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
|
9
9
|
const ref = useRef();
|
10
10
|
const { popupDetailData } = useSxpDataSource();
|
11
11
|
useEffect(() => {
|
12
|
-
var _a;
|
13
|
-
|
14
|
-
|
12
|
+
var _a, _b;
|
13
|
+
if (enableSlideActive)
|
14
|
+
(_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
15
|
+
}, [popupDetailData, enableSlideActive]);
|
15
16
|
return (React.createElement(Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [FreeMode, Scrollbar, Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
|
16
17
|
};
|
17
18
|
export default memo(Scroll);
|
@@ -8,50 +8,69 @@ const hooks_1 = require("../../../../core/hooks");
|
|
8
8
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
9
9
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
10
10
|
const LikeButton = (_a) => {
|
11
|
+
var _b;
|
11
12
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = tslib_1.__rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
12
|
-
const { mutateLike, mutateUnlike, bffEventReport } = (0, hooks_1.useSxpDataSource)();
|
13
|
-
const [state, setState] = (0, react_1.useState)(
|
13
|
+
const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = (0, hooks_1.useSxpDataSource)();
|
14
|
+
const [state, setState] = (0, react_1.useState)((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
|
14
15
|
const likeIcon = (0, useIconLink_1.useIconLink)(defaultLikeIconPath);
|
15
16
|
const unlikeIcon = (0, useIconLink_1.useIconLink)(defaultUnLikeIconPath);
|
16
17
|
const handleClick = (0, lodash_1.debounce)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
17
|
-
var
|
18
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
18
19
|
if (state) {
|
19
20
|
setState(false);
|
20
|
-
const result = (
|
21
|
+
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
21
22
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
22
23
|
eventInfo: {
|
23
24
|
eventSubject: 'favoriteContentCanceled',
|
24
25
|
eventDescription: 'This content was unfavorite by the user',
|
25
|
-
contentId: (
|
26
|
-
contentName: (
|
27
|
-
contentTags: JSON.stringify((
|
26
|
+
contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
27
|
+
contentName: (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '',
|
28
|
+
contentTags: JSON.stringify((_l = (_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.tags) !== null && _l !== void 0 ? _l : []),
|
28
29
|
position: position + '',
|
29
|
-
contentFormat: ((
|
30
|
-
traceInfo: (
|
30
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
31
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
31
32
|
}
|
32
33
|
});
|
33
34
|
if (!result) {
|
34
35
|
setState(true);
|
35
36
|
}
|
37
|
+
else {
|
38
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
39
|
+
if (index === position) {
|
40
|
+
item.isCollected = false;
|
41
|
+
}
|
42
|
+
return item;
|
43
|
+
})) !== null && _p !== void 0 ? _p : [];
|
44
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
45
|
+
}
|
36
46
|
}
|
37
47
|
else {
|
38
48
|
setState(true);
|
39
|
-
const result = (
|
49
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
40
50
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
41
51
|
eventInfo: {
|
42
52
|
eventSubject: 'favoriteContent',
|
43
53
|
eventDescription: 'This content was favorite by the user',
|
44
|
-
contentId: (
|
45
|
-
contentName: (
|
46
|
-
contentTags: JSON.stringify((
|
54
|
+
contentId: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
55
|
+
contentName: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.title) !== null && _u !== void 0 ? _u : '',
|
56
|
+
contentTags: JSON.stringify((_w = (_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.tags) !== null && _w !== void 0 ? _w : []),
|
47
57
|
position: position + '',
|
48
|
-
contentFormat: ((
|
49
|
-
traceInfo: (
|
58
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
59
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
50
60
|
}
|
51
61
|
});
|
52
62
|
if (!result) {
|
53
63
|
setState(false);
|
54
64
|
}
|
65
|
+
else {
|
66
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
67
|
+
if (index === position) {
|
68
|
+
item.isCollected = true;
|
69
|
+
}
|
70
|
+
return item;
|
71
|
+
})) !== null && _z !== void 0 ? _z : [];
|
72
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
73
|
+
}
|
55
74
|
}
|
56
75
|
}), 200);
|
57
76
|
return (react_1.default.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|