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
package/dist/index.js
CHANGED
@@ -622,6 +622,7 @@ const DEFAULT_TAG = 'FOR U';
|
|
622
622
|
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 }) => {
|
623
623
|
var _a, _b, _c, _d, _e;
|
624
624
|
const [rtcList, setRtcList] = useState([]);
|
625
|
+
const [firstRtcList, setFirstRtcList] = useState([]);
|
625
626
|
const [tagList, setTagList] = useState([]);
|
626
627
|
const [loading, setLoading] = useState(true);
|
627
628
|
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
@@ -653,6 +654,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
653
654
|
const [chatlabsId, setChatlabsId] = useState();
|
654
655
|
const finalPageData = useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
655
656
|
const pixelPvStatusRef = useRef(false);
|
657
|
+
const isDiyPage = useMemo(() => {
|
658
|
+
var _a, _b, _c;
|
659
|
+
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);
|
660
|
+
}, [isDiyH5, finalPageData]);
|
656
661
|
const isShowConsent = useMemo(() => {
|
657
662
|
var _a, _b, _c, _d;
|
658
663
|
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) &&
|
@@ -715,7 +720,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
715
720
|
}, [bffDataSource]);
|
716
721
|
// bff API 请求方法
|
717
722
|
const bffFetch = useCallback((path, options, isBota = true) => {
|
718
|
-
var _a;
|
723
|
+
var _a, _b;
|
719
724
|
if (!bffDataSource)
|
720
725
|
return;
|
721
726
|
const url = bffDataSource.url;
|
@@ -728,8 +733,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
728
733
|
val.split('=')[0];
|
729
734
|
val.split('=')[1];
|
730
735
|
});
|
736
|
+
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
731
737
|
return window
|
732
|
-
.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
|
738
|
+
.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
|
733
739
|
? JSON.stringify({
|
734
740
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
735
741
|
})
|
@@ -969,8 +975,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
969
975
|
}, [bffDataSource]);
|
970
976
|
// 获取推荐视频数据
|
971
977
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
972
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
973
|
-
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 })), (
|
978
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
979
|
+
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' }));
|
974
980
|
if (channel) {
|
975
981
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
976
982
|
}
|
@@ -983,9 +989,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
983
989
|
if (val)
|
984
990
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
985
991
|
}
|
992
|
+
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);
|
986
993
|
if (isEditor) {
|
987
994
|
let pageNum = 1;
|
988
|
-
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] }));
|
995
|
+
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 }));
|
989
996
|
if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
|
990
997
|
return undefined;
|
991
998
|
}
|
@@ -993,19 +1000,22 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
993
1000
|
let list = [];
|
994
1001
|
let result = null;
|
995
1002
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
996
|
-
var
|
1003
|
+
var _y, _z, _0, _1, _2, _3;
|
997
1004
|
query.pageNum = pageNum;
|
998
|
-
result = yield (
|
1005
|
+
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 }));
|
999
1006
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
1000
1007
|
return undefined;
|
1001
1008
|
}
|
1002
1009
|
setLoading(false);
|
1003
|
-
list = list.concat((
|
1010
|
+
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 : []);
|
1004
1011
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
1005
1012
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1006
1013
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1014
|
+
if (isDiyPage) {
|
1015
|
+
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1016
|
+
}
|
1007
1017
|
}
|
1008
|
-
const isNotNullList = (
|
1018
|
+
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));
|
1009
1019
|
if (isNotNullList) {
|
1010
1020
|
pageNum = pageNum + 1;
|
1011
1021
|
yield recurveRecList(query);
|
@@ -1013,13 +1023,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1013
1023
|
});
|
1014
1024
|
yield recurveRecList(query);
|
1015
1025
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
1016
|
-
setCurReqInfo({ rtc: (
|
1026
|
+
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 });
|
1017
1027
|
return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
|
1018
1028
|
}
|
1019
1029
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
1020
|
-
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (
|
1030
|
+
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 }));
|
1021
1031
|
}
|
1022
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
|
1032
|
+
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', {
|
1023
1033
|
method: 'POST',
|
1024
1034
|
body: query
|
1025
1035
|
}));
|
@@ -1029,26 +1039,31 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1029
1039
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
1030
1040
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
1031
1041
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
1032
|
-
const isNotNullList = (
|
1042
|
+
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));
|
1033
1043
|
if (!isNotNullList) {
|
1034
1044
|
setIsNoMoreData(true);
|
1035
1045
|
}
|
1036
1046
|
}
|
1037
1047
|
let list = [];
|
1038
|
-
list = list.concat((
|
1048
|
+
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 : []);
|
1039
1049
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
1040
|
-
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
1050
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin, isDiyPage, finalPageData, isDiyH5]);
|
1041
1051
|
const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
1042
|
-
var
|
1052
|
+
var _4, _5, _6, _7;
|
1043
1053
|
if (rtcList.length <= 0) {
|
1044
1054
|
return;
|
1045
1055
|
}
|
1056
|
+
if (isDiyPage && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
1057
|
+
setRtcList(rtcList.concat(firstRtcList));
|
1058
|
+
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
1059
|
+
return;
|
1060
|
+
}
|
1046
1061
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
1047
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
1062
|
+
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 })));
|
1048
1063
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
1049
1064
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
1050
1065
|
return data;
|
1051
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
1066
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyPage, firstRtcList]);
|
1052
1067
|
const refreshFeSession = useCallback((enableReSid, event) => {
|
1053
1068
|
var _a, _b, _c, _d, _e;
|
1054
1069
|
let expire = false;
|
@@ -1079,8 +1094,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1079
1094
|
// 用户信息都是公共的
|
1080
1095
|
if (!userInfo) {
|
1081
1096
|
userInfo = {
|
1082
|
-
|
1083
|
-
|
1097
|
+
productUserId: fakeUserId // 后端逻辑会从请求头获取,所以不需要传
|
1098
|
+
// tpChannelId: 'H5' // 后端处理
|
1084
1099
|
};
|
1085
1100
|
}
|
1086
1101
|
const sessionID = storeAndLoadFeSessionId();
|
@@ -1114,7 +1129,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1114
1129
|
layoutVariantId,
|
1115
1130
|
globalConfig,
|
1116
1131
|
playbookType,
|
1117
|
-
bffDataSource
|
1132
|
+
bffDataSource,
|
1133
|
+
fakeUserId
|
1118
1134
|
]);
|
1119
1135
|
const getEventParamsByJson = useCallback((json, product) => {
|
1120
1136
|
var _a, _b, _c;
|
@@ -1247,38 +1263,40 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1247
1263
|
}
|
1248
1264
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
1249
1265
|
const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1266
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1250
1267
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
1251
1268
|
return res === null || res === void 0 ? void 0 : res.success;
|
1252
|
-
}), [bffFetch]);
|
1269
|
+
}), [bffFetch, fakeUserId]);
|
1253
1270
|
const bffMutateUnlike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1271
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1254
1272
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
1255
1273
|
return res === null || res === void 0 ? void 0 : res.success;
|
1256
|
-
}), [bffFetch]);
|
1274
|
+
}), [bffFetch, fakeUserId]);
|
1257
1275
|
const bffSubmitForm = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1258
1276
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
1259
1277
|
return res === null || res === void 0 ? void 0 : res.success;
|
1260
1278
|
}), [bffFetch]);
|
1261
1279
|
// 获取 Tag
|
1262
1280
|
const bffGetTagList = useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
|
1263
|
-
var
|
1264
|
-
const isShowTag = !!((
|
1281
|
+
var _8, _9, _10, _11, _12, _13, _14, _15;
|
1282
|
+
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);
|
1265
1283
|
if (!utmVal || !isShowTag)
|
1266
1284
|
return;
|
1267
1285
|
try {
|
1268
|
-
const val = (
|
1286
|
+
const val = (_13 = (_12 = (_11 = splitUrlParams(utmVal)) === null || _11 === void 0 ? void 0 : _11.filter((val) => {
|
1269
1287
|
var _a, _b;
|
1270
1288
|
const key = val.split('=')[0];
|
1271
1289
|
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);
|
1272
|
-
})) === null ||
|
1290
|
+
})) === null || _12 === void 0 ? void 0 : _12.join('&')) !== null && _13 !== void 0 ? _13 : '';
|
1273
1291
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
1274
|
-
setTagList((
|
1292
|
+
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 : []);
|
1275
1293
|
}
|
1276
1294
|
catch (e) {
|
1277
1295
|
console.log('e', e);
|
1278
1296
|
}
|
1279
1297
|
}), [bffFetch, utmVal]);
|
1280
1298
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
1281
|
-
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;
|
1299
|
+
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;
|
1282
1300
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1283
1301
|
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);
|
1284
1302
|
let fromKName = '';
|
@@ -1296,7 +1314,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1296
1314
|
}
|
1297
1315
|
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;
|
1298
1316
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1299
|
-
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: (
|
1317
|
+
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 })
|
1300
1318
|
});
|
1301
1319
|
}, [bffEventReport, isFromHashtag]);
|
1302
1320
|
const h5EnterLink = useCallback(() => {
|
@@ -1331,10 +1349,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1331
1349
|
});
|
1332
1350
|
}, [bffEventReport]);
|
1333
1351
|
const getAccount = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
1334
|
-
var
|
1352
|
+
var _16, _17;
|
1335
1353
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
|
1336
|
-
setChatlabsId((
|
1337
|
-
return ((
|
1354
|
+
setChatlabsId((_16 = res === null || res === void 0 ? void 0 : res.data) === null || _16 === void 0 ? void 0 : _16.chatLabsId);
|
1355
|
+
return ((_17 = res === null || res === void 0 ? void 0 : res.data) === null || _17 === void 0 ? void 0 : _17.consentResult) === 'true';
|
1338
1356
|
}), [bffFetch]);
|
1339
1357
|
const accountSonsent = useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
|
1340
1358
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
|
@@ -1398,6 +1416,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1398
1416
|
}
|
1399
1417
|
setRtcList(list);
|
1400
1418
|
setCacheRtcList(list);
|
1419
|
+
if (isDiyPage) {
|
1420
|
+
setFirstRtcList(list);
|
1421
|
+
}
|
1401
1422
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1402
1423
|
if (channel) {
|
1403
1424
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1417,7 +1438,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1417
1438
|
});
|
1418
1439
|
setLoading(false);
|
1419
1440
|
});
|
1420
|
-
}, [isShowConsent, channel]);
|
1441
|
+
}, [isShowConsent, channel, isDiyPage]);
|
1421
1442
|
// cms预览
|
1422
1443
|
useEffect(() => {
|
1423
1444
|
if (!isPreview)
|
@@ -1433,12 +1454,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1433
1454
|
}
|
1434
1455
|
setRtcList(list);
|
1435
1456
|
setCacheRtcList(list);
|
1457
|
+
if (isDiyPage) {
|
1458
|
+
setFirstRtcList(list);
|
1459
|
+
}
|
1436
1460
|
}
|
1437
1461
|
})
|
1438
1462
|
.finally(() => {
|
1439
1463
|
setLoading(false);
|
1440
1464
|
});
|
1441
|
-
}, [getRecommendVideos, bffGetTagList, channel]);
|
1465
|
+
}, [getRecommendVideos, bffGetTagList, channel, isDiyPage]);
|
1442
1466
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
1443
1467
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
1444
1468
|
rtcList,
|
@@ -1496,7 +1520,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1496
1520
|
refreshFeSession,
|
1497
1521
|
getAccount,
|
1498
1522
|
accountSonsent,
|
1499
|
-
isDiyH5
|
1523
|
+
isDiyH5: isDiyPage,
|
1524
|
+
firstRtcList
|
1500
1525
|
} }, isShowConsent ? (React.createElement(Consent$4, 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({
|
1501
1526
|
rtcList,
|
1502
1527
|
mutateLike: bffMutateLike,
|
@@ -1957,14 +1982,14 @@ var settingRender$f = [
|
|
1957
1982
|
* @Author: binruan@chatlabs.com
|
1958
1983
|
* @Date: 2024-03-12 10:59:06
|
1959
1984
|
* @LastEditors: binruan@chatlabs.com
|
1960
|
-
* @LastEditTime:
|
1985
|
+
* @LastEditTime: 2025-05-09 15:30:59
|
1961
1986
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1962
1987
|
*
|
1963
1988
|
*/
|
1964
1989
|
function useEventReport() {
|
1965
1990
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1966
1991
|
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
1967
|
-
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;
|
1992
|
+
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;
|
1968
1993
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1969
1994
|
if (i !== -1) {
|
1970
1995
|
return;
|
@@ -1997,11 +2022,11 @@ function useEventReport() {
|
|
1997
2022
|
contentFormat = 'image';
|
1998
2023
|
}
|
1999
2024
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
2000
|
-
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 : '',
|
2025
|
+
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 }))
|
2001
2026
|
});
|
2002
2027
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
2003
2028
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
2004
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
2029
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
2005
2030
|
let fromKName = '';
|
2006
2031
|
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))) {
|
2007
2032
|
fromKName = 'pdpPage';
|
@@ -2020,8 +2045,9 @@ function useEventReport() {
|
|
2020
2045
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
2021
2046
|
position: position + '',
|
2022
2047
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
2048
|
+
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 : '',
|
2023
2049
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
2024
|
-
traceInfo: (
|
2050
|
+
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 : '',
|
2025
2051
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
2026
2052
|
eventSubject: 'productView',
|
2027
2053
|
eventDescription: 'User browsed the product'
|
@@ -2617,35 +2643,6 @@ var settingRender$e = [
|
|
2617
2643
|
}
|
2618
2644
|
];
|
2619
2645
|
|
2620
|
-
/*
|
2621
|
-
* @Author: binruan@chatlabs.com
|
2622
|
-
* @Date: 2024-07-09 14:35:10
|
2623
|
-
* @LastEditors: binruan@chatlabs.com
|
2624
|
-
* @LastEditTime: 2024-07-12 17:53:02
|
2625
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\interactionRender.tsx
|
2626
|
-
*
|
2627
|
-
*/
|
2628
|
-
/*
|
2629
|
-
* @Author: binruan@chatlabs.com
|
2630
|
-
* @Date: 2024-07-05 14:08:41
|
2631
|
-
* @LastEditors: binruan@chatlabs.com
|
2632
|
-
* @LastEditTime: 2024-07-09 14:34:49
|
2633
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
|
2634
|
-
*
|
2635
|
-
*/
|
2636
|
-
var interactionRender$g = [
|
2637
|
-
{
|
2638
|
-
title: '滑动事件',
|
2639
|
-
child: [
|
2640
|
-
{
|
2641
|
-
type: 'Switch',
|
2642
|
-
label: '滑动铺满全屏',
|
2643
|
-
name: ['isScrollFullScreen']
|
2644
|
-
}
|
2645
|
-
]
|
2646
|
-
}
|
2647
|
-
];
|
2648
|
-
|
2649
2646
|
/**
|
2650
2647
|
* SSR Window 4.0.2
|
2651
2648
|
* Better handling for window object in SSR environment
|
@@ -10224,7 +10221,7 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
|
|
10224
10221
|
return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css({
|
10225
10222
|
width: '50px',
|
10226
10223
|
height: '50px',
|
10227
|
-
|
10224
|
+
marginRight: '10px'
|
10228
10225
|
}), onClick: () => {
|
10229
10226
|
handleClick(item, index);
|
10230
10227
|
}, key: index },
|
@@ -10478,7 +10475,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
10478
10475
|
display: '-webkit-box',
|
10479
10476
|
WebkitBoxOrient: 'vertical'
|
10480
10477
|
})), { wordBreak: 'break-word', textRendering: 'geometricPrecision', fontKerning: 'none', textSizeAdjust: '100%', boxSizing: 'border-box', contain: 'content' }), dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
|
10481
|
-
React.createElement("div", { ref: realRef, style: {
|
10478
|
+
isPost && (React.createElement("div", { ref: realRef, style: {
|
10482
10479
|
wordBreak: 'break-word',
|
10483
10480
|
textRendering: 'geometricPrecision',
|
10484
10481
|
fontKerning: 'none',
|
@@ -10490,7 +10487,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
10490
10487
|
clipPath: 'inset(100%)',
|
10491
10488
|
transform: 'translateX(-9999px)'
|
10492
10489
|
// position: 'absolute'
|
10493
|
-
}, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
|
10490
|
+
}, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } })),
|
10494
10491
|
text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
|
10495
10492
|
__html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', textStyle)
|
10496
10493
|
} }))));
|
@@ -10823,6 +10820,35 @@ const CommodityDetail$1 = (_a) => {
|
|
10823
10820
|
};
|
10824
10821
|
var CommodityDetailComponent = memo(CommodityDetail$1);
|
10825
10822
|
|
10823
|
+
/*
|
10824
|
+
* @Author: binruan@chatlabs.com
|
10825
|
+
* @Date: 2024-07-09 14:35:10
|
10826
|
+
* @LastEditors: binruan@chatlabs.com
|
10827
|
+
* @LastEditTime: 2024-07-12 17:53:02
|
10828
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\interactionRender.tsx
|
10829
|
+
*
|
10830
|
+
*/
|
10831
|
+
/*
|
10832
|
+
* @Author: binruan@chatlabs.com
|
10833
|
+
* @Date: 2024-07-05 14:08:41
|
10834
|
+
* @LastEditors: binruan@chatlabs.com
|
10835
|
+
* @LastEditTime: 2024-07-09 14:34:49
|
10836
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
|
10837
|
+
*
|
10838
|
+
*/
|
10839
|
+
var interactionRender$g = [
|
10840
|
+
{
|
10841
|
+
title: '滑动事件',
|
10842
|
+
child: [
|
10843
|
+
{
|
10844
|
+
type: 'Switch',
|
10845
|
+
label: '滑动铺满全屏',
|
10846
|
+
name: ['isScrollFullScreen']
|
10847
|
+
}
|
10848
|
+
]
|
10849
|
+
}
|
10850
|
+
];
|
10851
|
+
|
10826
10852
|
/*
|
10827
10853
|
* @Author: binruan@chatlabs.com
|
10828
10854
|
* @Date: 2023-07-28 18:29:57
|
@@ -10869,6 +10895,7 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
|
10869
10895
|
taxInfo: {
|
10870
10896
|
color: '#000',
|
10871
10897
|
fontSize: 13,
|
10898
|
+
textAlign: 'left',
|
10872
10899
|
marginBottom: '10px'
|
10873
10900
|
}
|
10874
10901
|
},
|
@@ -11960,7 +11987,7 @@ var settingRender$b = [
|
|
11960
11987
|
type: 'Number',
|
11961
11988
|
label: '与右侧边距',
|
11962
11989
|
addonAfter: 'px',
|
11963
|
-
name: ['props', 'commodityPicture', '
|
11990
|
+
name: ['props', 'commodityPicture', 'marginRight']
|
11964
11991
|
},
|
11965
11992
|
{
|
11966
11993
|
label: '居中垂直偏移',
|
@@ -12246,11 +12273,12 @@ const CommodityList$1 = (_a) => {
|
|
12246
12273
|
React.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: css({
|
12247
12274
|
display: 'flex',
|
12248
12275
|
alignItems: 'normal',
|
12249
|
-
width: '100%'
|
12276
|
+
width: '100%',
|
12277
|
+
textAlign: 'left'
|
12250
12278
|
}) }, props),
|
12251
12279
|
React.createElement(Img$1, { 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 }),
|
12252
12280
|
React.createElement("div", { style: {
|
12253
|
-
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.
|
12281
|
+
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)`,
|
12254
12282
|
display: 'flex',
|
12255
12283
|
flexDirection: 'column',
|
12256
12284
|
justifyContent: 'space-between'
|
@@ -12331,7 +12359,7 @@ const CommodityList = createMaterial(CommodityListComponent, {
|
|
12331
12359
|
commodityPicture: {
|
12332
12360
|
width: 100,
|
12333
12361
|
height: 100,
|
12334
|
-
|
12362
|
+
marginRight: 10
|
12335
12363
|
},
|
12336
12364
|
commodityStyles: {
|
12337
12365
|
price: {
|
@@ -12577,7 +12605,7 @@ var settingRender$8 = [
|
|
12577
12605
|
type: 'Number',
|
12578
12606
|
label: '与右侧边距',
|
12579
12607
|
addonAfter: 'px',
|
12580
|
-
name: ['props', 'ctaTempStyles', 'img', '
|
12608
|
+
name: ['props', 'ctaTempStyles', 'img', 'marginRight']
|
12581
12609
|
},
|
12582
12610
|
{
|
12583
12611
|
label: '居中垂直偏移',
|
@@ -12838,11 +12866,12 @@ const Commodity = createMaterial(CommodityComponent, {
|
|
12838
12866
|
borderRadius: 3,
|
12839
12867
|
width: 60,
|
12840
12868
|
height: 60,
|
12841
|
-
|
12869
|
+
marginRight: 8
|
12842
12870
|
},
|
12843
12871
|
title: {
|
12844
12872
|
fontSize: 12,
|
12845
|
-
color: '#fff'
|
12873
|
+
color: '#fff',
|
12874
|
+
textAlign: 'left'
|
12846
12875
|
},
|
12847
12876
|
ctaTitle: {
|
12848
12877
|
fontSize: 10,
|
@@ -12920,11 +12949,12 @@ const Appoint = createMaterial(AppointComponent, {
|
|
12920
12949
|
borderRadius: 3,
|
12921
12950
|
width: 30,
|
12922
12951
|
height: 30,
|
12923
|
-
|
12952
|
+
marginRight: 8
|
12924
12953
|
},
|
12925
12954
|
ctaTitle: {
|
12926
12955
|
fontSize: 12,
|
12927
12956
|
color: '#fff',
|
12957
|
+
textAlign: 'left',
|
12928
12958
|
width: 130,
|
12929
12959
|
height: 20
|
12930
12960
|
}
|
@@ -13060,27 +13090,6 @@ var linkSettingRender = [
|
|
13060
13090
|
}
|
13061
13091
|
];
|
13062
13092
|
|
13063
|
-
/*
|
13064
|
-
* @Author: binruan@chatlabs.com
|
13065
|
-
* @Date: 2024-08-09 16:59:38
|
13066
|
-
* @LastEditors: binruan@chatlabs.com
|
13067
|
-
* @LastEditTime: 2024-09-09 13:59:50
|
13068
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Link\interactionRender.tsx
|
13069
|
-
*
|
13070
|
-
*/
|
13071
|
-
var interactionRender$a = [
|
13072
|
-
{
|
13073
|
-
title: '点击事件',
|
13074
|
-
child: [
|
13075
|
-
{
|
13076
|
-
type: 'link',
|
13077
|
-
name: 'onClick',
|
13078
|
-
hiddenUrl: true
|
13079
|
-
}
|
13080
|
-
]
|
13081
|
-
}
|
13082
|
-
];
|
13083
|
-
|
13084
13093
|
var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU","one-line-ellipsis":"index-module_one-line-ellipsis__buFw1"};
|
13085
13094
|
|
13086
13095
|
const Link$1 = (_a) => {
|
@@ -13108,6 +13117,27 @@ const Link$1 = (_a) => {
|
|
13108
13117
|
};
|
13109
13118
|
var LinkComponent = memo(Link$1);
|
13110
13119
|
|
13120
|
+
/*
|
13121
|
+
* @Author: binruan@chatlabs.com
|
13122
|
+
* @Date: 2024-08-09 16:59:38
|
13123
|
+
* @LastEditors: binruan@chatlabs.com
|
13124
|
+
* @LastEditTime: 2024-09-09 13:59:50
|
13125
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Link\interactionRender.tsx
|
13126
|
+
*
|
13127
|
+
*/
|
13128
|
+
var interactionRender$a = [
|
13129
|
+
{
|
13130
|
+
title: '点击事件',
|
13131
|
+
child: [
|
13132
|
+
{
|
13133
|
+
type: 'link',
|
13134
|
+
name: 'onClick',
|
13135
|
+
hiddenUrl: true
|
13136
|
+
}
|
13137
|
+
]
|
13138
|
+
}
|
13139
|
+
];
|
13140
|
+
|
13111
13141
|
var _a;
|
13112
13142
|
const Link = createMaterial(LinkComponent, {
|
13113
13143
|
displayName: '普通CTA',
|
@@ -13126,17 +13156,19 @@ const Link = createMaterial(LinkComponent, {
|
|
13126
13156
|
borderRadius: 3,
|
13127
13157
|
width: 60,
|
13128
13158
|
height: 60,
|
13129
|
-
|
13159
|
+
marginRight: 8
|
13130
13160
|
},
|
13131
13161
|
ctaTitle: {
|
13132
13162
|
fontSize: 12,
|
13133
13163
|
color: '#fff',
|
13164
|
+
textAlign: 'left',
|
13134
13165
|
width: 130,
|
13135
13166
|
height: 20
|
13136
13167
|
}
|
13137
13168
|
},
|
13138
13169
|
customTitle: {
|
13139
13170
|
style: {
|
13171
|
+
textAlign: 'left',
|
13140
13172
|
textDecoration: 'underline',
|
13141
13173
|
fontWeight: 'bold',
|
13142
13174
|
width: 130,
|
@@ -13226,11 +13258,12 @@ const CommodityDiro = createMaterial(CommodityDiroComponent, {
|
|
13226
13258
|
borderRadius: 3,
|
13227
13259
|
width: 60,
|
13228
13260
|
height: 60,
|
13229
|
-
|
13261
|
+
marginRight: 8
|
13230
13262
|
},
|
13231
13263
|
title: {
|
13232
13264
|
fontSize: 12,
|
13233
|
-
color: '#000'
|
13265
|
+
color: '#000',
|
13266
|
+
textAlign: 'left'
|
13234
13267
|
},
|
13235
13268
|
ctaTitle: {
|
13236
13269
|
fontSize: 10,
|
@@ -13321,17 +13354,19 @@ const CommodityDiroNew = createMaterial(CommodityDiroNewComponent, {
|
|
13321
13354
|
borderRadius: 8,
|
13322
13355
|
width: 78,
|
13323
13356
|
height: 78,
|
13324
|
-
|
13357
|
+
marginRight: 16
|
13325
13358
|
},
|
13326
13359
|
title: {
|
13327
13360
|
fontSize: 13,
|
13328
|
-
color: '#000'
|
13361
|
+
color: '#000',
|
13362
|
+
textAlign: 'left'
|
13329
13363
|
},
|
13330
13364
|
ctaTitle: {
|
13331
13365
|
textDecoration: 'underline',
|
13332
13366
|
fontSize: 14,
|
13333
13367
|
fontWeight: 'bold',
|
13334
13368
|
color: '#000',
|
13369
|
+
textAlign: 'left',
|
13335
13370
|
width: 150,
|
13336
13371
|
height: 20
|
13337
13372
|
}
|
@@ -13373,7 +13408,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
13373
13408
|
const [products] = 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]);
|
13374
13409
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
13375
13410
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13376
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0,
|
13411
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
13377
13412
|
React.createElement(EventProvider$1, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex, index: index }, props),
|
13378
13413
|
React.createElement(Img$1, { 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 }),
|
13379
13414
|
React.createElement("div", { className: css({
|
@@ -13419,11 +13454,12 @@ const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
|
|
13419
13454
|
borderRadius: 3,
|
13420
13455
|
width: 60,
|
13421
13456
|
height: 60,
|
13422
|
-
|
13457
|
+
marginRight: 8
|
13423
13458
|
},
|
13424
13459
|
title: {
|
13425
13460
|
fontSize: 12,
|
13426
|
-
color: '#000'
|
13461
|
+
color: '#000',
|
13462
|
+
textAlign: 'left'
|
13427
13463
|
},
|
13428
13464
|
ctaTitle: {
|
13429
13465
|
fontSize: 10,
|
@@ -13471,7 +13507,7 @@ const MultiCommodity$1 = (_a) => {
|
|
13471
13507
|
const [products] = 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]);
|
13472
13508
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
13473
13509
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13474
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0,
|
13510
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
13475
13511
|
React.createElement(EventProvider$1, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex, index: index }, props),
|
13476
13512
|
React.createElement(Img$1, { 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 }),
|
13477
13513
|
React.createElement("div", { className: css({
|
@@ -13517,11 +13553,12 @@ const MultiCommodity = createMaterial(MultiCommodityComponent, {
|
|
13517
13553
|
borderRadius: 3,
|
13518
13554
|
width: 60,
|
13519
13555
|
height: 60,
|
13520
|
-
|
13556
|
+
marginRight: 8
|
13521
13557
|
},
|
13522
13558
|
title: {
|
13523
13559
|
fontSize: 12,
|
13524
13560
|
color: '#fff',
|
13561
|
+
textAlign: 'left'
|
13525
13562
|
},
|
13526
13563
|
ctaTitle: {
|
13527
13564
|
fontSize: 10,
|
@@ -13577,7 +13614,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
13577
13614
|
const [products] = 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]);
|
13578
13615
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
13579
13616
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
13580
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0,
|
13617
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
13581
13618
|
React.createElement(EventProvider$1, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex, index: index }, props),
|
13582
13619
|
React.createElement(Img$1, { 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 }),
|
13583
13620
|
React.createElement("div", { className: css({
|
@@ -13624,17 +13661,19 @@ const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
|
|
13624
13661
|
borderRadius: 8,
|
13625
13662
|
width: 78,
|
13626
13663
|
height: 78,
|
13627
|
-
|
13664
|
+
marginRight: 16
|
13628
13665
|
},
|
13629
13666
|
title: {
|
13630
13667
|
fontSize: 12,
|
13631
|
-
color: '#000'
|
13668
|
+
color: '#000',
|
13669
|
+
textAlign: 'left'
|
13632
13670
|
},
|
13633
13671
|
ctaTitle: {
|
13634
13672
|
textDecoration: 'underline',
|
13635
13673
|
fontSize: 12,
|
13636
13674
|
fontWeight: 'bold',
|
13637
13675
|
color: '#000',
|
13676
|
+
textAlign: 'left',
|
13638
13677
|
width: 150,
|
13639
13678
|
height: 20
|
13640
13679
|
}
|
@@ -13729,11 +13768,12 @@ const NineCommodity = createMaterial(NineCommodityComponent, {
|
|
13729
13768
|
borderRadius: 3,
|
13730
13769
|
width: 60,
|
13731
13770
|
height: 60,
|
13732
|
-
|
13771
|
+
marginRight: 8
|
13733
13772
|
},
|
13734
13773
|
title: {
|
13735
13774
|
fontSize: 12,
|
13736
|
-
color: '#fff'
|
13775
|
+
color: '#fff',
|
13776
|
+
textAlign: 'left'
|
13737
13777
|
},
|
13738
13778
|
ctaTitle: {
|
13739
13779
|
fontSize: 10,
|
@@ -15822,7 +15862,7 @@ function WaterfallList(_a) {
|
|
15822
15862
|
* @Author: binruan@chatlabs.com
|
15823
15863
|
* @Date: 2024-01-10 10:58:24
|
15824
15864
|
* @LastEditors: binruan@chatlabs.com
|
15825
|
-
* @LastEditTime: 2025-
|
15865
|
+
* @LastEditTime: 2025-05-09 15:30:41
|
15826
15866
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15827
15867
|
*
|
15828
15868
|
*/
|
@@ -15860,7 +15900,7 @@ const WaterFall = (props) => {
|
|
15860
15900
|
}
|
15861
15901
|
}, [waterFallData]);
|
15862
15902
|
const reportTagsView = useCallback(() => {
|
15863
|
-
var _a, _b, _c, _d, _e, _f;
|
15903
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15864
15904
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15865
15905
|
if (!rec)
|
15866
15906
|
return;
|
@@ -15880,9 +15920,10 @@ const WaterFall = (props) => {
|
|
15880
15920
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15881
15921
|
eventInfo: {
|
15882
15922
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15923
|
+
sceneId: (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
15883
15924
|
position: cacheActiveIndex + '',
|
15884
|
-
contentTags: JSON.stringify((
|
15885
|
-
traceInfo: (
|
15925
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
15926
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
15886
15927
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15887
15928
|
fromKName,
|
15888
15929
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -16653,60 +16694,6 @@ var settingRender$4 = [
|
|
16653
16694
|
}
|
16654
16695
|
];
|
16655
16696
|
|
16656
|
-
/*
|
16657
|
-
* @Author: binruan@chatlabs.com
|
16658
|
-
* @Date: 2024-07-24 14:58:40
|
16659
|
-
* @LastEditors: binruan@chatlabs.com
|
16660
|
-
* @LastEditTime: 2024-09-09 13:54:35
|
16661
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\interactionRender.tsx
|
16662
|
-
*
|
16663
|
-
*/
|
16664
|
-
var interactionRender$2 = [
|
16665
|
-
{
|
16666
|
-
title: '点击事件',
|
16667
|
-
child: [
|
16668
|
-
{
|
16669
|
-
type: 'link',
|
16670
|
-
name: 'onClick',
|
16671
|
-
hiddenUrl: true
|
16672
|
-
}
|
16673
|
-
]
|
16674
|
-
},
|
16675
|
-
{
|
16676
|
-
title: '动画效果',
|
16677
|
-
child: [
|
16678
|
-
{
|
16679
|
-
type: 'Select',
|
16680
|
-
name: ['animation', 'name'],
|
16681
|
-
label: '动画',
|
16682
|
-
options: [
|
16683
|
-
{
|
16684
|
-
label: '默认',
|
16685
|
-
value: 1
|
16686
|
-
}
|
16687
|
-
],
|
16688
|
-
fieldProps: {
|
16689
|
-
style: {
|
16690
|
-
width: '100%'
|
16691
|
-
}
|
16692
|
-
}
|
16693
|
-
},
|
16694
|
-
{
|
16695
|
-
type: 'Number',
|
16696
|
-
label: '动画启动时间',
|
16697
|
-
name: ['animation', 'delay'],
|
16698
|
-
addonAfter: 'ms'
|
16699
|
-
},
|
16700
|
-
{
|
16701
|
-
type: 'Number',
|
16702
|
-
label: '动画持续时间',
|
16703
|
-
name: ['animation', 'duration'],
|
16704
|
-
addonAfter: 'ms'
|
16705
|
-
}
|
16706
|
-
]
|
16707
|
-
}
|
16708
|
-
];
|
16709
|
-
|
16710
16697
|
var styles = {"aniLinkPopup":"index-module_aniLinkPopup__YT7kj","animated-fadeIn":"index-module_animated-fadeIn__8ZCbq","fadeIn":"index-module_fadeIn__2E-dk","animated-fadeOut":"index-module_animated-fadeOut__iK4oc","fadeOut":"index-module_fadeOut__MgevT","one-line-ellipsis":"index-module_one-line-ellipsis__NRiVV","two-line-ellipsis":"index-module_two-line-ellipsis__k-YGB","modal-icon-wrapper":"index-module_modal-icon-wrapper__tu3BY","modal-icon-wrapper-img":"index-module_modal-icon-wrapper-img__4b7qZ"};
|
16711
16698
|
|
16712
16699
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
@@ -16779,6 +16766,60 @@ const AniLinkPopup$1 = (_a) => {
|
|
16779
16766
|
};
|
16780
16767
|
var AniLinkPopupComponent = memo(AniLinkPopup$1);
|
16781
16768
|
|
16769
|
+
/*
|
16770
|
+
* @Author: binruan@chatlabs.com
|
16771
|
+
* @Date: 2024-07-24 14:58:40
|
16772
|
+
* @LastEditors: binruan@chatlabs.com
|
16773
|
+
* @LastEditTime: 2024-09-09 13:54:35
|
16774
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\interactionRender.tsx
|
16775
|
+
*
|
16776
|
+
*/
|
16777
|
+
var interactionRender$2 = [
|
16778
|
+
{
|
16779
|
+
title: '点击事件',
|
16780
|
+
child: [
|
16781
|
+
{
|
16782
|
+
type: 'link',
|
16783
|
+
name: 'onClick',
|
16784
|
+
hiddenUrl: true
|
16785
|
+
}
|
16786
|
+
]
|
16787
|
+
},
|
16788
|
+
{
|
16789
|
+
title: '动画效果',
|
16790
|
+
child: [
|
16791
|
+
{
|
16792
|
+
type: 'Select',
|
16793
|
+
name: ['animation', 'name'],
|
16794
|
+
label: '动画',
|
16795
|
+
options: [
|
16796
|
+
{
|
16797
|
+
label: '默认',
|
16798
|
+
value: 1
|
16799
|
+
}
|
16800
|
+
],
|
16801
|
+
fieldProps: {
|
16802
|
+
style: {
|
16803
|
+
width: '100%'
|
16804
|
+
}
|
16805
|
+
}
|
16806
|
+
},
|
16807
|
+
{
|
16808
|
+
type: 'Number',
|
16809
|
+
label: '动画启动时间',
|
16810
|
+
name: ['animation', 'delay'],
|
16811
|
+
addonAfter: 'ms'
|
16812
|
+
},
|
16813
|
+
{
|
16814
|
+
type: 'Number',
|
16815
|
+
label: '动画持续时间',
|
16816
|
+
name: ['animation', 'duration'],
|
16817
|
+
addonAfter: 'ms'
|
16818
|
+
}
|
16819
|
+
]
|
16820
|
+
}
|
16821
|
+
];
|
16822
|
+
|
16782
16823
|
/*
|
16783
16824
|
* @Author: binruan@chatlabs.com
|
16784
16825
|
* @Date: 2024-07-24 14:58:40
|
@@ -16817,6 +16858,7 @@ const AniLinkPopup = createMaterial(AniLinkPopupComponent, {
|
|
16817
16858
|
title: {
|
16818
16859
|
fontSize: 14,
|
16819
16860
|
color: '#000',
|
16861
|
+
textAlign: 'left',
|
16820
16862
|
lineHeight: 2.6
|
16821
16863
|
},
|
16822
16864
|
ctaTitle: {
|
@@ -17045,7 +17087,7 @@ const Display$1 = (_a) => {
|
|
17045
17087
|
React.createElement("span", { style: content === null || content === void 0 ? void 0 : content.style, dangerouslySetInnerHTML: {
|
17046
17088
|
__html: 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)
|
17047
17089
|
} }),
|
17048
|
-
React.createElement("span", { style: Object.assign(Object.assign({}, interaction === null || interaction === void 0 ? void 0 : interaction.style), {
|
17090
|
+
React.createElement("span", { style: Object.assign(Object.assign({}, interaction === null || interaction === void 0 ? void 0 : interaction.style), { marginLeft: '5px' }), dangerouslySetInnerHTML: {
|
17049
17091
|
__html: 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)
|
17050
17092
|
}, onClick: handleClick })),
|
17051
17093
|
isShowClose && (React.createElement("button", { "aria-label": 'close', className: 'consentPopupDisplay-close', onClick: handleClickClose },
|
@@ -17963,21 +18005,22 @@ const LikeButton = (_a) => {
|
|
17963
18005
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17964
18006
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17965
18007
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17966
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
18008
|
+
var _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;
|
17967
18009
|
if (state) {
|
17968
18010
|
// 先设置状态
|
17969
18011
|
setState(false);
|
17970
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
18012
|
+
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ itemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
17971
18013
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17972
18014
|
eventInfo: {
|
17973
18015
|
eventSubject: 'favoriteContentCanceled',
|
17974
18016
|
eventDescription: 'This content was unfavorite by the user',
|
17975
18017
|
contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
17976
|
-
|
17977
|
-
|
18018
|
+
sceneId: (_k = (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.scene) === null || _j === void 0 ? void 0 : _j.sceneId) !== null && _k !== void 0 ? _k : '',
|
18019
|
+
contentName: (_m = (_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '',
|
18020
|
+
contentTags: JSON.stringify((_p = (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []),
|
17978
18021
|
position: position + '',
|
17979
|
-
contentFormat: ((
|
17980
|
-
traceInfo: (
|
18022
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
18023
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
17981
18024
|
}
|
17982
18025
|
});
|
17983
18026
|
// 如果接口调用失败,则回滚状态
|
@@ -17985,40 +18028,41 @@ const LikeButton = (_a) => {
|
|
17985
18028
|
setState(true);
|
17986
18029
|
}
|
17987
18030
|
else {
|
17988
|
-
const nRtcList = (
|
18031
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17989
18032
|
if (index === position) {
|
17990
18033
|
item.isCollected = false;
|
17991
18034
|
}
|
17992
18035
|
return item;
|
17993
|
-
})) !== null &&
|
18036
|
+
})) !== null && _s !== void 0 ? _s : [];
|
17994
18037
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17995
18038
|
}
|
17996
18039
|
}
|
17997
18040
|
else {
|
17998
18041
|
setState(true);
|
17999
|
-
const result = (
|
18042
|
+
const result = (_v = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData), itemId: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '' })))) !== null && _v !== void 0 ? _v : false;
|
18000
18043
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18001
18044
|
eventInfo: {
|
18002
18045
|
eventSubject: 'favoriteContent',
|
18003
18046
|
eventDescription: 'This content was favorite by the user',
|
18004
|
-
contentId: (
|
18005
|
-
|
18006
|
-
|
18047
|
+
contentId: (_x = (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
18048
|
+
sceneId: (_0 = (_z = (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.scene) === null || _z === void 0 ? void 0 : _z.sceneId) !== null && _0 !== void 0 ? _0 : '',
|
18049
|
+
contentName: (_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.title) !== null && _2 !== void 0 ? _2 : '',
|
18050
|
+
contentTags: JSON.stringify((_4 = (_3 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _3 === void 0 ? void 0 : _3.tags) !== null && _4 !== void 0 ? _4 : []),
|
18007
18051
|
position: position + '',
|
18008
|
-
contentFormat: ((
|
18009
|
-
traceInfo: (
|
18052
|
+
contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
|
18053
|
+
traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
|
18010
18054
|
}
|
18011
18055
|
});
|
18012
18056
|
if (!result) {
|
18013
18057
|
setState(false);
|
18014
18058
|
}
|
18015
18059
|
else {
|
18016
|
-
const nRtcList = (
|
18060
|
+
const nRtcList = (_7 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18017
18061
|
if (index === position) {
|
18018
18062
|
item.isCollected = true;
|
18019
18063
|
}
|
18020
18064
|
return item;
|
18021
|
-
})) !== null &&
|
18065
|
+
})) !== null && _7 !== void 0 ? _7 : [];
|
18022
18066
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18023
18067
|
}
|
18024
18068
|
}
|
@@ -18055,7 +18099,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
18055
18099
|
const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
18056
18100
|
var _a, _b;
|
18057
18101
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
18058
|
-
const { bffEventReport, sxpParameter,
|
18102
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
18059
18103
|
const videoStartTime = useRef(0);
|
18060
18104
|
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
18061
18105
|
const { isActive } = useSwiperSlide();
|
@@ -18121,6 +18165,23 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18121
18165
|
return;
|
18122
18166
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18123
18167
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18168
|
+
const handleEnd = () => {
|
18169
|
+
var _a, _b, _c, _d, _e, _f;
|
18170
|
+
if (!videoRef.current)
|
18171
|
+
return;
|
18172
|
+
if (isDiyH5) {
|
18173
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
18174
|
+
if (!loopPlayRef.current)
|
18175
|
+
return;
|
18176
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18177
|
+
const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
|
18178
|
+
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(i + 1);
|
18179
|
+
}
|
18180
|
+
}
|
18181
|
+
else {
|
18182
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
18183
|
+
}
|
18184
|
+
};
|
18124
18185
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
18125
18186
|
const handlePlaying = useCallback(() => {
|
18126
18187
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -18129,7 +18190,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18129
18190
|
setIsLoadFinish(true);
|
18130
18191
|
}, []);
|
18131
18192
|
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
18132
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
18193
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
18133
18194
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18134
18195
|
return;
|
18135
18196
|
setIsPauseVideo(false);
|
@@ -18140,16 +18201,11 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18140
18201
|
const videoCurrentTime = ((_h = (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.currentTime) !== null && _h !== void 0 ? _h : 0).toFixed(2);
|
18141
18202
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
18142
18203
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18143
|
-
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
18204
|
+
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '', sceneId: (_o = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.scene) === null || _m === void 0 ? void 0 : _m.sceneId) !== null && _o !== void 0 ? _o : '', contentName: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.title) !== null && _q !== void 0 ? _q : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []), position: index + '', contentFormat: 'video', traceInfo: (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.traceInfo }, ((isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) && { loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + '' }))
|
18144
18205
|
});
|
18145
18206
|
isFirstPlayRef.current = false;
|
18146
18207
|
}
|
18147
18208
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18148
|
-
const setCurrentTimeByStartTime = useCallback(() => {
|
18149
|
-
if (isDiyH5) {
|
18150
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18151
|
-
}
|
18152
|
-
}, []);
|
18153
18209
|
const handLoadeddata = useCallback(() => {
|
18154
18210
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
18155
18211
|
return;
|
@@ -18174,13 +18230,12 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18174
18230
|
const handleLoadedmetadata = useCallback(() => {
|
18175
18231
|
if (!videoRef.current)
|
18176
18232
|
return;
|
18177
|
-
setCurrentTimeByStartTime();
|
18178
18233
|
loadedTimeRef.current = new Date();
|
18179
18234
|
handleStartPlay();
|
18180
18235
|
handLoadeddata();
|
18181
18236
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18182
18237
|
const handleClickVideo = useCallback((type) => () => {
|
18183
|
-
var _a, _b, _c, _d, _e
|
18238
|
+
var _a, _b, _c, _d, _e;
|
18184
18239
|
if (!videoRef.current)
|
18185
18240
|
return;
|
18186
18241
|
if (!isLoadFinish)
|
@@ -18201,20 +18256,17 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18201
18256
|
break;
|
18202
18257
|
default:
|
18203
18258
|
if (isPause) {
|
18204
|
-
|
18205
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18206
|
-
}
|
18207
|
-
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18259
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
18208
18260
|
}
|
18209
18261
|
else {
|
18210
|
-
(
|
18262
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
18211
18263
|
}
|
18212
18264
|
setIsPauseVideo(!isPause);
|
18213
18265
|
break;
|
18214
18266
|
}
|
18215
18267
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18216
18268
|
const handlePause = useCallback(() => {
|
18217
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18269
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
18218
18270
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18219
18271
|
return;
|
18220
18272
|
if (activeIndex !== index)
|
@@ -18230,14 +18282,15 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18230
18282
|
eventSubject: 'playOverVideo',
|
18231
18283
|
eventDescription: 'User finished playing the video',
|
18232
18284
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
18233
|
-
|
18285
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
18286
|
+
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
18234
18287
|
endTime: videoCurrentTime,
|
18235
18288
|
videoDuration,
|
18236
18289
|
playDuration,
|
18237
|
-
contentTags: JSON.stringify((
|
18290
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
18238
18291
|
position: index + '',
|
18239
18292
|
contentFormat: 'video',
|
18240
|
-
traceInfo: (
|
18293
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
18241
18294
|
}
|
18242
18295
|
});
|
18243
18296
|
}
|
@@ -18245,27 +18298,8 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18245
18298
|
const handleWaiting = useCallback(() => {
|
18246
18299
|
setWaiting(true);
|
18247
18300
|
}, []);
|
18248
|
-
const handleTimeUpload = () => {
|
18249
|
-
if (!videoRef.current || !isDiyH5)
|
18250
|
-
return;
|
18251
|
-
setTimeout(() => {
|
18252
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18253
|
-
if (Math.round((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = scene === null || scene === void 0 ? void 0 : scene.endTime) !== null && _b !== void 0 ? _b : 0)) {
|
18254
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18255
|
-
if (!loopPlayRef.current)
|
18256
|
-
return;
|
18257
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18258
|
-
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(0);
|
18259
|
-
}
|
18260
|
-
else {
|
18261
|
-
const i = (_g = (_f = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _f === void 0 ? void 0 : _f.swiper) === null || _g === void 0 ? void 0 : _g.activeIndex;
|
18262
|
-
(_j = (_h = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _h === void 0 ? void 0 : _h.swiper) === null || _j === void 0 ? void 0 : _j.slideTo(i + 1);
|
18263
|
-
}
|
18264
|
-
}
|
18265
|
-
});
|
18266
|
-
};
|
18267
18301
|
useEffect(() => {
|
18268
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18302
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18269
18303
|
if (!isActive)
|
18270
18304
|
return;
|
18271
18305
|
const videoSrc = videoUrl;
|
@@ -18286,7 +18320,6 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18286
18320
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18287
18321
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18288
18322
|
var _a;
|
18289
|
-
setCurrentTimeByStartTime();
|
18290
18323
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18291
18324
|
});
|
18292
18325
|
}
|
@@ -18300,12 +18333,11 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18300
18333
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18301
18334
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18302
18335
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18303
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18336
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
|
18304
18337
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18305
18338
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18306
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18307
18339
|
return () => {
|
18308
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18340
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18309
18341
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18310
18342
|
if (!isPause)
|
18311
18343
|
handlePause();
|
@@ -18317,10 +18349,9 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18317
18349
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18318
18350
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18319
18351
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18320
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18352
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
|
18321
18353
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18322
18354
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18323
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18324
18355
|
};
|
18325
18356
|
}, [isActive]);
|
18326
18357
|
useEffect(() => {
|
@@ -18531,19 +18562,45 @@ const Picture = (props) => {
|
|
18531
18562
|
}, onLoad: onShowFirstImage }))));
|
18532
18563
|
};
|
18533
18564
|
|
18534
|
-
const PictureGroup$4 = ({ imgUrls,
|
18565
|
+
const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
18535
18566
|
var _a, _b;
|
18536
18567
|
const { isActive } = useSwiperSlide();
|
18537
|
-
const {
|
18568
|
+
const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
|
18538
18569
|
const [isLoad, setIsLoad] = useState(false);
|
18539
18570
|
const [imgInfo, setImgInfo] = useState();
|
18540
18571
|
const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
|
18541
|
-
const
|
18572
|
+
const imgsSwiperRef = useRef();
|
18542
18573
|
const isFirstPlayRef = useRef(true);
|
18574
|
+
const loopPlayRef = useRef(true);
|
18543
18575
|
const initTime = new Date();
|
18576
|
+
useImperativeHandle(ref, () => {
|
18577
|
+
return {
|
18578
|
+
setLoopPlay(v) {
|
18579
|
+
loopPlayRef.current = v;
|
18580
|
+
}
|
18581
|
+
};
|
18582
|
+
});
|
18583
|
+
useEffect(() => {
|
18584
|
+
let timerId;
|
18585
|
+
if (isLoad && isActive && isDiyH5) {
|
18586
|
+
timerId = setTimeout(() => {
|
18587
|
+
var _a, _b, _c, _d;
|
18588
|
+
if (!loopPlayRef.current)
|
18589
|
+
return;
|
18590
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18591
|
+
const i = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
|
18592
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(i + 1);
|
18593
|
+
}
|
18594
|
+
}, 3000);
|
18595
|
+
}
|
18596
|
+
return () => {
|
18597
|
+
if (timerId)
|
18598
|
+
clearTimeout(timerId);
|
18599
|
+
};
|
18600
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
18544
18601
|
useEffect(() => {
|
18545
18602
|
if (isLoad && isActive) {
|
18546
|
-
(
|
18603
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
18547
18604
|
if (openHashtag) {
|
18548
18605
|
onViewImageEndEvent(rec);
|
18549
18606
|
}
|
@@ -18553,7 +18610,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18553
18610
|
}
|
18554
18611
|
}
|
18555
18612
|
else {
|
18556
|
-
(
|
18613
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
|
18557
18614
|
}
|
18558
18615
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18559
18616
|
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18580,13 +18637,13 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18580
18637
|
};
|
18581
18638
|
}, [isActive, imgInfo]);
|
18582
18639
|
const handleMouseEnter = useCallback(() => {
|
18583
|
-
if (
|
18584
|
-
|
18640
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18641
|
+
imgsSwiperRef.current.swiper.autoplay.stop();
|
18585
18642
|
}
|
18586
18643
|
}, []);
|
18587
18644
|
const handleMouseLeave = useCallback(() => {
|
18588
|
-
if (
|
18589
|
-
|
18645
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18646
|
+
imgsSwiperRef.current.swiper.autoplay.start();
|
18590
18647
|
}
|
18591
18648
|
}, []);
|
18592
18649
|
const handleSlideChange = useCallback((swiper) => {
|
@@ -18607,7 +18664,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18607
18664
|
enabled: true
|
18608
18665
|
}
|
18609
18666
|
}
|
18610
|
-
: {}), { loop: true, ref:
|
18667
|
+
: {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18611
18668
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18612
18669
|
fontSize: '14px'
|
18613
18670
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18624,7 +18681,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18624
18681
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18625
18682
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18626
18683
|
}))));
|
18627
|
-
};
|
18684
|
+
});
|
18628
18685
|
var PictureGroup$5 = memo(PictureGroup$4);
|
18629
18686
|
|
18630
18687
|
/*
|
@@ -18745,22 +18802,10 @@ function withBindDataSource(Component) {
|
|
18745
18802
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
18746
18803
|
*
|
18747
18804
|
*/
|
18748
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, isNineProduct }) => {
|
18749
|
-
var _a, _b, _c, _d, _e;
|
18805
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, value, isNineProduct }) => {
|
18750
18806
|
const { schema } = useEditor();
|
18751
18807
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
18752
18808
|
return null;
|
18753
|
-
let cta = null;
|
18754
|
-
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
18755
|
-
cta = '多商品CTA';
|
18756
|
-
}
|
18757
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
18758
|
-
cta = '商品CTA';
|
18759
|
-
}
|
18760
|
-
else {
|
18761
|
-
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
18762
|
-
}
|
18763
|
-
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
18764
18809
|
const renderComp = useMemo(() => {
|
18765
18810
|
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;
|
18766
18811
|
// 如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
|
@@ -18788,7 +18833,7 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
|
|
18788
18833
|
const sbf = style.backdropFilter;
|
18789
18834
|
style.backdropFilter = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
18790
18835
|
}
|
18791
|
-
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50,
|
18836
|
+
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
|
18792
18837
|
}
|
18793
18838
|
else {
|
18794
18839
|
return null;
|
@@ -18916,7 +18961,7 @@ var NavBack$1 = memo(NavBack);
|
|
18916
18961
|
* @Author: binruan@chatlabs.com
|
18917
18962
|
* @Date: 2024-03-20 10:27:31
|
18918
18963
|
* @LastEditors: binruan@chatlabs.com
|
18919
|
-
* @LastEditTime: 2025-05-
|
18964
|
+
* @LastEditTime: 2025-05-12 14:26:15
|
18920
18965
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18921
18966
|
*
|
18922
18967
|
*/
|
@@ -18936,6 +18981,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18936
18981
|
const skipLinkRef = useRef(false);
|
18937
18982
|
const [pageNum, setPageNum] = useState(2);
|
18938
18983
|
const videoWidgetRef = useRef(null);
|
18984
|
+
const pictureGroupRef = useRef(null);
|
18939
18985
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5 } = useSxpDataSource();
|
18940
18986
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18941
18987
|
const isShowFingerTip = useMemo(() => {
|
@@ -18983,7 +19029,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18983
19029
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
18984
19030
|
}, [data, ctaType, swiperRef]);
|
18985
19031
|
const handleSessionCompleted = useCallback((fk) => {
|
18986
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
19032
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
18987
19033
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
18988
19034
|
let fromKName = '';
|
18989
19035
|
if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
@@ -19010,12 +19056,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19010
19056
|
eventSubject: 'sessionCompleted',
|
19011
19057
|
eventDescription: 'Session completed',
|
19012
19058
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
19013
|
-
|
19059
|
+
sceneId: (_q = (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.scene) === null || _p === void 0 ? void 0 : _p.sceneId) !== null && _q !== void 0 ? _q : '',
|
19060
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
19014
19061
|
position: activeIndex + '',
|
19015
19062
|
fromKName: fk || fromKName,
|
19016
19063
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
19017
|
-
ctatId: (
|
19018
|
-
traceInfo: (
|
19064
|
+
ctatId: (_u = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
19065
|
+
traceInfo: (_y = (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = item === null || item === void 0 ? void 0 : item.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : ''
|
19019
19066
|
}
|
19020
19067
|
});
|
19021
19068
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -19074,8 +19121,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19074
19121
|
refreshFeSession
|
19075
19122
|
]);
|
19076
19123
|
const handleSessionExpire = useCallback(debounce(() => {
|
19077
|
-
var _a;
|
19124
|
+
var _a, _b;
|
19078
19125
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19126
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19079
19127
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
19080
19128
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
19081
19129
|
useEffect(() => {
|
@@ -19145,18 +19193,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19145
19193
|
return null;
|
19146
19194
|
}, [globalConfig, activeIndex, visList]);
|
19147
19195
|
const renderContent = useCallback((rec, index) => {
|
19148
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
19196
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
19149
19197
|
if (rec === 'organic menu') {
|
19150
19198
|
return (React.createElement(MultiPosts$2, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
|
19151
19199
|
}
|
19152
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
19200
|
+
if (((_h = (_g = rec.video) === null || _g === void 0 ? void 0 : _g.scene) === null || _h === void 0 ? void 0 : _h.mediaUrl) || ((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.url)) {
|
19153
19201
|
return (React.createElement(VideoWidget$5, Object.assign({ key: isReload }, (activeIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, loopPlay: true, swiperRef: swiperRef })));
|
19154
19202
|
}
|
19155
|
-
if ((
|
19156
|
-
return (React.createElement(PictureGroup$5, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
19203
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
19204
|
+
return (React.createElement(PictureGroup$5, Object.assign({ data: data }, (activeIndex === index && { ref: pictureGroupRef }), { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, swiperRef: swiperRef })));
|
19157
19205
|
}
|
19158
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
19159
|
-
return (
|
19206
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _l === void 0 ? void 0 : _l.length) > 0) {
|
19207
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
19160
19208
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19161
19209
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19162
19210
|
const Component = withBindDataSource(t);
|
@@ -19194,7 +19242,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19194
19242
|
};
|
19195
19243
|
}, [isShowMore]);
|
19196
19244
|
const renderBottom = useCallback((rec, index) => {
|
19197
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19245
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
19198
19246
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19199
19247
|
let cta = null;
|
19200
19248
|
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
@@ -19203,25 +19251,28 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19203
19251
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19204
19252
|
cta = '商品CTA';
|
19205
19253
|
}
|
19254
|
+
else if (tempMap && ((_d = Object.keys(tempMap)) === null || _d === void 0 ? void 0 : _d.includes('服务CTA')) && ((_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId)) {
|
19255
|
+
cta = '服务CTA';
|
19256
|
+
}
|
19206
19257
|
else {
|
19207
|
-
cta = (
|
19258
|
+
cta = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) === null || _h === void 0 ? void 0 : _h.itemId;
|
19208
19259
|
}
|
19209
19260
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19210
19261
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19211
19262
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19212
|
-
((
|
19263
|
+
((_j = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _j === void 0 ? void 0 : _j.includes((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type));
|
19213
19264
|
return (React.createElement(React.Fragment, null,
|
19214
|
-
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
|
19215
|
-
((
|
19216
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19265
|
+
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19266
|
+
((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
19267
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _m !== void 0 ? _m : 40}px` } },
|
19217
19268
|
React.createElement(Nudge, { nudge: nudge }),
|
19218
19269
|
((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
19219
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
|
19270
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19220
19271
|
React.createElement("div", null,
|
19221
|
-
React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (
|
19222
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
19223
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19224
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
19272
|
+
React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.title) !== null && _p !== void 0 ? _p : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
19273
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19274
|
+
React.createElement(Hashtag$1, { index: activeIndex, tags: (_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.hashTags) !== null && _r !== void 0 ? _r : [], itemId: (_s = rec === null || rec === void 0 ? void 0 : rec.video) === null || _s === void 0 ? void 0 : _s.itemId, itemType: ((_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
19275
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19225
19276
|
}
|
19226
19277
|
return null;
|
19227
19278
|
}, [
|
@@ -19259,7 +19310,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19259
19310
|
return null;
|
19260
19311
|
}, [globalConfig, waterFallData]);
|
19261
19312
|
const handleViewImageStartEnd = (item) => {
|
19262
|
-
var _a, _b, _c, _d, _e, _f;
|
19313
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
19263
19314
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
19264
19315
|
const endTime = Date.now();
|
19265
19316
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19268,10 +19319,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19268
19319
|
eventSubject: 'viewImageCarouselEnd',
|
19269
19320
|
eventDescription: 'User end view the image carousel',
|
19270
19321
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
19271
|
-
|
19322
|
+
sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
19323
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19272
19324
|
imageEndTime: `${endTime}`,
|
19273
19325
|
playDuration: `${duration}`,
|
19274
|
-
contentTags: JSON.stringify((
|
19326
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19275
19327
|
position: activeIndex + '',
|
19276
19328
|
contentFormat: 'image',
|
19277
19329
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19280,7 +19332,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19280
19332
|
}
|
19281
19333
|
};
|
19282
19334
|
const handleSlideSkip = (item, position) => {
|
19283
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
19335
|
+
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;
|
19284
19336
|
if (isPreview || waterFallData)
|
19285
19337
|
return;
|
19286
19338
|
const t = new Date() - curTime.current;
|
@@ -19306,7 +19358,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19306
19358
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19307
19359
|
position: position + '',
|
19308
19360
|
contentId: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.itemId) !== null && _t !== void 0 ? _t : '',
|
19309
|
-
|
19361
|
+
sceneId: (_w = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.scene) === null || _v === void 0 ? void 0 : _v.sceneId) !== null && _w !== void 0 ? _w : '',
|
19362
|
+
traceInfo: (_0 = (_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_z = item === null || item === void 0 ? void 0 : item.product) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : '',
|
19310
19363
|
contentFormat
|
19311
19364
|
}
|
19312
19365
|
});
|
@@ -19316,7 +19369,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19316
19369
|
}
|
19317
19370
|
};
|
19318
19371
|
const handleScrollEvent = (swiper) => {
|
19319
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19372
|
+
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;
|
19320
19373
|
const item = data[swiper.previousIndex];
|
19321
19374
|
if (!item)
|
19322
19375
|
return;
|
@@ -19333,11 +19386,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19333
19386
|
eventSubject: 'scrollDown',
|
19334
19387
|
eventDescription: 'User scroll down',
|
19335
19388
|
contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
|
19336
|
-
|
19389
|
+
sceneId: (_h = (_g = (_f = item === null || item === void 0 ? void 0 : item.video) === null || _f === void 0 ? void 0 : _f.scene) === null || _g === void 0 ? void 0 : _g.sceneId) !== null && _h !== void 0 ? _h : '',
|
19390
|
+
productId: (_k = (_j = item === null || item === void 0 ? void 0 : item.product) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
19337
19391
|
requestId: null,
|
19338
|
-
traceInfo: (
|
19392
|
+
traceInfo: (_p = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
19339
19393
|
contentFormat,
|
19340
|
-
position: ((
|
19394
|
+
position: ((_q = swiper.previousIndex) !== null && _q !== void 0 ? _q : 0) + ''
|
19341
19395
|
}
|
19342
19396
|
});
|
19343
19397
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19349,12 +19403,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19349
19403
|
eventInfo: {
|
19350
19404
|
eventSubject: 'scrollUp',
|
19351
19405
|
eventDescription: 'User scroll up',
|
19352
|
-
contentId: (
|
19353
|
-
|
19406
|
+
contentId: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
19407
|
+
sceneId: (_v = (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.scene) === null || _u === void 0 ? void 0 : _u.sceneId) !== null && _v !== void 0 ? _v : '',
|
19408
|
+
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19354
19409
|
requestId: null,
|
19355
|
-
traceInfo: (
|
19410
|
+
traceInfo: (_1 = (_z = (_y = item === null || item === void 0 ? void 0 : item.video) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_0 = item === null || item === void 0 ? void 0 : item.product) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : '',
|
19356
19411
|
contentFormat,
|
19357
|
-
position: ((
|
19412
|
+
position: ((_2 = swiper.previousIndex) !== null && _2 !== void 0 ? _2 : 0) + ''
|
19358
19413
|
}
|
19359
19414
|
});
|
19360
19415
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19380,7 +19435,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19380
19435
|
}
|
19381
19436
|
}, [openHashtag, data, activeIndex]);
|
19382
19437
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19383
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19438
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
19384
19439
|
const item = data[activeIndex];
|
19385
19440
|
// 如果是图片集则上报事件
|
19386
19441
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
@@ -19391,9 +19446,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19391
19446
|
eventSubject: 'viewImageCarouselStart',
|
19392
19447
|
eventDescription: 'User start view the image carousel',
|
19393
19448
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
19394
|
-
|
19449
|
+
sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
19450
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19395
19451
|
imageStartTime: `${startTime}`,
|
19396
|
-
contentTags: JSON.stringify((
|
19452
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19397
19453
|
position: activeIndex + '',
|
19398
19454
|
contentFormat: 'image',
|
19399
19455
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19403,11 +19459,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19403
19459
|
if (enableCapi) {
|
19404
19460
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19405
19461
|
eventName: 'ViewContent',
|
19406
|
-
product: (
|
19462
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProduct
|
19407
19463
|
});
|
19408
19464
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19409
19465
|
eventName: 'PageView',
|
19410
|
-
product: (
|
19466
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProduct
|
19411
19467
|
});
|
19412
19468
|
}
|
19413
19469
|
}
|
@@ -19499,15 +19555,20 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19499
19555
|
swiperRef.current.swiper.allowTouchMove = true;
|
19500
19556
|
}, 500);
|
19501
19557
|
}, onActiveIndexChange: (swiper) => {
|
19558
|
+
var _a, _b;
|
19502
19559
|
setActiveIndex(swiper.activeIndex);
|
19503
19560
|
if (openHashtag)
|
19504
19561
|
return;
|
19505
19562
|
// 处理上滑下滑事件
|
19506
19563
|
handleScrollEvent(swiper);
|
19507
|
-
if (waterFallData || isEditor
|
19564
|
+
if (waterFallData || isEditor)
|
19508
19565
|
return;
|
19509
19566
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19510
19567
|
if (!isLoadMore) {
|
19568
|
+
if (isDiyH5) {
|
19569
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19570
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19571
|
+
}
|
19511
19572
|
setIsLoadMore(true);
|
19512
19573
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19513
19574
|
var _a;
|
@@ -19560,7 +19621,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19560
19621
|
}, []);
|
19561
19622
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19562
19623
|
const handlePlaying = useCallback(() => {
|
19563
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19624
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19564
19625
|
setIsPauseVideo(false);
|
19565
19626
|
const item = data[index];
|
19566
19627
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19573,14 +19634,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19573
19634
|
eventSubject: 'playVideo',
|
19574
19635
|
eventDescription: 'User played the video',
|
19575
19636
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
19576
|
-
|
19637
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
19638
|
+
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
19577
19639
|
playType,
|
19578
19640
|
startTime: videoCurrentTime,
|
19579
19641
|
videoDuration,
|
19580
|
-
contentTags: JSON.stringify((
|
19642
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
19581
19643
|
position: index + '',
|
19582
19644
|
contentFormat: 'video',
|
19583
|
-
traceInfo: (
|
19645
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19584
19646
|
}
|
19585
19647
|
});
|
19586
19648
|
setIsFirstPlay(false);
|
@@ -19619,7 +19681,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19619
19681
|
}
|
19620
19682
|
}, [isLoadFinish]);
|
19621
19683
|
const onPause = useCallback(() => {
|
19622
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19684
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19623
19685
|
const item = data[index];
|
19624
19686
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19625
19687
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19630,14 +19692,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19630
19692
|
eventSubject: 'playOverVideo',
|
19631
19693
|
eventDescription: 'User finished playing the video',
|
19632
19694
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
19633
|
-
|
19695
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
19696
|
+
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
19634
19697
|
endTime: videoCurrentTime,
|
19635
19698
|
videoDuration,
|
19636
19699
|
playDuration,
|
19637
|
-
contentTags: JSON.stringify((
|
19700
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
19638
19701
|
position: index + '',
|
19639
19702
|
contentFormat: 'video',
|
19640
|
-
traceInfo: (
|
19703
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19641
19704
|
}
|
19642
19705
|
});
|
19643
19706
|
}
|
@@ -19823,7 +19886,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
19823
19886
|
const CTA = (rec, index) => {
|
19824
19887
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
19825
19888
|
return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
19826
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$2
|
19889
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$2 })));
|
19827
19890
|
}
|
19828
19891
|
return null;
|
19829
19892
|
};
|
@@ -19836,10 +19899,8 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
19836
19899
|
React.createElement(Nudge, { nudge: nudge }),
|
19837
19900
|
CTA(rec, index),
|
19838
19901
|
React.createElement("div", null,
|
19839
|
-
React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }) }),
|
19840
|
-
|
19841
|
-
React.createElement(Hashtag$1, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })),
|
19842
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$2, includesCtaType: ['AniLinkPopup'], isActive: true })));
|
19902
|
+
React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }) })),
|
19903
|
+
React.createElement(Hashtag$1, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
|
19843
19904
|
}
|
19844
19905
|
return null;
|
19845
19906
|
};
|
@@ -20229,10 +20290,21 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
20229
20290
|
return null;
|
20230
20291
|
}, [globalConfig]);
|
20231
20292
|
const renderBottom = (rec, index) => {
|
20232
|
-
var _a, _b, _c, _d;
|
20293
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
20233
20294
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
20295
|
+
let cta = null;
|
20296
|
+
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
20297
|
+
cta = '多商品CTA';
|
20298
|
+
}
|
20299
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
20300
|
+
cta = '商品CTA';
|
20301
|
+
}
|
20302
|
+
else {
|
20303
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
20304
|
+
}
|
20305
|
+
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
20234
20306
|
return (React.createElement(React.Fragment, null,
|
20235
|
-
((
|
20307
|
+
((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && (React.createElement("div", { style: {
|
20236
20308
|
background: 'repeating-linear-gradient(0deg, rgba(26, 26, 25, 0.7), hsla(0, 0%, 100%, 0))',
|
20237
20309
|
height: '130px',
|
20238
20310
|
position: 'absolute',
|
@@ -20243,7 +20315,7 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
20243
20315
|
pointerEvents
|
20244
20316
|
} })),
|
20245
20317
|
React.createElement("div", { style: {
|
20246
|
-
marginBottom: `${(
|
20318
|
+
marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
|
20247
20319
|
zIndex: 999,
|
20248
20320
|
position: 'absolute',
|
20249
20321
|
bottom: 0,
|
@@ -20252,15 +20324,15 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
20252
20324
|
paddingTop: '20px'
|
20253
20325
|
} },
|
20254
20326
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { style: {} },
|
20255
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, isActive: index === activeIndex }))) : null,
|
20327
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, isActive: index === activeIndex, value: value }))) : null,
|
20256
20328
|
React.createElement("div", null,
|
20257
20329
|
React.createElement(ExpandableText$1
|
20258
20330
|
// className='clc-sxp-bottom-text'
|
20259
20331
|
, {
|
20260
20332
|
// className='clc-sxp-bottom-text'
|
20261
|
-
isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (
|
20262
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLink'], isActive: index === activeIndex }))),
|
20263
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
20333
|
+
isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none', padding: '0 20px', fontSize: '12px' }) }),
|
20334
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }))),
|
20335
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
20264
20336
|
}
|
20265
20337
|
return null;
|
20266
20338
|
};
|