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