pb-sxp-ui 1.18.0 → 1.18.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 +322 -394
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +15 -7
- package/dist/index.js +322 -394
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +322 -394
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/es/core/components/DiyPortalPreview/index.js +5 -3
- package/es/core/components/DiyStoryPreview/index.js +7 -18
- package/es/core/components/SxpPageRender/LikeButton/index.js +16 -18
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -39
- package/es/core/components/SxpPageRender/RenderCard.d.ts +0 -1
- package/es/core/components/SxpPageRender/RenderCard.js +14 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.js +45 -32
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +41 -57
- package/es/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/es/core/context/SxpDataSourceProvider.js +35 -62
- package/es/core/hooks/useEventReport.js +5 -6
- package/es/materials/sxp/consentPopup/Display/index.js +1 -1
- package/es/materials/sxp/cta/AniLinkPopup/material.js +2 -3
- package/es/materials/sxp/popup/CommodityDetail/material.js +1 -2
- package/es/materials/sxp/popup/CommodityList/index.js +4 -5
- package/es/materials/sxp/popup/CommodityList/material.js +1 -1
- package/es/materials/sxp/popup/CommodityList/settingRender.js +1 -1
- package/es/materials/sxp/template/Appoint/material.js +1 -2
- package/es/materials/sxp/template/Commodity/material.js +2 -3
- package/es/materials/sxp/template/CommodityDiro/material.js +2 -3
- package/es/materials/sxp/template/CommodityDiroNew/material.js +2 -4
- package/es/materials/sxp/template/Link/material.js +2 -4
- package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodity/material.js +1 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiro/material.js +2 -3
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +2 -4
- package/es/materials/sxp/template/NineCommodity/material.js +2 -3
- package/es/materials/sxp/template/components/CommodityGroup.js +1 -1
- package/es/materials/sxp/template/components/settingRender.js +1 -1
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/DiyPortalPreview/index.js +5 -3
- package/lib/core/components/DiyStoryPreview/index.js +7 -18
- package/lib/core/components/SxpPageRender/LikeButton/index.js +16 -18
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -38
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +0 -1
- package/lib/core/components/SxpPageRender/RenderCard.js +14 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +45 -32
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +41 -57
- package/lib/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/lib/core/context/SxpDataSourceProvider.js +35 -62
- package/lib/core/hooks/useEventReport.js +5 -6
- package/lib/materials/sxp/consentPopup/Display/index.js +1 -1
- package/lib/materials/sxp/cta/AniLinkPopup/material.js +1 -2
- package/lib/materials/sxp/popup/CommodityDetail/material.js +1 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +4 -5
- package/lib/materials/sxp/popup/CommodityList/material.js +1 -1
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +1 -1
- package/lib/materials/sxp/template/Appoint/material.js +1 -2
- package/lib/materials/sxp/template/Commodity/material.js +2 -3
- package/lib/materials/sxp/template/CommodityDiro/material.js +2 -3
- package/lib/materials/sxp/template/CommodityDiroNew/material.js +2 -4
- package/lib/materials/sxp/template/Link/material.js +2 -4
- package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodity/material.js +1 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/material.js +2 -3
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +2 -4
- package/lib/materials/sxp/template/NineCommodity/material.js +2 -3
- package/lib/materials/sxp/template/components/CommodityGroup.js +1 -1
- package/lib/materials/sxp/template/components/settingRender.js +1 -1
- package/package.json +1 -1
@@ -23,7 +23,6 @@ exports.DEFAULT_TAG = 'FOR U';
|
|
23
23
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, isDiyH5, onUpdateSchema, onUpdateChannel }) => {
|
24
24
|
var _a, _b, _c, _d, _e;
|
25
25
|
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
26
|
-
const [firstRtcList, setFirstRtcList] = (0, react_1.useState)([]);
|
27
26
|
const [tagList, setTagList] = (0, react_1.useState)([]);
|
28
27
|
const [loading, setLoading] = (0, react_1.useState)(true);
|
29
28
|
const [curReqInfo, setCurReqInfo] = (0, react_1.useState)({ rtc: '', requestId: '' });
|
@@ -54,10 +53,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
54
53
|
const [chatlabsId, setChatlabsId] = (0, react_1.useState)();
|
55
54
|
const finalPageData = (0, react_1.useMemo)(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
56
55
|
const pixelPvStatusRef = (0, react_1.useRef)(false);
|
57
|
-
const isDiyPage = (0, react_1.useMemo)(() => {
|
58
|
-
var _a, _b, _c;
|
59
|
-
return isDiyH5 && !((_c = (_b = (_a = finalPageData === null || finalPageData === void 0 ? void 0 : finalPageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig) === null || _c === void 0 ? void 0 : _c.enablePreview);
|
60
|
-
}, [isDiyH5, finalPageData]);
|
61
56
|
const isShowConsent = (0, react_1.useMemo)(() => {
|
62
57
|
var _a, _b, _c, _d;
|
63
58
|
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) &&
|
@@ -114,7 +109,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
114
109
|
return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + (0, localStore_1.storeAndLoadFeUserId)();
|
115
110
|
}, [bffDataSource]);
|
116
111
|
const bffFetch = (0, react_1.useCallback)((path, options, isBota = true) => {
|
117
|
-
var _a
|
112
|
+
var _a;
|
118
113
|
if (!bffDataSource)
|
119
114
|
return;
|
120
115
|
const url = bffDataSource.url;
|
@@ -129,9 +124,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
129
124
|
const value = val.split('=')[1];
|
130
125
|
params[key] = value;
|
131
126
|
});
|
132
|
-
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
133
127
|
return window
|
134
|
-
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId
|
128
|
+
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
|
135
129
|
? JSON.stringify({
|
136
130
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
137
131
|
})
|
@@ -352,8 +346,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
352
346
|
.catch((err) => Promise.reject(err));
|
353
347
|
}, [bffDataSource]);
|
354
348
|
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
355
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
356
|
-
query = Object.assign(Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : 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, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId })), (
|
349
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
350
|
+
query = Object.assign(Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : 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, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId })), (isDiyH5 && { type: 'story' }));
|
357
351
|
if (channel) {
|
358
352
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
359
353
|
}
|
@@ -366,10 +360,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
366
360
|
if (val)
|
367
361
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
368
362
|
}
|
369
|
-
const isDiy = isDiyH5 && ((_o = (_m = (_l = finalPageData === null || finalPageData === void 0 ? void 0 : finalPageData.data) === null || _l === void 0 ? void 0 : _l.sxpPageConf) === null || _m === void 0 ? void 0 : _m.globalConfig) === null || _o === void 0 ? void 0 : _o.enablePreview);
|
370
363
|
if (isEditor) {
|
371
364
|
let pageNum = 1;
|
372
|
-
query = Object.assign(Object.assign(Object.assign(
|
365
|
+
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] }));
|
373
366
|
if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
|
374
367
|
return undefined;
|
375
368
|
}
|
@@ -377,22 +370,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
377
370
|
let list = [];
|
378
371
|
let result = null;
|
379
372
|
const recurveRecList = (query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
380
|
-
var
|
373
|
+
var _v, _w, _x, _y, _z, _0;
|
381
374
|
query.pageNum = pageNum;
|
382
|
-
result =
|
375
|
+
result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
|
383
376
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
384
377
|
return undefined;
|
385
378
|
}
|
386
379
|
setLoading(false);
|
387
|
-
list = list.concat((
|
380
|
+
list = list.concat((_y = (_x = (_w = (_v = result === null || result === void 0 ? void 0 : result.data) === null || _v === void 0 ? void 0 : _v.recList) === null || _w === void 0 ? void 0 : _w.filter) === null || _x === void 0 ? void 0 : _x.call(_w, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _y !== void 0 ? _y : []);
|
388
381
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
389
382
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
390
383
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
391
|
-
if (isDiyPage) {
|
392
|
-
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
393
|
-
}
|
394
384
|
}
|
395
|
-
const isNotNullList = (
|
385
|
+
const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
396
386
|
if (isNotNullList) {
|
397
387
|
pageNum = pageNum + 1;
|
398
388
|
yield recurveRecList(query);
|
@@ -400,13 +390,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
400
390
|
});
|
401
391
|
yield recurveRecList(query);
|
402
392
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
403
|
-
setCurReqInfo({ rtc: (
|
393
|
+
setCurReqInfo({ rtc: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.rtc, requestId: (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.requestId });
|
404
394
|
return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
|
405
395
|
}
|
406
396
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
407
|
-
query = Object.assign(Object.assign(
|
397
|
+
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_o = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _o !== void 0 ? _o : 1 });
|
408
398
|
}
|
409
|
-
const result =
|
399
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
|
410
400
|
method: 'POST',
|
411
401
|
body: query
|
412
402
|
}));
|
@@ -416,31 +406,26 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
416
406
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
417
407
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
418
408
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
419
|
-
const isNotNullList = (
|
409
|
+
const isNotNullList = (_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.recList) === null || _q === void 0 ? void 0 : _q.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
420
410
|
if (!isNotNullList) {
|
421
411
|
setIsNoMoreData(true);
|
422
412
|
}
|
423
413
|
}
|
424
414
|
let list = [];
|
425
|
-
list = list.concat((
|
415
|
+
list = list.concat((_u = (_t = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.filter) === null || _t === void 0 ? void 0 : _t.call(_s, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _u !== void 0 ? _u : []);
|
426
416
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
427
|
-
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin
|
417
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
428
418
|
const loadVideos = (0, react_1.useCallback)((pageNum) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
429
|
-
var
|
419
|
+
var _1, _2, _3, _4;
|
430
420
|
if (rtcList.length <= 0) {
|
431
421
|
return;
|
432
422
|
}
|
433
|
-
if (isDiyPage && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
434
|
-
setRtcList(rtcList.concat(firstRtcList));
|
435
|
-
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
436
|
-
return;
|
437
|
-
}
|
438
423
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
439
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
424
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId) && { productFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _2 === void 0 ? void 0 : _2.itemId] })), (((_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId) && { contentFilter: [(_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _4 === void 0 ? void 0 : _4.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
440
425
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
441
426
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
442
427
|
return data;
|
443
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList
|
428
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
444
429
|
const refreshFeSession = (0, react_1.useCallback)((enableReSid, event) => {
|
445
430
|
var _a, _b, _c, _d, _e;
|
446
431
|
let expire = false;
|
@@ -468,9 +453,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
468
453
|
return;
|
469
454
|
}
|
470
455
|
if (!userInfo) {
|
471
|
-
userInfo = {
|
472
|
-
productUserId: fakeUserId
|
473
|
-
};
|
456
|
+
userInfo = {};
|
474
457
|
}
|
475
458
|
const sessionID = (0, sessionStore_1.storeAndLoadFeSessionId)();
|
476
459
|
const params = {};
|
@@ -503,8 +486,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
503
486
|
layoutVariantId,
|
504
487
|
globalConfig,
|
505
488
|
playbookType,
|
506
|
-
bffDataSource
|
507
|
-
fakeUserId
|
489
|
+
bffDataSource
|
508
490
|
]);
|
509
491
|
const getEventParamsByJson = (0, react_1.useCallback)((json, product) => {
|
510
492
|
var _a, _b, _c;
|
@@ -637,39 +619,37 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
637
619
|
}
|
638
620
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
639
621
|
const bffMutateLike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
640
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
641
622
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
642
623
|
return res === null || res === void 0 ? void 0 : res.success;
|
643
|
-
}), [bffFetch
|
624
|
+
}), [bffFetch]);
|
644
625
|
const bffMutateUnlike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
645
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
646
626
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
647
627
|
return res === null || res === void 0 ? void 0 : res.success;
|
648
|
-
}), [bffFetch
|
628
|
+
}), [bffFetch]);
|
649
629
|
const bffSubmitForm = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
650
630
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
651
631
|
return res === null || res === void 0 ? void 0 : res.success;
|
652
632
|
}), [bffFetch]);
|
653
633
|
const bffGetTagList = (0, react_1.useCallback)((data) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
654
|
-
var
|
655
|
-
const isShowTag = !!((
|
634
|
+
var _5, _6, _7, _8, _9, _10, _11, _12;
|
635
|
+
const isShowTag = !!((_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.data) === null || _5 === void 0 ? void 0 : _5.sxpPageConf) === null || _6 === void 0 ? void 0 : _6.globalConfig) === null || _7 === void 0 ? void 0 : _7.isShowTag);
|
656
636
|
if (!utmVal || !isShowTag)
|
657
637
|
return;
|
658
638
|
try {
|
659
|
-
const val = (
|
639
|
+
const val = (_10 = (_9 = (_8 = (0, tool_1.splitUrlParams)(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
|
660
640
|
var _a, _b;
|
661
641
|
const key = val.split('=')[0];
|
662
642
|
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);
|
663
|
-
})) === null ||
|
643
|
+
})) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
|
664
644
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
665
|
-
setTagList((
|
645
|
+
setTagList((_12 = (_11 = result === null || result === void 0 ? void 0 : result.data) === null || _11 === void 0 ? void 0 : _11.tags) !== null && _12 !== void 0 ? _12 : []);
|
666
646
|
}
|
667
647
|
catch (e) {
|
668
648
|
console.log('e', e);
|
669
649
|
}
|
670
650
|
}), [bffFetch, utmVal]);
|
671
651
|
const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position) => {
|
672
|
-
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, _10, _11
|
652
|
+
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, _10, _11;
|
673
653
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
674
654
|
const isProd = ((_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.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
|
675
655
|
let fromKName = '';
|
@@ -687,7 +667,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
687
667
|
}
|
688
668
|
const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
|
689
669
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
690
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
670
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
|
691
671
|
});
|
692
672
|
}, [bffEventReport, isFromHashtag]);
|
693
673
|
const h5EnterLink = (0, react_1.useCallback)(() => {
|
@@ -722,10 +702,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
722
702
|
});
|
723
703
|
}, [bffEventReport]);
|
724
704
|
const getAccount = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
725
|
-
var
|
705
|
+
var _13, _14;
|
726
706
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
|
727
|
-
setChatlabsId((
|
728
|
-
return ((
|
707
|
+
setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
|
708
|
+
return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
|
729
709
|
}), [bffFetch]);
|
730
710
|
const accountSonsent = (0, react_1.useCallback)((consentResult) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
731
711
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
|
@@ -789,9 +769,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
789
769
|
}
|
790
770
|
setRtcList(list);
|
791
771
|
setCacheRtcList(list);
|
792
|
-
if (isDiyPage) {
|
793
|
-
setFirstRtcList(list);
|
794
|
-
}
|
795
772
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
796
773
|
if (channel) {
|
797
774
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -811,7 +788,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
811
788
|
});
|
812
789
|
setLoading(false);
|
813
790
|
});
|
814
|
-
}, [isShowConsent, channel
|
791
|
+
}, [isShowConsent, channel]);
|
815
792
|
(0, react_1.useEffect)(() => {
|
816
793
|
if (!isPreview)
|
817
794
|
return;
|
@@ -826,15 +803,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
826
803
|
}
|
827
804
|
setRtcList(list);
|
828
805
|
setCacheRtcList(list);
|
829
|
-
if (isDiyPage) {
|
830
|
-
setFirstRtcList(list);
|
831
|
-
}
|
832
806
|
}
|
833
807
|
})
|
834
808
|
.finally(() => {
|
835
809
|
setLoading(false);
|
836
810
|
});
|
837
|
-
}, [getRecommendVideos, bffGetTagList, channel
|
811
|
+
}, [getRecommendVideos, bffGetTagList, channel]);
|
838
812
|
const defaultLoadingImage = (0, useIconLink_1.useIconLink)('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
839
813
|
return (react_1.default.createElement(exports.SxpDataSourceContext.Provider, { value: {
|
840
814
|
rtcList,
|
@@ -892,8 +866,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
892
866
|
refreshFeSession,
|
893
867
|
getAccount,
|
894
868
|
accountSonsent,
|
895
|
-
isDiyH5
|
896
|
-
firstRtcList
|
869
|
+
isDiyH5
|
897
870
|
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
|
898
871
|
rtcList,
|
899
872
|
mutateLike: bffMutateLike,
|
@@ -2,12 +2,12 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.useEventReport = void 0;
|
4
4
|
const react_1 = require("react");
|
5
|
-
const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
6
5
|
const useSxpDataSource_1 = require("./useSxpDataSource");
|
6
|
+
const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
7
7
|
function useEventReport() {
|
8
8
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = (0, useSxpDataSource_1.useSxpDataSource)();
|
9
9
|
const jumpToWeb = (0, react_1.useCallback)((e, data, product, cta, position, traceInfo) => {
|
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, _10, _11, _12, _13
|
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, _10, _11, _12, _13;
|
11
11
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
12
12
|
if (i !== -1) {
|
13
13
|
return;
|
@@ -40,11 +40,11 @@ function useEventReport() {
|
|
40
40
|
contentFormat = 'image';
|
41
41
|
}
|
42
42
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
43
|
-
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '',
|
43
|
+
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
|
44
44
|
});
|
45
45
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
46
46
|
const productView = (0, react_1.useCallback)((data, product, cta, viewTime, position) => {
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
47
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
48
48
|
let fromKName = '';
|
49
49
|
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))) {
|
50
50
|
fromKName = 'pdpPage';
|
@@ -63,9 +63,8 @@ function useEventReport() {
|
|
63
63
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
64
64
|
position: position + '',
|
65
65
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
66
|
-
sceneId: (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
67
66
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
68
|
-
traceInfo: (
|
67
|
+
traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
69
68
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
70
69
|
eventSubject: 'productView',
|
71
70
|
eventDescription: 'User browsed the product'
|
@@ -28,7 +28,7 @@ const Display = (_a) => {
|
|
28
28
|
react_1.default.createElement("span", { style: content === null || content === void 0 ? void 0 : content.style, dangerouslySetInnerHTML: {
|
29
29
|
__html: (0, tool_1.setFontForText)((_b = content === null || content === void 0 ? void 0 : content.text) === null || _b === void 0 ? void 0 : _b.replace(/\n/g, '</br>'), content === null || content === void 0 ? void 0 : content.style)
|
30
30
|
} }),
|
31
|
-
react_1.default.createElement("span", { style: Object.assign(Object.assign({}, interaction === null || interaction === void 0 ? void 0 : interaction.style), {
|
31
|
+
react_1.default.createElement("span", { style: Object.assign(Object.assign({}, interaction === null || interaction === void 0 ? void 0 : interaction.style), { marginInlineStart: '5px' }), dangerouslySetInnerHTML: {
|
32
32
|
__html: (0, tool_1.setFontForText)((_c = interaction === null || interaction === void 0 ? void 0 : interaction.text) === null || _c === void 0 ? void 0 : _c.replace(/\n/g, '</br>'), interaction === null || interaction === void 0 ? void 0 : interaction.style)
|
33
33
|
}, onClick: handleClick })),
|
34
34
|
isShowClose && (react_1.default.createElement("button", { "aria-label": 'close', className: 'consentPopupDisplay-close', onClick: handleClickClose },
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AniLinkPopup = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const settingRender_1 = tslib_1.__importDefault(require("./settingRender"));
|
6
|
+
const interactionRender_1 = tslib_1.__importDefault(require("./interactionRender"));
|
6
7
|
const _1 = tslib_1.__importDefault(require("."));
|
7
8
|
const create_1 = require("../../../../core/create");
|
8
|
-
const interactionRender_1 = tslib_1.__importDefault(require("./interactionRender"));
|
9
9
|
const AniLinkPopup = (0, create_1.createMaterial)(_1.default, {
|
10
10
|
displayName: '竖版弹窗CTA',
|
11
11
|
icon: '',
|
@@ -28,7 +28,6 @@ const AniLinkPopup = (0, create_1.createMaterial)(_1.default, {
|
|
28
28
|
title: {
|
29
29
|
fontSize: 14,
|
30
30
|
color: '#000',
|
31
|
-
textAlign: 'left',
|
32
31
|
lineHeight: 2.6
|
33
32
|
},
|
34
33
|
ctaTitle: {
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommodityDetail = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const settingRender_1 = tslib_1.__importDefault(require("./settingRender"));
|
6
|
+
const interactionRender_1 = tslib_1.__importDefault(require("./interactionRender"));
|
6
7
|
const _1 = tslib_1.__importDefault(require("."));
|
7
8
|
const create_1 = require("../../../../core/create");
|
8
|
-
const interactionRender_1 = tslib_1.__importDefault(require("./interactionRender"));
|
9
9
|
const CommodityDetail = (0, create_1.createMaterial)(_1.default, {
|
10
10
|
displayName: '商品详情',
|
11
11
|
icon: '',
|
@@ -44,7 +44,6 @@ const CommodityDetail = (0, create_1.createMaterial)(_1.default, {
|
|
44
44
|
taxInfo: {
|
45
45
|
color: '#000',
|
46
46
|
fontSize: 13,
|
47
|
-
textAlign: 'left',
|
48
47
|
marginBottom: '10px'
|
49
48
|
}
|
50
49
|
},
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
const css_1 = require("@emotion/css");
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
|
+
const lodash_1 = require("lodash");
|
7
|
+
const Img_1 = tslib_1.__importDefault(require("../../template/components/Img"));
|
6
8
|
const hooks_1 = require("../../../../core/hooks");
|
7
9
|
require("./index.less");
|
8
10
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
9
11
|
const tool_1 = require("../../../../core/utils/tool");
|
10
|
-
const Img_1 = tslib_1.__importDefault(require("../../template/components/Img"));
|
11
|
-
const lodash_1 = require("lodash");
|
12
12
|
const materials_1 = require("../../../../core/utils/materials");
|
13
13
|
const CommodityList = (_a) => {
|
14
14
|
var _b, _c, _d;
|
@@ -55,12 +55,11 @@ const CommodityList = (_a) => {
|
|
55
55
|
react_1.default.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: (0, css_1.css)({
|
56
56
|
display: 'flex',
|
57
57
|
alignItems: 'normal',
|
58
|
-
width: '100%'
|
59
|
-
textAlign: 'left'
|
58
|
+
width: '100%'
|
60
59
|
}) }, props),
|
61
60
|
react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
|
62
61
|
react_1.default.createElement("div", { style: {
|
63
|
-
width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.
|
62
|
+
width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginInlineEnd) !== null && _f !== void 0 ? _f : 0}px)`,
|
64
63
|
display: 'flex',
|
65
64
|
flexDirection: 'column',
|
66
65
|
justifyContent: 'space-between'
|
@@ -23,12 +23,11 @@ const Appoint = (0, create_1.createMaterial)(_1.default, {
|
|
23
23
|
borderRadius: 3,
|
24
24
|
width: 30,
|
25
25
|
height: 30,
|
26
|
-
|
26
|
+
marginInlineEnd: 8
|
27
27
|
},
|
28
28
|
ctaTitle: {
|
29
29
|
fontSize: 12,
|
30
30
|
color: '#fff',
|
31
|
-
textAlign: 'left',
|
32
31
|
width: 130,
|
33
32
|
height: 20
|
34
33
|
}
|
@@ -23,12 +23,11 @@ const Commodity = (0, create_1.createMaterial)(_1.default, {
|
|
23
23
|
borderRadius: 3,
|
24
24
|
width: 60,
|
25
25
|
height: 60,
|
26
|
-
|
26
|
+
marginInlineEnd: 8
|
27
27
|
},
|
28
28
|
title: {
|
29
29
|
fontSize: 12,
|
30
|
-
color: '#fff'
|
31
|
-
textAlign: 'left'
|
30
|
+
color: '#fff'
|
32
31
|
},
|
33
32
|
ctaTitle: {
|
34
33
|
fontSize: 10,
|
@@ -23,12 +23,11 @@ const CommodityDiro = (0, create_1.createMaterial)(_1.default, {
|
|
23
23
|
borderRadius: 3,
|
24
24
|
width: 60,
|
25
25
|
height: 60,
|
26
|
-
|
26
|
+
marginInlineEnd: 8
|
27
27
|
},
|
28
28
|
title: {
|
29
29
|
fontSize: 12,
|
30
|
-
color: '#000'
|
31
|
-
textAlign: 'left'
|
30
|
+
color: '#000'
|
32
31
|
},
|
33
32
|
ctaTitle: {
|
34
33
|
fontSize: 10,
|
@@ -23,19 +23,17 @@ const CommodityDiroNew = (0, create_1.createMaterial)(_1.default, {
|
|
23
23
|
borderRadius: 8,
|
24
24
|
width: 78,
|
25
25
|
height: 78,
|
26
|
-
|
26
|
+
marginInlineEnd: 16
|
27
27
|
},
|
28
28
|
title: {
|
29
29
|
fontSize: 13,
|
30
|
-
color: '#000'
|
31
|
-
textAlign: 'left'
|
30
|
+
color: '#000'
|
32
31
|
},
|
33
32
|
ctaTitle: {
|
34
33
|
textDecoration: 'underline',
|
35
34
|
fontSize: 14,
|
36
35
|
fontWeight: 'bold',
|
37
36
|
color: '#000',
|
38
|
-
textAlign: 'left',
|
39
37
|
width: 150,
|
40
38
|
height: 20
|
41
39
|
}
|
@@ -5,9 +5,9 @@ exports.Link = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
6
6
|
const settingRender_1 = tslib_1.__importDefault(require("../components/settingRender"));
|
7
7
|
const settingRender_2 = tslib_1.__importDefault(require("./settingRender"));
|
8
|
+
const interactionRender_1 = tslib_1.__importDefault(require("./interactionRender"));
|
8
9
|
const _1 = tslib_1.__importDefault(require("."));
|
9
10
|
const create_1 = require("../../../../core/create");
|
10
|
-
const interactionRender_1 = tslib_1.__importDefault(require("./interactionRender"));
|
11
11
|
const Link = (0, create_1.createMaterial)(_1.default, {
|
12
12
|
displayName: '普通CTA',
|
13
13
|
icon: '',
|
@@ -25,19 +25,17 @@ const Link = (0, create_1.createMaterial)(_1.default, {
|
|
25
25
|
borderRadius: 3,
|
26
26
|
width: 60,
|
27
27
|
height: 60,
|
28
|
-
|
28
|
+
marginInlineEnd: 8
|
29
29
|
},
|
30
30
|
ctaTitle: {
|
31
31
|
fontSize: 12,
|
32
32
|
color: '#fff',
|
33
|
-
textAlign: 'left',
|
34
33
|
width: 130,
|
35
34
|
height: 20
|
36
35
|
}
|
37
36
|
},
|
38
37
|
customTitle: {
|
39
38
|
style: {
|
40
|
-
textAlign: 'left',
|
41
39
|
textDecoration: 'underline',
|
42
40
|
fontWeight: 'bold',
|
43
41
|
width: 130,
|
@@ -6,10 +6,10 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_2 = require("swiper/react");
|
7
7
|
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
8
8
|
const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
|
9
|
+
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
9
10
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
10
11
|
const hooks_1 = require("../../../../core/hooks");
|
11
12
|
const tool_1 = require("../../../../core/utils/tool");
|
12
|
-
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
13
13
|
const MultiCommodity = (_a) => {
|
14
14
|
var _b, _c;
|
15
15
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
|
@@ -17,7 +17,7 @@ const MultiCommodity = (_a) => {
|
|
17
17
|
const [products] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
18
18
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
19
19
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
20
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, { key: itemIndex, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { flexShrink: 0,
|
20
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, { key: itemIndex, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { flexShrink: 0, marginInlineStart: 0, marginInlineEnd: '8px' })), tag: 'li', role: 'listitem' },
|
21
21
|
react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex, index: index }, props),
|
22
22
|
react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
23
23
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
@@ -23,12 +23,11 @@ const MultiCommodity = (0, create_1.createMaterial)(_1.default, {
|
|
23
23
|
borderRadius: 3,
|
24
24
|
width: 60,
|
25
25
|
height: 60,
|
26
|
-
|
26
|
+
marginInlineEnd: 8
|
27
27
|
},
|
28
28
|
title: {
|
29
29
|
fontSize: 12,
|
30
30
|
color: '#fff',
|
31
|
-
textAlign: 'left'
|
32
31
|
},
|
33
32
|
ctaTitle: {
|
34
33
|
fontSize: 10,
|