pb-sxp-ui 1.0.84 → 1.0.86
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 +37 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -28
- 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 +37 -28
- 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/Consent/index.js +1 -1
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
- package/es/core/components/SxpPageRender/index.js +11 -6
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +21 -17
- package/lib/core/components/Consent/index.js +1 -1
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
- package/lib/core/components/SxpPageRender/index.js +11 -6
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +21 -17
- package/package.json +1 -1
@@ -38,7 +38,7 @@ const Consent = ({ width = window.innerWidth, height = window.innerHeight, priva
|
|
38
38
|
eventSubject: 'userConsent',
|
39
39
|
eventDescription: '用户授权【操作结果】',
|
40
40
|
consentResult: '0',
|
41
|
-
consentTags: '[]',
|
41
|
+
consentTags: '["系统运营"]',
|
42
42
|
rtc: null,
|
43
43
|
requestId: null,
|
44
44
|
sessionID: null
|
@@ -90,7 +90,7 @@ const WaterfallFlowItem = (props) => {
|
|
90
90
|
useEffect(() => {
|
91
91
|
const height = imgInfo.height * (unitWidth / imgInfo.width);
|
92
92
|
if (isLoading) {
|
93
|
-
sizeChange(height +
|
93
|
+
sizeChange(height + 56 + space, index);
|
94
94
|
}
|
95
95
|
}, [imgInfo, index, unitWidth, isLoading, space]);
|
96
96
|
const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
|
@@ -106,9 +106,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
106
106
|
const visibleChange = () => {
|
107
107
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
108
108
|
if (document.visibilityState === 'hidden') {
|
109
|
-
|
110
|
-
|
111
|
-
|
109
|
+
if (!openHashtag) {
|
110
|
+
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
111
|
+
handleReportViewImageEnd(item);
|
112
|
+
handleReportProductView(item);
|
113
|
+
}
|
112
114
|
let fromKName = '';
|
113
115
|
if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
114
116
|
fromKName = 'pdpPage';
|
@@ -144,8 +146,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
144
146
|
}
|
145
147
|
else if (document.visibilityState === 'visible') {
|
146
148
|
handleH5EnterLink();
|
147
|
-
|
148
|
-
|
149
|
+
if (!openHashtag) {
|
150
|
+
handleViewImageStartEvent(activeIndex);
|
151
|
+
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
152
|
+
}
|
149
153
|
backMainFeed('external');
|
150
154
|
}
|
151
155
|
};
|
@@ -162,7 +166,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
162
166
|
isFromHashtag,
|
163
167
|
tempMap,
|
164
168
|
curTime,
|
165
|
-
backMainFeed
|
169
|
+
backMainFeed,
|
170
|
+
openHashtag
|
166
171
|
]);
|
167
172
|
useEffect(() => {
|
168
173
|
const initTime = () => {
|
@@ -113,6 +113,7 @@ export interface SxpDataSourceProviderProps {
|
|
113
113
|
consentHeight?: number;
|
114
114
|
isOpenConsent?: boolean;
|
115
115
|
globalConfig?: ISxpPageRenderProps['globalConfig'];
|
116
|
+
isEditor?: boolean;
|
116
117
|
}
|
117
118
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
118
119
|
export default _default;
|
@@ -15,8 +15,8 @@ var DataSourceType;
|
|
15
15
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
16
16
|
})(DataSourceType || (DataSourceType = {}));
|
17
17
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
18
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig }) => {
|
19
|
-
var _a, _b, _c
|
18
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
|
19
|
+
var _a, _b, _c;
|
20
20
|
const [rtcList, setRtcList] = useState([]);
|
21
21
|
const [tagList, setTagList] = useState([]);
|
22
22
|
const [loading, setLoading] = useState(false);
|
@@ -33,6 +33,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
33
33
|
const [videoRef, setVideoRef] = useState(null);
|
34
34
|
const themeTag = useRef();
|
35
35
|
const curTime = useRef();
|
36
|
+
const isShowConsent = useMemo(() => {
|
37
|
+
var _a, _b, _c, _d;
|
38
|
+
return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
|
39
|
+
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
|
36
40
|
useEffect(() => {
|
37
41
|
const handleChangeThemeTag = (tag) => {
|
38
42
|
themeTag.current = tag;
|
@@ -72,10 +76,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
72
76
|
.catch((err) => Promise.reject(err));
|
73
77
|
}, [bffDataSource]);
|
74
78
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
75
|
-
var
|
79
|
+
var _d, _e, _f, _g, _h;
|
76
80
|
query = {
|
77
|
-
maxSize: (
|
78
|
-
defaultSize: (
|
81
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
82
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
79
83
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
80
84
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
81
85
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -83,10 +87,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
83
87
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
84
88
|
};
|
85
89
|
if (utmVal) {
|
86
|
-
const val = (
|
90
|
+
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
87
91
|
const key = val.split('=')[0];
|
88
92
|
return UTM_KEYS.includes(key);
|
89
|
-
})) === null ||
|
93
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
90
94
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
91
95
|
}
|
92
96
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -98,7 +102,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
98
102
|
return result === null || result === void 0 ? void 0 : result.data;
|
99
103
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
100
104
|
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
101
|
-
var
|
105
|
+
var _j, _k;
|
102
106
|
if (rtcList.length <= 0) {
|
103
107
|
return;
|
104
108
|
}
|
@@ -108,8 +112,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
108
112
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
109
113
|
themeTag: themeTag.current
|
110
114
|
});
|
111
|
-
setRtcList(rtcList.concat((
|
112
|
-
setCacheRtcList(cacheRtcList.concat((
|
115
|
+
setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
|
116
|
+
setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
|
113
117
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
114
118
|
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
115
119
|
if (!enableReportEvent) {
|
@@ -167,16 +171,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
167
171
|
return res === null || res === void 0 ? void 0 : res.success;
|
168
172
|
}), [bffFetch]);
|
169
173
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
170
|
-
var
|
174
|
+
var _l, _m, _o, _p, _q;
|
171
175
|
if (!utmVal || !isShowTag)
|
172
176
|
return;
|
173
177
|
try {
|
174
|
-
const val = (
|
178
|
+
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
175
179
|
const key = val.split('=')[0];
|
176
180
|
return UTM_KEYS.includes(key);
|
177
|
-
})) === null ||
|
181
|
+
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
178
182
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
179
|
-
setTagList((
|
183
|
+
setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
|
180
184
|
}
|
181
185
|
catch (e) {
|
182
186
|
console.log('e', e);
|
@@ -230,7 +234,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
230
234
|
h5EnterLink();
|
231
235
|
}, []);
|
232
236
|
useEffect(() => {
|
233
|
-
if (
|
237
|
+
if (isShowConsent)
|
234
238
|
return;
|
235
239
|
setLoading(true);
|
236
240
|
bffGetTagList();
|
@@ -250,7 +254,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
250
254
|
setLoading(false);
|
251
255
|
isInit.current = true;
|
252
256
|
});
|
253
|
-
}, [
|
257
|
+
}, [isShowConsent]);
|
254
258
|
useEffect(() => {
|
255
259
|
if (!isInit.current)
|
256
260
|
return;
|
@@ -308,7 +312,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
308
312
|
curTime,
|
309
313
|
h5EnterLink,
|
310
314
|
themeTag
|
311
|
-
} },
|
315
|
+
} }, isShowConsent ? (React.createElement(Consent, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
|
312
316
|
rtcList,
|
313
317
|
mutateLike: bffMutateLike,
|
314
318
|
mutateUnlike: bffMutateUnlike,
|
@@ -41,7 +41,7 @@ const Consent = ({ width = window.innerWidth, height = window.innerHeight, priva
|
|
41
41
|
eventSubject: 'userConsent',
|
42
42
|
eventDescription: '用户授权【操作结果】',
|
43
43
|
consentResult: '0',
|
44
|
-
consentTags: '[]',
|
44
|
+
consentTags: '["系统运营"]',
|
45
45
|
rtc: null,
|
46
46
|
requestId: null,
|
47
47
|
sessionID: null
|
@@ -92,7 +92,7 @@ const WaterfallFlowItem = (props) => {
|
|
92
92
|
(0, react_1.useEffect)(() => {
|
93
93
|
const height = imgInfo.height * (unitWidth / imgInfo.width);
|
94
94
|
if (isLoading) {
|
95
|
-
sizeChange(height +
|
95
|
+
sizeChange(height + 56 + space, index);
|
96
96
|
}
|
97
97
|
}, [imgInfo, index, unitWidth, isLoading, space]);
|
98
98
|
const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
|
@@ -109,9 +109,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
109
109
|
const visibleChange = () => {
|
110
110
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
111
111
|
if (document.visibilityState === 'hidden') {
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
if (!openHashtag) {
|
113
|
+
event_1.default.emit(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
114
|
+
handleReportViewImageEnd(item);
|
115
|
+
handleReportProductView(item);
|
116
|
+
}
|
115
117
|
let fromKName = '';
|
116
118
|
if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
117
119
|
fromKName = 'pdpPage';
|
@@ -147,8 +149,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
147
149
|
}
|
148
150
|
else if (document.visibilityState === 'visible') {
|
149
151
|
handleH5EnterLink();
|
150
|
-
|
151
|
-
|
152
|
+
if (!openHashtag) {
|
153
|
+
handleViewImageStartEvent(activeIndex);
|
154
|
+
event_1.default.emit(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
155
|
+
}
|
152
156
|
backMainFeed('external');
|
153
157
|
}
|
154
158
|
};
|
@@ -165,7 +169,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
165
169
|
isFromHashtag,
|
166
170
|
tempMap,
|
167
171
|
curTime,
|
168
|
-
backMainFeed
|
172
|
+
backMainFeed,
|
173
|
+
openHashtag
|
169
174
|
]);
|
170
175
|
(0, react_1.useEffect)(() => {
|
171
176
|
const initTime = () => {
|
@@ -113,6 +113,7 @@ export interface SxpDataSourceProviderProps {
|
|
113
113
|
consentHeight?: number;
|
114
114
|
isOpenConsent?: boolean;
|
115
115
|
globalConfig?: ISxpPageRenderProps['globalConfig'];
|
116
|
+
isEditor?: boolean;
|
116
117
|
}
|
117
118
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
118
119
|
export default _default;
|
@@ -18,8 +18,8 @@ var DataSourceType;
|
|
18
18
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
19
19
|
})(DataSourceType || (DataSourceType = {}));
|
20
20
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
21
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig }) => {
|
22
|
-
var _a, _b, _c
|
21
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
|
22
|
+
var _a, _b, _c;
|
23
23
|
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
24
24
|
const [tagList, setTagList] = (0, react_1.useState)([]);
|
25
25
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
@@ -36,6 +36,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
36
36
|
const [videoRef, setVideoRef] = (0, react_1.useState)(null);
|
37
37
|
const themeTag = (0, react_1.useRef)();
|
38
38
|
const curTime = (0, react_1.useRef)();
|
39
|
+
const isShowConsent = (0, react_1.useMemo)(() => {
|
40
|
+
var _a, _b, _c, _d;
|
41
|
+
return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
|
42
|
+
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
|
39
43
|
(0, react_1.useEffect)(() => {
|
40
44
|
const handleChangeThemeTag = (tag) => {
|
41
45
|
themeTag.current = tag;
|
@@ -75,10 +79,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
75
79
|
.catch((err) => Promise.reject(err));
|
76
80
|
}, [bffDataSource]);
|
77
81
|
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
78
|
-
var
|
82
|
+
var _d, _e, _f, _g, _h;
|
79
83
|
query = {
|
80
|
-
maxSize: (
|
81
|
-
defaultSize: (
|
84
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
85
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
82
86
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
83
87
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
84
88
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -86,10 +90,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
86
90
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
87
91
|
};
|
88
92
|
if (utmVal) {
|
89
|
-
const val = (
|
93
|
+
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
90
94
|
const key = val.split('=')[0];
|
91
95
|
return UTM_KEYS.includes(key);
|
92
|
-
})) === null ||
|
96
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
93
97
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
94
98
|
}
|
95
99
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -101,7 +105,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
101
105
|
return result === null || result === void 0 ? void 0 : result.data;
|
102
106
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
103
107
|
const loadVideos = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
104
|
-
var
|
108
|
+
var _j, _k;
|
105
109
|
if (rtcList.length <= 0) {
|
106
110
|
return;
|
107
111
|
}
|
@@ -111,8 +115,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
111
115
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
112
116
|
themeTag: themeTag.current
|
113
117
|
});
|
114
|
-
setRtcList(rtcList.concat((
|
115
|
-
setCacheRtcList(cacheRtcList.concat((
|
118
|
+
setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
|
119
|
+
setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
|
116
120
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
117
121
|
const bffEventReport = (0, react_1.useCallback)(({ userInfo, eventInfo }) => {
|
118
122
|
if (!enableReportEvent) {
|
@@ -170,16 +174,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
170
174
|
return res === null || res === void 0 ? void 0 : res.success;
|
171
175
|
}), [bffFetch]);
|
172
176
|
const bffGetTagList = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
173
|
-
var
|
177
|
+
var _l, _m, _o, _p, _q;
|
174
178
|
if (!utmVal || !isShowTag)
|
175
179
|
return;
|
176
180
|
try {
|
177
|
-
const val = (
|
181
|
+
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
178
182
|
const key = val.split('=')[0];
|
179
183
|
return UTM_KEYS.includes(key);
|
180
|
-
})) === null ||
|
184
|
+
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
181
185
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
182
|
-
setTagList((
|
186
|
+
setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
|
183
187
|
}
|
184
188
|
catch (e) {
|
185
189
|
console.log('e', e);
|
@@ -233,7 +237,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
233
237
|
h5EnterLink();
|
234
238
|
}, []);
|
235
239
|
(0, react_1.useEffect)(() => {
|
236
|
-
if (
|
240
|
+
if (isShowConsent)
|
237
241
|
return;
|
238
242
|
setLoading(true);
|
239
243
|
bffGetTagList();
|
@@ -253,7 +257,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
253
257
|
setLoading(false);
|
254
258
|
isInit.current = true;
|
255
259
|
});
|
256
|
-
}, [
|
260
|
+
}, [isShowConsent]);
|
257
261
|
(0, react_1.useEffect)(() => {
|
258
262
|
if (!isInit.current)
|
259
263
|
return;
|
@@ -311,7 +315,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
311
315
|
curTime,
|
312
316
|
h5EnterLink,
|
313
317
|
themeTag
|
314
|
-
} },
|
318
|
+
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
|
315
319
|
rtcList,
|
316
320
|
mutateLike: bffMutateLike,
|
317
321
|
mutateUnlike: bffMutateUnlike,
|