pb-sxp-ui 1.16.10 → 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 +140 -164
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +140 -164
- 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 +140 -164
- 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 -42
- package/es/core/components/SxpPageRender/VideoWidget/index.js +44 -34
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +36 -47
- package/es/core/context/SxpDataSourceProvider.js +2 -2
- 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 -41
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +44 -34
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +36 -47
- package/lib/core/context/SxpDataSourceProvider.js +2 -2
- 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
@@ -1063,7 +1063,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1063
1063
|
}
|
1064
1064
|
}), [bffFetch, utmVal]);
|
1065
1065
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
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
|
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;
|
1067
1067
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1068
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);
|
1069
1069
|
let fromKName = '';
|
@@ -1081,7 +1081,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1081
1081
|
}
|
1082
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;
|
1083
1083
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
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 : '',
|
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 })
|
1085
1085
|
});
|
1086
1086
|
}, [bffEventReport, isFromHashtag]);
|
1087
1087
|
const h5EnterLink = useCallback(() => {
|
@@ -1742,14 +1742,14 @@ var settingRender$f = [
|
|
1742
1742
|
* @Author: binruan@chatlabs.com
|
1743
1743
|
* @Date: 2024-03-12 10:59:06
|
1744
1744
|
* @LastEditors: binruan@chatlabs.com
|
1745
|
-
* @LastEditTime:
|
1745
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
1746
1746
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1747
1747
|
*
|
1748
1748
|
*/
|
1749
1749
|
function useEventReport() {
|
1750
1750
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1751
1751
|
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
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
|
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;
|
1753
1753
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1754
1754
|
if (i !== -1) {
|
1755
1755
|
return;
|
@@ -1782,11 +1782,11 @@ function useEventReport() {
|
|
1782
1782
|
contentFormat = 'image';
|
1783
1783
|
}
|
1784
1784
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
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 : '',
|
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 }))
|
1786
1786
|
});
|
1787
1787
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1788
1788
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
1789
|
-
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;
|
1790
1790
|
let fromKName = '';
|
1791
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))) {
|
1792
1792
|
fromKName = 'pdpPage';
|
@@ -1805,9 +1805,8 @@ function useEventReport() {
|
|
1805
1805
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
1806
1806
|
position: position + '',
|
1807
1807
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1808
|
-
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 : '',
|
1809
1808
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1810
|
-
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 : '',
|
1811
1810
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1812
1811
|
eventSubject: 'productView',
|
1813
1812
|
eventDescription: 'User browsed the product'
|
@@ -10359,7 +10358,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
10359
10358
|
const CommodityDetail$1 = (_a) => {
|
10360
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;
|
10361
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"]);
|
10362
|
-
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
10361
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
|
10363
10362
|
const { jumpToWeb, productView } = useEventReport();
|
10364
10363
|
const curTimeRef = useRef(null);
|
10365
10364
|
const [showModal, setShowModal] = useState(false);
|
@@ -10385,6 +10384,12 @@ const CommodityDetail$1 = (_a) => {
|
|
10385
10384
|
if (!isPost) {
|
10386
10385
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
10387
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
|
+
}
|
10388
10393
|
window.location.href = window.getJointUtmLink(product.link);
|
10389
10394
|
}
|
10390
10395
|
};
|
@@ -11287,7 +11292,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
11287
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;
|
11288
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"]);
|
11289
11294
|
useState(true);
|
11290
|
-
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
11295
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
|
11291
11296
|
const { jumpToWeb, productView } = useEventReport();
|
11292
11297
|
useState(false);
|
11293
11298
|
useState(false);
|
@@ -11316,6 +11321,12 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
11316
11321
|
if (!isPost) {
|
11317
11322
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
11318
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
|
+
}
|
11319
11330
|
window.location.href = window.getJointUtmLink(product.link);
|
11320
11331
|
}
|
11321
11332
|
};
|
@@ -15610,7 +15621,7 @@ function WaterfallList(_a) {
|
|
15610
15621
|
* @Author: binruan@chatlabs.com
|
15611
15622
|
* @Date: 2024-01-10 10:58:24
|
15612
15623
|
* @LastEditors: binruan@chatlabs.com
|
15613
|
-
* @LastEditTime: 2025-
|
15624
|
+
* @LastEditTime: 2025-02-28 10:00:31
|
15614
15625
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15615
15626
|
*
|
15616
15627
|
*/
|
@@ -15648,7 +15659,7 @@ const WaterFall = (props) => {
|
|
15648
15659
|
}
|
15649
15660
|
}, [waterFallData]);
|
15650
15661
|
const reportTagsView = useCallback(() => {
|
15651
|
-
var _a, _b, _c, _d, _e, _f
|
15662
|
+
var _a, _b, _c, _d, _e, _f;
|
15652
15663
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15653
15664
|
if (!rec)
|
15654
15665
|
return;
|
@@ -15668,10 +15679,9 @@ const WaterFall = (props) => {
|
|
15668
15679
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15669
15680
|
eventInfo: {
|
15670
15681
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15671
|
-
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 : '',
|
15672
15682
|
position: cacheActiveIndex + '',
|
15673
|
-
contentTags: JSON.stringify((
|
15674
|
-
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,
|
15675
15685
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15676
15686
|
fromKName,
|
15677
15687
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17753,7 +17763,7 @@ const LikeButton = (_a) => {
|
|
17753
17763
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17754
17764
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17755
17765
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17756
|
-
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;
|
17757
17767
|
if (state) {
|
17758
17768
|
// 先设置状态
|
17759
17769
|
setState(false);
|
@@ -17763,12 +17773,11 @@ const LikeButton = (_a) => {
|
|
17763
17773
|
eventSubject: 'favoriteContentCanceled',
|
17764
17774
|
eventDescription: 'This content was unfavorite by the user',
|
17765
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 : '',
|
17766
|
-
|
17767
|
-
|
17768
|
-
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 : []),
|
17769
17778
|
position: position + '',
|
17770
|
-
contentFormat: ((
|
17771
|
-
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
|
17772
17781
|
}
|
17773
17782
|
});
|
17774
17783
|
// 如果接口调用失败,则回滚状态
|
@@ -17776,41 +17785,40 @@ const LikeButton = (_a) => {
|
|
17776
17785
|
setState(true);
|
17777
17786
|
}
|
17778
17787
|
else {
|
17779
|
-
const nRtcList = (
|
17788
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17780
17789
|
if (index === position) {
|
17781
17790
|
item.isCollected = false;
|
17782
17791
|
}
|
17783
17792
|
return item;
|
17784
|
-
})) !== null &&
|
17793
|
+
})) !== null && _p !== void 0 ? _p : [];
|
17785
17794
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17786
17795
|
}
|
17787
17796
|
}
|
17788
17797
|
else {
|
17789
17798
|
setState(true);
|
17790
|
-
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;
|
17791
17800
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17792
17801
|
eventInfo: {
|
17793
17802
|
eventSubject: 'favoriteContent',
|
17794
17803
|
eventDescription: 'This content was favorite by the user',
|
17795
|
-
contentId: (
|
17796
|
-
|
17797
|
-
|
17798
|
-
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 : []),
|
17799
17807
|
position: position + '',
|
17800
|
-
contentFormat: ((
|
17801
|
-
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
|
17802
17810
|
}
|
17803
17811
|
});
|
17804
17812
|
if (!result) {
|
17805
17813
|
setState(false);
|
17806
17814
|
}
|
17807
17815
|
else {
|
17808
|
-
const nRtcList = (
|
17816
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17809
17817
|
if (index === position) {
|
17810
17818
|
item.isCollected = true;
|
17811
17819
|
}
|
17812
17820
|
return item;
|
17813
|
-
})) !== null &&
|
17821
|
+
})) !== null && _z !== void 0 ? _z : [];
|
17814
17822
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17815
17823
|
}
|
17816
17824
|
}
|
@@ -17913,26 +17921,6 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17913
17921
|
return;
|
17914
17922
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
17915
17923
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17916
|
-
const handleEnd = () => {
|
17917
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
17918
|
-
if (!videoRef.current)
|
17919
|
-
return;
|
17920
|
-
if (isDiyH5) {
|
17921
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
17922
|
-
if (!loopPlayRef.current)
|
17923
|
-
return;
|
17924
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
17925
|
-
(_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.slideTo(0);
|
17926
|
-
}
|
17927
|
-
else {
|
17928
|
-
const i = (_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.activeIndex;
|
17929
|
-
(_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.slideTo(i + 1);
|
17930
|
-
}
|
17931
|
-
}
|
17932
|
-
else {
|
17933
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.play();
|
17934
|
-
}
|
17935
|
-
};
|
17936
17924
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
17937
17925
|
const handlePlaying = useCallback(() => {
|
17938
17926
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -17941,7 +17929,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17941
17929
|
setIsLoadFinish(true);
|
17942
17930
|
}, []);
|
17943
17931
|
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
17944
|
-
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;
|
17945
17933
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
17946
17934
|
return;
|
17947
17935
|
setIsPauseVideo(false);
|
@@ -17952,11 +17940,16 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17952
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);
|
17953
17941
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
17954
17942
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17955
|
-
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) + '' }))
|
17956
17944
|
});
|
17957
17945
|
isFirstPlayRef.current = false;
|
17958
17946
|
}
|
17959
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
|
+
}, []);
|
17960
17953
|
const handLoadeddata = useCallback(() => {
|
17961
17954
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
17962
17955
|
return;
|
@@ -17981,12 +17974,13 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17981
17974
|
const handleLoadedmetadata = useCallback(() => {
|
17982
17975
|
if (!videoRef.current)
|
17983
17976
|
return;
|
17977
|
+
setCurrentTimeByStartTime();
|
17984
17978
|
loadedTimeRef.current = new Date();
|
17985
17979
|
handleStartPlay();
|
17986
17980
|
handLoadeddata();
|
17987
17981
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
17988
17982
|
const handleClickVideo = useCallback((type) => () => {
|
17989
|
-
var _a, _b, _c, _d, _e;
|
17983
|
+
var _a, _b, _c, _d, _e, _f;
|
17990
17984
|
if (!videoRef.current)
|
17991
17985
|
return;
|
17992
17986
|
if (!isLoadFinish)
|
@@ -18007,17 +18001,20 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18007
18001
|
break;
|
18008
18002
|
default:
|
18009
18003
|
if (isPause) {
|
18010
|
-
(_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();
|
18011
18008
|
}
|
18012
18009
|
else {
|
18013
|
-
(
|
18010
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
18014
18011
|
}
|
18015
18012
|
setIsPauseVideo(!isPause);
|
18016
18013
|
break;
|
18017
18014
|
}
|
18018
18015
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18019
18016
|
const handlePause = useCallback(() => {
|
18020
|
-
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;
|
18021
18018
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18022
18019
|
return;
|
18023
18020
|
if (activeIndex !== index)
|
@@ -18033,15 +18030,14 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18033
18030
|
eventSubject: 'playOverVideo',
|
18034
18031
|
eventDescription: 'User finished playing the video',
|
18035
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 : '',
|
18036
|
-
|
18037
|
-
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 : '',
|
18038
18034
|
endTime: videoCurrentTime,
|
18039
18035
|
videoDuration,
|
18040
18036
|
playDuration,
|
18041
|
-
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 : []),
|
18042
18038
|
position: index + '',
|
18043
18039
|
contentFormat: 'video',
|
18044
|
-
traceInfo: (
|
18040
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
18045
18041
|
}
|
18046
18042
|
});
|
18047
18043
|
}
|
@@ -18049,8 +18045,27 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18049
18045
|
const handleWaiting = useCallback(() => {
|
18050
18046
|
setWaiting(true);
|
18051
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
|
+
};
|
18052
18067
|
useEffect(() => {
|
18053
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18068
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18054
18069
|
if (!isActive)
|
18055
18070
|
return;
|
18056
18071
|
const videoSrc = videoUrl;
|
@@ -18071,6 +18086,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18071
18086
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18072
18087
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18073
18088
|
var _a;
|
18089
|
+
setCurrentTimeByStartTime();
|
18074
18090
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18075
18091
|
});
|
18076
18092
|
}
|
@@ -18084,11 +18100,12 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18084
18100
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18085
18101
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18086
18102
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18087
|
-
(_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);
|
18088
18104
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18089
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);
|
18090
18107
|
return () => {
|
18091
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18108
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18092
18109
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18093
18110
|
if (!isPause)
|
18094
18111
|
handlePause();
|
@@ -18100,9 +18117,10 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18100
18117
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18101
18118
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18102
18119
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18103
|
-
(_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);
|
18104
18121
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18105
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);
|
18106
18124
|
};
|
18107
18125
|
}, [isActive]);
|
18108
18126
|
useEffect(() => {
|
@@ -18313,48 +18331,19 @@ const Picture = (props) => {
|
|
18313
18331
|
}, onLoad: onShowFirstImage }))));
|
18314
18332
|
};
|
18315
18333
|
|
18316
|
-
const PictureGroup$4 =
|
18334
|
+
const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
18317
18335
|
var _a, _b;
|
18318
18336
|
const { isActive } = useSwiperSlide();
|
18319
|
-
const { sxpParameter, openHashtag
|
18337
|
+
const { sxpParameter, openHashtag } = useSxpDataSource();
|
18320
18338
|
const [isLoad, setIsLoad] = useState(false);
|
18321
18339
|
const [imgInfo, setImgInfo] = useState();
|
18322
18340
|
const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
|
18323
|
-
const
|
18341
|
+
const swiperRef = useRef();
|
18324
18342
|
const isFirstPlayRef = useRef(true);
|
18325
|
-
const loopPlayRef = useRef(true);
|
18326
18343
|
const initTime = new Date();
|
18327
|
-
useImperativeHandle(ref, () => {
|
18328
|
-
return {
|
18329
|
-
setLoopPlay(v) {
|
18330
|
-
loopPlayRef.current = v;
|
18331
|
-
}
|
18332
|
-
};
|
18333
|
-
});
|
18334
|
-
useEffect(() => {
|
18335
|
-
let timerId;
|
18336
|
-
if (isLoad && isActive && isDiyH5) {
|
18337
|
-
timerId = setTimeout(() => {
|
18338
|
-
var _a, _b, _c, _d, _e, _f;
|
18339
|
-
if (!loopPlayRef.current)
|
18340
|
-
return;
|
18341
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18342
|
-
(_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.slideTo(0);
|
18343
|
-
}
|
18344
|
-
else {
|
18345
|
-
const i = (_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.activeIndex;
|
18346
|
-
(_f = (_e = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _e === void 0 ? void 0 : _e.swiper) === null || _f === void 0 ? void 0 : _f.slideTo(i + 1);
|
18347
|
-
}
|
18348
|
-
}, 3000);
|
18349
|
-
}
|
18350
|
-
return () => {
|
18351
|
-
if (timerId)
|
18352
|
-
clearTimeout(timerId);
|
18353
|
-
};
|
18354
|
-
}, [isLoad, isActive, isDiyH5, data, index, swiperRef]);
|
18355
18344
|
useEffect(() => {
|
18356
18345
|
if (isLoad && isActive) {
|
18357
|
-
(
|
18346
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
18358
18347
|
if (openHashtag) {
|
18359
18348
|
onViewImageEndEvent(rec);
|
18360
18349
|
}
|
@@ -18364,7 +18353,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18364
18353
|
}
|
18365
18354
|
}
|
18366
18355
|
else {
|
18367
|
-
(
|
18356
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
18368
18357
|
}
|
18369
18358
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18370
18359
|
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18391,13 +18380,13 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18391
18380
|
};
|
18392
18381
|
}, [isActive, imgInfo]);
|
18393
18382
|
const handleMouseEnter = useCallback(() => {
|
18394
|
-
if (
|
18395
|
-
|
18383
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18384
|
+
swiperRef.current.swiper.autoplay.stop();
|
18396
18385
|
}
|
18397
18386
|
}, []);
|
18398
18387
|
const handleMouseLeave = useCallback(() => {
|
18399
|
-
if (
|
18400
|
-
|
18388
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18389
|
+
swiperRef.current.swiper.autoplay.start();
|
18401
18390
|
}
|
18402
18391
|
}, []);
|
18403
18392
|
const handleSlideChange = useCallback((swiper) => {
|
@@ -18418,7 +18407,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18418
18407
|
enabled: true
|
18419
18408
|
}
|
18420
18409
|
}
|
18421
|
-
: {}), { loop: true, ref:
|
18410
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18422
18411
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18423
18412
|
fontSize: '14px'
|
18424
18413
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18435,7 +18424,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18435
18424
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18436
18425
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18437
18426
|
}))));
|
18438
|
-
}
|
18427
|
+
};
|
18439
18428
|
var PictureGroup$5 = memo(PictureGroup$4);
|
18440
18429
|
|
18441
18430
|
/*
|
@@ -18715,7 +18704,7 @@ var NavBack$1 = memo(NavBack);
|
|
18715
18704
|
* @Author: binruan@chatlabs.com
|
18716
18705
|
* @Date: 2024-03-20 10:27:31
|
18717
18706
|
* @LastEditors: binruan@chatlabs.com
|
18718
|
-
* @LastEditTime: 2025-05-
|
18707
|
+
* @LastEditTime: 2025-05-09 15:51:40
|
18719
18708
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18720
18709
|
*
|
18721
18710
|
*/
|
@@ -18735,7 +18724,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18735
18724
|
const skipLinkRef = useRef(false);
|
18736
18725
|
const [pageNum, setPageNum] = useState(2);
|
18737
18726
|
const videoWidgetRef = useRef(null);
|
18738
|
-
const pictureGroupRef = useRef(null);
|
18739
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();
|
18740
18728
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18741
18729
|
const isShowFingerTip = useMemo(() => {
|
@@ -18783,7 +18771,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18783
18771
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
18784
18772
|
}, [data, ctaType, swiperRef]);
|
18785
18773
|
const handleSessionCompleted = useCallback((fk) => {
|
18786
|
-
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;
|
18787
18775
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
18788
18776
|
let fromKName = '';
|
18789
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))) {
|
@@ -18810,13 +18798,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18810
18798
|
eventSubject: 'sessionCompleted',
|
18811
18799
|
eventDescription: 'Session completed',
|
18812
18800
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
18813
|
-
|
18814
|
-
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,
|
18815
18802
|
position: activeIndex + '',
|
18816
18803
|
fromKName: fk || fromKName,
|
18817
18804
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
18818
|
-
ctatId: (
|
18819
|
-
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 : ''
|
18820
18807
|
}
|
18821
18808
|
});
|
18822
18809
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -18875,9 +18862,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18875
18862
|
refreshFeSession
|
18876
18863
|
]);
|
18877
18864
|
const handleSessionExpire = useCallback(debounce(() => {
|
18878
|
-
var _a
|
18865
|
+
var _a;
|
18879
18866
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
18880
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
18881
18867
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
18882
18868
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
18883
18869
|
useEffect(() => {
|
@@ -18947,18 +18933,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18947
18933
|
return null;
|
18948
18934
|
}, [globalConfig, activeIndex, visList]);
|
18949
18935
|
const renderContent = useCallback((rec, index) => {
|
18950
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18936
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18951
18937
|
if (rec === 'organic menu') {
|
18952
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)));
|
18953
18939
|
}
|
18954
|
-
if ((
|
18940
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
18955
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 })));
|
18956
18942
|
}
|
18957
|
-
if ((
|
18958
|
-
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 }));
|
18959
18945
|
}
|
18960
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
18961
|
-
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) => {
|
18962
18948
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
18963
18949
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
18964
18950
|
const Component = withBindDataSource(t);
|
@@ -18996,7 +18982,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18996
18982
|
};
|
18997
18983
|
}, [isShowMore]);
|
18998
18984
|
const renderBottom = useCallback((rec, index) => {
|
18999
|
-
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;
|
19000
18986
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19001
18987
|
let cta = null;
|
19002
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) {
|
@@ -19005,27 +18991,24 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19005
18991
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19006
18992
|
cta = '商品CTA';
|
19007
18993
|
}
|
19008
|
-
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)) {
|
19009
|
-
cta = '服务CTA';
|
19010
|
-
}
|
19011
18994
|
else {
|
19012
|
-
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;
|
19013
18996
|
}
|
19014
18997
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19015
18998
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19016
18999
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19017
|
-
((
|
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));
|
19018
19001
|
return (React.createElement(React.Fragment, null,
|
19019
19002
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19020
|
-
((
|
19021
|
-
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` } },
|
19022
19005
|
React.createElement(Nudge, { nudge: nudge }),
|
19023
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' },
|
19024
19007
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19025
19008
|
React.createElement("div", null,
|
19026
|
-
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 }),
|
19027
19010
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19028
|
-
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) }))),
|
19029
19012
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19030
19013
|
}
|
19031
19014
|
return null;
|
@@ -19064,7 +19047,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19064
19047
|
return null;
|
19065
19048
|
}, [globalConfig, waterFallData]);
|
19066
19049
|
const handleViewImageStartEnd = (item) => {
|
19067
|
-
var _a, _b, _c, _d, _e, _f
|
19050
|
+
var _a, _b, _c, _d, _e, _f;
|
19068
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)) {
|
19069
19052
|
const endTime = Date.now();
|
19070
19053
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19073,11 +19056,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19073
19056
|
eventSubject: 'viewImageCarouselEnd',
|
19074
19057
|
eventDescription: 'User end view the image carousel',
|
19075
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 : '',
|
19076
|
-
|
19077
|
-
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 : '',
|
19078
19060
|
imageEndTime: `${endTime}`,
|
19079
19061
|
playDuration: `${duration}`,
|
19080
|
-
contentTags: JSON.stringify((
|
19062
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19081
19063
|
position: activeIndex + '',
|
19082
19064
|
contentFormat: 'image',
|
19083
19065
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19086,7 +19068,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19086
19068
|
}
|
19087
19069
|
};
|
19088
19070
|
const handleSlideSkip = (item, position) => {
|
19089
|
-
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;
|
19090
19072
|
if (isPreview || waterFallData)
|
19091
19073
|
return;
|
19092
19074
|
const t = new Date() - curTime.current;
|
@@ -19112,8 +19094,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19112
19094
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19113
19095
|
position: position + '',
|
19114
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 : '',
|
19115
|
-
|
19116
|
-
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 : '',
|
19117
19098
|
contentFormat
|
19118
19099
|
}
|
19119
19100
|
});
|
@@ -19123,7 +19104,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19123
19104
|
}
|
19124
19105
|
};
|
19125
19106
|
const handleScrollEvent = (swiper) => {
|
19126
|
-
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;
|
19127
19108
|
const item = data[swiper.previousIndex];
|
19128
19109
|
if (!item)
|
19129
19110
|
return;
|
@@ -19140,12 +19121,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19140
19121
|
eventSubject: 'scrollDown',
|
19141
19122
|
eventDescription: 'User scroll down',
|
19142
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 : '',
|
19143
|
-
|
19144
|
-
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 : '',
|
19145
19125
|
requestId: null,
|
19146
|
-
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 : '',
|
19147
19127
|
contentFormat,
|
19148
|
-
position: ((
|
19128
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
19149
19129
|
}
|
19150
19130
|
});
|
19151
19131
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19157,13 +19137,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19157
19137
|
eventInfo: {
|
19158
19138
|
eventSubject: 'scrollUp',
|
19159
19139
|
eventDescription: 'User scroll up',
|
19160
|
-
contentId: (
|
19161
|
-
|
19162
|
-
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 : '',
|
19163
19142
|
requestId: null,
|
19164
|
-
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 : '',
|
19165
19144
|
contentFormat,
|
19166
|
-
position: ((
|
19145
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
19167
19146
|
}
|
19168
19147
|
});
|
19169
19148
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19189,7 +19168,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19189
19168
|
}
|
19190
19169
|
}, [openHashtag, data, activeIndex]);
|
19191
19170
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19192
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
19171
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19193
19172
|
const item = data[activeIndex];
|
19194
19173
|
// 如果是图片集则上报事件
|
19195
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)) {
|
@@ -19200,10 +19179,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19200
19179
|
eventSubject: 'viewImageCarouselStart',
|
19201
19180
|
eventDescription: 'User start view the image carousel',
|
19202
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 : '',
|
19203
|
-
|
19204
|
-
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 : '',
|
19205
19183
|
imageStartTime: `${startTime}`,
|
19206
|
-
contentTags: JSON.stringify((
|
19184
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19207
19185
|
position: activeIndex + '',
|
19208
19186
|
contentFormat: 'image',
|
19209
19187
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19213,11 +19191,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19213
19191
|
if (enableCapi) {
|
19214
19192
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19215
19193
|
eventName: 'ViewContent',
|
19216
|
-
product: (
|
19194
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
19217
19195
|
});
|
19218
19196
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19219
19197
|
eventName: 'PageView',
|
19220
|
-
product: (
|
19198
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
19221
19199
|
});
|
19222
19200
|
}
|
19223
19201
|
}
|
@@ -19370,7 +19348,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19370
19348
|
}, []);
|
19371
19349
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19372
19350
|
const handlePlaying = useCallback(() => {
|
19373
|
-
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;
|
19374
19352
|
setIsPauseVideo(false);
|
19375
19353
|
const item = data[index];
|
19376
19354
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19383,15 +19361,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19383
19361
|
eventSubject: 'playVideo',
|
19384
19362
|
eventDescription: 'User played the video',
|
19385
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 : '',
|
19386
|
-
|
19387
|
-
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 : '',
|
19388
19365
|
playType,
|
19389
19366
|
startTime: videoCurrentTime,
|
19390
19367
|
videoDuration,
|
19391
|
-
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 : []),
|
19392
19369
|
position: index + '',
|
19393
19370
|
contentFormat: 'video',
|
19394
|
-
traceInfo: (
|
19371
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19395
19372
|
}
|
19396
19373
|
});
|
19397
19374
|
setIsFirstPlay(false);
|
@@ -19430,7 +19407,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19430
19407
|
}
|
19431
19408
|
}, [isLoadFinish]);
|
19432
19409
|
const onPause = useCallback(() => {
|
19433
|
-
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;
|
19434
19411
|
const item = data[index];
|
19435
19412
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19436
19413
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19441,15 +19418,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19441
19418
|
eventSubject: 'playOverVideo',
|
19442
19419
|
eventDescription: 'User finished playing the video',
|
19443
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 : '',
|
19444
|
-
|
19445
|
-
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 : '',
|
19446
19422
|
endTime: videoCurrentTime,
|
19447
19423
|
videoDuration,
|
19448
19424
|
playDuration,
|
19449
|
-
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 : []),
|
19450
19426
|
position: index + '',
|
19451
19427
|
contentFormat: 'video',
|
19452
|
-
traceInfo: (
|
19428
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19453
19429
|
}
|
19454
19430
|
});
|
19455
19431
|
}
|