pb-sxp-ui 1.15.23-alpha.1 → 1.15.24
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 +143 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +143 -157
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +5 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +5 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +143 -157
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +5 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/es/core/components/SxpPageRender/ExpandableText.js +52 -44
- package/es/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/es/core/components/SxpPageRender/VideoWidget/index.js +18 -20
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +33 -42
- package/es/core/context/SxpDataSourceProvider.js +2 -2
- package/es/core/hooks/useEventReport.js +5 -6
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/SxpPageRender/ExpandableText.js +51 -44
- package/lib/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +18 -20
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +33 -42
- package/lib/core/context/SxpDataSourceProvider.js +2 -2
- package/lib/core/hooks/useEventReport.js +5 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1080,7 +1080,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1080
1080
|
}
|
1081
1081
|
}), [bffFetch, utmVal]);
|
1082
1082
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
1083
|
-
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
|
1083
|
+
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;
|
1084
1084
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1085
1085
|
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);
|
1086
1086
|
let fromKName = '';
|
@@ -1098,7 +1098,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1098
1098
|
}
|
1099
1099
|
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;
|
1100
1100
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1101
|
-
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 : '',
|
1101
|
+
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 })
|
1102
1102
|
});
|
1103
1103
|
}, [bffEventReport, isFromHashtag]);
|
1104
1104
|
const h5EnterLink = useCallback(() => {
|
@@ -1759,14 +1759,14 @@ var settingRender$f = [
|
|
1759
1759
|
* @Author: binruan@chatlabs.com
|
1760
1760
|
* @Date: 2024-03-12 10:59:06
|
1761
1761
|
* @LastEditors: binruan@chatlabs.com
|
1762
|
-
* @LastEditTime:
|
1762
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
1763
1763
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1764
1764
|
*
|
1765
1765
|
*/
|
1766
1766
|
function useEventReport() {
|
1767
1767
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1768
1768
|
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
1769
|
-
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
|
1769
|
+
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;
|
1770
1770
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1771
1771
|
if (i !== -1) {
|
1772
1772
|
return;
|
@@ -1799,11 +1799,11 @@ function useEventReport() {
|
|
1799
1799
|
contentFormat = 'image';
|
1800
1800
|
}
|
1801
1801
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1802
|
-
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 : '',
|
1802
|
+
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 }))
|
1803
1803
|
});
|
1804
1804
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1805
1805
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
1806
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
1806
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1807
1807
|
let fromKName = '';
|
1808
1808
|
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))) {
|
1809
1809
|
fromKName = 'pdpPage';
|
@@ -1822,9 +1822,8 @@ function useEventReport() {
|
|
1822
1822
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
1823
1823
|
position: position + '',
|
1824
1824
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1825
|
-
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 : '',
|
1826
1825
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1827
|
-
traceInfo: (
|
1826
|
+
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 : '',
|
1828
1827
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1829
1828
|
eventSubject: 'productView',
|
1830
1829
|
eventDescription: 'User browsed the product'
|
@@ -10188,69 +10187,72 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
10188
10187
|
};
|
10189
10188
|
var Modal$1 = memo(Modal);
|
10190
10189
|
|
10191
|
-
/*
|
10192
|
-
* @Author: binruan@chatlabs.com
|
10193
|
-
* @Date: 2023-12-26 16:11:34
|
10194
|
-
* @LastEditors: binruan@chatlabs.com
|
10195
|
-
* @LastEditTime: 2024-11-07 14:27:18
|
10196
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
|
10197
|
-
*
|
10198
|
-
*/
|
10199
|
-
const limitTextLastWholeWord = (originalText = '', limit) => {
|
10200
|
-
// 匹配到中文
|
10201
|
-
const chineseRegex = /[\u4e00-\u9fa5]+/;
|
10202
|
-
if (chineseRegex.test(originalText)) {
|
10203
|
-
return originalText.slice(0, 54);
|
10204
|
-
}
|
10205
|
-
const words = originalText.split(' ');
|
10206
|
-
const newWords = [];
|
10207
|
-
for (let i = 0; i < words.length; i++) {
|
10208
|
-
newWords.push(words[i]);
|
10209
|
-
const tempText = newWords.join(' ');
|
10210
|
-
if (tempText.length >= limit)
|
10211
|
-
break;
|
10212
|
-
}
|
10213
|
-
// const _words = newWords.length === words.length ? newWords : newWords.slice(0, newWords.length - 1);
|
10214
|
-
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
10215
|
-
return _words.join(' ') + ' ';
|
10216
|
-
};
|
10217
10190
|
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText, isPost, onChange }) => {
|
10218
10191
|
const [isShowMore, setIsShowMore] = useState(false);
|
10219
10192
|
const [isShow, setIsShow] = useState(false);
|
10220
|
-
const
|
10193
|
+
const _a = style || {}, { lineClamp } = _a, textStyle = __rest(_a, ["lineClamp"]);
|
10194
|
+
const textLineClamp = Number(lineClamp || 2);
|
10221
10195
|
const multiRow = useRef(null);
|
10222
|
-
|
10223
|
-
const handleClick =
|
10196
|
+
useRef();
|
10197
|
+
const handleClick = () => {
|
10224
10198
|
setIsShowMore(!isShowMore);
|
10225
|
-
|
10226
|
-
|
10227
|
-
|
10228
|
-
|
10229
|
-
|
10199
|
+
};
|
10200
|
+
const checkOverflow = useCallback(() => {
|
10201
|
+
if (!multiRow.current || !isPost || !text)
|
10202
|
+
return;
|
10203
|
+
// 强制同步布局(消除浏览器优化导致的误差)
|
10204
|
+
const triggerReflow = (el) => el.offsetHeight;
|
10205
|
+
// 分三步精确测量
|
10206
|
+
requestAnimationFrame(() => {
|
10207
|
+
// 第一步:获取干净状态
|
10208
|
+
const el = multiRow.current;
|
10209
|
+
triggerReflow(el);
|
10210
|
+
// 第二步:测量无约束状态的真实高度
|
10211
|
+
const originalStyle = el.style.cssText;
|
10212
|
+
el.style.webkitLineClamp = 'unset';
|
10213
|
+
el.style.display = 'block';
|
10214
|
+
triggerReflow(el);
|
10215
|
+
const realHeight = el.getBoundingClientRect().height;
|
10216
|
+
// 第三步:恢复约束状态
|
10217
|
+
el.style.cssText = originalStyle;
|
10218
|
+
triggerReflow(el);
|
10219
|
+
const clampHeight = el.getBoundingClientRect().height;
|
10220
|
+
// 精准比较(考虑亚像素渲染)
|
10221
|
+
const isActuallyClamped = realHeight > clampHeight + 1;
|
10222
|
+
// 防抖处理
|
10223
|
+
console.log('[精确测量]', { realHeight, clampHeight, isActuallyClamped });
|
10224
|
+
setIsShow(isActuallyClamped);
|
10225
|
+
});
|
10226
|
+
}, [isPost, text, textLineClamp]);
|
10227
|
+
// 增强版监听(同时监听字体加载)
|
10230
10228
|
useEffect(() => {
|
10231
|
-
|
10232
|
-
if (
|
10233
|
-
|
10234
|
-
|
10235
|
-
|
10236
|
-
}
|
10237
|
-
|
10238
|
-
|
10239
|
-
|
10240
|
-
|
10241
|
-
|
10242
|
-
|
10243
|
-
|
10244
|
-
|
10245
|
-
|
10229
|
+
const el = multiRow.current;
|
10230
|
+
if (!el)
|
10231
|
+
return;
|
10232
|
+
const fontCheck = () => {
|
10233
|
+
document.fonts.ready.then(checkOverflow);
|
10234
|
+
};
|
10235
|
+
const observer = new ResizeObserver((entries) => {
|
10236
|
+
entries.forEach((entry) => {
|
10237
|
+
if (entry.contentBoxSize) ;
|
10238
|
+
});
|
10239
|
+
});
|
10240
|
+
fontCheck();
|
10241
|
+
observer.observe(el);
|
10242
|
+
return () => observer.disconnect();
|
10243
|
+
}, [checkOverflow]);
|
10244
|
+
return (React.createElement("div", { className: className, style: Object.assign(Object.assign({}, textStyle), { transform: 'translate3d(0px, 0px, 0px)' }), hidden: !text || text === '' },
|
10245
|
+
React.createElement("div", { ref: multiRow, style: Object.assign(Object.assign({}, (!isShowMore &&
|
10246
|
+
isPost && {
|
10247
|
+
WebkitLineClamp: textLineClamp,
|
10248
|
+
lineClamp: textLineClamp,
|
10246
10249
|
textOverflow: 'ellipsis',
|
10250
|
+
overflow: 'hidden',
|
10247
10251
|
display: '-webkit-box',
|
10248
|
-
WebkitBoxOrient: 'vertical'
|
10249
|
-
|
10250
|
-
}, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
10251
|
-
React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
10252
|
+
WebkitBoxOrient: 'vertical'
|
10253
|
+
})), { wordBreak: 'break-word', textRendering: 'geometricPrecision', fontKerning: 'none', textSizeAdjust: '100%', boxSizing: 'border-box', contain: 'content' }), dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
|
10252
10254
|
text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
|
10253
|
-
__html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more',
|
10255
|
+
__html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', textStyle)
|
10254
10256
|
} }))));
|
10255
10257
|
};
|
10256
10258
|
var ExpandableText$1 = memo(ExpandableText);
|
@@ -15484,7 +15486,7 @@ function WaterfallList(_a) {
|
|
15484
15486
|
* @Author: binruan@chatlabs.com
|
15485
15487
|
* @Date: 2024-01-10 10:58:24
|
15486
15488
|
* @LastEditors: binruan@chatlabs.com
|
15487
|
-
* @LastEditTime: 2025-
|
15489
|
+
* @LastEditTime: 2025-02-28 10:00:31
|
15488
15490
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15489
15491
|
*
|
15490
15492
|
*/
|
@@ -15522,7 +15524,7 @@ const WaterFall = (props) => {
|
|
15522
15524
|
}
|
15523
15525
|
}, [waterFallData]);
|
15524
15526
|
const reportTagsView = useCallback(() => {
|
15525
|
-
var _a, _b, _c, _d, _e, _f
|
15527
|
+
var _a, _b, _c, _d, _e, _f;
|
15526
15528
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15527
15529
|
if (!rec)
|
15528
15530
|
return;
|
@@ -15542,10 +15544,9 @@ const WaterFall = (props) => {
|
|
15542
15544
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15543
15545
|
eventInfo: {
|
15544
15546
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15545
|
-
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 : '',
|
15546
15547
|
position: cacheActiveIndex + '',
|
15547
|
-
contentTags: JSON.stringify((
|
15548
|
-
traceInfo: (
|
15548
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
15549
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
15549
15550
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15550
15551
|
fromKName,
|
15551
15552
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17626,7 +17627,7 @@ const LikeButton = (_a) => {
|
|
17626
17627
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17627
17628
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17628
17629
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17629
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
|
17630
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17630
17631
|
if (state) {
|
17631
17632
|
// 先设置状态
|
17632
17633
|
setState(false);
|
@@ -17636,12 +17637,11 @@ const LikeButton = (_a) => {
|
|
17636
17637
|
eventSubject: 'favoriteContentCanceled',
|
17637
17638
|
eventDescription: 'This content was unfavorite by the user',
|
17638
17639
|
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 : '',
|
17639
|
-
|
17640
|
-
|
17641
|
-
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 : []),
|
17640
|
+
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 : '',
|
17641
|
+
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 : []),
|
17642
17642
|
position: position + '',
|
17643
|
-
contentFormat: ((
|
17644
|
-
traceInfo: (
|
17643
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
17644
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
17645
17645
|
}
|
17646
17646
|
});
|
17647
17647
|
// 如果接口调用失败,则回滚状态
|
@@ -17649,41 +17649,40 @@ const LikeButton = (_a) => {
|
|
17649
17649
|
setState(true);
|
17650
17650
|
}
|
17651
17651
|
else {
|
17652
|
-
const nRtcList = (
|
17652
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17653
17653
|
if (index === position) {
|
17654
17654
|
item.isCollected = false;
|
17655
17655
|
}
|
17656
17656
|
return item;
|
17657
|
-
})) !== null &&
|
17657
|
+
})) !== null && _p !== void 0 ? _p : [];
|
17658
17658
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17659
17659
|
}
|
17660
17660
|
}
|
17661
17661
|
else {
|
17662
17662
|
setState(true);
|
17663
|
-
const result = (
|
17663
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
17664
17664
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17665
17665
|
eventInfo: {
|
17666
17666
|
eventSubject: 'favoriteContent',
|
17667
17667
|
eventDescription: 'This content was favorite by the user',
|
17668
|
-
contentId: (
|
17669
|
-
|
17670
|
-
|
17671
|
-
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 : []),
|
17668
|
+
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 : '',
|
17669
|
+
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 : '',
|
17670
|
+
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 : []),
|
17672
17671
|
position: position + '',
|
17673
|
-
contentFormat: ((
|
17674
|
-
traceInfo: (
|
17672
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
17673
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
17675
17674
|
}
|
17676
17675
|
});
|
17677
17676
|
if (!result) {
|
17678
17677
|
setState(false);
|
17679
17678
|
}
|
17680
17679
|
else {
|
17681
|
-
const nRtcList = (
|
17680
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17682
17681
|
if (index === position) {
|
17683
17682
|
item.isCollected = true;
|
17684
17683
|
}
|
17685
17684
|
return item;
|
17686
|
-
})) !== null &&
|
17685
|
+
})) !== null && _z !== void 0 ? _z : [];
|
17687
17686
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17688
17687
|
}
|
17689
17688
|
}
|
@@ -17794,7 +17793,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17794
17793
|
setIsLoadFinish(true);
|
17795
17794
|
}, []);
|
17796
17795
|
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
17797
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
17796
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
17798
17797
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
17799
17798
|
return;
|
17800
17799
|
setIsPauseVideo(false);
|
@@ -17805,15 +17804,14 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17805
17804
|
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);
|
17806
17805
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
17807
17806
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17808
|
-
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 : '',
|
17807
|
+
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) + '' }))
|
17809
17808
|
});
|
17810
17809
|
isFirstPlayRef.current = false;
|
17811
17810
|
}
|
17812
17811
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17813
17812
|
const setCurrentTimeByStartTime = useCallback(() => {
|
17814
|
-
var _a;
|
17815
17813
|
if (isDiyH5) {
|
17816
|
-
videoRef.current.currentTime =
|
17814
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
17817
17815
|
}
|
17818
17816
|
}, []);
|
17819
17817
|
const handLoadeddata = useCallback(() => {
|
@@ -17846,7 +17844,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17846
17844
|
handLoadeddata();
|
17847
17845
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
17848
17846
|
const handleClickVideo = useCallback((type) => () => {
|
17849
|
-
var _a, _b, _c, _d, _e, _f
|
17847
|
+
var _a, _b, _c, _d, _e, _f;
|
17850
17848
|
if (!videoRef.current)
|
17851
17849
|
return;
|
17852
17850
|
if (!isLoadFinish)
|
@@ -17867,20 +17865,20 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17867
17865
|
break;
|
17868
17866
|
default:
|
17869
17867
|
if (isPause) {
|
17870
|
-
if (Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (
|
17871
|
-
|
17868
|
+
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)) {
|
17869
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
17872
17870
|
}
|
17873
|
-
(
|
17871
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
17874
17872
|
}
|
17875
17873
|
else {
|
17876
|
-
(
|
17874
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
17877
17875
|
}
|
17878
17876
|
setIsPauseVideo(!isPause);
|
17879
17877
|
break;
|
17880
17878
|
}
|
17881
17879
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17882
17880
|
const handlePause = useCallback(() => {
|
17883
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
17881
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
17884
17882
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
17885
17883
|
return;
|
17886
17884
|
if (activeIndex !== index)
|
@@ -17896,15 +17894,14 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17896
17894
|
eventSubject: 'playOverVideo',
|
17897
17895
|
eventDescription: 'User finished playing the video',
|
17898
17896
|
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 : '',
|
17899
|
-
|
17900
|
-
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 : '',
|
17897
|
+
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 : '',
|
17901
17898
|
endTime: videoCurrentTime,
|
17902
17899
|
videoDuration,
|
17903
17900
|
playDuration,
|
17904
|
-
contentTags: JSON.stringify((
|
17901
|
+
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 : []),
|
17905
17902
|
position: index + '',
|
17906
17903
|
contentFormat: 'video',
|
17907
|
-
traceInfo: (
|
17904
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
17908
17905
|
}
|
17909
17906
|
});
|
17910
17907
|
}
|
@@ -17916,17 +17913,17 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
17916
17913
|
if (!videoRef.current || !isDiyH5)
|
17917
17914
|
return;
|
17918
17915
|
setTimeout(() => {
|
17919
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
17920
|
-
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 :
|
17921
|
-
(
|
17916
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
17917
|
+
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)) {
|
17918
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
17922
17919
|
if (!loopPlayRef.current)
|
17923
17920
|
return;
|
17924
17921
|
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
17925
|
-
(
|
17922
|
+
(_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);
|
17926
17923
|
}
|
17927
17924
|
else {
|
17928
|
-
const i = (
|
17929
|
-
(
|
17925
|
+
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;
|
17926
|
+
(_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);
|
17930
17927
|
}
|
17931
17928
|
}
|
17932
17929
|
});
|
@@ -18571,7 +18568,7 @@ var NavBack$1 = memo(NavBack);
|
|
18571
18568
|
* @Author: binruan@chatlabs.com
|
18572
18569
|
* @Date: 2024-03-20 10:27:31
|
18573
18570
|
* @LastEditors: binruan@chatlabs.com
|
18574
|
-
* @LastEditTime: 2025-05-
|
18571
|
+
* @LastEditTime: 2025-05-09 15:51:40
|
18575
18572
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18576
18573
|
*
|
18577
18574
|
*/
|
@@ -18638,7 +18635,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18638
18635
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
18639
18636
|
}, [data, ctaType, swiperRef]);
|
18640
18637
|
const handleSessionCompleted = useCallback((fk) => {
|
18641
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
18638
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
18642
18639
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
18643
18640
|
let fromKName = '';
|
18644
18641
|
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))) {
|
@@ -18665,13 +18662,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18665
18662
|
eventSubject: 'sessionCompleted',
|
18666
18663
|
eventDescription: 'Session completed',
|
18667
18664
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
18668
|
-
|
18669
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
18665
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
18670
18666
|
position: activeIndex + '',
|
18671
18667
|
fromKName: fk || fromKName,
|
18672
18668
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
18673
|
-
ctatId: (
|
18674
|
-
traceInfo: (
|
18669
|
+
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 : '',
|
18670
|
+
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 : ''
|
18675
18671
|
}
|
18676
18672
|
});
|
18677
18673
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -18801,18 +18797,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18801
18797
|
return null;
|
18802
18798
|
}, [globalConfig, activeIndex, visList]);
|
18803
18799
|
const renderContent = useCallback((rec, index) => {
|
18804
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18800
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18805
18801
|
if (rec === 'organic menu') {
|
18806
18802
|
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)));
|
18807
18803
|
}
|
18808
|
-
if ((
|
18804
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
18809
18805
|
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 })));
|
18810
18806
|
}
|
18811
|
-
if ((
|
18807
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
18812
18808
|
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 }));
|
18813
18809
|
}
|
18814
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
18815
|
-
return (
|
18810
|
+
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) {
|
18811
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
18816
18812
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
18817
18813
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
18818
18814
|
const Component = withBindDataSource(t);
|
@@ -18850,7 +18846,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18850
18846
|
};
|
18851
18847
|
}, [isShowMore]);
|
18852
18848
|
const renderBottom = useCallback((rec, index) => {
|
18853
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
18849
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18854
18850
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
18855
18851
|
let cta = null;
|
18856
18852
|
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) {
|
@@ -18859,23 +18855,20 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18859
18855
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
18860
18856
|
cta = '商品CTA';
|
18861
18857
|
}
|
18862
|
-
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)) {
|
18863
|
-
cta = '服务CTA';
|
18864
|
-
}
|
18865
18858
|
else {
|
18866
|
-
cta = (
|
18859
|
+
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;
|
18867
18860
|
}
|
18868
18861
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
18869
18862
|
return (React.createElement(React.Fragment, null,
|
18870
|
-
((
|
18871
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
18863
|
+
((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
18864
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px` } },
|
18872
18865
|
React.createElement(Nudge, { nudge: nudge }),
|
18873
18866
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
18874
18867
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
18875
18868
|
React.createElement("div", null,
|
18876
|
-
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: (
|
18869
|
+
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: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
18877
18870
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
18878
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
18871
|
+
React.createElement(Hashtag$1, { index: activeIndex, tags: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.hashTags) !== null && _l !== void 0 ? _l : [], itemId: (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.itemId, itemType: ((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
18879
18872
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
18880
18873
|
}
|
18881
18874
|
return null;
|
@@ -18913,7 +18906,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18913
18906
|
return null;
|
18914
18907
|
}, [globalConfig, waterFallData]);
|
18915
18908
|
const handleViewImageStartEnd = (item) => {
|
18916
|
-
var _a, _b, _c, _d, _e, _f
|
18909
|
+
var _a, _b, _c, _d, _e, _f;
|
18917
18910
|
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)) {
|
18918
18911
|
const endTime = Date.now();
|
18919
18912
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -18922,11 +18915,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18922
18915
|
eventSubject: 'viewImageCarouselEnd',
|
18923
18916
|
eventDescription: 'User end view the image carousel',
|
18924
18917
|
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 : '',
|
18925
|
-
|
18926
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
18918
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
18927
18919
|
imageEndTime: `${endTime}`,
|
18928
18920
|
playDuration: `${duration}`,
|
18929
|
-
contentTags: JSON.stringify((
|
18921
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
18930
18922
|
position: activeIndex + '',
|
18931
18923
|
contentFormat: 'image',
|
18932
18924
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -18935,7 +18927,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18935
18927
|
}
|
18936
18928
|
};
|
18937
18929
|
const handleSlideSkip = (item, position) => {
|
18938
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
18930
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
18939
18931
|
if (isPreview || waterFallData)
|
18940
18932
|
return;
|
18941
18933
|
const t = new Date() - curTime.current;
|
@@ -18961,8 +18953,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18961
18953
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
18962
18954
|
position: position + '',
|
18963
18955
|
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 : '',
|
18964
|
-
|
18965
|
-
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 : '',
|
18956
|
+
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 : '',
|
18966
18957
|
contentFormat
|
18967
18958
|
}
|
18968
18959
|
});
|
@@ -18972,7 +18963,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18972
18963
|
}
|
18973
18964
|
};
|
18974
18965
|
const handleScrollEvent = (swiper) => {
|
18975
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
18966
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
18976
18967
|
const item = data[swiper.previousIndex];
|
18977
18968
|
if (!item)
|
18978
18969
|
return;
|
@@ -18989,12 +18980,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18989
18980
|
eventSubject: 'scrollDown',
|
18990
18981
|
eventDescription: 'User scroll down',
|
18991
18982
|
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 : '',
|
18992
|
-
|
18993
|
-
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 : '',
|
18983
|
+
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 : '',
|
18994
18984
|
requestId: null,
|
18995
|
-
traceInfo: (
|
18985
|
+
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 : '',
|
18996
18986
|
contentFormat,
|
18997
|
-
position: ((
|
18987
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
18998
18988
|
}
|
18999
18989
|
});
|
19000
18990
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19006,13 +18996,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19006
18996
|
eventInfo: {
|
19007
18997
|
eventSubject: 'scrollUp',
|
19008
18998
|
eventDescription: 'User scroll up',
|
19009
|
-
contentId: (
|
19010
|
-
|
19011
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
18999
|
+
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 : '',
|
19000
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
19012
19001
|
requestId: null,
|
19013
|
-
traceInfo: (
|
19002
|
+
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 : '',
|
19014
19003
|
contentFormat,
|
19015
|
-
position: ((
|
19004
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
19016
19005
|
}
|
19017
19006
|
});
|
19018
19007
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19038,7 +19027,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19038
19027
|
}
|
19039
19028
|
}, [openHashtag, data, activeIndex]);
|
19040
19029
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19041
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
19030
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19042
19031
|
const item = data[activeIndex];
|
19043
19032
|
// 如果是图片集则上报事件
|
19044
19033
|
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)) {
|
@@ -19049,10 +19038,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19049
19038
|
eventSubject: 'viewImageCarouselStart',
|
19050
19039
|
eventDescription: 'User start view the image carousel',
|
19051
19040
|
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 : '',
|
19052
|
-
|
19053
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19041
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19054
19042
|
imageStartTime: `${startTime}`,
|
19055
|
-
contentTags: JSON.stringify((
|
19043
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19056
19044
|
position: activeIndex + '',
|
19057
19045
|
contentFormat: 'image',
|
19058
19046
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19062,11 +19050,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19062
19050
|
if (enableCapi) {
|
19063
19051
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19064
19052
|
eventName: 'ViewContent',
|
19065
|
-
product: (
|
19053
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
19066
19054
|
});
|
19067
19055
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19068
19056
|
eventName: 'PageView',
|
19069
|
-
product: (
|
19057
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
19070
19058
|
});
|
19071
19059
|
}
|
19072
19060
|
}
|
@@ -19219,7 +19207,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19219
19207
|
}, []);
|
19220
19208
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19221
19209
|
const handlePlaying = useCallback(() => {
|
19222
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19210
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19223
19211
|
setIsPauseVideo(false);
|
19224
19212
|
const item = data[index];
|
19225
19213
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19232,15 +19220,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19232
19220
|
eventSubject: 'playVideo',
|
19233
19221
|
eventDescription: 'User played the video',
|
19234
19222
|
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 : '',
|
19235
|
-
|
19236
|
-
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 : '',
|
19223
|
+
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 : '',
|
19237
19224
|
playType,
|
19238
19225
|
startTime: videoCurrentTime,
|
19239
19226
|
videoDuration,
|
19240
|
-
contentTags: JSON.stringify((
|
19227
|
+
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 : []),
|
19241
19228
|
position: index + '',
|
19242
19229
|
contentFormat: 'video',
|
19243
|
-
traceInfo: (
|
19230
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19244
19231
|
}
|
19245
19232
|
});
|
19246
19233
|
setIsFirstPlay(false);
|
@@ -19279,7 +19266,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19279
19266
|
}
|
19280
19267
|
}, [isLoadFinish]);
|
19281
19268
|
const onPause = useCallback(() => {
|
19282
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19269
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19283
19270
|
const item = data[index];
|
19284
19271
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19285
19272
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19290,15 +19277,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19290
19277
|
eventSubject: 'playOverVideo',
|
19291
19278
|
eventDescription: 'User finished playing the video',
|
19292
19279
|
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 : '',
|
19293
|
-
|
19294
|
-
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 : '',
|
19280
|
+
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 : '',
|
19295
19281
|
endTime: videoCurrentTime,
|
19296
19282
|
videoDuration,
|
19297
19283
|
playDuration,
|
19298
|
-
contentTags: JSON.stringify((
|
19284
|
+
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 : []),
|
19299
19285
|
position: index + '',
|
19300
19286
|
contentFormat: 'video',
|
19301
|
-
traceInfo: (
|
19287
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19302
19288
|
}
|
19303
19289
|
});
|
19304
19290
|
}
|