pb-sxp-ui 1.3.0 → 1.3.1
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 +207 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +207 -78
- 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 +207 -78
- 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/WaterFall/List.js +8 -4
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +7 -3
- package/es/core/components/SxpPageRender/index.js +29 -21
- package/es/core/context/EditorContext.js +2 -0
- package/es/core/context/SxpDataSourceProvider.js +33 -10
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +2 -2
- package/es/materials/sxp/HashTag/settingRender.d.ts +6 -7
- package/es/materials/sxp/HashTag/settingRender.js +9 -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 +21 -13
- 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 +24 -16
- 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/settingRender.js +4 -0
- 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/WaterFall/List.js +8 -4
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +7 -3
- package/lib/core/components/SxpPageRender/index.js +28 -20
- package/lib/core/context/EditorContext.js +2 -0
- package/lib/core/context/SxpDataSourceProvider.js +33 -10
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +2 -2
- package/lib/materials/sxp/HashTag/settingRender.d.ts +6 -7
- package/lib/materials/sxp/HashTag/settingRender.js +9 -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 +21 -13
- 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 +24 -16
- 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/settingRender.js +4 -0
- 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
@@ -208,6 +208,16 @@ export default [
|
|
208
208
|
label: '默认行数',
|
209
209
|
type: 'Number',
|
210
210
|
name: ['lineClamp']
|
211
|
+
},
|
212
|
+
{
|
213
|
+
label: '间距',
|
214
|
+
type: 'TextSpace'
|
215
|
+
},
|
216
|
+
{
|
217
|
+
label: '价格千分符展示',
|
218
|
+
type: 'Switch',
|
219
|
+
name: ['enableFormattedPrice'],
|
220
|
+
initialValue: true
|
211
221
|
}
|
212
222
|
]
|
213
223
|
}
|
@@ -293,6 +303,11 @@ export default [
|
|
293
303
|
{
|
294
304
|
type: 'TextAlign',
|
295
305
|
name: ['props', 'buttonStyle']
|
306
|
+
},
|
307
|
+
{
|
308
|
+
label: '间距',
|
309
|
+
type: 'TextSpace',
|
310
|
+
name: ['props', 'buttonStyle']
|
296
311
|
}
|
297
312
|
]
|
298
313
|
},
|
@@ -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,7 +151,7 @@ Made in Italy` })));
|
|
143
151
|
objectFit: 'cover',
|
144
152
|
width: '100%',
|
145
153
|
height: '100%'
|
146
|
-
}), src: (
|
154
|
+
}), src: (_5 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _5 !== void 0 ? _5 : bottom_image, alt: 'pdp image' }))),
|
147
155
|
(iframeUrl && iframeIcon) ||
|
148
156
|
(!product && iframeIcon && (React.createElement("div", { style: {
|
149
157
|
padding: '5px 10px',
|
@@ -163,7 +171,7 @@ Made in Italy` })));
|
|
163
171
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
164
172
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
165
173
|
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((
|
174
|
+
__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
175
|
} }),
|
168
176
|
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
177
|
__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 +181,11 @@ Made in Italy` })));
|
|
173
181
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
174
182
|
} }),
|
175
183
|
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((
|
184
|
+
__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
185
|
} }))),
|
178
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (
|
186
|
+
(!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
187
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
180
|
-
__html: setFontForText((
|
188
|
+
__html: setFontForText((_9 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _9 !== void 0 ? _9 : 'Shop now', buttonStyle)
|
181
189
|
} }))),
|
182
190
|
productInfoText({ isPost }))),
|
183
191
|
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
|
},
|
@@ -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;
|
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: (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),
|
133
134
|
overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden'
|
134
135
|
} }, children)))))), modalEleRef.current);
|
135
136
|
};
|
@@ -8,9 +8,10 @@ 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) => {
|
12
13
|
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
13
|
-
const { swiperRef, setRtcList, setOpenHashtag,
|
14
|
+
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
14
15
|
const [showVideo, setShowVideo] = (0, react_1.useState)(false);
|
15
16
|
const imgDom = (0, react_1.useRef)(null);
|
16
17
|
const ref = (0, react_1.useRef)(null);
|
@@ -123,7 +124,8 @@ const WaterfallFlowItem = (props) => {
|
|
123
124
|
function WaterfallList(_a) {
|
124
125
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
125
126
|
var { reportTagsView, showBanner } = _a, props = tslib_1.__rest(_a, ["reportTagsView", "showBanner"]);
|
126
|
-
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = (0, hooks_1.useSxpDataSource)();
|
127
|
+
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = (0, hooks_1.useSxpDataSource)();
|
128
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
127
129
|
const [list, setList] = (0, react_1.useState)();
|
128
130
|
const [data, setData] = (0, react_1.useState)();
|
129
131
|
const [isLoadingData, setIsLoadingData] = (0, react_1.useState)(false);
|
@@ -159,10 +161,12 @@ function WaterfallList(_a) {
|
|
159
161
|
}
|
160
162
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
161
163
|
const handleClickLink = () => {
|
162
|
-
var _a, _b;
|
164
|
+
var _a, _b, _c, _d, _e;
|
163
165
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
164
166
|
reportTagsView();
|
165
|
-
|
167
|
+
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
168
|
+
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);
|
169
|
+
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
166
170
|
}
|
167
171
|
};
|
168
172
|
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' } },
|
@@ -8,6 +8,7 @@ const preview_json_1 = tslib_1.__importDefault(require("./preview.json"));
|
|
8
8
|
const FormatImage_1 = tslib_1.__importDefault(require("../FormatImage"));
|
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) => {
|
12
13
|
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
13
14
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
@@ -115,7 +116,8 @@ const WaterfallFlowItem = (props) => {
|
|
115
116
|
function WaterfallList(_a) {
|
116
117
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
117
118
|
var { reportTagsView, showBanner } = _a, props = tslib_1.__rest(_a, ["reportTagsView", "showBanner"]);
|
118
|
-
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = (0, hooks_1.useSxpDataSource)();
|
119
|
+
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = (0, hooks_1.useSxpDataSource)();
|
120
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
119
121
|
const scrollParent = (0, react_1.useRef)(null);
|
120
122
|
const [scrollTop, setScrollTop] = (0, react_1.useState)(0);
|
121
123
|
const [data, setData] = (0, react_1.useState)();
|
@@ -267,10 +269,12 @@ function WaterfallList(_a) {
|
|
267
269
|
};
|
268
270
|
}, [onScroll, scrollParent]);
|
269
271
|
const handleClickLink = () => {
|
270
|
-
var _a, _b;
|
272
|
+
var _a, _b, _c, _d, _e;
|
271
273
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
272
274
|
reportTagsView();
|
273
|
-
|
275
|
+
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
276
|
+
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);
|
277
|
+
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
274
278
|
}
|
275
279
|
};
|
276
280
|
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' } },
|
@@ -38,8 +38,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
38
38
|
const [isReload, setIsReload] = (0, react_1.useState)(new Date().getTime());
|
39
39
|
const skipLinkRef = (0, react_1.useRef)(false);
|
40
40
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview } = (0, hooks_1.useSxpDataSource)();
|
41
|
-
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
42
|
-
const { productView } = (0, useEventReport_1.useEventReport)();
|
41
|
+
const { backMainFeed, productView, jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
43
42
|
const isShowFingerTip = (0, react_1.useMemo)(() => {
|
44
43
|
return data.length > 0 && !loading && ((0, localStore_1.getFeUserId)() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
45
44
|
}, [data, loading, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip]);
|
@@ -179,15 +178,39 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
179
178
|
const height = (0, react_1.useMemo)(() => {
|
180
179
|
return containerHeight - minusHeight - tagHeight;
|
181
180
|
}, [globalConfig, containerHeight, tagHeight]);
|
181
|
+
const visList = (0, react_1.useMemo)(() => {
|
182
|
+
var _a;
|
183
|
+
const list = activeIndex === 0 && !waterFallData
|
184
|
+
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
185
|
+
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
186
|
+
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
187
|
+
return item;
|
188
|
+
}
|
189
|
+
else {
|
190
|
+
return null;
|
191
|
+
}
|
192
|
+
});
|
193
|
+
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
194
|
+
}, [data, activeIndex, waterFallData]);
|
182
195
|
const renderLogo = (0, react_1.useMemo)(() => {
|
183
|
-
var _a, _b;
|
196
|
+
var _a, _b, _c, _d;
|
184
197
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
185
198
|
const link = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.value;
|
186
|
-
|
199
|
+
const isExternalLink = ((_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
200
|
+
const rec = visList[activeIndex];
|
201
|
+
return (react_1.default.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && {
|
202
|
+
onClick: () => {
|
203
|
+
var _a, _b, _c, _d;
|
204
|
+
if (isExternalLink) {
|
205
|
+
jumpToWeb(rec, (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindCta, activeIndex, ((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || ((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo));
|
206
|
+
}
|
207
|
+
new Function(link)();
|
208
|
+
}
|
209
|
+
})),
|
187
210
|
react_1.default.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
188
211
|
}
|
189
212
|
return null;
|
190
|
-
}, [globalConfig]);
|
213
|
+
}, [globalConfig, activeIndex, visList]);
|
191
214
|
const renderContent = (0, react_1.useCallback)((rec, index) => {
|
192
215
|
var _a, _b, _c, _d;
|
193
216
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
@@ -324,7 +347,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
324
347
|
traceInfo: (_u = (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_t = item === null || item === void 0 ? void 0 : item.product) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : ''
|
325
348
|
}
|
326
349
|
});
|
327
|
-
(0, localStore_1.setSlideSkipState)();
|
328
350
|
skipLinkRef.current = true;
|
329
351
|
window.location.href = window.getJointUtmLink(link);
|
330
352
|
}
|
@@ -406,20 +428,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
406
428
|
});
|
407
429
|
}
|
408
430
|
};
|
409
|
-
const visList = (0, react_1.useMemo)(() => {
|
410
|
-
var _a;
|
411
|
-
const list = activeIndex === 0 && !waterFallData
|
412
|
-
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
413
|
-
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
414
|
-
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
415
|
-
return item;
|
416
|
-
}
|
417
|
-
else {
|
418
|
-
return null;
|
419
|
-
}
|
420
|
-
});
|
421
|
-
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
422
|
-
}, [data, activeIndex, waterFallData]);
|
423
431
|
const renderToggleButton = (0, react_1.useCallback)((visible) => {
|
424
432
|
var _a, _b, _c, _d, _e, _f;
|
425
433
|
if (!visible)
|
@@ -6,6 +6,7 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const lodash_1 = require("lodash");
|
7
7
|
const DataSourceProvider_1 = tslib_1.__importDefault(require("./DataSourceProvider"));
|
8
8
|
const tool_1 = require("../../core/utils/tool");
|
9
|
+
const localStore_1 = require("../utils/localStore");
|
9
10
|
const item = {
|
10
11
|
id: (0, tool_1.uuid)(6, 10),
|
11
12
|
item: {
|
@@ -79,6 +80,7 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
|
|
79
80
|
});
|
80
81
|
typeof window !== 'undefined' &&
|
81
82
|
(window.getJointUtmLink = (url) => {
|
83
|
+
(0, localStore_1.setSlideSkipState)();
|
82
84
|
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
83
85
|
return url + (utmVal ? '&' + utmVal : '');
|
84
86
|
}
|
@@ -96,7 +96,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
96
96
|
.catch((err) => Promise.reject(err));
|
97
97
|
}, [bffDataSource]);
|
98
98
|
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
99
|
-
var _d, _e, _f, _g, _h;
|
99
|
+
var _d, _e, _f, _g, _h, _j, _k;
|
100
100
|
query = Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` }));
|
101
101
|
if (utmVal) {
|
102
102
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
@@ -107,7 +107,30 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
107
107
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
108
108
|
}
|
109
109
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isEditor) {
|
110
|
-
query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1
|
110
|
+
query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] }));
|
111
|
+
if (!(query === null || query === void 0 ? void 0 : query.channel))
|
112
|
+
return;
|
113
|
+
let list = [];
|
114
|
+
let result = null;
|
115
|
+
let pageNum = 1;
|
116
|
+
const recurveRecList = (query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
117
|
+
var _l, _m, _o, _p;
|
118
|
+
query.pageNum = pageNum;
|
119
|
+
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
120
|
+
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
121
|
+
return undefined;
|
122
|
+
}
|
123
|
+
const rec = (_m = (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.recList) === null || _m === void 0 ? void 0 : _m[0];
|
124
|
+
list = list.concat((_p = (_o = result === null || result === void 0 ? void 0 : result.data) === null || _o === void 0 ? void 0 : _o.recList) !== null && _p !== void 0 ? _p : []);
|
125
|
+
if ((rec === null || rec === void 0 ? void 0 : rec.product) || (rec === null || rec === void 0 ? void 0 : rec.video)) {
|
126
|
+
pageNum = pageNum + 1;
|
127
|
+
yield recurveRecList(query);
|
128
|
+
}
|
129
|
+
});
|
130
|
+
yield recurveRecList(query);
|
131
|
+
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
132
|
+
setCurReqInfo({ rtc: (_j = result === null || result === void 0 ? void 0 : result.data) === null || _j === void 0 ? void 0 : _j.rtc, requestId: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.requestId });
|
133
|
+
return Object.assign(Object.assign({}, result.data), { recList: list });
|
111
134
|
}
|
112
135
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
113
136
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
@@ -118,12 +141,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
118
141
|
return result === null || result === void 0 ? void 0 : result.data;
|
119
142
|
}), [bffFetch, utmVal, maxSize, defaultSize, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, channelQueryList, isEditor]);
|
120
143
|
const loadVideos = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
121
|
-
var
|
144
|
+
var _q, _r, _s, _t;
|
122
145
|
if (rtcList.length <= 0) {
|
123
146
|
return;
|
124
147
|
}
|
125
148
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
126
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
149
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_q = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _q === void 0 ? void 0 : _q.itemId) && { productFilter: (_r = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _r === void 0 ? void 0 : _r.itemId })), (((_s = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _s === void 0 ? void 0 : _s.itemId) && { contentFilter: (_t = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _t === void 0 ? void 0 : _t.itemId })), { themeTag: themeTag.current }));
|
127
150
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
128
151
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
129
152
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
@@ -186,17 +209,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
186
209
|
return res === null || res === void 0 ? void 0 : res.success;
|
187
210
|
}), [bffFetch]);
|
188
211
|
const bffGetTagList = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
189
|
-
var
|
212
|
+
var _u, _v, _w, _x, _y;
|
190
213
|
if (!utmVal || !isShowTag)
|
191
214
|
return;
|
192
215
|
try {
|
193
|
-
const val = (
|
216
|
+
const val = (_w = (_v = (_u = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _u === void 0 ? void 0 : _u.filter((val) => {
|
194
217
|
var _a, _b;
|
195
218
|
const key = val.split('=')[0];
|
196
219
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
197
|
-
})) === null ||
|
220
|
+
})) === null || _v === void 0 ? void 0 : _v.join('&')) !== null && _w !== void 0 ? _w : '';
|
198
221
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
199
|
-
setTagList((
|
222
|
+
setTagList((_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.tags) !== null && _y !== void 0 ? _y : []);
|
200
223
|
}
|
201
224
|
catch (e) {
|
202
225
|
console.log('e', e);
|
@@ -273,7 +296,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
273
296
|
});
|
274
297
|
}, [isShowConsent]);
|
275
298
|
(0, react_1.useEffect)(() => {
|
276
|
-
if (!isInit.current)
|
299
|
+
if (!isInit.current && !isEditor)
|
277
300
|
return;
|
278
301
|
setLoading(true);
|
279
302
|
bffGetTagList();
|
@@ -285,7 +308,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
285
308
|
.finally(() => {
|
286
309
|
setLoading(false);
|
287
310
|
});
|
288
|
-
}, [
|
311
|
+
}, [bffGetTagList, isEditor, getRecommendVideos]);
|
289
312
|
const defaultLoadingImage = (0, useIconLink_1.useIconLink)('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
290
313
|
return (react_1.default.createElement(exports.SxpDataSourceContext.Provider, { value: {
|
291
314
|
rtcList,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { RecItemType } from '../components/SxpPageRender/typing';
|
2
2
|
export declare function useEventReport(): {
|
3
|
-
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number) => void;
|
3
|
+
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number, traceInfo?: string) => void;
|
4
4
|
productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
|
5
5
|
backMainFeed: (lastFeed: 'theme' | 'branch' | 'external', selectTag?: string, themeTag?: string, hashTag?: string) => void;
|
6
6
|
};
|
@@ -6,7 +6,7 @@ const useSxpDataSource_1 = require("./useSxpDataSource");
|
|
6
6
|
const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
7
7
|
function useEventReport() {
|
8
8
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = (0, useSxpDataSource_1.useSxpDataSource)();
|
9
|
-
const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position) => {
|
9
|
+
const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position, traceInfo) => {
|
10
10
|
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, _4, _5, _6, _7, _8, _9;
|
11
11
|
let fromKName = '';
|
12
12
|
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
@@ -39,7 +39,7 @@ function useEventReport() {
|
|
39
39
|
position: position + '',
|
40
40
|
contentId: (_v = (_u = data === null || data === void 0 ? void 0 : data.video) === null || _u === void 0 ? void 0 : _u.itemId) !== null && _v !== void 0 ? _v : '',
|
41
41
|
ctatId: (_w = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _w !== void 0 ? _w : '',
|
42
|
-
traceInfo: (_9 = (_6 = (_4 = (_0 = (_x = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProduct) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : (_3 = (_2 = (_1 = data === null || data === void 0 ? void 0 : data.video) === null || _1 === void 0 ? void 0 : _1.bindProducts) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_5 = data === null || data === void 0 ? void 0 : data.product) === null || _5 === void 0 ? void 0 : _5.traceInfo) !== null && _6 !== void 0 ? _6 : (_8 = (_7 = data === null || data === void 0 ? void 0 : data.video) === null || _7 === void 0 ? void 0 : _7.bindCta) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : ''
|
42
|
+
traceInfo: (_9 = (_6 = (_4 = (_0 = (_x = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProduct) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : (_3 = (_2 = (_1 = data === null || data === void 0 ? void 0 : data.video) === null || _1 === void 0 ? void 0 : _1.bindProducts) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_5 = data === null || data === void 0 ? void 0 : data.product) === null || _5 === void 0 ? void 0 : _5.traceInfo) !== null && _6 !== void 0 ? _6 : (_8 = (_7 = data === null || data === void 0 ? void 0 : data.video) === null || _7 === void 0 ? void 0 : _7.bindCta) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : ''
|
43
43
|
}
|
44
44
|
});
|
45
45
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|