pb-sxp-ui 1.2.5 → 1.2.6
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 +65 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +9 -1
- package/dist/index.js +65 -37
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +65 -37
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/Popup/index.js +7 -5
- package/es/core/components/SxpPageRender/index.js +2 -2
- package/es/core/context/SxpDataSourceProvider.js +3 -3
- package/es/core/hooks/useEventReport.js +4 -4
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +11 -6
- package/es/materials/sxp/popup/CommodityDetail/material.js +6 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +4 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +5 -2
- package/es/materials/sxp/popup/CommodityList/index.js +10 -10
- package/es/materials/sxp/template/components/CommodityGroup.js +11 -1
- package/lib/core/components/SxpPageRender/Popup/index.js +7 -5
- package/lib/core/components/SxpPageRender/index.js +2 -2
- package/lib/core/context/SxpDataSourceProvider.js +3 -3
- package/lib/core/hooks/useEventReport.js +4 -4
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -5
- package/lib/materials/sxp/popup/CommodityDetail/material.js +6 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +4 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +5 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +10 -10
- package/lib/materials/sxp/template/components/CommodityGroup.js +11 -1
- package/package.json +1 -1
@@ -25,7 +25,7 @@ const Popup = () => {
|
|
25
25
|
}
|
26
26
|
}, [popup]);
|
27
27
|
const handleClose = () => {
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
29
29
|
if (!popup ||
|
30
30
|
(popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
|
31
31
|
!visible ||
|
@@ -39,9 +39,11 @@ const Popup = () => {
|
|
39
39
|
let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
|
40
40
|
let cta = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta;
|
41
41
|
if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
|
42
|
-
const p = (_k = data === null || data === void 0 ? void 0 : data.video) === null || _k === void 0 ? void 0 : _k.bindProducts[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
|
43
|
-
|
44
|
-
|
42
|
+
const p = (_l = (_k = data === null || data === void 0 ? void 0 : data.video) === null || _k === void 0 ? void 0 : _k.bindProducts) === null || _l === void 0 ? void 0 : _l[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
|
43
|
+
if (p) {
|
44
|
+
product = p;
|
45
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
46
|
+
}
|
45
47
|
}
|
46
48
|
if (product && cta) {
|
47
49
|
productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
@@ -63,7 +65,7 @@ const Popup = () => {
|
|
63
65
|
const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
64
66
|
const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
|
65
67
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
66
|
-
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
|
68
|
+
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose, index: index })));
|
67
69
|
}
|
68
70
|
else {
|
69
71
|
return React.createElement(React.Fragment, null);
|
@@ -286,7 +286,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
286
286
|
}
|
287
287
|
};
|
288
288
|
const handleSlideSkip = (item, position) => {
|
289
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
289
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
290
290
|
if (isPreview || waterFallData)
|
291
291
|
return;
|
292
292
|
const t = new Date() - curTime.current;
|
@@ -305,7 +305,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
305
305
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
306
306
|
position: position + '',
|
307
307
|
contentId: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
308
|
-
traceInfo: (_r =
|
308
|
+
traceInfo: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : ''
|
309
309
|
}
|
310
310
|
});
|
311
311
|
setSlideSkipState();
|
@@ -34,7 +34,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
34
34
|
const themeTag = useRef();
|
35
35
|
const curTime = useRef();
|
36
36
|
const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
|
37
|
-
const checkCommodityIndexRef = useRef();
|
37
|
+
const checkCommodityIndexRef = useRef(-1);
|
38
38
|
const popupCurTimeRef = useRef(null);
|
39
39
|
const isShowConsent = useMemo(() => {
|
40
40
|
var _a, _b, _c, _d;
|
@@ -192,7 +192,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
192
192
|
}
|
193
193
|
}), [bffFetch, utmVal, isShowTag]);
|
194
194
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
195
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
195
|
+
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;
|
196
196
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
197
197
|
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);
|
198
198
|
let fromKName = '';
|
@@ -206,7 +206,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
206
206
|
fromKName = 'imagePage';
|
207
207
|
}
|
208
208
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
209
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m =
|
209
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_1 = (_y = (_t = (_p = (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.bindCta) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : (_s = (_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.bindCta) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_x = (_w = (_v = (_u = rec === null || rec === void 0 ? void 0 : rec.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.product) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : '', fromKName, fromKPage: (_2 = location === null || location === void 0 ? void 0 : location.href) !== null && _2 !== void 0 ? _2 : '' })
|
210
210
|
});
|
211
211
|
}, [bffEventReport, isFromHashtag]);
|
212
212
|
const h5EnterLink = useCallback(() => {
|
@@ -4,7 +4,7 @@ import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
|
4
4
|
export function useEventReport() {
|
5
5
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
6
6
|
const jumpToWeb = useCallback((data, product, cta, position) => {
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
7
|
+
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;
|
8
8
|
let fromKName = '';
|
9
9
|
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))) {
|
10
10
|
fromKName = 'pdpPage';
|
@@ -35,12 +35,12 @@ export function useEventReport() {
|
|
35
35
|
position: position + '',
|
36
36
|
contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
37
37
|
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
38
|
-
traceInfo: (_p =
|
38
|
+
traceInfo: (_0 = (_x = (_v = (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProduct) === null || _q === void 0 ? void 0 : _q.traceInfo) !== null && _r !== void 0 ? _r : (_u = (_t = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = data === null || data === void 0 ? void 0 : data.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindCta) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : ''
|
39
39
|
}
|
40
40
|
});
|
41
41
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
42
42
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
43
|
-
var _a, _b, _c, _d;
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
44
44
|
let fromKName = '';
|
45
45
|
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))) {
|
46
46
|
fromKName = 'pdpPage';
|
@@ -60,7 +60,7 @@ export function useEventReport() {
|
|
60
60
|
position: position + '',
|
61
61
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
62
62
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
63
|
-
traceInfo:
|
63
|
+
traceInfo: (_o = (_l = (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.traceInfo) !== null && _g !== void 0 ? _g : (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_m = data === null || data === void 0 ? void 0 : data.product) === null || _m === void 0 ? void 0 : _m.traceInfo) !== null && _o !== void 0 ? _o : '',
|
64
64
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
65
65
|
eventSubject: 'productView',
|
66
66
|
eventDescription: 'User browsed the product'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
3
|
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
4
|
-
import {
|
4
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import './index.less';
|
6
6
|
import { Autoplay, Pagination } from 'swiper/modules';
|
7
7
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
@@ -14,8 +14,7 @@ import CommodityGroup from '../../template/components/CommodityGroup';
|
|
14
14
|
const CommodityDetail = (_a) => {
|
15
15
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
16
16
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
|
17
|
-
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = useSxpDataSource();
|
18
|
-
const { popup } = useEditor();
|
17
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
19
18
|
const { jumpToWeb, productView } = useEventReport();
|
20
19
|
const curTimeRef = useRef(null);
|
21
20
|
const [showModal, setShowModal] = useState(false);
|
@@ -28,6 +27,7 @@ const CommodityDetail = (_a) => {
|
|
28
27
|
: (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta) !== null && _k !== void 0 ? _k : (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta;
|
29
28
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
30
29
|
if (!isPost && (commodityGroup === null || commodityGroup === void 0 ? void 0 : commodityGroup.open) && ((_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) && ((_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length) > 0) {
|
30
|
+
checkCommodityIndexRef.current = checkCommodityIndex;
|
31
31
|
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
32
32
|
product = p;
|
33
33
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
@@ -71,7 +71,7 @@ const CommodityDetail = (_a) => {
|
|
71
71
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
72
72
|
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
73
73
|
const renderContent = ({ isPost }) => {
|
74
|
-
var _a, _b, _c;
|
74
|
+
var _a, _b, _c, _d;
|
75
75
|
return (React.createElement("div", null,
|
76
76
|
React.createElement("div", { className: 'pb-commondity-content-collection', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), dangerouslySetInnerHTML: {
|
77
77
|
__html: setFontForText((_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -82,8 +82,11 @@ const CommodityDetail = (_a) => {
|
|
82
82
|
React.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), dangerouslySetInnerHTML: {
|
83
83
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
84
84
|
} }),
|
85
|
+
React.createElement("div", { hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
86
|
+
__html: setFontForText((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
87
|
+
} }),
|
85
88
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
86
|
-
React.createElement(ExpandableText, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (
|
89
|
+
React.createElement(ExpandableText, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
87
90
|
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
88
91
|
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
89
92
|
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
@@ -105,6 +108,7 @@ const CommodityDetail = (_a) => {
|
|
105
108
|
const handleClick = useCallback((index) => {
|
106
109
|
popupCurTimeRef.current = new Date();
|
107
110
|
setCheckCommodityIndex(index);
|
111
|
+
checkCommodityIndexRef.current = index;
|
108
112
|
}, []);
|
109
113
|
const renderCommodityGroup = useCallback(() => {
|
110
114
|
var _a, _b, _c;
|
@@ -125,6 +129,7 @@ const CommodityDetail = (_a) => {
|
|
125
129
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
126
130
|
} },
|
127
131
|
React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
132
|
+
var _a;
|
128
133
|
return (React.createElement(SwiperSlide, { key: src },
|
129
134
|
React.createElement("div", { style: {
|
130
135
|
overflow: 'hidden',
|
@@ -137,7 +142,7 @@ const CommodityDetail = (_a) => {
|
|
137
142
|
objectFit: 'cover',
|
138
143
|
display: 'block',
|
139
144
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
140
|
-
}, src: src }))));
|
145
|
+
}, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
|
141
146
|
}))))),
|
142
147
|
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
|
143
148
|
position: 'relative',
|
@@ -15,7 +15,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
15
15
|
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;
|
16
16
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
|
17
17
|
const [spread, setSpread] = useState(true);
|
18
|
-
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport } = useSxpDataSource();
|
18
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
|
19
19
|
const { jumpToWeb, productView } = useEventReport();
|
20
20
|
const [stopSlide, setStopSlide] = useState(false);
|
21
21
|
const [isBottom, setIsBottom] = useState(false);
|
@@ -30,6 +30,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
30
30
|
: (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta) !== null && _k !== void 0 ? _k : (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta;
|
31
31
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
32
32
|
if (!isPost && (commodityGroup === null || commodityGroup === void 0 ? void 0 : commodityGroup.open) && ((_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) && ((_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length) > 0) {
|
33
|
+
checkCommodityIndexRef.current = checkCommodityIndex;
|
33
34
|
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
34
35
|
product = p;
|
35
36
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
@@ -90,6 +91,7 @@ Made in Italy` })));
|
|
90
91
|
const handleClick = useCallback((index) => {
|
91
92
|
popupCurTimeRef.current = new Date();
|
92
93
|
setCheckCommodityIndex(index);
|
94
|
+
checkCommodityIndexRef.current = index;
|
93
95
|
}, []);
|
94
96
|
const renderCommodityGroup = useCallback(() => {
|
95
97
|
var _a, _b, _c;
|
@@ -108,6 +110,7 @@ Made in Italy` })));
|
|
108
110
|
}, loop: true, autoplay: {
|
109
111
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
110
112
|
} }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
113
|
+
var _a;
|
111
114
|
return (React.createElement(SwiperSlide, { key: src },
|
112
115
|
React.createElement("div", { style: {
|
113
116
|
overflow: 'hidden',
|
@@ -120,7 +123,7 @@ Made in Italy` })));
|
|
120
123
|
objectFit: 'cover',
|
121
124
|
display: 'block',
|
122
125
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
123
|
-
}, src: src }))));
|
126
|
+
}, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
|
124
127
|
}))),
|
125
128
|
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
|
126
129
|
position: 'relative',
|
@@ -42,25 +42,24 @@ const CommodityList = (_a) => {
|
|
42
42
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
43
43
|
}
|
44
44
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
45
|
-
return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
46
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
45
|
+
return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
47
47
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css({
|
48
48
|
display: 'flex'
|
49
49
|
}), onClick: () => handleClick(item, index) }),
|
50
50
|
React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
|
51
51
|
React.createElement("div", { style: {
|
52
|
-
|
53
|
-
width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px - ${(_g = style === null || style === void 0 ? void 0 : style.padding) !== null && _g !== void 0 ? _g : 0}px)`,
|
52
|
+
width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px)`,
|
54
53
|
display: 'flex',
|
55
54
|
flexDirection: 'column',
|
56
55
|
justifyContent: 'space-between'
|
57
56
|
} },
|
58
57
|
React.createElement("div", null,
|
59
58
|
React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
|
60
|
-
__html: setFontForText((
|
59
|
+
__html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
61
60
|
} }),
|
62
61
|
React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
|
63
|
-
__html: setFontForText((
|
62
|
+
__html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
64
63
|
} })),
|
65
64
|
React.createElement("div", { className: css({
|
66
65
|
display: 'flex',
|
@@ -69,11 +68,12 @@ const CommodityList = (_a) => {
|
|
69
68
|
width: '100%',
|
70
69
|
overflow: 'hidden'
|
71
70
|
}) },
|
72
|
-
React.createElement("div",
|
73
|
-
|
74
|
-
|
71
|
+
React.createElement("div", null,
|
72
|
+
React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
|
73
|
+
__html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
74
|
+
} })),
|
75
75
|
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
76
|
-
__html: setFontForText((
|
76
|
+
__html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', buttonStyle)
|
77
77
|
} })))))));
|
78
78
|
})));
|
79
79
|
};
|
@@ -1,10 +1,20 @@
|
|
1
1
|
import React, { memo } from 'react';
|
2
2
|
import Scroll from './Scroll';
|
3
3
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
4
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
4
5
|
import { SwiperSlide } from 'swiper/react';
|
5
6
|
import { css } from '@emotion/css';
|
7
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
6
8
|
const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
|
7
9
|
var _a;
|
10
|
+
const { productView } = useEventReport();
|
11
|
+
const { popupCurTimeRef } = useSxpDataSource();
|
12
|
+
const handleClick = (item, index) => {
|
13
|
+
if (check === index)
|
14
|
+
return;
|
15
|
+
productView(popupDetailData, item, item === null || item === void 0 ? void 0 : item.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
16
|
+
onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
|
17
|
+
};
|
8
18
|
return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.open) && ((products && (products === null || products === void 0 ? void 0 : products.length) > 1) || !popupDetailData) && (React.createElement(Scroll, { enableSlideActive: true, isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_a = (popupDetailData ? products : [0, 1, 2, 3])) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
|
9
19
|
var _a, _b, _c;
|
10
20
|
return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css({
|
@@ -12,7 +22,7 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
|
|
12
22
|
height: '50px',
|
13
23
|
marginRight: '10px'
|
14
24
|
}), onClick: () => {
|
15
|
-
|
25
|
+
handleClick(item, index);
|
16
26
|
}, key: index },
|
17
27
|
React.createElement(FormatImage, { style: {
|
18
28
|
height: '100%',
|
@@ -28,7 +28,7 @@ const Popup = () => {
|
|
28
28
|
}
|
29
29
|
}, [popup]);
|
30
30
|
const handleClose = () => {
|
31
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
31
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
32
32
|
if (!popup ||
|
33
33
|
(popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
|
34
34
|
!visible ||
|
@@ -42,9 +42,11 @@ const Popup = () => {
|
|
42
42
|
let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
|
43
43
|
let cta = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta;
|
44
44
|
if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
|
45
|
-
const p = (_k = data === null || data === void 0 ? void 0 : data.video) === null || _k === void 0 ? void 0 : _k.bindProducts[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
|
46
|
-
|
47
|
-
|
45
|
+
const p = (_l = (_k = data === null || data === void 0 ? void 0 : data.video) === null || _k === void 0 ? void 0 : _k.bindProducts) === null || _l === void 0 ? void 0 : _l[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
|
46
|
+
if (p) {
|
47
|
+
product = p;
|
48
|
+
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
49
|
+
}
|
48
50
|
}
|
49
51
|
if (product && cta) {
|
50
52
|
productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
@@ -66,7 +68,7 @@ const Popup = () => {
|
|
66
68
|
const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
67
69
|
const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
|
68
70
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
69
|
-
return (react_1.default.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
|
71
|
+
return (react_1.default.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose, index: index })));
|
70
72
|
}
|
71
73
|
else {
|
72
74
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
@@ -289,7 +289,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
289
289
|
}
|
290
290
|
};
|
291
291
|
const handleSlideSkip = (item, position) => {
|
292
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
292
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
293
293
|
if (isPreview || waterFallData)
|
294
294
|
return;
|
295
295
|
const t = new Date() - curTime.current;
|
@@ -308,7 +308,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
308
308
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
309
309
|
position: position + '',
|
310
310
|
contentId: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
311
|
-
traceInfo: (_r =
|
311
|
+
traceInfo: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : ''
|
312
312
|
}
|
313
313
|
});
|
314
314
|
(0, localStore_1.setSlideSkipState)();
|
@@ -37,7 +37,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
37
37
|
const themeTag = (0, react_1.useRef)();
|
38
38
|
const curTime = (0, react_1.useRef)();
|
39
39
|
const [selectTag, setSelectTag] = (0, react_1.useState)(exports.DEFAULT_TAG);
|
40
|
-
const checkCommodityIndexRef = (0, react_1.useRef)();
|
40
|
+
const checkCommodityIndexRef = (0, react_1.useRef)(-1);
|
41
41
|
const popupCurTimeRef = (0, react_1.useRef)(null);
|
42
42
|
const isShowConsent = (0, react_1.useMemo)(() => {
|
43
43
|
var _a, _b, _c, _d;
|
@@ -195,7 +195,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
195
195
|
}
|
196
196
|
}), [bffFetch, utmVal, isShowTag]);
|
197
197
|
const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position) => {
|
198
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
198
|
+
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;
|
199
199
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
200
200
|
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);
|
201
201
|
let fromKName = '';
|
@@ -209,7 +209,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
209
209
|
fromKName = 'imagePage';
|
210
210
|
}
|
211
211
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
212
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m =
|
212
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_1 = (_y = (_t = (_p = (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.bindCta) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : (_s = (_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.bindCta) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_x = (_w = (_v = (_u = rec === null || rec === void 0 ? void 0 : rec.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.product) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : '', fromKName, fromKPage: (_2 = location === null || location === void 0 ? void 0 : location.href) !== null && _2 !== void 0 ? _2 : '' })
|
213
213
|
});
|
214
214
|
}, [bffEventReport, isFromHashtag]);
|
215
215
|
const h5EnterLink = (0, react_1.useCallback)(() => {
|
@@ -7,7 +7,7 @@ const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
|
7
7
|
function useEventReport() {
|
8
8
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = (0, useSxpDataSource_1.useSxpDataSource)();
|
9
9
|
const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position) => {
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
11
11
|
let fromKName = '';
|
12
12
|
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))) {
|
13
13
|
fromKName = 'pdpPage';
|
@@ -38,12 +38,12 @@ function useEventReport() {
|
|
38
38
|
position: position + '',
|
39
39
|
contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
40
40
|
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
41
|
-
traceInfo: (_p =
|
41
|
+
traceInfo: (_0 = (_x = (_v = (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProduct) === null || _q === void 0 ? void 0 : _q.traceInfo) !== null && _r !== void 0 ? _r : (_u = (_t = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = data === null || data === void 0 ? void 0 : data.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindCta) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : ''
|
42
42
|
}
|
43
43
|
});
|
44
44
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
45
45
|
const productView = (0, react_1.useCallback)((data, product, cta, viewTime, position) => {
|
46
|
-
var _a, _b, _c, _d;
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
47
47
|
let fromKName = '';
|
48
48
|
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))) {
|
49
49
|
fromKName = 'pdpPage';
|
@@ -63,7 +63,7 @@ function useEventReport() {
|
|
63
63
|
position: position + '',
|
64
64
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
65
65
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
66
|
-
traceInfo:
|
66
|
+
traceInfo: (_o = (_l = (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.traceInfo) !== null && _g !== void 0 ? _g : (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_m = data === null || data === void 0 ? void 0 : data.product) === null || _m === void 0 ? void 0 : _m.traceInfo) !== null && _o !== void 0 ? _o : '',
|
67
67
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
68
68
|
eventSubject: 'productView',
|
69
69
|
eventDescription: 'User browsed the product'
|
@@ -16,8 +16,7 @@ const CommodityGroup_1 = tslib_1.__importDefault(require("../../template/compone
|
|
16
16
|
const CommodityDetail = (_a) => {
|
17
17
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
18
18
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
|
19
|
-
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = (0, hooks_1.useSxpDataSource)();
|
20
|
-
const { popup } = (0, hooks_1.useEditor)();
|
19
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = (0, hooks_1.useSxpDataSource)();
|
21
20
|
const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
|
22
21
|
const curTimeRef = (0, react_1.useRef)(null);
|
23
22
|
const [showModal, setShowModal] = (0, react_1.useState)(false);
|
@@ -30,6 +29,7 @@ const CommodityDetail = (_a) => {
|
|
30
29
|
: (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta) !== null && _k !== void 0 ? _k : (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta;
|
31
30
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
32
31
|
if (!isPost && (commodityGroup === null || commodityGroup === void 0 ? void 0 : commodityGroup.open) && ((_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) && ((_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length) > 0) {
|
32
|
+
checkCommodityIndexRef.current = checkCommodityIndex;
|
33
33
|
const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
|
34
34
|
product = p;
|
35
35
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
@@ -73,7 +73,7 @@ const CommodityDetail = (_a) => {
|
|
73
73
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
74
74
|
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
75
75
|
const renderContent = ({ isPost }) => {
|
76
|
-
var _a, _b, _c;
|
76
|
+
var _a, _b, _c, _d;
|
77
77
|
return (react_1.default.createElement("div", null,
|
78
78
|
react_1.default.createElement("div", { className: 'pb-commondity-content-collection', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), dangerouslySetInnerHTML: {
|
79
79
|
__html: (0, tool_1.setFontForText)((_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -84,8 +84,11 @@ const CommodityDetail = (_a) => {
|
|
84
84
|
react_1.default.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), dangerouslySetInnerHTML: {
|
85
85
|
__html: (0, tool_1.setFontForText)(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
86
86
|
} }),
|
87
|
+
react_1.default.createElement("div", { hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
88
|
+
__html: (0, tool_1.setFontForText)((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
89
|
+
} }),
|
87
90
|
react_1.default.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
88
|
-
react_1.default.createElement(ExpandableText_1.default, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (
|
91
|
+
react_1.default.createElement(ExpandableText_1.default, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
89
92
|
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
90
93
|
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
91
94
|
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
@@ -107,6 +110,7 @@ const CommodityDetail = (_a) => {
|
|
107
110
|
const handleClick = (0, react_1.useCallback)((index) => {
|
108
111
|
popupCurTimeRef.current = new Date();
|
109
112
|
setCheckCommodityIndex(index);
|
113
|
+
checkCommodityIndexRef.current = index;
|
110
114
|
}, []);
|
111
115
|
const renderCommodityGroup = (0, react_1.useCallback)(() => {
|
112
116
|
var _a, _b, _c;
|
@@ -127,6 +131,7 @@ const CommodityDetail = (_a) => {
|
|
127
131
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
128
132
|
} },
|
129
133
|
react_1.default.createElement(react_1.default.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
|
134
|
+
var _a;
|
130
135
|
return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
|
131
136
|
react_1.default.createElement("div", { style: {
|
132
137
|
overflow: 'hidden',
|
@@ -139,7 +144,7 @@ const CommodityDetail = (_a) => {
|
|
139
144
|
objectFit: 'cover',
|
140
145
|
display: 'block',
|
141
146
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
142
|
-
}, src: src }))));
|
147
|
+
}, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
|
143
148
|
}))))),
|
144
149
|
!((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
|
145
150
|
position: 'relative',
|