pb-sxp-ui 1.2.9 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +611 -260
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +62 -2
- package/dist/index.js +611 -260
- 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 +611 -260
- 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/FormatImage.js +19 -17
- package/es/core/components/SxpPageRender/Modal/index.js +33 -20
- package/es/core/components/SxpPageRender/Popup/index.js +2 -2
- package/es/core/components/SxpPageRender/ToggleButton/index.js +4 -1
- package/es/core/components/SxpPageRender/WaterFall/List.js +5 -14
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
- package/es/core/components/SxpPageRender/index.d.ts +6 -1
- package/es/core/components/SxpPageRender/index.js +46 -23
- package/es/core/components/SxpPageRender/typing.d.ts +2 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -2
- package/es/core/context/SxpDataSourceProvider.js +27 -30
- package/es/core/hooks/useEventReport.js +9 -8
- package/es/core/utils/tool.d.ts +5 -1
- package/es/core/utils/tool.js +69 -1
- package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +46 -28
- package/es/materials/sxp/popup/CommodityDetail/material.js +4 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -0
- package/es/materials/sxp/popup/Iframe/index.d.ts +16 -0
- package/es/materials/sxp/popup/Iframe/index.js +18 -0
- package/es/materials/sxp/popup/Iframe/material.d.ts +2 -0
- package/es/materials/sxp/popup/Iframe/material.js +21 -0
- package/es/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
- package/es/materials/sxp/popup/Iframe/settingRender.js +12 -0
- package/es/materials/sxp/popup/Prompt/settingRender.js +16 -1
- package/es/materials/sxp/popup/index.d.ts +1 -0
- package/es/materials/sxp/popup/index.js +1 -0
- package/es/materials/sxp/template/Link/index.js +5 -11
- package/es/materials/sxp/template/Link/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/Link/interactionRender.js +11 -0
- package/es/materials/sxp/template/Link/material.js +3 -1
- package/es/materials/sxp/template/components/EventProvider.d.ts +3 -2
- package/es/materials/sxp/template/components/EventProvider.js +3 -3
- package/lib/core/components/SxpPageRender/FormatImage.js +19 -17
- package/lib/core/components/SxpPageRender/Modal/index.js +33 -20
- package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +3 -0
- package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -14
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
- package/lib/core/components/SxpPageRender/index.d.ts +6 -1
- package/lib/core/components/SxpPageRender/index.js +46 -23
- package/lib/core/components/SxpPageRender/typing.d.ts +2 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -2
- package/lib/core/context/SxpDataSourceProvider.js +27 -30
- package/lib/core/hooks/useEventReport.js +9 -8
- package/lib/core/utils/tool.d.ts +5 -1
- package/lib/core/utils/tool.js +73 -1
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +46 -28
- package/lib/materials/sxp/popup/CommodityDetail/material.js +4 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -0
- package/lib/materials/sxp/popup/Iframe/index.d.ts +16 -0
- package/lib/materials/sxp/popup/Iframe/index.js +20 -0
- package/lib/materials/sxp/popup/Iframe/material.d.ts +2 -0
- package/lib/materials/sxp/popup/Iframe/material.js +25 -0
- package/lib/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
- package/lib/materials/sxp/popup/Iframe/settingRender.js +14 -0
- package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -1
- package/lib/materials/sxp/popup/index.d.ts +1 -0
- package/lib/materials/sxp/popup/index.js +1 -0
- package/lib/materials/sxp/template/Link/index.js +5 -11
- package/lib/materials/sxp/template/Link/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/Link/interactionRender.js +13 -0
- package/lib/materials/sxp/template/Link/material.js +3 -1
- package/lib/materials/sxp/template/components/EventProvider.d.ts +3 -2
- package/lib/materials/sxp/template/components/EventProvider.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -217,6 +217,87 @@ const setFontForText = (textContent, style) => {
|
|
217
217
|
}
|
218
218
|
return content;
|
219
219
|
};
|
220
|
+
function getBrowserInfo() {
|
221
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
222
|
+
let userAgent = self.navigator.userAgent;
|
223
|
+
if (!userAgent)
|
224
|
+
return 'Unknown';
|
225
|
+
if (/edge\/([\d\.]+)/i.exec(userAgent))
|
226
|
+
return `Edge ${(_a = /edge\/([\d\.]+)/i.exec(userAgent)) === null || _a === void 0 ? void 0 : _a[1]}`;
|
227
|
+
if (/edg\/([\d\.]+)/i.exec(userAgent))
|
228
|
+
return `Edge(Chromium) ${(_b = /edge\/([\d\.]+)/i.exec(userAgent)) === null || _b === void 0 ? void 0 : _b[1]}`;
|
229
|
+
if (/msie/i.test(userAgent))
|
230
|
+
return `Internet Explorer ${(_c = /msie ([\d\.]+)/i.exec(userAgent)) === null || _c === void 0 ? void 0 : _c[1]}`;
|
231
|
+
if (/Trident/i.test(userAgent))
|
232
|
+
return `Internet Explorer ${(_d = /rv:([\d\.]+)/i.exec(userAgent)) === null || _d === void 0 ? void 0 : _d[1]}`;
|
233
|
+
if (/chrome/i.test(userAgent))
|
234
|
+
return `Chrome ${(_e = /chrome\/([\d\.]+)/i.exec(userAgent)) === null || _e === void 0 ? void 0 : _e[1]}`;
|
235
|
+
if (/firefox/i.test(userAgent))
|
236
|
+
return `Firefox ${(_f = /firefox\/([\d\.]+)/i.exec(userAgent)) === null || _f === void 0 ? void 0 : _f[1]}`;
|
237
|
+
if (/safari/i.test(userAgent))
|
238
|
+
return `Safari ${(_g = /version\/([\d\.]+)/i.exec(userAgent)) === null || _g === void 0 ? void 0 : _g[1]}`;
|
239
|
+
return 'Unknown';
|
240
|
+
}
|
241
|
+
function getSystem() {
|
242
|
+
var _a, _b, _c;
|
243
|
+
let userAgent = self.navigator.userAgent;
|
244
|
+
if (!userAgent)
|
245
|
+
return 'Unknown';
|
246
|
+
if (/iphone/i.test(userAgent))
|
247
|
+
return `IOS ${(_a = userAgent.match(/OS\s(.*?)\slike/)) === null || _a === void 0 ? void 0 : _a[1]}`;
|
248
|
+
if (/android/i.test(userAgent))
|
249
|
+
return `Android ${(_b = userAgent.match(/Android\s(.*?)\;/)) === null || _b === void 0 ? void 0 : _b[1]}`;
|
250
|
+
if (/windows/i.test(userAgent))
|
251
|
+
return `Windows ${(_c = userAgent.match(/Windows\s(.*?)\;/)) === null || _c === void 0 ? void 0 : _c[1]}`;
|
252
|
+
if (/mac/i.test(userAgent))
|
253
|
+
return `Mac OS`;
|
254
|
+
return 'Unknown';
|
255
|
+
}
|
256
|
+
function getDevice$1() {
|
257
|
+
let userAgent = self.navigator.userAgent;
|
258
|
+
if (!userAgent)
|
259
|
+
return 'Unknown';
|
260
|
+
if (/iphone/i.test(userAgent))
|
261
|
+
return `iPhone`;
|
262
|
+
if (/android/i.test(userAgent)) {
|
263
|
+
// var index1 = userAgent.indexOf(';');
|
264
|
+
// var index2 = userAgent.indexOf(';', index1 + 1);
|
265
|
+
// var index3 = userAgent.indexOf(';', index2 + 1);
|
266
|
+
// var index4 = userAgent.indexOf(';', index3 + 1);
|
267
|
+
// if (index2 !== -1 && index3 !== -1) {
|
268
|
+
// var value1 = userAgent.substring(index3 + 1, index4);
|
269
|
+
// return `${value1}`;
|
270
|
+
// }
|
271
|
+
var index1 = userAgent.indexOf('(');
|
272
|
+
var index2 = userAgent.indexOf(')');
|
273
|
+
if (index1 !== -1 && index2 !== -1) {
|
274
|
+
var value = userAgent.substring(index1 + 1, index2);
|
275
|
+
return `${value}`;
|
276
|
+
}
|
277
|
+
}
|
278
|
+
if (/windows/i.test(userAgent))
|
279
|
+
return `Windows`;
|
280
|
+
if (/mac/i.test(userAgent))
|
281
|
+
return `Mac`;
|
282
|
+
return 'Unknown';
|
283
|
+
}
|
284
|
+
function getCookie(val) {
|
285
|
+
// const expirationDate = new Date();
|
286
|
+
// expirationDate.setDate(expirationDate.getDate() + 100);
|
287
|
+
// document.cookie = `_fbc=IwAR2F4-dbP0l7Mn1IawQQGCINEz7PYXQvwjNwB_qa2ofrHyiLjcbCRxTDGrc; expires=${expirationDate.toUTCString()}; path=/`;
|
288
|
+
const cookies = document.cookie;
|
289
|
+
// 将cookie字符串拆分成数组
|
290
|
+
const cookieArray = cookies.split(';');
|
291
|
+
let value = null;
|
292
|
+
// 遍历cookie数组,查找名为_fbc的cookie
|
293
|
+
cookieArray.forEach((cookie) => {
|
294
|
+
const [cookieName, cookieValue] = cookie.trim().split('=');
|
295
|
+
if (cookieName === val) {
|
296
|
+
value = cookieValue;
|
297
|
+
}
|
298
|
+
});
|
299
|
+
return value !== null && value !== void 0 ? value : '';
|
300
|
+
}
|
220
301
|
|
221
302
|
function unzip(b64Data) {
|
222
303
|
const strData = atob(b64Data);
|
@@ -532,7 +613,7 @@ var DataSourceType;
|
|
532
613
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
533
614
|
})(DataSourceType || (DataSourceType = {}));
|
534
615
|
const DEFAULT_TAG = 'FOR U';
|
535
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false, utmParameter }) => {
|
616
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false, utmParameter, channelQueryList }) => {
|
536
617
|
var _a, _b, _c;
|
537
618
|
const [rtcList, setRtcList] = useState([]);
|
538
619
|
const [tagList, setTagList] = useState([]);
|
@@ -616,15 +697,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
616
697
|
// 获取推荐视频数据
|
617
698
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
618
699
|
var _d, _e, _f, _g, _h;
|
619
|
-
query = {
|
620
|
-
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
621
|
-
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
622
|
-
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
623
|
-
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
624
|
-
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
625
|
-
traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo,
|
626
|
-
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
627
|
-
};
|
700
|
+
query = Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` }));
|
628
701
|
if (utmVal) {
|
629
702
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
630
703
|
var _a, _b;
|
@@ -633,6 +706,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
633
706
|
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
634
707
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
635
708
|
}
|
709
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isEditor) {
|
710
|
+
query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.join('&') }));
|
711
|
+
}
|
636
712
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
637
713
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
638
714
|
return undefined;
|
@@ -640,23 +716,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
640
716
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
641
717
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
642
718
|
return result === null || result === void 0 ? void 0 : result.data;
|
643
|
-
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
719
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, channelQueryList, isEditor]);
|
644
720
|
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
721
|
+
var _j, _k, _l, _m;
|
645
722
|
if (rtcList.length <= 0) {
|
646
723
|
return;
|
647
724
|
}
|
648
|
-
const
|
649
|
-
|
650
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
651
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
652
|
-
themeTag: themeTag.current
|
653
|
-
});
|
725
|
+
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
726
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_j = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _j === void 0 ? void 0 : _j.itemId) && { productFilter: (_k = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _k === void 0 ? void 0 : _k.itemId })), (((_l = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _l === void 0 ? void 0 : _l.itemId) && { contentFilter: (_m = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _m === void 0 ? void 0 : _m.itemId })), { themeTag: themeTag.current }));
|
654
727
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
655
728
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
656
729
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
657
730
|
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
658
731
|
// 关闭 BFF 事件上报
|
659
|
-
if (!enableReportEvent) {
|
732
|
+
if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
660
733
|
return;
|
661
734
|
}
|
662
735
|
// 用户信息都是公共的
|
@@ -667,7 +740,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
667
740
|
};
|
668
741
|
}
|
669
742
|
const sessionID = storeAndLoadFeSessionId();
|
670
|
-
const ef = Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo);
|
743
|
+
const ef = Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), { sxpDevice: getDevice$1(), sxpSystem: getSystem(), sxpBrowser: getBrowserInfo() });
|
671
744
|
const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
|
672
745
|
const realEventInfo = Object.entries(ef)
|
673
746
|
.map(([k, v]) => v && { name: k, value: v })
|
@@ -681,11 +754,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
681
754
|
body: { userInfo: realUserInfo, eventInfo: realEventInfo },
|
682
755
|
type: 'beacon'
|
683
756
|
});
|
684
|
-
}, [bffFetch, curReqInfo, enableReportEvent]);
|
757
|
+
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
685
758
|
const bffFbReport = useCallback((_a) => {
|
686
|
-
var _b;
|
759
|
+
var _b, _c;
|
687
760
|
var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
|
688
|
-
if (!enableReportEvent || !enabledMetaConversionApi) {
|
761
|
+
if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
689
762
|
return;
|
690
763
|
}
|
691
764
|
const fakeUserId = storeAndLoadFeUserId();
|
@@ -696,12 +769,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
696
769
|
actionSource,
|
697
770
|
eventSourceUrl,
|
698
771
|
userData: {
|
699
|
-
externalId: fakeUserId
|
772
|
+
externalId: fakeUserId,
|
773
|
+
fbc: `fb.2.${new Date().getTime()}.${getCookie('_fbc')}`,
|
774
|
+
fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}`,
|
775
|
+
client_user_agent: (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent
|
700
776
|
}
|
701
777
|
},
|
702
778
|
type: 'beacon'
|
703
779
|
});
|
704
|
-
}, [bffFetch, enableReportEvent, enabledMetaConversionApi]);
|
780
|
+
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
705
781
|
const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
706
782
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
|
707
783
|
return res === null || res === void 0 ? void 0 : res.success;
|
@@ -716,24 +792,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
716
792
|
}), [bffFetch]);
|
717
793
|
// 获取 Tag
|
718
794
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
719
|
-
var
|
795
|
+
var _o, _p, _q, _r, _s;
|
720
796
|
if (!utmVal || !isShowTag)
|
721
797
|
return;
|
722
798
|
try {
|
723
|
-
const val = (
|
799
|
+
const val = (_q = (_p = (_o = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _o === void 0 ? void 0 : _o.filter((val) => {
|
724
800
|
var _a, _b;
|
725
801
|
const key = val.split('=')[0];
|
726
802
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
727
|
-
})) === null ||
|
803
|
+
})) === null || _p === void 0 ? void 0 : _p.join('&')) !== null && _q !== void 0 ? _q : '';
|
728
804
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
729
|
-
setTagList((
|
805
|
+
setTagList((_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []);
|
730
806
|
}
|
731
807
|
catch (e) {
|
732
808
|
console.log('e', e);
|
733
809
|
}
|
734
810
|
}), [bffFetch, utmVal, isShowTag]);
|
735
811
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
736
|
-
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;
|
812
|
+
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;
|
737
813
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
738
814
|
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);
|
739
815
|
let fromKName = '';
|
@@ -746,8 +822,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
746
822
|
else if ((_g = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.imgUrls) === null || _g === void 0 ? void 0 : _g.length) {
|
747
823
|
fromKName = 'imagePage';
|
748
824
|
}
|
825
|
+
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;
|
749
826
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
750
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (
|
827
|
+
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 : '' })
|
751
828
|
});
|
752
829
|
}, [bffEventReport, isFromHashtag]);
|
753
830
|
const h5EnterLink = useCallback(() => {
|
@@ -1099,7 +1176,7 @@ var index$2 = /*#__PURE__*/Object.freeze({
|
|
1099
1176
|
EditorCore: EditorCore
|
1100
1177
|
});
|
1101
1178
|
|
1102
|
-
var interactionRender$
|
1179
|
+
var interactionRender$e = [
|
1103
1180
|
{
|
1104
1181
|
title: '点击事件',
|
1105
1182
|
child: [
|
@@ -1115,11 +1192,26 @@ var interactionRender$d = [
|
|
1115
1192
|
* @Author: binruan@chatlabs.com
|
1116
1193
|
* @Date: 2023-07-28 18:29:57
|
1117
1194
|
* @LastEditors: binruan@chatlabs.com
|
1118
|
-
* @LastEditTime: 2024-
|
1195
|
+
* @LastEditTime: 2024-08-06 15:35:25
|
1119
1196
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
|
1120
1197
|
*
|
1121
1198
|
*/
|
1122
|
-
var settingRender$
|
1199
|
+
var settingRender$a = [
|
1200
|
+
{
|
1201
|
+
title: '弹窗背景',
|
1202
|
+
child: [
|
1203
|
+
{
|
1204
|
+
type: 'Number',
|
1205
|
+
label: '左右边距',
|
1206
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
1207
|
+
},
|
1208
|
+
{
|
1209
|
+
type: 'Number',
|
1210
|
+
label: '下边距',
|
1211
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
1212
|
+
}
|
1213
|
+
]
|
1214
|
+
},
|
1123
1215
|
{
|
1124
1216
|
type: 'Text',
|
1125
1217
|
label: '组件名称',
|
@@ -1277,14 +1369,14 @@ var settingRender$9 = [
|
|
1277
1369
|
* @Author: binruan@chatlabs.com
|
1278
1370
|
* @Date: 2024-03-12 10:59:06
|
1279
1371
|
* @LastEditors: binruan@chatlabs.com
|
1280
|
-
* @LastEditTime: 2024-08-
|
1372
|
+
* @LastEditTime: 2024-08-14 17:02:53
|
1281
1373
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1282
1374
|
*
|
1283
1375
|
*/
|
1284
1376
|
function useEventReport() {
|
1285
1377
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
1286
1378
|
const jumpToWeb = useCallback((data, product, cta, position) => {
|
1287
|
-
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;
|
1379
|
+
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;
|
1288
1380
|
let fromKName = '';
|
1289
1381
|
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))) {
|
1290
1382
|
fromKName = 'pdpPage';
|
@@ -1301,21 +1393,22 @@ function useEventReport() {
|
|
1301
1393
|
else if (data === null || data === void 0 ? void 0 : data.product) {
|
1302
1394
|
fromKName = 'productPage';
|
1303
1395
|
}
|
1396
|
+
const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== 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.tags) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = data === null || data === void 0 ? void 0 : data.product) === null || _q === void 0 ? void 0 : _q.tags;
|
1304
1397
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1305
1398
|
eventInfo: {
|
1306
1399
|
eventSubject: 'jumpToWeb',
|
1307
1400
|
eventDescription: 'User jumped to website',
|
1308
|
-
productId: (
|
1309
|
-
productName: (
|
1401
|
+
productId: (_r = product === null || product === void 0 ? void 0 : product.itemId) !== null && _r !== void 0 ? _r : '',
|
1402
|
+
productName: (_s = product === null || product === void 0 ? void 0 : product.title) !== null && _s !== void 0 ? _s : '',
|
1310
1403
|
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
1311
|
-
productCollection: (
|
1404
|
+
productCollection: (_t = product === null || product === void 0 ? void 0 : product.collection) !== null && _t !== void 0 ? _t : '',
|
1312
1405
|
fromKName,
|
1313
1406
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
1314
|
-
contentTags:
|
1407
|
+
contentTags: contentTags ? JSON.stringify(contentTags) : '',
|
1315
1408
|
position: position + '',
|
1316
|
-
contentId: (
|
1317
|
-
ctatId: (
|
1318
|
-
traceInfo: (
|
1409
|
+
contentId: (_v = (_u = data === null || data === void 0 ? void 0 : data.video) === null || _u === void 0 ? void 0 : _u.itemId) !== null && _v !== void 0 ? _v : '',
|
1410
|
+
ctatId: (_w = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _w !== void 0 ? _w : '',
|
1411
|
+
traceInfo: (_9 = (_6 = (_4 = (_0 = (_x = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProduct) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : (_3 = (_2 = (_1 = data === null || data === void 0 ? void 0 : data.video) === null || _1 === void 0 ? void 0 : _1.bindProducts) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_5 = data === null || data === void 0 ? void 0 : data.product) === null || _5 === void 0 ? void 0 : _5.traceInfo) !== null && _6 !== void 0 ? _6 : (_8 = (_7 = data === null || data === void 0 ? void 0 : data.video) === null || _7 === void 0 ? void 0 : _7.bindCta) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : ''
|
1319
1412
|
}
|
1320
1413
|
});
|
1321
1414
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
@@ -1485,9 +1578,9 @@ const AppointForm = createMaterial(AppointFormComponent, {
|
|
1485
1578
|
category: 'popup',
|
1486
1579
|
type: 'AppointForm',
|
1487
1580
|
related: {
|
1488
|
-
settingRender: settingRender$
|
1581
|
+
settingRender: settingRender$a,
|
1489
1582
|
bindableProps: [],
|
1490
|
-
interactionRender: interactionRender$
|
1583
|
+
interactionRender: interactionRender$e
|
1491
1584
|
},
|
1492
1585
|
defaulSetting: {
|
1493
1586
|
name: '表单',
|
@@ -1510,10 +1603,41 @@ const AppointForm = createMaterial(AppointFormComponent, {
|
|
1510
1603
|
sort: 2
|
1511
1604
|
});
|
1512
1605
|
|
1513
|
-
var settingRender$
|
1606
|
+
var settingRender$9 = [
|
1607
|
+
{
|
1608
|
+
title: '弹窗背景',
|
1609
|
+
child: [
|
1610
|
+
{
|
1611
|
+
type: 'Number',
|
1612
|
+
label: '左右边距',
|
1613
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
1614
|
+
},
|
1615
|
+
{
|
1616
|
+
type: 'Number',
|
1617
|
+
label: '下边距',
|
1618
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
1619
|
+
}
|
1620
|
+
]
|
1621
|
+
},
|
1514
1622
|
{
|
1515
1623
|
title: '商品图片',
|
1516
1624
|
child: [
|
1625
|
+
{
|
1626
|
+
type: 'Group',
|
1627
|
+
label: '宽高比',
|
1628
|
+
child: [
|
1629
|
+
{
|
1630
|
+
type: 'Number',
|
1631
|
+
name: ['props', 'commodityImgRatio', 'w'],
|
1632
|
+
addonAfter: 'w'
|
1633
|
+
},
|
1634
|
+
{
|
1635
|
+
type: 'Number',
|
1636
|
+
name: ['props', 'commodityImgRatio', 'h'],
|
1637
|
+
addonAfter: 'h'
|
1638
|
+
}
|
1639
|
+
]
|
1640
|
+
},
|
1517
1641
|
{
|
1518
1642
|
type: 'Radius',
|
1519
1643
|
label: '轮播指示器',
|
@@ -1525,6 +1649,10 @@ var settingRender$8 = [
|
|
1525
1649
|
{
|
1526
1650
|
label: '居中',
|
1527
1651
|
value: 'center'
|
1652
|
+
},
|
1653
|
+
{
|
1654
|
+
label: '居右',
|
1655
|
+
value: 'right'
|
1528
1656
|
}
|
1529
1657
|
],
|
1530
1658
|
name: ['props', 'swiper', 'dotsAlign']
|
@@ -1772,6 +1900,17 @@ var settingRender$8 = [
|
|
1772
1900
|
name: ['props', 'buttonStyle']
|
1773
1901
|
}
|
1774
1902
|
]
|
1903
|
+
},
|
1904
|
+
{
|
1905
|
+
title: 'Iframe商品弹窗',
|
1906
|
+
child: [
|
1907
|
+
{
|
1908
|
+
label: '弹窗按钮',
|
1909
|
+
type: 'Upload',
|
1910
|
+
name: ['props', 'iframeIcon'],
|
1911
|
+
text: '建议尺寸:106 * 41'
|
1912
|
+
}
|
1913
|
+
]
|
1775
1914
|
}
|
1776
1915
|
];
|
1777
1916
|
|
@@ -8601,13 +8740,13 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8601
8740
|
* @Author: binruan@chatlabs.com
|
8602
8741
|
* @Date: 2023-11-02 18:34:34
|
8603
8742
|
* @LastEditors: binruan@chatlabs.com
|
8604
|
-
* @LastEditTime: 2024-
|
8743
|
+
* @LastEditTime: 2024-08-06 16:35:43
|
8605
8744
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8606
8745
|
*
|
8607
8746
|
*/
|
8608
8747
|
const closeIcon$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8609
8748
|
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false }) => {
|
8610
|
-
var _a, _b;
|
8749
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
8611
8750
|
const touchRef = useRef(null);
|
8612
8751
|
const fTouchRef = useRef(null);
|
8613
8752
|
const touchMoveRef = useRef(null);
|
@@ -8634,12 +8773,16 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
8634
8773
|
const isOpen = useMemo(() => {
|
8635
8774
|
return ((popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') || visible;
|
8636
8775
|
}, [visible, popup]);
|
8637
|
-
const
|
8638
|
-
var _a, _b, _c
|
8776
|
+
const getPopupById = useMemo(() => {
|
8777
|
+
var _a, _b, _c;
|
8639
8778
|
const schemaData = schema !== null && schema !== void 0 ? schema : _schema;
|
8640
8779
|
const value = (_c = (_b = (_a = schemaData === null || schemaData === void 0 ? void 0 : schemaData.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.find((value) => (value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id));
|
8641
|
-
return
|
8780
|
+
return value;
|
8642
8781
|
}, [popup, schema, _schema]);
|
8782
|
+
const isScrollFullScreen = useMemo(() => {
|
8783
|
+
var _a, _b;
|
8784
|
+
return ((_b = (_a = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _a === void 0 ? void 0 : _a.event) === null || _b === void 0 ? void 0 : _b.isScrollFullScreen) || false;
|
8785
|
+
}, [getPopupById]);
|
8643
8786
|
useEffect(() => {
|
8644
8787
|
if (isOpen) {
|
8645
8788
|
setIsShow(true);
|
@@ -8706,22 +8849,31 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
8706
8849
|
touchMoveRef.current = false;
|
8707
8850
|
};
|
8708
8851
|
return ReactDOM.createPortal(React.createElement(React.Fragment, null, isShow && (React.createElement("div", { className: 'modal-bg', style: Object.assign({ display: 'flex', backgroundColor: isOpen ? 'rgba(0, 0, 0, 0.7)' : 'rgba(0, 0, 0, 0)' }, modalStyle), onClick: handleClose },
|
8709
|
-
React.createElement("div",
|
8710
|
-
|
8711
|
-
|
8712
|
-
|
8713
|
-
|
8714
|
-
|
8715
|
-
|
8716
|
-
|
8717
|
-
|
8718
|
-
|
8719
|
-
|
8720
|
-
|
8721
|
-
|
8722
|
-
|
8723
|
-
|
8724
|
-
|
8852
|
+
React.createElement("div", { style: {
|
8853
|
+
position: 'relative',
|
8854
|
+
left: `${(_d = (_c = (_b = (_a = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.popupBg) === null || _c === void 0 ? void 0 : _c.horizontalMargin) !== null && _d !== void 0 ? _d : 0}px`,
|
8855
|
+
right: `${(_h = (_g = (_f = (_e = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _e === void 0 ? void 0 : _e.props) === null || _f === void 0 ? void 0 : _f.popupBg) === null || _g === void 0 ? void 0 : _g.horizontalMargin) !== null && _h !== void 0 ? _h : 0}px`,
|
8856
|
+
bottom: `${(_m = (_l = (_k = (_j = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.popupBg) === null || _l === void 0 ? void 0 : _l.bottomMargin) !== null && _m !== void 0 ? _m : 0}px`,
|
8857
|
+
overflow: 'hidden',
|
8858
|
+
width: `calc(100% - ${((_r = (_q = (_p = (_o = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _o === void 0 ? void 0 : _o.props) === null || _p === void 0 ? void 0 : _p.popupBg) === null || _q === void 0 ? void 0 : _q.horizontalMargin) !== null && _r !== void 0 ? _r : 0) * 2}px)`,
|
8859
|
+
height: '100%'
|
8860
|
+
} },
|
8861
|
+
React.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, style: Object.assign({ padding, animationDuration: ((_s = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _s !== void 0 ? _s : 0) / 1000 + 's' }, (isScrollFullScreen && {
|
8862
|
+
transform: `translateY(${modalTrans}px)`
|
8863
|
+
})), onClick: (e) => {
|
8864
|
+
e.stopPropagation();
|
8865
|
+
e.preventDefault();
|
8866
|
+
} }, (isScrollFullScreen && {
|
8867
|
+
onTouchMove: handleTouchMove,
|
8868
|
+
onTouchStart: handleTouchStart,
|
8869
|
+
onTouchEnd: handleTouchEnd
|
8870
|
+
})),
|
8871
|
+
React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
8872
|
+
React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon$1, alt: 'close', className: 'modal-icon' })),
|
8873
|
+
React.createElement("div", { ref: ref, style: {
|
8874
|
+
height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
|
8875
|
+
overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden'
|
8876
|
+
} }, children)))))), modalEleRef.current);
|
8725
8877
|
};
|
8726
8878
|
var Modal$1 = memo(Modal);
|
8727
8879
|
|
@@ -8794,18 +8946,20 @@ const FormatImage = forwardRef((props, ref) => {
|
|
8794
8946
|
const { src, onLoad, style, className, loading, alt = 'image' } = props;
|
8795
8947
|
const [imgSrc, setImgSrc] = useState();
|
8796
8948
|
const imgRef = useRef(null);
|
8949
|
+
const [visible, setVisible] = useState(false);
|
8797
8950
|
useImperativeHandle(ref, () => ({
|
8798
8951
|
setSrc: (v) => {
|
8799
|
-
|
8952
|
+
if (v)
|
8953
|
+
setImgSrc(v);
|
8800
8954
|
}
|
8801
8955
|
}));
|
8802
8956
|
useEffect(() => {
|
8803
|
-
|
8957
|
+
if (src)
|
8958
|
+
setImgSrc(src);
|
8804
8959
|
}, [src]);
|
8805
8960
|
useEffect(() => {
|
8806
8961
|
const onShow = () => {
|
8807
|
-
|
8808
|
-
if (src && ((_b = (_a = imgRef === null || imgRef === void 0 ? void 0 : imgRef.current) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === 'none') {
|
8962
|
+
if (src && !visible && imgRef.current) {
|
8809
8963
|
imgRef.current.src = '';
|
8810
8964
|
imgRef.current.src = src;
|
8811
8965
|
}
|
@@ -8814,20 +8968,20 @@ const FormatImage = forwardRef((props, ref) => {
|
|
8814
8968
|
return () => {
|
8815
8969
|
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
8816
8970
|
};
|
8817
|
-
}, [src]);
|
8818
|
-
return (React.createElement(React.Fragment, null,
|
8819
|
-
React.createElement("
|
8820
|
-
|
8821
|
-
|
8822
|
-
|
8823
|
-
|
8824
|
-
|
8971
|
+
}, [src, visible]);
|
8972
|
+
return (React.createElement(React.Fragment, null,
|
8973
|
+
!visible && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
|
8974
|
+
(imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
|
8975
|
+
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
8976
|
+
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
|
8977
|
+
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
|
8978
|
+
React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
8979
|
+
setVisible(true);
|
8980
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
8981
|
+
}, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
8982
|
+
setVisible(true);
|
8825
8983
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
8826
|
-
}, alt: alt })))
|
8827
|
-
if (imgRef.current)
|
8828
|
-
imgRef.current.style.display = 'block';
|
8829
|
-
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
8830
|
-
}, alt: alt }))));
|
8984
|
+
}, alt: alt }))));
|
8831
8985
|
});
|
8832
8986
|
var FormatImage$1 = memo(FormatImage);
|
8833
8987
|
|
@@ -8885,8 +9039,8 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
|
|
8885
9039
|
var CommodityGroup$1 = memo(CommodityGroup);
|
8886
9040
|
|
8887
9041
|
const CommodityDetail$1 = (_a) => {
|
8888
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
8889
|
-
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"]);
|
9042
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
9043
|
+
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
|
8890
9044
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
8891
9045
|
const { jumpToWeb, productView } = useEventReport();
|
8892
9046
|
const curTimeRef = useRef(null);
|
@@ -8942,7 +9096,8 @@ const CommodityDetail$1 = (_a) => {
|
|
8942
9096
|
return '$7,000';
|
8943
9097
|
}
|
8944
9098
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8945
|
-
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
9099
|
+
const width = (isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth) - ((_u = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _u !== void 0 ? _u : 0) * 2;
|
9100
|
+
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
8946
9101
|
const renderContent = ({ isPost }) => {
|
8947
9102
|
var _a, _b, _c, _d;
|
8948
9103
|
return (React.createElement("div", null,
|
@@ -8989,25 +9144,32 @@ const CommodityDetail$1 = (_a) => {
|
|
8989
9144
|
return;
|
8990
9145
|
return (React.createElement(CommodityGroup$1, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
|
8991
9146
|
}, [checkCommodityIndex]);
|
9147
|
+
const getDotsAlign = useMemo(() => {
|
9148
|
+
const dotsAlignClass = {
|
9149
|
+
left: 'commondityDetail-swiper-clickable-left',
|
9150
|
+
center: 'commondityDetail-swiper-clickable-center',
|
9151
|
+
right: 'commondityDetail-swiper-clickable-right'
|
9152
|
+
};
|
9153
|
+
return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
|
9154
|
+
}, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
|
9155
|
+
const iframeUrl = ((_w = (_v = data === null || data === void 0 ? void 0 : data.video) === null || _v === void 0 ? void 0 : _v.bindProduct) === null || _w === void 0 ? void 0 : _w.remark) || ((_z = (_y = (_x = data === null || data === void 0 ? void 0 : data.video) === null || _x === void 0 ? void 0 : _x.bindProducts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.remark) || ((_0 = data === null || data === void 0 ? void 0 : data.product) === null || _0 === void 0 ? void 0 : _0.remark);
|
8992
9156
|
return (React.createElement(React.Fragment, null,
|
8993
9157
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
8994
|
-
|
8995
|
-
React.createElement(Swiper, { height:
|
9158
|
+
React.createElement("div", { style: { position: 'relative' } },
|
9159
|
+
product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
|
8996
9160
|
clickable: true,
|
8997
9161
|
bulletActiveClass: 'swipe-item-active-bullet',
|
8998
|
-
clickableClass:
|
8999
|
-
? 'commondityDetail-swiper-clickable-left'
|
9000
|
-
: 'commondityDetail-swiper-clickable-center'
|
9162
|
+
clickableClass: getDotsAlign
|
9001
9163
|
}, loop: true, autoplay: {
|
9002
9164
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
9003
9165
|
} },
|
9004
|
-
React.createElement(React.Fragment, null, (
|
9166
|
+
React.createElement(React.Fragment, null, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
|
9005
9167
|
var _a;
|
9006
9168
|
return (React.createElement(SwiperSlide, { key: src },
|
9007
9169
|
React.createElement("div", { style: {
|
9008
9170
|
overflow: 'hidden',
|
9009
9171
|
width,
|
9010
|
-
height
|
9172
|
+
height
|
9011
9173
|
} },
|
9012
9174
|
React.createElement(FormatImage$1, { style: {
|
9013
9175
|
height: '100%',
|
@@ -9016,21 +9178,30 @@ const CommodityDetail$1 = (_a) => {
|
|
9016
9178
|
display: 'block',
|
9017
9179
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
9018
9180
|
}, 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 }))));
|
9019
|
-
}))))
|
9020
|
-
|
9021
|
-
|
9022
|
-
|
9023
|
-
|
9024
|
-
|
9025
|
-
|
9026
|
-
|
9027
|
-
|
9028
|
-
|
9029
|
-
|
9030
|
-
|
9031
|
-
|
9032
|
-
|
9033
|
-
|
9181
|
+
})))),
|
9182
|
+
!((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (React.createElement("div", { className: css({
|
9183
|
+
height,
|
9184
|
+
width
|
9185
|
+
}) },
|
9186
|
+
React.createElement("img", { className: css({
|
9187
|
+
objectFit: 'cover',
|
9188
|
+
width: '100%',
|
9189
|
+
height: '100%'
|
9190
|
+
}), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
|
9191
|
+
(iframeUrl && iframeIcon) ||
|
9192
|
+
(!product && iframeIcon && (React.createElement("div", { style: {
|
9193
|
+
padding: '5px 10px',
|
9194
|
+
display: 'flex',
|
9195
|
+
alignItems: 'center',
|
9196
|
+
position: 'absolute',
|
9197
|
+
right: '10px',
|
9198
|
+
bottom: '10px',
|
9199
|
+
zIndex: 1,
|
9200
|
+
background: '#fff',
|
9201
|
+
borderRadius: '3px'
|
9202
|
+
}, onClick: () => setShow3DModal(true) },
|
9203
|
+
React.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
|
9204
|
+
React.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
|
9034
9205
|
renderCommodityGroup(),
|
9035
9206
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
9036
9207
|
renderBtn(),
|
@@ -9038,10 +9209,11 @@ const CommodityDetail$1 = (_a) => {
|
|
9038
9209
|
React.createElement("div", { style: { paddingBottom: '80px' } }, renderContent({ isPost: false })),
|
9039
9210
|
renderBtn()),
|
9040
9211
|
React.createElement(Modal$1, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
|
9041
|
-
React.createElement("iframe", { src:
|
9212
|
+
React.createElement("iframe", { src: iframeUrl, style: {
|
9042
9213
|
width: '100%',
|
9043
|
-
height: 'calc(100% -
|
9044
|
-
marginTop: '40px'
|
9214
|
+
height: 'calc(100% - 50px)',
|
9215
|
+
marginTop: '40px',
|
9216
|
+
border: 'none'
|
9045
9217
|
} }))));
|
9046
9218
|
};
|
9047
9219
|
var CommodityDetailComponent = memo(CommodityDetail$1);
|
@@ -9062,7 +9234,7 @@ var CommodityDetailComponent = memo(CommodityDetail$1);
|
|
9062
9234
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
|
9063
9235
|
*
|
9064
9236
|
*/
|
9065
|
-
var interactionRender$
|
9237
|
+
var interactionRender$d = [
|
9066
9238
|
{
|
9067
9239
|
title: '滑动事件',
|
9068
9240
|
child: [
|
@@ -9079,7 +9251,7 @@ var interactionRender$c = [
|
|
9079
9251
|
* @Author: binruan@chatlabs.com
|
9080
9252
|
* @Date: 2023-07-28 18:29:57
|
9081
9253
|
* @LastEditors: binruan@chatlabs.com
|
9082
|
-
* @LastEditTime: 2024-
|
9254
|
+
* @LastEditTime: 2024-08-08 18:30:20
|
9083
9255
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\material.tsx
|
9084
9256
|
*
|
9085
9257
|
*/
|
@@ -9089,8 +9261,8 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
|
9089
9261
|
category: 'popup',
|
9090
9262
|
type: 'CommodityDetail',
|
9091
9263
|
related: {
|
9092
|
-
settingRender: settingRender$
|
9093
|
-
interactionRender: interactionRender$
|
9264
|
+
settingRender: settingRender$9,
|
9265
|
+
interactionRender: interactionRender$d
|
9094
9266
|
},
|
9095
9267
|
defaulSetting: {
|
9096
9268
|
props: {
|
@@ -9132,6 +9304,10 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
|
9132
9304
|
fontWeight: 'bold',
|
9133
9305
|
textAlign: 'center',
|
9134
9306
|
color: 'rgba(255, 255, 255, 0.9)'
|
9307
|
+
},
|
9308
|
+
commodityImgRatio: {
|
9309
|
+
w: 1,
|
9310
|
+
h: 1
|
9135
9311
|
}
|
9136
9312
|
},
|
9137
9313
|
style: {}
|
@@ -9141,7 +9317,7 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
|
9141
9317
|
sort: 1
|
9142
9318
|
});
|
9143
9319
|
|
9144
|
-
var interactionRender$
|
9320
|
+
var interactionRender$c = [
|
9145
9321
|
{
|
9146
9322
|
title: '点击事件',
|
9147
9323
|
child: [
|
@@ -9157,13 +9333,28 @@ var interactionRender$b = [
|
|
9157
9333
|
* @Author: binruan@chatlabs.com
|
9158
9334
|
* @Date: 2023-10-27 14:06:35
|
9159
9335
|
* @LastEditors: binruan@chatlabs.com
|
9160
|
-
* @LastEditTime: 2024-
|
9336
|
+
* @LastEditTime: 2024-08-06 16:15:08
|
9161
9337
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\Prompt\settingRender.tsx
|
9162
9338
|
*
|
9163
9339
|
*/
|
9164
|
-
var settingRender$
|
9340
|
+
var settingRender$8 = [
|
9165
9341
|
{
|
9166
|
-
title: '',
|
9342
|
+
title: '弹窗背景',
|
9343
|
+
child: [
|
9344
|
+
{
|
9345
|
+
type: 'Number',
|
9346
|
+
label: '左右边距',
|
9347
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
9348
|
+
},
|
9349
|
+
{
|
9350
|
+
type: 'Number',
|
9351
|
+
label: '下边距',
|
9352
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
9353
|
+
}
|
9354
|
+
]
|
9355
|
+
},
|
9356
|
+
{
|
9357
|
+
title: '内容',
|
9167
9358
|
child: [
|
9168
9359
|
{
|
9169
9360
|
type: 'Media',
|
@@ -9331,9 +9522,9 @@ const Prompt = createMaterial(PromptComponent, {
|
|
9331
9522
|
category: 'popup',
|
9332
9523
|
type: 'Prompt',
|
9333
9524
|
related: {
|
9334
|
-
settingRender: settingRender$
|
9525
|
+
settingRender: settingRender$8,
|
9335
9526
|
bindableProps: [],
|
9336
|
-
interactionRender: interactionRender$
|
9527
|
+
interactionRender: interactionRender$c
|
9337
9528
|
},
|
9338
9529
|
defaulSetting: {
|
9339
9530
|
props: {
|
@@ -9352,14 +9543,45 @@ const Prompt = createMaterial(PromptComponent, {
|
|
9352
9543
|
* @Author: binruan@chatlabs.com
|
9353
9544
|
* @Date: 2024-03-26 16:50:25
|
9354
9545
|
* @LastEditors: binruan@chatlabs.com
|
9355
|
-
* @LastEditTime: 2024-
|
9546
|
+
* @LastEditTime: 2024-08-08 18:34:06
|
9356
9547
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
|
9357
9548
|
*
|
9358
9549
|
*/
|
9359
|
-
var settingRender$
|
9550
|
+
var settingRender$7 = [
|
9551
|
+
{
|
9552
|
+
title: '弹窗背景',
|
9553
|
+
child: [
|
9554
|
+
{
|
9555
|
+
type: 'Number',
|
9556
|
+
label: '左右边距',
|
9557
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
9558
|
+
},
|
9559
|
+
{
|
9560
|
+
type: 'Number',
|
9561
|
+
label: '下边距',
|
9562
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
9563
|
+
}
|
9564
|
+
]
|
9565
|
+
},
|
9360
9566
|
{
|
9361
9567
|
title: '商品图片',
|
9362
9568
|
child: [
|
9569
|
+
{
|
9570
|
+
type: 'Group',
|
9571
|
+
label: '宽高比',
|
9572
|
+
child: [
|
9573
|
+
{
|
9574
|
+
type: 'Number',
|
9575
|
+
name: ['props', 'commodityImgRatio', 'w'],
|
9576
|
+
addonAfter: 'w'
|
9577
|
+
},
|
9578
|
+
{
|
9579
|
+
type: 'Number',
|
9580
|
+
name: ['props', 'commodityImgRatio', 'h'],
|
9581
|
+
addonAfter: 'h'
|
9582
|
+
}
|
9583
|
+
]
|
9584
|
+
},
|
9363
9585
|
{
|
9364
9586
|
type: 'Radius',
|
9365
9587
|
label: '轮播指示器',
|
@@ -9371,6 +9593,10 @@ var settingRender$6 = [
|
|
9371
9593
|
{
|
9372
9594
|
label: '居中',
|
9373
9595
|
value: 'center'
|
9596
|
+
},
|
9597
|
+
{
|
9598
|
+
label: '居右',
|
9599
|
+
value: 'right'
|
9374
9600
|
}
|
9375
9601
|
],
|
9376
9602
|
name: ['props', 'swiper', 'dotsAlign']
|
@@ -9601,12 +9827,23 @@ var settingRender$6 = [
|
|
9601
9827
|
name: ['props', 'buttonStyle']
|
9602
9828
|
}
|
9603
9829
|
]
|
9830
|
+
},
|
9831
|
+
{
|
9832
|
+
title: 'Iframe商品弹窗',
|
9833
|
+
child: [
|
9834
|
+
{
|
9835
|
+
label: '弹窗按钮',
|
9836
|
+
type: 'Upload',
|
9837
|
+
name: ['props', 'iframeIcon'],
|
9838
|
+
text: '建议尺寸:106 * 41'
|
9839
|
+
}
|
9840
|
+
]
|
9604
9841
|
}
|
9605
9842
|
];
|
9606
9843
|
|
9607
9844
|
const CommodityDetailDiroNew$1 = (_a) => {
|
9608
|
-
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;
|
9609
|
-
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"]);
|
9845
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
9846
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
|
9610
9847
|
useState(true);
|
9611
9848
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
|
9612
9849
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -9615,6 +9852,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
9615
9852
|
useState(true);
|
9616
9853
|
const [showModal, setShowModal] = useState(false);
|
9617
9854
|
const curTimeRef = useRef(null);
|
9855
|
+
const [show3DModal, setShow3DModal] = useState(false);
|
9618
9856
|
const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
9619
9857
|
const data = isPost ? rec : popupDetailData;
|
9620
9858
|
let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
|
@@ -9665,7 +9903,8 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
9665
9903
|
return '£102,300.00';
|
9666
9904
|
}
|
9667
9905
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
9668
|
-
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
9906
|
+
const width = (isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth) - ((_u = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _u !== void 0 ? _u : 0) * 2;
|
9907
|
+
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
9669
9908
|
// useEffect(() => {
|
9670
9909
|
// console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
|
9671
9910
|
// if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
|
@@ -9739,52 +9978,69 @@ Made in Italy` })));
|
|
9739
9978
|
return;
|
9740
9979
|
return (React.createElement(CommodityGroup$1, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
|
9741
9980
|
}, [checkCommodityIndex]);
|
9981
|
+
const getDotsAlign = useMemo(() => {
|
9982
|
+
const dotsAlignClass = {
|
9983
|
+
left: 'commondityDetail-swiper-clickable-left',
|
9984
|
+
center: 'commondityDetail-swiper-clickable-center',
|
9985
|
+
right: 'commondityDetail-swiper-clickable-right'
|
9986
|
+
};
|
9987
|
+
return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
|
9988
|
+
}, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
|
9989
|
+
const iframeUrl = ((_w = (_v = data === null || data === void 0 ? void 0 : data.video) === null || _v === void 0 ? void 0 : _v.bindProduct) === null || _w === void 0 ? void 0 : _w.remark) || ((_z = (_y = (_x = data === null || data === void 0 ? void 0 : data.video) === null || _x === void 0 ? void 0 : _x.bindProducts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.remark) || ((_0 = data === null || data === void 0 ? void 0 : data.product) === null || _0 === void 0 ? void 0 : _0.remark);
|
9742
9990
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
9743
9991
|
React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
9744
|
-
|
9745
|
-
|
9746
|
-
|
9747
|
-
|
9748
|
-
|
9749
|
-
|
9750
|
-
|
9751
|
-
|
9752
|
-
|
9753
|
-
|
9754
|
-
|
9755
|
-
|
9756
|
-
|
9757
|
-
|
9758
|
-
|
9759
|
-
|
9760
|
-
|
9761
|
-
|
9762
|
-
|
9763
|
-
|
9764
|
-
|
9765
|
-
|
9766
|
-
|
9767
|
-
|
9768
|
-
|
9769
|
-
|
9770
|
-
|
9771
|
-
|
9772
|
-
|
9773
|
-
|
9774
|
-
|
9775
|
-
|
9776
|
-
|
9777
|
-
|
9778
|
-
|
9779
|
-
|
9780
|
-
|
9781
|
-
|
9992
|
+
React.createElement("div", { style: { position: 'relative' } },
|
9993
|
+
product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
|
9994
|
+
clickable: true,
|
9995
|
+
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
9996
|
+
clickableClass: getDotsAlign
|
9997
|
+
}, loop: true, autoplay: {
|
9998
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
9999
|
+
} }, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
|
10000
|
+
var _a;
|
10001
|
+
return (React.createElement(SwiperSlide, { key: src },
|
10002
|
+
React.createElement("div", { style: {
|
10003
|
+
overflow: 'hidden',
|
10004
|
+
width,
|
10005
|
+
height
|
10006
|
+
} },
|
10007
|
+
React.createElement(FormatImage$1, { style: {
|
10008
|
+
height: '100%',
|
10009
|
+
width: '100%',
|
10010
|
+
objectFit: 'cover',
|
10011
|
+
display: 'block',
|
10012
|
+
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
10013
|
+
}, 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 }))));
|
10014
|
+
}))),
|
10015
|
+
!((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (React.createElement("div", { className: css({
|
10016
|
+
height,
|
10017
|
+
width
|
10018
|
+
}) },
|
10019
|
+
React.createElement("img", { className: css({
|
10020
|
+
objectFit: 'cover',
|
10021
|
+
width: '100%',
|
10022
|
+
height: '100%'
|
10023
|
+
}), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
|
10024
|
+
(iframeUrl && iframeIcon) ||
|
10025
|
+
(!product && iframeIcon && (React.createElement("div", { style: {
|
10026
|
+
padding: '5px 10px',
|
10027
|
+
display: 'flex',
|
10028
|
+
alignItems: 'center',
|
10029
|
+
position: 'absolute',
|
10030
|
+
right: '10px',
|
10031
|
+
bottom: '10px',
|
10032
|
+
zIndex: 1,
|
10033
|
+
background: '#fff',
|
10034
|
+
borderRadius: '3px'
|
10035
|
+
}, onClick: () => setShow3DModal(true) },
|
10036
|
+
React.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
|
10037
|
+
React.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
|
9782
10038
|
renderCommodityGroup(),
|
9783
10039
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
9784
10040
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
9785
10041
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
9786
10042
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
|
9787
|
-
__html: setFontForText((
|
10043
|
+
__html: setFontForText((_5 = product === null || product === void 0 ? void 0 : product.title) !== null && _5 !== void 0 ? _5 : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
9788
10044
|
} }),
|
9789
10045
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), dangerouslySetInnerHTML: {
|
9790
10046
|
__html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -9794,14 +10050,21 @@ Made in Italy` })));
|
|
9794
10050
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
9795
10051
|
} }),
|
9796
10052
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
9797
|
-
__html: setFontForText((
|
10053
|
+
__html: setFontForText((_6 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _6 !== void 0 ? _6 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
9798
10054
|
} }))),
|
9799
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (
|
10055
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_7 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _7 !== void 0 ? _7 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
|
9800
10056
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
9801
|
-
__html: setFontForText((
|
10057
|
+
__html: setFontForText((_8 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _8 !== void 0 ? _8 : 'Shop now', buttonStyle)
|
9802
10058
|
} }))),
|
9803
10059
|
productInfoText({ isPost }))),
|
9804
|
-
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))
|
10060
|
+
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false })),
|
10061
|
+
React.createElement(Modal$1, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
|
10062
|
+
React.createElement("iframe", { src: iframeUrl, style: {
|
10063
|
+
width: '100%',
|
10064
|
+
height: 'calc(100% - 50px)',
|
10065
|
+
marginTop: '40px',
|
10066
|
+
border: 'none'
|
10067
|
+
} }))));
|
9805
10068
|
};
|
9806
10069
|
var CommodityDetailDiroNewComponent = memo(CommodityDetailDiroNew$1);
|
9807
10070
|
|
@@ -9821,7 +10084,7 @@ var CommodityDetailDiroNewComponent = memo(CommodityDetailDiroNew$1);
|
|
9821
10084
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
|
9822
10085
|
*
|
9823
10086
|
*/
|
9824
|
-
var interactionRender$
|
10087
|
+
var interactionRender$b = [
|
9825
10088
|
{
|
9826
10089
|
title: '滑动事件',
|
9827
10090
|
child: [
|
@@ -9848,8 +10111,8 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
|
|
9848
10111
|
category: 'popup',
|
9849
10112
|
type: 'CommodityDetailDiroNew',
|
9850
10113
|
related: {
|
9851
|
-
settingRender: settingRender$
|
9852
|
-
interactionRender: interactionRender$
|
10114
|
+
settingRender: settingRender$7,
|
10115
|
+
interactionRender: interactionRender$b
|
9853
10116
|
},
|
9854
10117
|
defaulSetting: {
|
9855
10118
|
props: {
|
@@ -9892,6 +10155,10 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
|
|
9892
10155
|
borderRadius: 25,
|
9893
10156
|
marginTop: 16,
|
9894
10157
|
marginBottom: 16
|
10158
|
+
},
|
10159
|
+
commodityImgRatio: {
|
10160
|
+
w: 1,
|
10161
|
+
h: 1
|
9895
10162
|
}
|
9896
10163
|
},
|
9897
10164
|
style: {}
|
@@ -9909,7 +10176,22 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
|
|
9909
10176
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\settingRender.tsx
|
9910
10177
|
*
|
9911
10178
|
*/
|
9912
|
-
var settingRender$
|
10179
|
+
var settingRender$6 = [
|
10180
|
+
{
|
10181
|
+
title: '弹窗背景',
|
10182
|
+
child: [
|
10183
|
+
{
|
10184
|
+
type: 'Number',
|
10185
|
+
label: '左右边距',
|
10186
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
10187
|
+
},
|
10188
|
+
{
|
10189
|
+
type: 'Number',
|
10190
|
+
label: '下边距',
|
10191
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
10192
|
+
}
|
10193
|
+
]
|
10194
|
+
},
|
9913
10195
|
{
|
9914
10196
|
title: '商品图片',
|
9915
10197
|
child: [
|
@@ -10267,7 +10549,7 @@ var CommodityListComponent = memo(CommodityList$1);
|
|
10267
10549
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
|
10268
10550
|
*
|
10269
10551
|
*/
|
10270
|
-
var interactionRender$
|
10552
|
+
var interactionRender$a = [
|
10271
10553
|
{
|
10272
10554
|
title: '点击事件',
|
10273
10555
|
child: [
|
@@ -10293,8 +10575,8 @@ const CommodityList = createMaterial(CommodityListComponent, {
|
|
10293
10575
|
category: 'popup',
|
10294
10576
|
type: 'CommodityList',
|
10295
10577
|
related: {
|
10296
|
-
settingRender: settingRender$
|
10297
|
-
interactionRender: interactionRender$
|
10578
|
+
settingRender: settingRender$6,
|
10579
|
+
interactionRender: interactionRender$a
|
10298
10580
|
},
|
10299
10581
|
defaulSetting: {
|
10300
10582
|
props: {
|
@@ -10335,6 +10617,59 @@ const CommodityList = createMaterial(CommodityListComponent, {
|
|
10335
10617
|
sort: 1
|
10336
10618
|
});
|
10337
10619
|
|
10620
|
+
/*
|
10621
|
+
* @Author: binruan@chatlabs.com
|
10622
|
+
* @Date: 2023-10-27 14:06:35
|
10623
|
+
* @LastEditors: binruan@chatlabs.com
|
10624
|
+
* @LastEditTime: 2024-08-08 17:32:11
|
10625
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\Iframe\settingRender.tsx
|
10626
|
+
*
|
10627
|
+
*/
|
10628
|
+
var settingRender$5 = [
|
10629
|
+
{
|
10630
|
+
title: '背景样式',
|
10631
|
+
child: [
|
10632
|
+
{
|
10633
|
+
type: 'Color',
|
10634
|
+
label: '背景色',
|
10635
|
+
name: ['style', 'backgroundColor']
|
10636
|
+
}
|
10637
|
+
]
|
10638
|
+
}
|
10639
|
+
];
|
10640
|
+
|
10641
|
+
const Iframe$1 = (_a) => {
|
10642
|
+
var _b, _c;
|
10643
|
+
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle"]);
|
10644
|
+
const { popupDetailData } = useSxpDataSource();
|
10645
|
+
const iframeUrl = (_c = (_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _b === void 0 ? void 0 : _b.bindCta) === null || _c === void 0 ? void 0 : _c.remark;
|
10646
|
+
return (React.createElement("div", Object.assign({ className: `${css(Object.assign({}, style))}` }, props), iframeUrl && (React.createElement("iframe", { src: iframeUrl, style: {
|
10647
|
+
width: '100%',
|
10648
|
+
height: 'calc(100% - 50px)',
|
10649
|
+
marginTop: '40px',
|
10650
|
+
border: 'none'
|
10651
|
+
} }))));
|
10652
|
+
};
|
10653
|
+
var IframeComponent = memo(Iframe$1);
|
10654
|
+
|
10655
|
+
const Iframe = createMaterial(IframeComponent, {
|
10656
|
+
displayName: 'Iframe弹窗',
|
10657
|
+
icon: '',
|
10658
|
+
category: 'popup',
|
10659
|
+
type: 'Iframe',
|
10660
|
+
related: {
|
10661
|
+
settingRender: settingRender$5,
|
10662
|
+
bindableProps: []
|
10663
|
+
},
|
10664
|
+
defaulSetting: {
|
10665
|
+
props: {},
|
10666
|
+
style: {}
|
10667
|
+
},
|
10668
|
+
w: 100,
|
10669
|
+
h: 40,
|
10670
|
+
sort: 3
|
10671
|
+
});
|
10672
|
+
|
10338
10673
|
/*
|
10339
10674
|
* @Author: binruan@chatlabs.com
|
10340
10675
|
* @Date: 2024-03-26 16:50:25
|
@@ -10594,7 +10929,7 @@ var settingRender$4 = [
|
|
10594
10929
|
}
|
10595
10930
|
];
|
10596
10931
|
|
10597
|
-
var interactionRender$
|
10932
|
+
var interactionRender$9 = [
|
10598
10933
|
{
|
10599
10934
|
title: '点击事件',
|
10600
10935
|
child: [
|
@@ -10607,7 +10942,7 @@ var interactionRender$8 = [
|
|
10607
10942
|
];
|
10608
10943
|
|
10609
10944
|
const EventProvider = (_a) => {
|
10610
|
-
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
10945
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink"]);
|
10611
10946
|
const ref = useRef(null);
|
10612
10947
|
const { popup } = useEditor();
|
10613
10948
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
@@ -10621,11 +10956,11 @@ const EventProvider = (_a) => {
|
|
10621
10956
|
}, rec, item, index);
|
10622
10957
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
10623
10958
|
if (isExternalLink) {
|
10624
|
-
if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
|
10959
|
+
if (jumpLink || ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link)) {
|
10625
10960
|
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
10626
10961
|
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
10627
10962
|
jumpToWeb(rec, product, cta, index);
|
10628
|
-
window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
|
10963
|
+
window.location.href = window.getJointUtmLink(jumpLink || ((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link) || '');
|
10629
10964
|
}
|
10630
10965
|
}
|
10631
10966
|
else {
|
@@ -10677,7 +11012,7 @@ const Commodity = createMaterial(CommodityComponent, {
|
|
10677
11012
|
category: 'template',
|
10678
11013
|
type: 'Commodity',
|
10679
11014
|
related: {
|
10680
|
-
interactionRender: interactionRender$
|
11015
|
+
interactionRender: interactionRender$9,
|
10681
11016
|
bindableProps: [],
|
10682
11017
|
settingRender: settingRender$4
|
10683
11018
|
},
|
@@ -10719,7 +11054,7 @@ const Commodity = createMaterial(CommodityComponent, {
|
|
10719
11054
|
sort: 1
|
10720
11055
|
});
|
10721
11056
|
|
10722
|
-
var interactionRender$
|
11057
|
+
var interactionRender$8 = [
|
10723
11058
|
{
|
10724
11059
|
title: '点击事件',
|
10725
11060
|
child: [
|
@@ -10759,7 +11094,7 @@ const Appoint = createMaterial(AppointComponent, {
|
|
10759
11094
|
category: 'template',
|
10760
11095
|
type: 'Appoint',
|
10761
11096
|
related: {
|
10762
|
-
interactionRender: interactionRender$
|
11097
|
+
interactionRender: interactionRender$8,
|
10763
11098
|
settingRender: settingRender$4 === null || settingRender$4 === void 0 ? void 0 : settingRender$4.filter((i) => i.type !== 'commodityTitle'),
|
10764
11099
|
bindableProps: []
|
10765
11100
|
},
|
@@ -10909,21 +11244,15 @@ var linkSettingRender = [
|
|
10909
11244
|
var styles$7 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU","one-line-ellipsis":"index-module_one-line-ellipsis__buFw1"};
|
10910
11245
|
|
10911
11246
|
const Link$1 = (_a) => {
|
10912
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
11247
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
10913
11248
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle"]);
|
10914
11249
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
10915
|
-
|
11250
|
+
useEventReport();
|
10916
11251
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
10917
|
-
|
10918
|
-
const handleTo = () => {
|
10919
|
-
if (cta === null || cta === void 0 ? void 0 : cta.link) {
|
10920
|
-
jumpToWeb(recData, product, cta, index);
|
10921
|
-
window.location.href = window.getJointUtmLink(cta.link);
|
10922
|
-
}
|
10923
|
-
};
|
11252
|
+
(_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
10924
11253
|
const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
10925
|
-
return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, {
|
10926
|
-
React.createElement(Img$1, { src: src, rec: recData, item: (
|
11254
|
+
return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
|
11255
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
10927
11256
|
React.createElement("div", { className: css({
|
10928
11257
|
display: 'flex',
|
10929
11258
|
alignItems: 'center',
|
@@ -10932,14 +11261,34 @@ const Link$1 = (_a) => {
|
|
10932
11261
|
}) },
|
10933
11262
|
React.createElement("div", null,
|
10934
11263
|
React.createElement("div", { className: styles$7['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
|
10935
|
-
__html: setFontForText((
|
11264
|
+
__html: setFontForText((_j = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
10936
11265
|
} }),
|
10937
|
-
(customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (React.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((
|
11266
|
+
(customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (React.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((_k = customTitle === null || customTitle === void 0 ? void 0 : customTitle.style) === null || _k === void 0 ? void 0 : _k.height) + 'px' }), className: styles$7['one-line-ellipsis'], dangerouslySetInnerHTML: {
|
10938
11267
|
__html: setFontForText(customTitle === null || customTitle === void 0 ? void 0 : customTitle.text, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style)
|
10939
11268
|
} }))))));
|
10940
11269
|
};
|
10941
11270
|
var LinkComponent = memo(Link$1);
|
10942
11271
|
|
11272
|
+
/*
|
11273
|
+
* @Author: binruan@chatlabs.com
|
11274
|
+
* @Date: 2024-08-09 16:59:38
|
11275
|
+
* @LastEditors: binruan@chatlabs.com
|
11276
|
+
* @LastEditTime: 2024-08-09 16:59:44
|
11277
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Link\interactionRender.tsx
|
11278
|
+
*
|
11279
|
+
*/
|
11280
|
+
var interactionRender$7 = [
|
11281
|
+
{
|
11282
|
+
title: '点击事件',
|
11283
|
+
child: [
|
11284
|
+
{
|
11285
|
+
type: 'link',
|
11286
|
+
name: 'onClick'
|
11287
|
+
}
|
11288
|
+
]
|
11289
|
+
}
|
11290
|
+
];
|
11291
|
+
|
10943
11292
|
var _a;
|
10944
11293
|
const Link = createMaterial(LinkComponent, {
|
10945
11294
|
displayName: '跳转指引',
|
@@ -10948,7 +11297,8 @@ const Link = createMaterial(LinkComponent, {
|
|
10948
11297
|
type: 'Link',
|
10949
11298
|
related: {
|
10950
11299
|
settingRender: (_a = settingRender$4 === null || settingRender$4 === void 0 ? void 0 : settingRender$4.filter((i) => i.type !== 'commodityTitle')) === null || _a === void 0 ? void 0 : _a.concat(linkSettingRender),
|
10951
|
-
bindableProps: []
|
11300
|
+
bindableProps: [],
|
11301
|
+
interactionRender: interactionRender$7
|
10952
11302
|
},
|
10953
11303
|
defaulSetting: {
|
10954
11304
|
props: {
|
@@ -13283,16 +13633,10 @@ function WaterfallList$1(_a) {
|
|
13283
13633
|
}, [unitWidth, rowsNum, list]); /* 增加getStyleList依赖项会导致在admin预览编辑时无限刷新 */
|
13284
13634
|
/** 初始化请求数据 */
|
13285
13635
|
useEffect(() => {
|
13286
|
-
var _a, _b;
|
13636
|
+
var _a, _b, _c, _d, _e, _f;
|
13287
13637
|
setIsLoadingData(true);
|
13288
13638
|
waterFallData &&
|
13289
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
13290
|
-
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
13291
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
13292
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
13293
|
-
defaultSize: hashTagSize,
|
13294
|
-
maxSize: hashTagSize
|
13295
|
-
}).then((res) => {
|
13639
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag, defaultSize: hashTagSize, maxSize: hashTagSize }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId }))).then((res) => {
|
13296
13640
|
var _a, _b;
|
13297
13641
|
setData(res);
|
13298
13642
|
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
@@ -13301,7 +13645,7 @@ function WaterfallList$1(_a) {
|
|
13301
13645
|
if (isOpenHashTag) {
|
13302
13646
|
const res = previewData;
|
13303
13647
|
setData(res);
|
13304
|
-
setList((
|
13648
|
+
setList((_f = (_e = res === null || res === void 0 ? void 0 : res.recList) === null || _e === void 0 ? void 0 : _e.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _f !== void 0 ? _f : []);
|
13305
13649
|
setIsLoadingData(false);
|
13306
13650
|
}
|
13307
13651
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
@@ -13327,13 +13671,10 @@ function WaterfallList$1(_a) {
|
|
13327
13671
|
};
|
13328
13672
|
}, [onResize]);
|
13329
13673
|
useCallback(() => {
|
13674
|
+
var _a, _b, _c, _d;
|
13330
13675
|
setIsLoadingData(true);
|
13331
13676
|
waterFallData &&
|
13332
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
13333
|
-
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
13334
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
13335
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
13336
|
-
}).then((res) => {
|
13677
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId }))).then((res) => {
|
13337
13678
|
var _a, _b;
|
13338
13679
|
setList(list === null || list === void 0 ? void 0 : list.concat((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => !(item === null || item === void 0 ? void 0 : item.video))) !== null && _b !== void 0 ? _b : []));
|
13339
13680
|
setIsLoadingData(false);
|
@@ -13541,31 +13882,22 @@ function WaterfallList(_a) {
|
|
13541
13882
|
const containerRef = useRef(null);
|
13542
13883
|
const [isLoadMore, setIsLoadMore] = useState(false);
|
13543
13884
|
useCallback(() => {
|
13885
|
+
var _a, _b, _c, _d;
|
13544
13886
|
if (isLoadMore)
|
13545
13887
|
return;
|
13546
13888
|
setIsLoadMore(true);
|
13547
13889
|
waterFallData &&
|
13548
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
13549
|
-
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
13550
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
13551
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
13552
|
-
}).then((res) => {
|
13890
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId }))).then((res) => {
|
13553
13891
|
var _a;
|
13554
13892
|
setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
|
13555
13893
|
setIsLoadMore(false);
|
13556
13894
|
}));
|
13557
13895
|
}, [waterFallData, getRecommendVideos, list, isLoadMore]);
|
13558
13896
|
useEffect(() => {
|
13559
|
-
var _a, _b;
|
13897
|
+
var _a, _b, _c, _d, _e, _f;
|
13560
13898
|
setIsLoadingData(true);
|
13561
13899
|
waterFallData &&
|
13562
|
-
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
13563
|
-
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
13564
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
13565
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
13566
|
-
defaultSize: hashTagSize,
|
13567
|
-
maxSize: hashTagSize
|
13568
|
-
}).then((res) => {
|
13900
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.itemId) && { productFilter: (_d = (_c = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.itemId })), ((waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId) && { contentFilter: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId })), { defaultSize: hashTagSize, maxSize: hashTagSize })).then((res) => {
|
13569
13901
|
var _a, _b;
|
13570
13902
|
setData(res);
|
13571
13903
|
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
@@ -13574,7 +13906,7 @@ function WaterfallList(_a) {
|
|
13574
13906
|
if (isOpenHashTag) {
|
13575
13907
|
const res = previewData;
|
13576
13908
|
setData(res);
|
13577
|
-
setList((
|
13909
|
+
setList((_f = (_e = res === null || res === void 0 ? void 0 : res.recList) === null || _e === void 0 ? void 0 : _e.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _f !== void 0 ? _f : []);
|
13578
13910
|
setIsLoadingData(false);
|
13579
13911
|
}
|
13580
13912
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
@@ -14661,6 +14993,7 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
14661
14993
|
CommodityList: CommodityList,
|
14662
14994
|
Consent: Consent,
|
14663
14995
|
HashTag: HashTag,
|
14996
|
+
Iframe: Iframe,
|
14664
14997
|
Link: Link,
|
14665
14998
|
MultiCommodity: MultiCommodity,
|
14666
14999
|
MultiCommodityDiro: MultiCommodityDiro,
|
@@ -15119,14 +15452,6 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
15119
15452
|
};
|
15120
15453
|
var VideoWidget$3 = memo(VideoWidget$2);
|
15121
15454
|
|
15122
|
-
/*
|
15123
|
-
* @Author: binruan@chatlabs.com
|
15124
|
-
* @Date: 2023-12-27 19:02:59
|
15125
|
-
* @LastEditors: binruan@chatlabs.com
|
15126
|
-
* @LastEditTime: 2024-01-24 10:30:13
|
15127
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ToggleButton\index.tsx
|
15128
|
-
*
|
15129
|
-
*/
|
15130
15455
|
const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
|
15131
15456
|
const [isTrue, setIsTure] = useState(defaultValue);
|
15132
15457
|
const handleClick = (e) => {
|
@@ -15135,6 +15460,9 @@ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style
|
|
15135
15460
|
setIsTure(result);
|
15136
15461
|
onChange === null || onChange === void 0 ? void 0 : onChange(result);
|
15137
15462
|
};
|
15463
|
+
useEffect(() => {
|
15464
|
+
setIsTure(defaultValue);
|
15465
|
+
}, [defaultValue]);
|
15138
15466
|
return (React.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
|
15139
15467
|
React.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
|
15140
15468
|
};
|
@@ -15513,12 +15841,14 @@ var Tagbar$1 = memo(Tagbar);
|
|
15513
15841
|
* @Author: binruan@chatlabs.com
|
15514
15842
|
* @Date: 2024-01-15 19:03:09
|
15515
15843
|
* @LastEditors: binruan@chatlabs.com
|
15516
|
-
* @LastEditTime: 2024-08-
|
15844
|
+
* @LastEditTime: 2024-08-14 19:09:32
|
15517
15845
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
15518
15846
|
*
|
15519
15847
|
*/
|
15520
15848
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
15521
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
15849
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15850
|
+
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
15851
|
+
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
15522
15852
|
const { schema } = useEditor();
|
15523
15853
|
const [activeIndex, setActiveIndex] = useState(0);
|
15524
15854
|
const viewImageStartTime = useRef(0);
|
@@ -15532,8 +15862,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15532
15862
|
const { backMainFeed } = useEventReport();
|
15533
15863
|
const { productView } = useEventReport();
|
15534
15864
|
const isShowFingerTip = useMemo(() => {
|
15535
|
-
return data.length > 0 && !loading && getFeUserId();
|
15536
|
-
}, [data, loading]);
|
15865
|
+
return data.length > 0 && !loading && (getFeUserId() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
15866
|
+
}, [data, loading, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip]);
|
15537
15867
|
useEffect(() => {
|
15538
15868
|
refreshFeSessionId();
|
15539
15869
|
}, []);
|
@@ -15561,14 +15891,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15561
15891
|
var _a;
|
15562
15892
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
15563
15893
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15564
|
-
|
15894
|
+
const ctaType0 = ctaType === null || ctaType === void 0 ? void 0 : ctaType[0];
|
15895
|
+
if (ctaType0 === '多商品CTA') {
|
15565
15896
|
return ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) && ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c.length) > 0;
|
15566
15897
|
}
|
15567
|
-
else if (
|
15898
|
+
else if (ctaType0 === '商品CTA') {
|
15568
15899
|
return (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindProduct;
|
15569
15900
|
}
|
15570
15901
|
else {
|
15571
|
-
return ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId) ===
|
15902
|
+
return ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId) === ctaType0 && (((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url) || ((_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.imgUrls) === null || _j === void 0 ? void 0 : _j.length));
|
15572
15903
|
}
|
15573
15904
|
})) || 0;
|
15574
15905
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
@@ -15673,8 +16004,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15673
16004
|
return containerHeight - minusHeight - tagHeight;
|
15674
16005
|
}, [globalConfig, containerHeight, tagHeight]);
|
15675
16006
|
const renderLogo = useMemo(() => {
|
16007
|
+
var _a, _b;
|
15676
16008
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
15677
|
-
|
16009
|
+
const link = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.value;
|
16010
|
+
return (React.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && { onClick: () => new Function(link)() })),
|
15678
16011
|
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
15679
16012
|
}
|
15680
16013
|
return null;
|
@@ -15754,9 +16087,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15754
16087
|
isShowMore,
|
15755
16088
|
lineGradStyle
|
15756
16089
|
]);
|
15757
|
-
const renderLikeButton = useCallback((rec, index) => {
|
16090
|
+
const renderLikeButton = useCallback((rec, index, visible) => {
|
15758
16091
|
var _a, _b, _c, _d;
|
15759
|
-
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
16092
|
+
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike) || !visible)
|
15760
16093
|
return;
|
15761
16094
|
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
15762
16095
|
if (waterFallData && top < 40) {
|
@@ -15764,6 +16097,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15764
16097
|
}
|
15765
16098
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
15766
16099
|
return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon, unActicveIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
|
16100
|
+
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed) ? 'fixed' : 'absolute',
|
15767
16101
|
[(_b = globalConfig.likeIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig.likeIconX) !== null && _c !== void 0 ? _c : 0,
|
15768
16102
|
[(_d = globalConfig.likeIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top
|
15769
16103
|
}, position: index }));
|
@@ -15914,6 +16248,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15914
16248
|
});
|
15915
16249
|
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
15916
16250
|
}, [data, activeIndex, waterFallData]);
|
16251
|
+
const renderToggleButton = useCallback((visible) => {
|
16252
|
+
var _a, _b, _c, _d, _e, _f;
|
16253
|
+
if (!visible)
|
16254
|
+
return;
|
16255
|
+
return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (React.createElement(ToggleButton$1, { style: {
|
16256
|
+
position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
|
16257
|
+
visibility: ((_b = (_a = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) ? 'visible' : 'hidden',
|
16258
|
+
zIndex: 999,
|
16259
|
+
[(_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _c !== void 0 ? _c : 'right']: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _d !== void 0 ? _d : 0,
|
16260
|
+
[(_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _e !== void 0 ? _e : 'bottom']: (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _f !== void 0 ? _f : 23
|
16261
|
+
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })));
|
16262
|
+
}, [globalConfig, visList, activeIndex, isMuted]);
|
15917
16263
|
const renderView = useMemo(() => {
|
15918
16264
|
if (loading) {
|
15919
16265
|
return (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -15930,20 +16276,30 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15930
16276
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
|
15931
16277
|
renderContent(rec, index),
|
15932
16278
|
renderBottom(rec, index),
|
15933
|
-
renderLikeButton(rec, index))
|
16279
|
+
renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
16280
|
+
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))))))));
|
15934
16281
|
});
|
15935
|
-
}, [
|
15936
|
-
|
15937
|
-
|
16282
|
+
}, [
|
16283
|
+
containerWidth,
|
16284
|
+
data,
|
16285
|
+
height,
|
16286
|
+
loading,
|
16287
|
+
renderBottom,
|
16288
|
+
renderContent,
|
16289
|
+
visList,
|
16290
|
+
loadingImage,
|
16291
|
+
isReload,
|
16292
|
+
renderToggleButton
|
16293
|
+
]);
|
15938
16294
|
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
15939
|
-
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
|
16295
|
+
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
15940
16296
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
15941
16297
|
} })),
|
15942
16298
|
renderLogo,
|
15943
16299
|
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
15944
16300
|
top: minusHeight
|
15945
16301
|
} }),
|
15946
|
-
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((
|
16302
|
+
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _f !== void 0 ? _f : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
|
15947
16303
|
React.createElement(Swiper, { style: {
|
15948
16304
|
marginTop: tagHeight
|
15949
16305
|
}, ref: swiperRef, onSlideChange: () => {
|
@@ -15968,15 +16324,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
15968
16324
|
}
|
15969
16325
|
}
|
15970
16326
|
}, direction: 'vertical', height: height },
|
15971
|
-
(
|
15972
|
-
|
15973
|
-
visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
15974
|
-
zIndex: 999,
|
15975
|
-
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
|
15976
|
-
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _g !== void 0 ? _g : 23
|
15977
|
-
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })),
|
16327
|
+
renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
16328
|
+
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
15978
16329
|
renderView),
|
15979
|
-
React.createElement(WaterFall$1, Object.assign({}, (
|
16330
|
+
React.createElement(WaterFall$1, Object.assign({}, (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props))));
|
15980
16331
|
};
|
15981
16332
|
|
15982
16333
|
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
@@ -16343,7 +16694,7 @@ var index$1 = memo(DiyPortalPreview);
|
|
16343
16694
|
* @Author: binruan@chatlabs.com
|
16344
16695
|
* @Date: 2023-10-31 10:56:01
|
16345
16696
|
* @LastEditors: binruan@chatlabs.com
|
16346
|
-
* @LastEditTime: 2024-08-
|
16697
|
+
* @LastEditTime: 2024-08-06 17:15:56
|
16347
16698
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
16348
16699
|
*
|
16349
16700
|
*/
|
@@ -16402,14 +16753,14 @@ const Popup = () => {
|
|
16402
16753
|
const renderPopupDetail = useMemo(() => {
|
16403
16754
|
var _a, _b, _c;
|
16404
16755
|
return (_c = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.map((value, index) => {
|
16405
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
16756
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
16406
16757
|
if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
|
16407
16758
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
16408
16759
|
const Component = withBindDataSource(t);
|
16409
16760
|
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';
|
16410
16761
|
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';
|
16411
16762
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
16412
|
-
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), {
|
16763
|
+
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), { height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.textStyle), bindDatas: (_m = (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.bindDatas) !== null && _m !== void 0 ? _m : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_o = value === null || value === void 0 ? void 0 : value.item) === null || _o === void 0 ? void 0 : _o.props, { event: ((_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
|
16413
16764
|
}
|
16414
16765
|
else {
|
16415
16766
|
return React.createElement(React.Fragment, null);
|