pb-sxp-ui 1.16.11 → 1.16.12
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 +142 -182
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +142 -182
- 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 +142 -182
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/es/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -41
- package/es/core/components/SxpPageRender/VideoWidget/index.js +44 -33
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +37 -53
- package/es/core/context/SxpDataSourceProvider.js +3 -18
- package/es/core/hooks/useEventReport.js +5 -6
- package/es/materials/sxp/popup/CommodityDetail/index.js +7 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -1
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -40
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +44 -33
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +37 -53
- package/lib/core/context/SxpDataSourceProvider.js +3 -18
- package/lib/core/hooks/useEventReport.js +5 -6
- package/lib/materials/sxp/popup/CommodityDetail/index.js +7 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -622,7 +622,6 @@ 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([]);
|
626
625
|
const [tagList, setTagList] = useState([]);
|
627
626
|
const [loading, setLoading] = useState(true);
|
628
627
|
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
@@ -793,9 +792,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
793
792
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
794
793
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
795
794
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
796
|
-
if (isDiyH5) {
|
797
|
-
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
798
|
-
}
|
799
795
|
}
|
800
796
|
const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
801
797
|
if (isNotNullList) {
|
@@ -835,17 +831,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
835
831
|
if (rtcList.length <= 0) {
|
836
832
|
return;
|
837
833
|
}
|
838
|
-
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
839
|
-
setRtcList(rtcList.concat(firstRtcList));
|
840
|
-
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
841
|
-
return;
|
842
|
-
}
|
843
834
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
844
835
|
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId) && { productFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _2 === void 0 ? void 0 : _2.itemId] })), (((_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId) && { contentFilter: [(_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _4 === void 0 ? void 0 : _4.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
845
836
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
846
837
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
847
838
|
return data;
|
848
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList
|
839
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
849
840
|
const refreshFeSession = useCallback((enableReSid, event) => {
|
850
841
|
var _a, _b, _c, _d, _e;
|
851
842
|
let expire = false;
|
@@ -1072,7 +1063,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1072
1063
|
}
|
1073
1064
|
}), [bffFetch, utmVal]);
|
1074
1065
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
1075
|
-
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
|
1066
|
+
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;
|
1076
1067
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1077
1068
|
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);
|
1078
1069
|
let fromKName = '';
|
@@ -1090,7 +1081,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1090
1081
|
}
|
1091
1082
|
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;
|
1092
1083
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1093
|
-
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 : '',
|
1084
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
|
1094
1085
|
});
|
1095
1086
|
}, [bffEventReport, isFromHashtag]);
|
1096
1087
|
const h5EnterLink = useCallback(() => {
|
@@ -1192,9 +1183,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1192
1183
|
}
|
1193
1184
|
setRtcList(list);
|
1194
1185
|
setCacheRtcList(list);
|
1195
|
-
if (isDiyH5) {
|
1196
|
-
setFirstRtcList(list);
|
1197
|
-
}
|
1198
1186
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1199
1187
|
if (channel) {
|
1200
1188
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1230,9 +1218,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1230
1218
|
}
|
1231
1219
|
setRtcList(list);
|
1232
1220
|
setCacheRtcList(list);
|
1233
|
-
if (isDiyH5) {
|
1234
|
-
setFirstRtcList(list);
|
1235
|
-
}
|
1236
1221
|
}
|
1237
1222
|
})
|
1238
1223
|
.finally(() => {
|
@@ -1757,14 +1742,14 @@ var settingRender$f = [
|
|
1757
1742
|
* @Author: binruan@chatlabs.com
|
1758
1743
|
* @Date: 2024-03-12 10:59:06
|
1759
1744
|
* @LastEditors: binruan@chatlabs.com
|
1760
|
-
* @LastEditTime:
|
1745
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
1761
1746
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1762
1747
|
*
|
1763
1748
|
*/
|
1764
1749
|
function useEventReport() {
|
1765
1750
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1766
1751
|
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
1767
|
-
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
|
1752
|
+
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;
|
1768
1753
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1769
1754
|
if (i !== -1) {
|
1770
1755
|
return;
|
@@ -1797,11 +1782,11 @@ function useEventReport() {
|
|
1797
1782
|
contentFormat = 'image';
|
1798
1783
|
}
|
1799
1784
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1800
|
-
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 : '',
|
1785
|
+
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
|
1801
1786
|
});
|
1802
1787
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1803
1788
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
1804
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
1789
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1805
1790
|
let fromKName = '';
|
1806
1791
|
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))) {
|
1807
1792
|
fromKName = 'pdpPage';
|
@@ -1820,9 +1805,8 @@ function useEventReport() {
|
|
1820
1805
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
1821
1806
|
position: position + '',
|
1822
1807
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1823
|
-
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 : '',
|
1824
1808
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1825
|
-
traceInfo: (
|
1809
|
+
traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
1826
1810
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1827
1811
|
eventSubject: 'productView',
|
1828
1812
|
eventDescription: 'User browsed the product'
|
@@ -10374,7 +10358,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
10374
10358
|
const CommodityDetail$1 = (_a) => {
|
10375
10359
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
10376
10360
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
10377
|
-
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
10361
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
|
10378
10362
|
const { jumpToWeb, productView } = useEventReport();
|
10379
10363
|
const curTimeRef = useRef(null);
|
10380
10364
|
const [showModal, setShowModal] = useState(false);
|
@@ -10400,6 +10384,12 @@ const CommodityDetail$1 = (_a) => {
|
|
10400
10384
|
if (!isPost) {
|
10401
10385
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
10402
10386
|
}
|
10387
|
+
else {
|
10388
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10389
|
+
eventSubject: 'clickCta',
|
10390
|
+
eventDescription: 'User clicked the CTA'
|
10391
|
+
}, data, product, position);
|
10392
|
+
}
|
10403
10393
|
window.location.href = window.getJointUtmLink(product.link);
|
10404
10394
|
}
|
10405
10395
|
};
|
@@ -11302,7 +11292,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
11302
11292
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
11303
11293
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
11304
11294
|
useState(true);
|
11305
|
-
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
11295
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
|
11306
11296
|
const { jumpToWeb, productView } = useEventReport();
|
11307
11297
|
useState(false);
|
11308
11298
|
useState(false);
|
@@ -11331,6 +11321,12 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
11331
11321
|
if (!isPost) {
|
11332
11322
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
11333
11323
|
}
|
11324
|
+
else {
|
11325
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11326
|
+
eventSubject: 'clickCta',
|
11327
|
+
eventDescription: 'User clicked the CTA'
|
11328
|
+
}, data, product, position);
|
11329
|
+
}
|
11334
11330
|
window.location.href = window.getJointUtmLink(product.link);
|
11335
11331
|
}
|
11336
11332
|
};
|
@@ -15625,7 +15621,7 @@ function WaterfallList(_a) {
|
|
15625
15621
|
* @Author: binruan@chatlabs.com
|
15626
15622
|
* @Date: 2024-01-10 10:58:24
|
15627
15623
|
* @LastEditors: binruan@chatlabs.com
|
15628
|
-
* @LastEditTime: 2025-
|
15624
|
+
* @LastEditTime: 2025-02-28 10:00:31
|
15629
15625
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15630
15626
|
*
|
15631
15627
|
*/
|
@@ -15663,7 +15659,7 @@ const WaterFall = (props) => {
|
|
15663
15659
|
}
|
15664
15660
|
}, [waterFallData]);
|
15665
15661
|
const reportTagsView = useCallback(() => {
|
15666
|
-
var _a, _b, _c, _d, _e, _f
|
15662
|
+
var _a, _b, _c, _d, _e, _f;
|
15667
15663
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15668
15664
|
if (!rec)
|
15669
15665
|
return;
|
@@ -15683,10 +15679,9 @@ const WaterFall = (props) => {
|
|
15683
15679
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15684
15680
|
eventInfo: {
|
15685
15681
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15686
|
-
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 : '',
|
15687
15682
|
position: cacheActiveIndex + '',
|
15688
|
-
contentTags: JSON.stringify((
|
15689
|
-
traceInfo: (
|
15683
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
15684
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
15690
15685
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15691
15686
|
fromKName,
|
15692
15687
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17768,7 +17763,7 @@ const LikeButton = (_a) => {
|
|
17768
17763
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17769
17764
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17770
17765
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17771
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
|
17766
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17772
17767
|
if (state) {
|
17773
17768
|
// 先设置状态
|
17774
17769
|
setState(false);
|
@@ -17778,12 +17773,11 @@ const LikeButton = (_a) => {
|
|
17778
17773
|
eventSubject: 'favoriteContentCanceled',
|
17779
17774
|
eventDescription: 'This content was unfavorite by the user',
|
17780
17775
|
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 : '',
|
17781
|
-
|
17782
|
-
|
17783
|
-
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 : []),
|
17776
|
+
contentName: (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '',
|
17777
|
+
contentTags: JSON.stringify((_l = (_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.tags) !== null && _l !== void 0 ? _l : []),
|
17784
17778
|
position: position + '',
|
17785
|
-
contentFormat: ((
|
17786
|
-
traceInfo: (
|
17779
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
17780
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
17787
17781
|
}
|
17788
17782
|
});
|
17789
17783
|
// 如果接口调用失败,则回滚状态
|
@@ -17791,41 +17785,40 @@ const LikeButton = (_a) => {
|
|
17791
17785
|
setState(true);
|
17792
17786
|
}
|
17793
17787
|
else {
|
17794
|
-
const nRtcList = (
|
17788
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17795
17789
|
if (index === position) {
|
17796
17790
|
item.isCollected = false;
|
17797
17791
|
}
|
17798
17792
|
return item;
|
17799
|
-
})) !== null &&
|
17793
|
+
})) !== null && _p !== void 0 ? _p : [];
|
17800
17794
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17801
17795
|
}
|
17802
17796
|
}
|
17803
17797
|
else {
|
17804
17798
|
setState(true);
|
17805
|
-
const result = (
|
17799
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
17806
17800
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17807
17801
|
eventInfo: {
|
17808
17802
|
eventSubject: 'favoriteContent',
|
17809
17803
|
eventDescription: 'This content was favorite by the user',
|
17810
|
-
contentId: (
|
17811
|
-
|
17812
|
-
|
17813
|
-
contentTags: JSON.stringify((_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.tags) !== null && _2 !== void 0 ? _2 : []),
|
17804
|
+
contentId: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
17805
|
+
contentName: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.title) !== null && _u !== void 0 ? _u : '',
|
17806
|
+
contentTags: JSON.stringify((_w = (_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.tags) !== null && _w !== void 0 ? _w : []),
|
17814
17807
|
position: position + '',
|
17815
|
-
contentFormat: ((
|
17816
|
-
traceInfo: (
|
17808
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
17809
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
17817
17810
|
}
|
17818
17811
|
});
|
17819
17812
|
if (!result) {
|
17820
17813
|
setState(false);
|
17821
17814
|
}
|
17822
17815
|
else {
|
17823
|
-
const nRtcList = (
|
17816
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17824
17817
|
if (index === position) {
|
17825
17818
|
item.isCollected = true;
|
17826
17819
|
}
|
17827
17820
|
return item;
|
17828
|
-
})) !== null &&
|
17821
|
+
})) !== null && _z !== void 0 ? _z : [];
|
17829
17822
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17830
17823
|
}
|
17831
17824
|
}
|
@@ -17928,24 +17921,6 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17928
17921
|
return;
|
17929
17922
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
17930
17923
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17931
|
-
const handleEnd = () => {
|
17932
|
-
var _a, _b, _c, _d, _e, _f;
|
17933
|
-
if (!videoRef.current)
|
17934
|
-
return;
|
17935
|
-
if (isDiyH5) {
|
17936
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
17937
|
-
if (!loopPlayRef.current)
|
17938
|
-
return;
|
17939
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) ;
|
17940
|
-
else {
|
17941
|
-
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;
|
17942
|
-
(_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);
|
17943
|
-
}
|
17944
|
-
}
|
17945
|
-
else {
|
17946
|
-
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
17947
|
-
}
|
17948
|
-
};
|
17949
17924
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
17950
17925
|
const handlePlaying = useCallback(() => {
|
17951
17926
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -17954,7 +17929,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17954
17929
|
setIsLoadFinish(true);
|
17955
17930
|
}, []);
|
17956
17931
|
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
17957
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
17932
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
17958
17933
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
17959
17934
|
return;
|
17960
17935
|
setIsPauseVideo(false);
|
@@ -17965,11 +17940,16 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17965
17940
|
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);
|
17966
17941
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
17967
17942
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17968
|
-
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 : '',
|
17943
|
+
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 : '', contentName: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []), position: index + '', contentFormat: 'video', traceInfo: (_q = item === null || item === void 0 ? void 0 : item.video) === null || _q === void 0 ? void 0 : _q.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) + '' }))
|
17969
17944
|
});
|
17970
17945
|
isFirstPlayRef.current = false;
|
17971
17946
|
}
|
17972
17947
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17948
|
+
const setCurrentTimeByStartTime = useCallback(() => {
|
17949
|
+
if (isDiyH5) {
|
17950
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
17951
|
+
}
|
17952
|
+
}, []);
|
17973
17953
|
const handLoadeddata = useCallback(() => {
|
17974
17954
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
17975
17955
|
return;
|
@@ -17994,12 +17974,13 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17994
17974
|
const handleLoadedmetadata = useCallback(() => {
|
17995
17975
|
if (!videoRef.current)
|
17996
17976
|
return;
|
17977
|
+
setCurrentTimeByStartTime();
|
17997
17978
|
loadedTimeRef.current = new Date();
|
17998
17979
|
handleStartPlay();
|
17999
17980
|
handLoadeddata();
|
18000
17981
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18001
17982
|
const handleClickVideo = useCallback((type) => () => {
|
18002
|
-
var _a, _b, _c, _d, _e;
|
17983
|
+
var _a, _b, _c, _d, _e, _f;
|
18003
17984
|
if (!videoRef.current)
|
18004
17985
|
return;
|
18005
17986
|
if (!isLoadFinish)
|
@@ -18020,17 +18001,20 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18020
18001
|
break;
|
18021
18002
|
default:
|
18022
18003
|
if (isPause) {
|
18023
|
-
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
18004
|
+
if (isDiyH5 && Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (scene === null || scene === void 0 ? void 0 : scene.endTime)) {
|
18005
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18006
|
+
}
|
18007
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18024
18008
|
}
|
18025
18009
|
else {
|
18026
|
-
(
|
18010
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
18027
18011
|
}
|
18028
18012
|
setIsPauseVideo(!isPause);
|
18029
18013
|
break;
|
18030
18014
|
}
|
18031
18015
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18032
18016
|
const handlePause = useCallback(() => {
|
18033
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
18017
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18034
18018
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18035
18019
|
return;
|
18036
18020
|
if (activeIndex !== index)
|
@@ -18046,15 +18030,14 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18046
18030
|
eventSubject: 'playOverVideo',
|
18047
18031
|
eventDescription: 'User finished playing the video',
|
18048
18032
|
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 : '',
|
18049
|
-
|
18050
|
-
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 : '',
|
18033
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
18051
18034
|
endTime: videoCurrentTime,
|
18052
18035
|
videoDuration,
|
18053
18036
|
playDuration,
|
18054
|
-
contentTags: JSON.stringify((
|
18037
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
18055
18038
|
position: index + '',
|
18056
18039
|
contentFormat: 'video',
|
18057
|
-
traceInfo: (
|
18040
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
18058
18041
|
}
|
18059
18042
|
});
|
18060
18043
|
}
|
@@ -18062,8 +18045,27 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18062
18045
|
const handleWaiting = useCallback(() => {
|
18063
18046
|
setWaiting(true);
|
18064
18047
|
}, []);
|
18048
|
+
const handleTimeUpload = () => {
|
18049
|
+
if (!videoRef.current || !isDiyH5)
|
18050
|
+
return;
|
18051
|
+
setTimeout(() => {
|
18052
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18053
|
+
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)) {
|
18054
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18055
|
+
if (!loopPlayRef.current)
|
18056
|
+
return;
|
18057
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18058
|
+
(_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);
|
18059
|
+
}
|
18060
|
+
else {
|
18061
|
+
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;
|
18062
|
+
(_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);
|
18063
|
+
}
|
18064
|
+
}
|
18065
|
+
});
|
18066
|
+
};
|
18065
18067
|
useEffect(() => {
|
18066
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18068
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18067
18069
|
if (!isActive)
|
18068
18070
|
return;
|
18069
18071
|
const videoSrc = videoUrl;
|
@@ -18084,6 +18086,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18084
18086
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18085
18087
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18086
18088
|
var _a;
|
18089
|
+
setCurrentTimeByStartTime();
|
18087
18090
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18088
18091
|
});
|
18089
18092
|
}
|
@@ -18097,11 +18100,12 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18097
18100
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18098
18101
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18099
18102
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18100
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18103
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
18101
18104
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18102
18105
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18106
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18103
18107
|
return () => {
|
18104
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18108
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18105
18109
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18106
18110
|
if (!isPause)
|
18107
18111
|
handlePause();
|
@@ -18113,9 +18117,10 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18113
18117
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18114
18118
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18115
18119
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18116
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18120
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
18117
18121
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18118
18122
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18123
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18119
18124
|
};
|
18120
18125
|
}, [isActive]);
|
18121
18126
|
useEffect(() => {
|
@@ -18326,46 +18331,19 @@ const Picture = (props) => {
|
|
18326
18331
|
}, onLoad: onShowFirstImage }))));
|
18327
18332
|
};
|
18328
18333
|
|
18329
|
-
const PictureGroup$4 =
|
18334
|
+
const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
18330
18335
|
var _a, _b;
|
18331
18336
|
const { isActive } = useSwiperSlide();
|
18332
|
-
const { sxpParameter, openHashtag
|
18337
|
+
const { sxpParameter, openHashtag } = useSxpDataSource();
|
18333
18338
|
const [isLoad, setIsLoad] = useState(false);
|
18334
18339
|
const [imgInfo, setImgInfo] = useState();
|
18335
18340
|
const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
|
18336
|
-
const
|
18341
|
+
const swiperRef = useRef();
|
18337
18342
|
const isFirstPlayRef = useRef(true);
|
18338
|
-
const loopPlayRef = useRef(true);
|
18339
18343
|
const initTime = new Date();
|
18340
|
-
useImperativeHandle(ref, () => {
|
18341
|
-
return {
|
18342
|
-
setLoopPlay(v) {
|
18343
|
-
loopPlayRef.current = v;
|
18344
|
-
}
|
18345
|
-
};
|
18346
|
-
});
|
18347
|
-
useEffect(() => {
|
18348
|
-
let timerId;
|
18349
|
-
if (isLoad && isActive && isDiyH5) {
|
18350
|
-
timerId = setTimeout(() => {
|
18351
|
-
var _a, _b, _c, _d;
|
18352
|
-
if (!loopPlayRef.current)
|
18353
|
-
return;
|
18354
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) ;
|
18355
|
-
else {
|
18356
|
-
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;
|
18357
|
-
(_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);
|
18358
|
-
}
|
18359
|
-
}, 3000);
|
18360
|
-
}
|
18361
|
-
return () => {
|
18362
|
-
if (timerId)
|
18363
|
-
clearTimeout(timerId);
|
18364
|
-
};
|
18365
|
-
}, [isLoad, isActive, isDiyH5, index, swiperRef]);
|
18366
18344
|
useEffect(() => {
|
18367
18345
|
if (isLoad && isActive) {
|
18368
|
-
(
|
18346
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
18369
18347
|
if (openHashtag) {
|
18370
18348
|
onViewImageEndEvent(rec);
|
18371
18349
|
}
|
@@ -18375,7 +18353,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18375
18353
|
}
|
18376
18354
|
}
|
18377
18355
|
else {
|
18378
|
-
(
|
18356
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
18379
18357
|
}
|
18380
18358
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18381
18359
|
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18402,13 +18380,13 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18402
18380
|
};
|
18403
18381
|
}, [isActive, imgInfo]);
|
18404
18382
|
const handleMouseEnter = useCallback(() => {
|
18405
|
-
if (
|
18406
|
-
|
18383
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18384
|
+
swiperRef.current.swiper.autoplay.stop();
|
18407
18385
|
}
|
18408
18386
|
}, []);
|
18409
18387
|
const handleMouseLeave = useCallback(() => {
|
18410
|
-
if (
|
18411
|
-
|
18388
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18389
|
+
swiperRef.current.swiper.autoplay.start();
|
18412
18390
|
}
|
18413
18391
|
}, []);
|
18414
18392
|
const handleSlideChange = useCallback((swiper) => {
|
@@ -18429,7 +18407,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18429
18407
|
enabled: true
|
18430
18408
|
}
|
18431
18409
|
}
|
18432
|
-
: {}), { loop: true, ref:
|
18410
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18433
18411
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18434
18412
|
fontSize: '14px'
|
18435
18413
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18446,7 +18424,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18446
18424
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18447
18425
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18448
18426
|
}))));
|
18449
|
-
}
|
18427
|
+
};
|
18450
18428
|
var PictureGroup$5 = memo(PictureGroup$4);
|
18451
18429
|
|
18452
18430
|
/*
|
@@ -18726,7 +18704,7 @@ var NavBack$1 = memo(NavBack);
|
|
18726
18704
|
* @Author: binruan@chatlabs.com
|
18727
18705
|
* @Date: 2024-03-20 10:27:31
|
18728
18706
|
* @LastEditors: binruan@chatlabs.com
|
18729
|
-
* @LastEditTime: 2025-05-
|
18707
|
+
* @LastEditTime: 2025-05-09 15:51:40
|
18730
18708
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18731
18709
|
*
|
18732
18710
|
*/
|
@@ -18746,7 +18724,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18746
18724
|
const skipLinkRef = useRef(false);
|
18747
18725
|
const [pageNum, setPageNum] = useState(2);
|
18748
18726
|
const videoWidgetRef = useRef(null);
|
18749
|
-
const pictureGroupRef = useRef(null);
|
18750
18727
|
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();
|
18751
18728
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18752
18729
|
const isShowFingerTip = useMemo(() => {
|
@@ -18794,7 +18771,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18794
18771
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
18795
18772
|
}, [data, ctaType, swiperRef]);
|
18796
18773
|
const handleSessionCompleted = useCallback((fk) => {
|
18797
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
18774
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
18798
18775
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
18799
18776
|
let fromKName = '';
|
18800
18777
|
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))) {
|
@@ -18821,13 +18798,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18821
18798
|
eventSubject: 'sessionCompleted',
|
18822
18799
|
eventDescription: 'Session completed',
|
18823
18800
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
18824
|
-
|
18825
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
18801
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
18826
18802
|
position: activeIndex + '',
|
18827
18803
|
fromKName: fk || fromKName,
|
18828
18804
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
18829
|
-
ctatId: (
|
18830
|
-
traceInfo: (
|
18805
|
+
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
18806
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
|
18831
18807
|
}
|
18832
18808
|
});
|
18833
18809
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -18886,9 +18862,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18886
18862
|
refreshFeSession
|
18887
18863
|
]);
|
18888
18864
|
const handleSessionExpire = useCallback(debounce(() => {
|
18889
|
-
var _a
|
18865
|
+
var _a;
|
18890
18866
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
18891
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
18892
18867
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
18893
18868
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
18894
18869
|
useEffect(() => {
|
@@ -18958,18 +18933,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18958
18933
|
return null;
|
18959
18934
|
}, [globalConfig, activeIndex, visList]);
|
18960
18935
|
const renderContent = useCallback((rec, index) => {
|
18961
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18936
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18962
18937
|
if (rec === 'organic menu') {
|
18963
18938
|
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)));
|
18964
18939
|
}
|
18965
|
-
if ((
|
18940
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
18966
18941
|
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 })));
|
18967
18942
|
}
|
18968
|
-
if ((
|
18969
|
-
return (React.createElement(PictureGroup$5,
|
18943
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
18944
|
+
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 }));
|
18970
18945
|
}
|
18971
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
18972
|
-
return (
|
18946
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
18947
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
18973
18948
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
18974
18949
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
18975
18950
|
const Component = withBindDataSource(t);
|
@@ -19007,7 +18982,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19007
18982
|
};
|
19008
18983
|
}, [isShowMore]);
|
19009
18984
|
const renderBottom = useCallback((rec, index) => {
|
19010
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
18985
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19011
18986
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19012
18987
|
let cta = null;
|
19013
18988
|
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) {
|
@@ -19016,27 +18991,24 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19016
18991
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19017
18992
|
cta = '商品CTA';
|
19018
18993
|
}
|
19019
|
-
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)) {
|
19020
|
-
cta = '服务CTA';
|
19021
|
-
}
|
19022
18994
|
else {
|
19023
|
-
cta = (
|
18995
|
+
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;
|
19024
18996
|
}
|
19025
18997
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19026
18998
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19027
18999
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19028
|
-
((
|
19000
|
+
((_f = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _f === void 0 ? void 0 : _f.includes((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type));
|
19029
19001
|
return (React.createElement(React.Fragment, null,
|
19030
19002
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19031
|
-
((
|
19032
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19003
|
+
((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
19004
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
|
19033
19005
|
React.createElement(Nudge, { nudge: nudge }),
|
19034
19006
|
((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' },
|
19035
19007
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19036
19008
|
React.createElement("div", null,
|
19037
|
-
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: (
|
19009
|
+
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: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', 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 }),
|
19038
19010
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19039
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19011
|
+
React.createElement(Hashtag$1, { index: activeIndex, tags: (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.hashTags) !== null && _o !== void 0 ? _o : [], itemId: (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.itemId, itemType: ((_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
19040
19012
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19041
19013
|
}
|
19042
19014
|
return null;
|
@@ -19075,7 +19047,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19075
19047
|
return null;
|
19076
19048
|
}, [globalConfig, waterFallData]);
|
19077
19049
|
const handleViewImageStartEnd = (item) => {
|
19078
|
-
var _a, _b, _c, _d, _e, _f
|
19050
|
+
var _a, _b, _c, _d, _e, _f;
|
19079
19051
|
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)) {
|
19080
19052
|
const endTime = Date.now();
|
19081
19053
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19084,11 +19056,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19084
19056
|
eventSubject: 'viewImageCarouselEnd',
|
19085
19057
|
eventDescription: 'User end view the image carousel',
|
19086
19058
|
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 : '',
|
19087
|
-
|
19088
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19059
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19089
19060
|
imageEndTime: `${endTime}`,
|
19090
19061
|
playDuration: `${duration}`,
|
19091
|
-
contentTags: JSON.stringify((
|
19062
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19092
19063
|
position: activeIndex + '',
|
19093
19064
|
contentFormat: 'image',
|
19094
19065
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19097,7 +19068,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19097
19068
|
}
|
19098
19069
|
};
|
19099
19070
|
const handleSlideSkip = (item, position) => {
|
19100
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
19071
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
19101
19072
|
if (isPreview || waterFallData)
|
19102
19073
|
return;
|
19103
19074
|
const t = new Date() - curTime.current;
|
@@ -19123,8 +19094,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19123
19094
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19124
19095
|
position: position + '',
|
19125
19096
|
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 : '',
|
19126
|
-
|
19127
|
-
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 : '',
|
19097
|
+
traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
|
19128
19098
|
contentFormat
|
19129
19099
|
}
|
19130
19100
|
});
|
@@ -19134,7 +19104,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19134
19104
|
}
|
19135
19105
|
};
|
19136
19106
|
const handleScrollEvent = (swiper) => {
|
19137
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
19107
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19138
19108
|
const item = data[swiper.previousIndex];
|
19139
19109
|
if (!item)
|
19140
19110
|
return;
|
@@ -19151,12 +19121,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19151
19121
|
eventSubject: 'scrollDown',
|
19152
19122
|
eventDescription: 'User scroll down',
|
19153
19123
|
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 : '',
|
19154
|
-
|
19155
|
-
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 : '',
|
19124
|
+
productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
19156
19125
|
requestId: null,
|
19157
|
-
traceInfo: (
|
19126
|
+
traceInfo: (_l = (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : (_k = item === null || item === void 0 ? void 0 : item.product) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : '',
|
19158
19127
|
contentFormat,
|
19159
|
-
position: ((
|
19128
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
19160
19129
|
}
|
19161
19130
|
});
|
19162
19131
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19168,13 +19137,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19168
19137
|
eventInfo: {
|
19169
19138
|
eventSubject: 'scrollUp',
|
19170
19139
|
eventDescription: 'User scroll up',
|
19171
|
-
contentId: (
|
19172
|
-
|
19173
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19140
|
+
contentId: (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
19141
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
19174
19142
|
requestId: null,
|
19175
|
-
traceInfo: (
|
19143
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : '',
|
19176
19144
|
contentFormat,
|
19177
|
-
position: ((
|
19145
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
19178
19146
|
}
|
19179
19147
|
});
|
19180
19148
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19200,7 +19168,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19200
19168
|
}
|
19201
19169
|
}, [openHashtag, data, activeIndex]);
|
19202
19170
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19203
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
19171
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19204
19172
|
const item = data[activeIndex];
|
19205
19173
|
// 如果是图片集则上报事件
|
19206
19174
|
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)) {
|
@@ -19211,10 +19179,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19211
19179
|
eventSubject: 'viewImageCarouselStart',
|
19212
19180
|
eventDescription: 'User start view the image carousel',
|
19213
19181
|
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 : '',
|
19214
|
-
|
19215
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19182
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19216
19183
|
imageStartTime: `${startTime}`,
|
19217
|
-
contentTags: JSON.stringify((
|
19184
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19218
19185
|
position: activeIndex + '',
|
19219
19186
|
contentFormat: 'image',
|
19220
19187
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19224,11 +19191,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19224
19191
|
if (enableCapi) {
|
19225
19192
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19226
19193
|
eventName: 'ViewContent',
|
19227
|
-
product: (
|
19194
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
19228
19195
|
});
|
19229
19196
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19230
19197
|
eventName: 'PageView',
|
19231
|
-
product: (
|
19198
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
19232
19199
|
});
|
19233
19200
|
}
|
19234
19201
|
}
|
@@ -19320,20 +19287,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19320
19287
|
swiperRef.current.swiper.allowTouchMove = true;
|
19321
19288
|
}, 500);
|
19322
19289
|
}, onActiveIndexChange: (swiper) => {
|
19323
|
-
var _a, _b;
|
19324
19290
|
setActiveIndex(swiper.activeIndex);
|
19325
19291
|
if (openHashtag)
|
19326
19292
|
return;
|
19327
19293
|
// 处理上滑下滑事件
|
19328
19294
|
handleScrollEvent(swiper);
|
19329
|
-
if (waterFallData || isEditor)
|
19295
|
+
if (waterFallData || isEditor || isDiyH5)
|
19330
19296
|
return;
|
19331
19297
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19332
19298
|
if (!isLoadMore) {
|
19333
|
-
if (isDiyH5) {
|
19334
|
-
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19335
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19336
|
-
}
|
19337
19299
|
setIsLoadMore(true);
|
19338
19300
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19339
19301
|
var _a;
|
@@ -19386,7 +19348,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19386
19348
|
}, []);
|
19387
19349
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19388
19350
|
const handlePlaying = useCallback(() => {
|
19389
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19351
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19390
19352
|
setIsPauseVideo(false);
|
19391
19353
|
const item = data[index];
|
19392
19354
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19399,15 +19361,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19399
19361
|
eventSubject: 'playVideo',
|
19400
19362
|
eventDescription: 'User played the video',
|
19401
19363
|
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 : '',
|
19402
|
-
|
19403
|
-
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 : '',
|
19364
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
19404
19365
|
playType,
|
19405
19366
|
startTime: videoCurrentTime,
|
19406
19367
|
videoDuration,
|
19407
|
-
contentTags: JSON.stringify((
|
19368
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
19408
19369
|
position: index + '',
|
19409
19370
|
contentFormat: 'video',
|
19410
|
-
traceInfo: (
|
19371
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19411
19372
|
}
|
19412
19373
|
});
|
19413
19374
|
setIsFirstPlay(false);
|
@@ -19446,7 +19407,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19446
19407
|
}
|
19447
19408
|
}, [isLoadFinish]);
|
19448
19409
|
const onPause = useCallback(() => {
|
19449
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19410
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19450
19411
|
const item = data[index];
|
19451
19412
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19452
19413
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19457,15 +19418,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19457
19418
|
eventSubject: 'playOverVideo',
|
19458
19419
|
eventDescription: 'User finished playing the video',
|
19459
19420
|
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 : '',
|
19460
|
-
|
19461
|
-
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 : '',
|
19421
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
19462
19422
|
endTime: videoCurrentTime,
|
19463
19423
|
videoDuration,
|
19464
19424
|
playDuration,
|
19465
|
-
contentTags: JSON.stringify((
|
19425
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
19466
19426
|
position: index + '',
|
19467
19427
|
contentFormat: 'video',
|
19468
|
-
traceInfo: (
|
19428
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19469
19429
|
}
|
19470
19430
|
});
|
19471
19431
|
}
|