pb-sxp-ui 1.3.0 → 1.3.2
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 +371 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +371 -198
- 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 +371 -198
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/Modal/index.js +3 -2
- package/es/core/components/SxpPageRender/RenderCard.d.ts +3 -3
- package/es/core/components/SxpPageRender/RenderCard.js +17 -27
- package/es/core/components/SxpPageRender/WaterFall/List.js +28 -15
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +27 -14
- package/es/core/components/SxpPageRender/index.js +41 -29
- package/es/core/context/EditorContext.js +2 -0
- package/es/core/context/EditorDataProvider.d.ts +3 -0
- package/es/core/context/EditorDataProvider.js +2 -1
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +58 -23
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +2 -2
- package/es/core/utils/tool.d.ts +3 -3
- package/es/core/utils/tool.js +6 -6
- package/es/materials/sxp/HashTag/index.d.ts +3 -1
- package/es/materials/sxp/HashTag/settingRender.d.ts +13 -7
- package/es/materials/sxp/HashTag/settingRender.js +15 -0
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +5 -0
- package/es/materials/sxp/cta/AniLink/settingRender.js +4 -0
- package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +8 -5
- package/es/materials/sxp/popup/AppointForm/settingRender.js +12 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +3 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +34 -27
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +13 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +15 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +3 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +37 -30
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +13 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +15 -0
- package/es/materials/sxp/popup/CommodityList/index.d.ts +3 -1
- package/es/materials/sxp/popup/CommodityList/index.js +11 -7
- package/es/materials/sxp/popup/CommodityList/settingRender.d.ts +7 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +10 -0
- package/es/materials/sxp/popup/Iframe/index.d.ts +1 -0
- package/es/materials/sxp/popup/Iframe/index.js +8 -7
- package/es/materials/sxp/popup/Prompt/settingRender.js +10 -0
- package/es/materials/sxp/template/Link/settingRender.js +5 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +3 -2
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +3 -3
- package/lib/core/components/SxpPageRender/RenderCard.js +16 -26
- package/lib/core/components/SxpPageRender/WaterFall/List.js +28 -15
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +27 -14
- package/lib/core/components/SxpPageRender/index.js +40 -28
- package/lib/core/context/EditorContext.js +2 -0
- package/lib/core/context/EditorDataProvider.d.ts +3 -0
- package/lib/core/context/EditorDataProvider.js +2 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +58 -23
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +2 -2
- package/lib/core/utils/tool.d.ts +3 -3
- package/lib/core/utils/tool.js +6 -6
- package/lib/materials/sxp/HashTag/index.d.ts +3 -1
- package/lib/materials/sxp/HashTag/settingRender.d.ts +13 -7
- package/lib/materials/sxp/HashTag/settingRender.js +15 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +5 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.js +4 -0
- package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +8 -5
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +12 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +3 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +34 -27
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +13 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +15 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +3 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +37 -30
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +13 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +15 -0
- package/lib/materials/sxp/popup/CommodityList/index.d.ts +3 -1
- package/lib/materials/sxp/popup/CommodityList/index.js +11 -7
- package/lib/materials/sxp/popup/CommodityList/settingRender.d.ts +7 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +10 -0
- package/lib/materials/sxp/popup/Iframe/index.d.ts +1 -0
- package/lib/materials/sxp/popup/Iframe/index.js +8 -7
- package/lib/materials/sxp/popup/Prompt/settingRender.js +10 -0
- package/lib/materials/sxp/template/Link/settingRender.js +5 -0
- package/package.json +1 -1
@@ -25,7 +25,9 @@ export interface ICommodityDetailDiroNewProps {
|
|
25
25
|
commodityStyles?: {
|
26
26
|
title: CSSProperties;
|
27
27
|
collection: CSSProperties;
|
28
|
-
price: CSSProperties
|
28
|
+
price: CSSProperties & {
|
29
|
+
enableFormattedPrice?: boolean;
|
30
|
+
};
|
29
31
|
taxInfo: CSSProperties;
|
30
32
|
info: CSSProperties;
|
31
33
|
};
|
@@ -12,7 +12,7 @@ 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, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
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, _2, _3, _4, _5, _6, _7, _8, _9;
|
16
16
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
|
17
17
|
const [spread, setSpread] = useState(true);
|
18
18
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
|
@@ -24,6 +24,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
24
24
|
const curTimeRef = useRef(null);
|
25
25
|
const [show3DModal, setShow3DModal] = useState(false);
|
26
26
|
const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
27
|
+
const ref = useRef();
|
27
28
|
const data = isPost ? rec : popupDetailData;
|
28
29
|
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];
|
29
30
|
let cta = isPost
|
@@ -63,17 +64,20 @@ const CommodityDetailDiroNew = (_a) => {
|
|
63
64
|
};
|
64
65
|
}, []);
|
65
66
|
const priceText = useMemo(() => {
|
66
|
-
var _a, _b, _c, _d, _e;
|
67
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
68
|
+
const isToLocStr = ((_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
|
67
69
|
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
68
|
-
return `${(
|
69
|
-
|
70
|
-
|
70
|
+
return `${(_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.currency) === null || _c === void 0 ? void 0 : _c.split('-')[1]) === null || _d === void 0 ? void 0 : _d.toUpperCase()) !== null && _e !== void 0 ? _e : ''}${isToLocStr
|
71
|
+
? (_g = (_f = product === null || product === void 0 ? void 0 : product.price) === null || _f === void 0 ? void 0 : _f.toLocaleString('zh', {
|
72
|
+
minimumFractionDigits: 0
|
73
|
+
})) !== null && _g !== void 0 ? _g : ''
|
74
|
+
: product === null || product === void 0 ? void 0 : product.price}`;
|
71
75
|
}
|
72
76
|
else {
|
73
77
|
return '£102,300.00';
|
74
78
|
}
|
75
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
76
|
-
const width = (isPreview ? 375 : (
|
79
|
+
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency, (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice]);
|
80
|
+
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
77
81
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
78
82
|
const handleClickCollapse = () => {
|
79
83
|
setSpread(!spread);
|
@@ -94,6 +98,10 @@ Made in Italy` })));
|
|
94
98
|
popupCurTimeRef.current = new Date();
|
95
99
|
setCheckCommodityIndex(index);
|
96
100
|
checkCommodityIndexRef.current = index;
|
101
|
+
if (ref === null || ref === void 0 ? void 0 : ref.current) {
|
102
|
+
ref.current.swiper.slideTo(0);
|
103
|
+
ref.current.swiper.autoplay.start();
|
104
|
+
}
|
97
105
|
}, []);
|
98
106
|
const renderCommodityGroup = useCallback(() => {
|
99
107
|
var _a, _b, _c;
|
@@ -109,17 +117,17 @@ Made in Italy` })));
|
|
109
117
|
};
|
110
118
|
return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
|
111
119
|
}, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
|
112
|
-
const iframeUrl = ((
|
120
|
+
const iframeUrl = ((_x = (_w = data === null || data === void 0 ? void 0 : data.video) === null || _w === void 0 ? void 0 : _w.bindProduct) === null || _x === void 0 ? void 0 : _x.remark) || ((_0 = (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProducts) === null || _z === void 0 ? void 0 : _z[0]) === null || _0 === void 0 ? void 0 : _0.remark) || ((_1 = data === null || data === void 0 ? void 0 : data.product) === null || _1 === void 0 ? void 0 : _1.remark);
|
113
121
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
114
122
|
React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
115
123
|
React.createElement("div", { style: { position: 'relative' } },
|
116
|
-
product && ((
|
124
|
+
product && ((_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
|
117
125
|
clickable: true,
|
118
126
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
119
127
|
clickableClass: getDotsAlign
|
120
128
|
}, loop: true, autoplay: {
|
121
129
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
122
|
-
} }, (
|
130
|
+
}, ref: ref }, (_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.map((src) => {
|
123
131
|
var _a;
|
124
132
|
return (React.createElement(SwiperSlide, { key: src },
|
125
133
|
React.createElement("div", { style: {
|
@@ -135,7 +143,7 @@ Made in Italy` })));
|
|
135
143
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
136
144
|
}, 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 }))));
|
137
145
|
}))),
|
138
|
-
!((
|
146
|
+
!((_4 = product === null || product === void 0 ? void 0 : product.homePage) === null || _4 === void 0 ? void 0 : _4.length) && (React.createElement("div", { className: css({
|
139
147
|
height,
|
140
148
|
width
|
141
149
|
}) },
|
@@ -143,27 +151,26 @@ Made in Italy` })));
|
|
143
151
|
objectFit: 'cover',
|
144
152
|
width: '100%',
|
145
153
|
height: '100%'
|
146
|
-
}), src: (
|
147
|
-
(iframeUrl && iframeIcon
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
React.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
|
154
|
+
}), src: (_5 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _5 !== void 0 ? _5 : bottom_image, alt: 'pdp image' }))),
|
155
|
+
(iframeUrl || !product) && iframeIcon && (React.createElement("div", { style: {
|
156
|
+
padding: '5px 10px',
|
157
|
+
display: 'flex',
|
158
|
+
alignItems: 'center',
|
159
|
+
position: 'absolute',
|
160
|
+
right: '10px',
|
161
|
+
bottom: '10px',
|
162
|
+
zIndex: 1,
|
163
|
+
background: '#fff',
|
164
|
+
borderRadius: '3px'
|
165
|
+
}, onClick: () => setShow3DModal(true) },
|
166
|
+
React.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
|
167
|
+
React.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D")))),
|
161
168
|
renderCommodityGroup(),
|
162
169
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
163
170
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
164
171
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
165
172
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
|
166
|
-
__html: setFontForText((
|
173
|
+
__html: setFontForText((_6 = product === null || product === void 0 ? void 0 : product.title) !== null && _6 !== void 0 ? _6 : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
167
174
|
} }),
|
168
175
|
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: {
|
169
176
|
__html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -173,11 +180,11 @@ Made in Italy` })));
|
|
173
180
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
174
181
|
} }),
|
175
182
|
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: {
|
176
|
-
__html: setFontForText((
|
183
|
+
__html: setFontForText((_7 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _7 !== void 0 ? _7 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
177
184
|
} }))),
|
178
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (
|
185
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_8 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _8 !== void 0 ? _8 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
|
179
186
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
180
|
-
__html: setFontForText((
|
187
|
+
__html: setFontForText((_9 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _9 !== void 0 ? _9 : 'Shop now', buttonStyle)
|
181
188
|
} }))),
|
182
189
|
productInfoText({ isPost }))),
|
183
190
|
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false })),
|
@@ -135,6 +135,13 @@ declare const _default: ({
|
|
135
135
|
options?: undefined;
|
136
136
|
initialValue?: undefined;
|
137
137
|
child?: undefined;
|
138
|
+
} | {
|
139
|
+
label: string;
|
140
|
+
type: string;
|
141
|
+
name: string[];
|
142
|
+
initialValue: boolean;
|
143
|
+
options?: undefined;
|
144
|
+
child?: undefined;
|
138
145
|
})[];
|
139
146
|
}[];
|
140
147
|
} | {
|
@@ -193,6 +200,12 @@ declare const _default: ({
|
|
193
200
|
})[];
|
194
201
|
name?: undefined;
|
195
202
|
initialValue?: undefined;
|
203
|
+
} | {
|
204
|
+
label: string;
|
205
|
+
type: string;
|
206
|
+
name: string[];
|
207
|
+
initialValue?: undefined;
|
208
|
+
child?: undefined;
|
196
209
|
})[];
|
197
210
|
} | {
|
198
211
|
title: string;
|
@@ -191,6 +191,16 @@ export default [
|
|
191
191
|
label: '默认行数',
|
192
192
|
type: 'Number',
|
193
193
|
name: ['lineClamp']
|
194
|
+
},
|
195
|
+
{
|
196
|
+
label: '间距',
|
197
|
+
type: 'TextSpace'
|
198
|
+
},
|
199
|
+
{
|
200
|
+
label: '价格千分符展示',
|
201
|
+
type: 'Switch',
|
202
|
+
name: ['enableFormattedPrice'],
|
203
|
+
initialValue: true
|
194
204
|
}
|
195
205
|
]
|
196
206
|
}
|
@@ -276,6 +286,11 @@ export default [
|
|
276
286
|
{
|
277
287
|
type: 'TextAlign',
|
278
288
|
name: ['props', 'buttonStyle']
|
289
|
+
},
|
290
|
+
{
|
291
|
+
label: '间距',
|
292
|
+
type: 'TextSpace',
|
293
|
+
name: ['props', 'buttonStyle']
|
279
294
|
}
|
280
295
|
]
|
281
296
|
},
|
@@ -16,7 +16,9 @@ export interface ICommodityListProps {
|
|
16
16
|
commodityStyles?: {
|
17
17
|
title: CSSProperties;
|
18
18
|
collection: CSSProperties;
|
19
|
-
price: CSSProperties
|
19
|
+
price: CSSProperties & {
|
20
|
+
enableFormattedPrice?: boolean;
|
21
|
+
};
|
20
22
|
};
|
21
23
|
buttonStyle?: CSSProperties;
|
22
24
|
translateY?: number;
|
@@ -8,7 +8,7 @@ import { setFontForText } from '../../../../core/utils/tool';
|
|
8
8
|
import Img from '../../template/components/Img';
|
9
9
|
import { throttle } from 'lodash';
|
10
10
|
const CommodityList = (_a) => {
|
11
|
-
var _b, _c;
|
11
|
+
var _b, _c, _d;
|
12
12
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
|
13
13
|
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
|
14
14
|
const { jumpToWeb } = useEventReport();
|
@@ -17,16 +17,20 @@ const CommodityList = (_a) => {
|
|
17
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];
|
18
18
|
const index = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
19
19
|
const priceText = useCallback((product) => {
|
20
|
-
var _a, _b, _c, _d, _e;
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
21
|
+
const isToLocStr = ((_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
|
21
22
|
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
22
|
-
return `${(
|
23
|
-
|
24
|
-
|
23
|
+
return `${(_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.currency) === null || _c === void 0 ? void 0 : _c.split('-')[1]) === null || _d === void 0 ? void 0 : _d.toUpperCase()) !== null && _e !== void 0 ? _e : ''}${isToLocStr
|
24
|
+
? (_g = (_f = product === null || product === void 0 ? void 0 : product.price) === null || _f === void 0 ? void 0 : _f.toLocaleString('zh', {
|
25
|
+
minimumFractionDigits: 0
|
26
|
+
})) !== null && _g !== void 0 ? _g : ''
|
27
|
+
: product === null || product === void 0 ? void 0 : product.price}`;
|
25
28
|
}
|
26
29
|
else {
|
27
|
-
|
30
|
+
const p = 7000;
|
31
|
+
return `$${isToLocStr ? p === null || p === void 0 ? void 0 : p.toLocaleString() : p}`;
|
28
32
|
}
|
29
|
-
}, []);
|
33
|
+
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice]);
|
30
34
|
const handleClick = throttle((item, multiCheckIndex) => {
|
31
35
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
32
36
|
eventSubject: 'clickCta',
|
@@ -95,6 +95,13 @@ declare const _default: ({
|
|
95
95
|
name?: undefined;
|
96
96
|
initialValue?: undefined;
|
97
97
|
child?: undefined;
|
98
|
+
} | {
|
99
|
+
label: string;
|
100
|
+
type: string;
|
101
|
+
name: string[];
|
102
|
+
initialValue: boolean;
|
103
|
+
options?: undefined;
|
104
|
+
child?: undefined;
|
98
105
|
})[];
|
99
106
|
}[];
|
100
107
|
} | {
|
@@ -131,6 +131,16 @@ export default [
|
|
131
131
|
{
|
132
132
|
label: '标题对齐',
|
133
133
|
type: 'TextAlign'
|
134
|
+
},
|
135
|
+
{
|
136
|
+
label: '间距',
|
137
|
+
type: 'TextSpace'
|
138
|
+
},
|
139
|
+
{
|
140
|
+
label: '价格千分符展示',
|
141
|
+
type: 'Switch',
|
142
|
+
name: ['enableFormattedPrice'],
|
143
|
+
initialValue: true
|
134
144
|
}
|
135
145
|
]
|
136
146
|
}
|
@@ -5,14 +5,15 @@ import './index.less';
|
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
6
|
const Iframe = (_a) => {
|
7
7
|
var _b, _c;
|
8
|
-
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle"]);
|
8
|
+
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle, isTel } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle", "isTel"]);
|
9
9
|
const { popupDetailData } = useSxpDataSource();
|
10
10
|
const iframeUrl = (_c = (_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _b === void 0 ? void 0 : _b.bindCta) === null || _c === void 0 ? void 0 : _c.remark;
|
11
|
-
return (React.createElement("div", Object.assign({ className: `${css(Object.assign({}, style)
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
return (React.createElement("div", Object.assign({ className: `${css(Object.assign(Object.assign({}, style), { height: isTel ? 664 : '100%' }))}` }, props),
|
12
|
+
React.createElement("iframe", { src: iframeUrl, style: {
|
13
|
+
width: '100%',
|
14
|
+
height: 'calc(100% - 50px)',
|
15
|
+
marginTop: '40px',
|
16
|
+
border: 'none'
|
17
|
+
} })));
|
17
18
|
};
|
18
19
|
export default memo(Iframe);
|
@@ -61,6 +61,11 @@ export default [
|
|
61
61
|
}
|
62
62
|
]
|
63
63
|
},
|
64
|
+
{
|
65
|
+
label: '内容字体间距',
|
66
|
+
type: 'TextSpace',
|
67
|
+
name: ['props', 'contentStyle']
|
68
|
+
},
|
64
69
|
{
|
65
70
|
type: 'Group',
|
66
71
|
label: '提交按钮字体',
|
@@ -94,6 +99,11 @@ export default [
|
|
94
99
|
}
|
95
100
|
]
|
96
101
|
},
|
102
|
+
{
|
103
|
+
label: '提交按钮间距',
|
104
|
+
type: 'TextSpace',
|
105
|
+
name: ['props', 'submitButtonStyle']
|
106
|
+
},
|
97
107
|
{
|
98
108
|
type: 'TextStyle',
|
99
109
|
name: ['props', 'submitButtonStyle']
|
@@ -7,7 +7,7 @@ const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
7
7
|
const hooks_1 = require("../../../../core/hooks");
|
8
8
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
9
9
|
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false }) => {
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
11
11
|
const touchRef = (0, react_1.useRef)(null);
|
12
12
|
const fTouchRef = (0, react_1.useRef)(null);
|
13
13
|
const touchMoveRef = (0, react_1.useRef)(null);
|
@@ -129,7 +129,8 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
129
129
|
react_1.default.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
130
130
|
react_1.default.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: 'modal-icon' })),
|
131
131
|
react_1.default.createElement("div", { ref: ref, style: {
|
132
|
-
height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H
|
132
|
+
height: (_x = (isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H) -
|
133
|
+
((_w = (_v = (_u = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _u === void 0 ? void 0 : _u.props) === null || _v === void 0 ? void 0 : _v.popupBg) === null || _w === void 0 ? void 0 : _w.bottomMargin)) !== null && _x !== void 0 ? _x : 0,
|
133
134
|
overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden'
|
134
135
|
} }, children)))))), modalEleRef.current);
|
135
136
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { FC } from 'react';
|
2
2
|
import './index.less';
|
3
3
|
import { RecItemType } from './typing';
|
4
4
|
interface IRenderCardProps {
|
@@ -9,5 +9,5 @@ interface IRenderCardProps {
|
|
9
9
|
includesCtaType?: string[];
|
10
10
|
isActive?: boolean;
|
11
11
|
}
|
12
|
-
declare const
|
13
|
-
export default
|
12
|
+
declare const RenderCard: FC<IRenderCardProps>;
|
13
|
+
export default RenderCard;
|
@@ -21,43 +21,33 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
|
|
21
21
|
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
22
22
|
}
|
23
23
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
24
|
-
const renderComp = (0, react_1.
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3
|
24
|
+
const renderComp = (0, react_1.useCallback)(() => {
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
26
26
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
27
27
|
return null;
|
28
|
-
|
29
|
-
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
30
|
-
cta = '多商品CTA';
|
31
|
-
}
|
32
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
33
|
-
cta = '商品CTA';
|
34
|
-
}
|
35
|
-
else {
|
36
|
-
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
37
|
-
}
|
38
|
-
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
|
28
|
+
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
39
29
|
return;
|
40
|
-
if (!includesCtaType && ((
|
30
|
+
if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
|
41
31
|
return;
|
42
|
-
if ((((
|
43
|
-
(((
|
44
|
-
(((
|
45
|
-
(((
|
46
|
-
(((
|
47
|
-
(((
|
32
|
+
if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
|
33
|
+
(((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'Commodity' && !((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct)) ||
|
34
|
+
(((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type) === 'CommodityDiroNew' && !((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.bindProduct)) ||
|
35
|
+
(((_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.type) === 'MultiCommodity' && !((_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.bindProducts) === null || _l === void 0 ? void 0 : _l.length)) ||
|
36
|
+
(((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'MultiCommodityDiro' && !((_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProducts) === null || _p === void 0 ? void 0 : _p.length)) ||
|
37
|
+
(((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.type) === 'MultiCommodityDiroNew' && !((_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProducts) === null || _s === void 0 ? void 0 : _s.length))) {
|
48
38
|
return null;
|
49
39
|
}
|
50
40
|
if (value && resolver) {
|
51
|
-
const t = resolver[(
|
41
|
+
const t = resolver[(_t = value === null || value === void 0 ? void 0 : value.item) === null || _t === void 0 ? void 0 : _t.type];
|
52
42
|
const Component = (0, withBindDataSource_1.default)(t);
|
53
|
-
const defaulSetting = (
|
54
|
-
const isExternalLink = ((
|
55
|
-
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (
|
43
|
+
const defaulSetting = (_u = t === null || t === void 0 ? void 0 : t.extend) === null || _u === void 0 ? void 0 : _u.defaulSetting;
|
44
|
+
const isExternalLink = ((_x = (_w = (_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.event) === null || _w === void 0 ? void 0 : _w.onClick) === null || _x === void 0 ? void 0 : _x.linkType) === 'externalLink';
|
45
|
+
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
|
56
46
|
}
|
57
47
|
else {
|
58
48
|
return null;
|
59
49
|
}
|
60
50
|
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
|
61
|
-
return react_1.default.createElement(react_1.default.Fragment, null, renderComp);
|
51
|
+
return react_1.default.createElement(react_1.default.Fragment, null, renderComp());
|
62
52
|
};
|
63
|
-
exports.default =
|
53
|
+
exports.default = RenderCard;
|
@@ -8,9 +8,11 @@ const preview_json_1 = tslib_1.__importDefault(require("./preview.json"));
|
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
9
|
const css_1 = require("@emotion/css");
|
10
10
|
const tool_1 = require("../../../../core/utils/tool");
|
11
|
+
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
11
12
|
const WaterfallFlowItem = (props) => {
|
13
|
+
var _a;
|
12
14
|
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
13
|
-
const { swiperRef, setRtcList, setOpenHashtag,
|
15
|
+
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
14
16
|
const [showVideo, setShowVideo] = (0, react_1.useState)(false);
|
15
17
|
const imgDom = (0, react_1.useRef)(null);
|
16
18
|
const ref = (0, react_1.useRef)(null);
|
@@ -37,16 +39,19 @@ const WaterfallFlowItem = (props) => {
|
|
37
39
|
return ((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.title) || ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) || null;
|
38
40
|
}, [rec]);
|
39
41
|
const priceText = (0, react_1.useMemo)(() => {
|
40
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
43
|
+
const isToLocStr = ((_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
|
44
|
+
if (((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) && ((_d = rec === null || rec === void 0 ? void 0 : rec.product) === null || _d === void 0 ? void 0 : _d.price)) {
|
45
|
+
return `${(_h = (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.product) === null || _e === void 0 ? void 0 : _e.currency) === null || _f === void 0 ? void 0 : _f.split('-')[1]) === null || _g === void 0 ? void 0 : _g.toUpperCase()) !== null && _h !== void 0 ? _h : ''}${isToLocStr
|
46
|
+
? (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k.toLocaleString('zh', {
|
47
|
+
minimumFractionDigits: 0
|
48
|
+
})) !== null && _l !== void 0 ? _l : ''
|
49
|
+
: (_m = rec === null || rec === void 0 ? void 0 : rec.product) === null || _m === void 0 ? void 0 : _m.price}`;
|
45
50
|
}
|
46
51
|
else {
|
47
52
|
return null;
|
48
53
|
}
|
49
|
-
}, [rec]);
|
54
|
+
}, [rec, (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice]);
|
50
55
|
(0, react_1.useEffect)(() => {
|
51
56
|
const observer = new IntersectionObserver((entries) => {
|
52
57
|
entries.forEach((entry) => {
|
@@ -123,29 +128,35 @@ const WaterfallFlowItem = (props) => {
|
|
123
128
|
function WaterfallList(_a) {
|
124
129
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
125
130
|
var { reportTagsView, showBanner } = _a, props = tslib_1.__rest(_a, ["reportTagsView", "showBanner"]);
|
126
|
-
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = (0, hooks_1.useSxpDataSource)();
|
131
|
+
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = (0, hooks_1.useSxpDataSource)();
|
132
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
127
133
|
const [list, setList] = (0, react_1.useState)();
|
128
134
|
const [data, setData] = (0, react_1.useState)();
|
129
135
|
const [isLoadingData, setIsLoadingData] = (0, react_1.useState)(false);
|
130
136
|
const containerRef = (0, react_1.useRef)(null);
|
131
137
|
const [isLoadMore, setIsLoadMore] = (0, react_1.useState)(false);
|
132
138
|
const loadMoreData = (0, react_1.useCallback)(() => {
|
133
|
-
var _a, _b, _c, _d;
|
134
139
|
if (isLoadMore)
|
135
140
|
return;
|
136
141
|
setIsLoadMore(true);
|
137
142
|
waterFallData &&
|
138
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(
|
143
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
144
|
+
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag
|
145
|
+
}).then((res) => {
|
139
146
|
var _a;
|
140
147
|
setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
|
141
148
|
setIsLoadMore(false);
|
142
149
|
}));
|
143
150
|
}, [waterFallData, getRecommendVideos, list, isLoadMore]);
|
144
151
|
(0, react_1.useEffect)(() => {
|
145
|
-
var _a, _b
|
152
|
+
var _a, _b;
|
146
153
|
setIsLoadingData(true);
|
147
154
|
waterFallData &&
|
148
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(
|
155
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
156
|
+
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
157
|
+
defaultSize: hashTagSize,
|
158
|
+
maxSize: hashTagSize
|
159
|
+
}).then((res) => {
|
149
160
|
var _a, _b;
|
150
161
|
setData(res);
|
151
162
|
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
@@ -154,15 +165,17 @@ function WaterfallList(_a) {
|
|
154
165
|
if (isOpenHashTag) {
|
155
166
|
const res = preview_json_1.default;
|
156
167
|
setData(res);
|
157
|
-
setList((
|
168
|
+
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
158
169
|
setIsLoadingData(false);
|
159
170
|
}
|
160
171
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
161
172
|
const handleClickLink = () => {
|
162
|
-
var _a, _b;
|
173
|
+
var _a, _b, _c, _d, _e;
|
163
174
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
164
175
|
reportTagsView();
|
165
|
-
|
176
|
+
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
177
|
+
jumpToWeb(rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
178
|
+
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
166
179
|
}
|
167
180
|
};
|
168
181
|
return (react_1.default.createElement(react_1.default.Fragment, null, isLoadingData ? (react_1.default.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|