pb-sxp-ui 1.4.4 → 1.5.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 +163 -125
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +163 -125
- 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 +163 -125
- 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/WaterFall/List.js +7 -15
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +7 -15
- package/es/core/components/SxpPageRender/index.d.ts +6 -0
- package/es/core/components/SxpPageRender/index.js +2 -0
- package/es/core/context/SxpDataSourceProvider.js +2 -0
- package/es/core/utils/materials.d.ts +7 -0
- package/es/core/utils/materials.js +47 -0
- package/es/materials/sxp/HashTag/settingRender.d.ts +5 -0
- package/es/materials/sxp/HashTag/settingRender.js +2 -1
- package/es/materials/sxp/cta/AniLink/interactionRender.d.ts +1 -0
- package/es/materials/sxp/cta/AniLink/interactionRender.js +2 -1
- package/es/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +1 -0
- package/es/materials/sxp/cta/AniLinkPopup/interactionRender.js +2 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +7 -15
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +7 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +2 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -15
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +6 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +2 -1
- package/es/materials/sxp/popup/CommodityList/index.js +9 -15
- package/es/materials/sxp/popup/CommodityList/settingRender.d.ts +5 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +2 -1
- package/es/materials/sxp/template/Appoint/interactionRender.d.ts +1 -0
- package/es/materials/sxp/template/Appoint/interactionRender.js +2 -1
- package/es/materials/sxp/template/Commodity/interactionRender.d.ts +1 -0
- package/es/materials/sxp/template/Commodity/interactionRender.js +2 -1
- package/es/materials/sxp/template/CommodityDiro/interactionRender.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiro/interactionRender.js +2 -1
- package/es/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiroNew/interactionRender.js +2 -1
- package/es/materials/sxp/template/Link/interactionRender.d.ts +1 -0
- package/es/materials/sxp/template/Link/interactionRender.js +2 -1
- package/es/materials/sxp/template/Link/material.js +1 -1
- package/es/materials/sxp/template/MultiCommodity/interactionRender.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodity/interactionRender.js +2 -1
- package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.js +2 -1
- package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +2 -1
- package/lib/core/components/SxpPageRender/WaterFall/List.js +7 -15
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +7 -15
- package/lib/core/components/SxpPageRender/index.d.ts +6 -0
- package/lib/core/components/SxpPageRender/index.js +2 -0
- package/lib/core/context/SxpDataSourceProvider.js +2 -0
- package/lib/core/utils/materials.d.ts +7 -0
- package/lib/core/utils/materials.js +49 -1
- package/lib/materials/sxp/HashTag/settingRender.d.ts +5 -0
- package/lib/materials/sxp/HashTag/settingRender.js +2 -1
- package/lib/materials/sxp/cta/AniLink/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/cta/AniLink/interactionRender.js +2 -1
- package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.js +2 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +7 -15
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +7 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +2 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -15
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +6 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +2 -1
- package/lib/materials/sxp/popup/CommodityList/index.js +9 -15
- package/lib/materials/sxp/popup/CommodityList/settingRender.d.ts +5 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +2 -1
- package/lib/materials/sxp/template/Appoint/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/template/Appoint/interactionRender.js +2 -1
- package/lib/materials/sxp/template/Commodity/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/template/Commodity/interactionRender.js +2 -1
- package/lib/materials/sxp/template/CommodityDiro/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiro/interactionRender.js +2 -1
- package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.js +2 -1
- package/lib/materials/sxp/template/Link/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/template/Link/interactionRender.js +2 -1
- package/lib/materials/sxp/template/Link/material.js +1 -1
- package/lib/materials/sxp/template/MultiCommodity/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodity/interactionRender.js +2 -1
- package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.js +2 -1
- package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +2 -1
- package/package.json +1 -1
@@ -5,7 +5,7 @@ import LinkComponent from '.';
|
|
5
5
|
import { createMaterial } from '../../../../core/create';
|
6
6
|
import interactionRender from './interactionRender';
|
7
7
|
const Link = createMaterial(LinkComponent, {
|
8
|
-
displayName: '
|
8
|
+
displayName: '普通CTA',
|
9
9
|
icon: '',
|
10
10
|
category: 'template',
|
11
11
|
type: 'Link',
|
@@ -9,10 +9,11 @@ const hooks_1 = require("../../../../core/hooks");
|
|
9
9
|
const css_1 = require("@emotion/css");
|
10
10
|
const tool_1 = require("../../../../core/utils/tool");
|
11
11
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
12
|
+
const materials_1 = require("../../../../core/utils/materials");
|
12
13
|
const WaterfallFlowItem = (props) => {
|
13
14
|
var _a;
|
14
15
|
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
15
|
-
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
16
|
+
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = (0, hooks_1.useSxpDataSource)();
|
16
17
|
const [showVideo, setShowVideo] = (0, react_1.useState)(false);
|
17
18
|
const imgDom = (0, react_1.useRef)(null);
|
18
19
|
const ref = (0, react_1.useRef)(null);
|
@@ -38,20 +39,11 @@ const WaterfallFlowItem = (props) => {
|
|
38
39
|
var _a, _b;
|
39
40
|
return ((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.title) || ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) || null;
|
40
41
|
}, [rec]);
|
41
|
-
const priceText = (0,
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
? (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k.toLocaleString('zh', {
|
47
|
-
minimumFractionDigits: 0
|
48
|
-
})) !== null && _l !== void 0 ? _l : ''
|
49
|
-
: (_m = rec === null || rec === void 0 ? void 0 : rec.product) === null || _m === void 0 ? void 0 : _m.price}`;
|
50
|
-
}
|
51
|
-
else {
|
52
|
-
return null;
|
53
|
-
}
|
54
|
-
}, [rec, (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice]);
|
42
|
+
const priceText = (0, materials_1.getPriceText)({
|
43
|
+
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
44
|
+
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
45
|
+
globalConfig
|
46
|
+
});
|
55
47
|
(0, react_1.useEffect)(() => {
|
56
48
|
const observer = new IntersectionObserver((entries) => {
|
57
49
|
entries.forEach((entry) => {
|
@@ -9,10 +9,11 @@ const FormatImage_1 = tslib_1.__importDefault(require("../FormatImage"));
|
|
9
9
|
const css_1 = require("@emotion/css");
|
10
10
|
const tool_1 = require("../../../../core/utils/tool");
|
11
11
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
12
|
+
const materials_1 = require("../../../../core/utils/materials");
|
12
13
|
const WaterfallFlowItem = (props) => {
|
13
14
|
var _a;
|
14
15
|
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
15
|
-
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
16
|
+
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = (0, hooks_1.useSxpDataSource)();
|
16
17
|
const [showVideo, setShowVideo] = (0, react_1.useState)(false);
|
17
18
|
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
18
19
|
const [imgInfo, setImgInfo] = (0, react_1.useState)({
|
@@ -61,20 +62,11 @@ const WaterfallFlowItem = (props) => {
|
|
61
62
|
return false;
|
62
63
|
}
|
63
64
|
}, [top, showBorder]);
|
64
|
-
const priceText = (0,
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
? (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k.toLocaleString('zh', {
|
70
|
-
minimumFractionDigits: 0
|
71
|
-
})) !== null && _l !== void 0 ? _l : ''
|
72
|
-
: (_m = rec === null || rec === void 0 ? void 0 : rec.product) === null || _m === void 0 ? void 0 : _m.price}`;
|
73
|
-
}
|
74
|
-
else {
|
75
|
-
return null;
|
76
|
-
}
|
77
|
-
}, [rec, (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice]);
|
65
|
+
const priceText = (0, materials_1.getPriceText)({
|
66
|
+
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
67
|
+
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
68
|
+
globalConfig
|
69
|
+
});
|
78
70
|
(0, react_1.useEffect)(() => {
|
79
71
|
if (imgDom.current === null || src === '') {
|
80
72
|
return;
|
@@ -51,6 +51,12 @@ export interface ISxpPageRenderProps {
|
|
51
51
|
enableSwiperTip?: boolean;
|
52
52
|
logoBar?: any;
|
53
53
|
textUnderlineOffset?: number;
|
54
|
+
priceSymbol?: {
|
55
|
+
millesimalSymbol?: string;
|
56
|
+
decimalPoint?: string;
|
57
|
+
currencyPosition?: string;
|
58
|
+
showTwoDecimalPoint?: boolean;
|
59
|
+
};
|
54
60
|
};
|
55
61
|
descStyle?: CSSProperties;
|
56
62
|
tipText?: {
|
@@ -195,6 +195,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
195
195
|
return null;
|
196
196
|
}
|
197
197
|
});
|
198
|
+
if (!(list === null || list === void 0 ? void 0 : list.length))
|
199
|
+
return [];
|
198
200
|
return !waterFallData && !isNoMoreData ? list.concat([{ loading: true }]) : list;
|
199
201
|
}, [data, activeIndex, waterFallData, isEditor, isNoMoreData]);
|
200
202
|
const renderLogo = (0, react_1.useMemo)(() => {
|
@@ -125,6 +125,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
125
125
|
}
|
126
126
|
setLoading(false);
|
127
127
|
list = list.concat((_w = (_v = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.filter) === null || _v === void 0 ? void 0 : _v.call(_u, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _w !== void 0 ? _w : []);
|
128
|
+
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
|
129
|
+
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
|
128
130
|
const isNotNullList = (_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.recList) === null || _y === void 0 ? void 0 : _y.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
129
131
|
if (isNotNullList) {
|
130
132
|
pageNum = pageNum + 1;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import { ISxpPageRenderProps } from '../components/SxpPageRender';
|
2
|
+
import { ProductInfoType } from '../components/SxpPageRender/typing';
|
1
3
|
export declare const getMediaValueByMode: (obj?: Record<string, any>) => any;
|
2
4
|
export declare const getBgStyle: (imgSrc: string) => "" | {
|
3
5
|
backgroundImage: string;
|
@@ -9,3 +11,8 @@ export declare const getBgStyleByImg: (data: any) => "" | {
|
|
9
11
|
backgroundRepeat: string;
|
10
12
|
backgroundSize: string;
|
11
13
|
};
|
14
|
+
export declare const getPriceText: ({ product, enableFormattedPrice, globalConfig }: {
|
15
|
+
product: ProductInfoType | undefined | null;
|
16
|
+
enableFormattedPrice: boolean | undefined;
|
17
|
+
globalConfig: ISxpPageRenderProps['globalConfig'];
|
18
|
+
}) => string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getBgStyleByImg = exports.getBgStyle = exports.getMediaValueByMode = void 0;
|
3
|
+
exports.getPriceText = exports.getBgStyleByImg = exports.getBgStyle = exports.getMediaValueByMode = void 0;
|
4
4
|
const getMediaValueByMode = (obj) => {
|
5
5
|
var _a;
|
6
6
|
if (!obj || typeof obj !== 'object') {
|
@@ -35,3 +35,51 @@ const getBgStyleByImg = (data) => {
|
|
35
35
|
return (0, exports.getBgStyle)(imgSrc);
|
36
36
|
};
|
37
37
|
exports.getBgStyleByImg = getBgStyleByImg;
|
38
|
+
const getPriceText = ({ product, enableFormattedPrice, globalConfig }) => {
|
39
|
+
var _a, _b, _c, _d, _e;
|
40
|
+
let price = (product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price) ? product === null || product === void 0 ? void 0 : product.price : 7000;
|
41
|
+
let text = '';
|
42
|
+
let priceSymbol = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol;
|
43
|
+
let currency = (product === null || product === void 0 ? void 0 : product.currency) ? (_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : '' : '$';
|
44
|
+
const isToLocStr = enableFormattedPrice === undefined || enableFormattedPrice || (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.millesimalSymbol) !== 'none';
|
45
|
+
let decPic = price.toString();
|
46
|
+
if (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) {
|
47
|
+
decPic = price === null || price === void 0 ? void 0 : price.toFixed(2);
|
48
|
+
}
|
49
|
+
let decInd = (_d = decPic === null || decPic === void 0 ? void 0 : decPic.indexOf('.')) !== null && _d !== void 0 ? _d : -1;
|
50
|
+
if (isToLocStr) {
|
51
|
+
text =
|
52
|
+
(_e = price === null || price === void 0 ? void 0 : price.toLocaleString('zh', {
|
53
|
+
minimumFractionDigits: (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) ? 2 : 0
|
54
|
+
})) !== null && _e !== void 0 ? _e : '';
|
55
|
+
let startIndex = 0;
|
56
|
+
let endIndex = decInd !== null && decInd !== void 0 ? decInd : text === null || text === void 0 ? void 0 : text.length;
|
57
|
+
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.millesimalSymbol) === '.') {
|
58
|
+
text = text === null || text === void 0 ? void 0 : text.replace(/,/g, function (match, index) {
|
59
|
+
if (index >= startIndex && index < endIndex) {
|
60
|
+
return '.';
|
61
|
+
}
|
62
|
+
else {
|
63
|
+
return match;
|
64
|
+
}
|
65
|
+
});
|
66
|
+
}
|
67
|
+
else if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.millesimalSymbol) === ' ') {
|
68
|
+
text = text === null || text === void 0 ? void 0 : text.replace(',', ' ');
|
69
|
+
}
|
70
|
+
}
|
71
|
+
else {
|
72
|
+
text = `${(priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.showTwoDecimalPoint) ? price === null || price === void 0 ? void 0 : price.toFixed(2) : price}`;
|
73
|
+
}
|
74
|
+
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.decimalPoint) === ',' && decInd > 0 && decInd + 1 < (text === null || text === void 0 ? void 0 : text.length)) {
|
75
|
+
text = text.slice(0, decInd + 1) + ',' + text.slice(decInd + 2);
|
76
|
+
}
|
77
|
+
if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
|
78
|
+
text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
|
79
|
+
}
|
80
|
+
else if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
|
81
|
+
text = currency + text;
|
82
|
+
}
|
83
|
+
return text;
|
84
|
+
};
|
85
|
+
exports.getPriceText = getPriceText;
|
@@ -28,6 +28,7 @@ declare const _default: ({
|
|
28
28
|
name: string[];
|
29
29
|
initialValue: string;
|
30
30
|
child?: undefined;
|
31
|
+
belong?: undefined;
|
31
32
|
} | {
|
32
33
|
type: string;
|
33
34
|
label: string;
|
@@ -39,6 +40,7 @@ declare const _default: ({
|
|
39
40
|
options?: undefined;
|
40
41
|
name?: undefined;
|
41
42
|
initialValue?: undefined;
|
43
|
+
belong?: undefined;
|
42
44
|
} | {
|
43
45
|
type: string;
|
44
46
|
label: string;
|
@@ -54,6 +56,7 @@ declare const _default: ({
|
|
54
56
|
options?: undefined;
|
55
57
|
name?: undefined;
|
56
58
|
initialValue?: undefined;
|
59
|
+
belong?: undefined;
|
57
60
|
} | {
|
58
61
|
label: string;
|
59
62
|
type: string;
|
@@ -61,11 +64,13 @@ declare const _default: ({
|
|
61
64
|
name?: undefined;
|
62
65
|
initialValue?: undefined;
|
63
66
|
child?: undefined;
|
67
|
+
belong?: undefined;
|
64
68
|
} | {
|
65
69
|
label: string;
|
66
70
|
type: string;
|
67
71
|
name: string[];
|
68
72
|
initialValue: boolean;
|
73
|
+
belong: string;
|
69
74
|
options?: undefined;
|
70
75
|
child?: undefined;
|
71
76
|
})[];
|
@@ -13,10 +13,11 @@ const ExpandableText_1 = tslib_1.__importDefault(require("../../../../core/compo
|
|
13
13
|
const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
|
14
14
|
const tool_1 = require("../../../../core/utils/tool");
|
15
15
|
const CommodityGroup_1 = tslib_1.__importDefault(require("../../template/components/CommodityGroup"));
|
16
|
+
const materials_1 = require("../../../../core/utils/materials");
|
16
17
|
const CommodityDetail = (_a) => {
|
17
18
|
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;
|
18
19
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
|
19
|
-
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = (0, hooks_1.useSxpDataSource)();
|
20
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = (0, hooks_1.useSxpDataSource)();
|
20
21
|
const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
|
21
22
|
const curTimeRef = (0, react_1.useRef)(null);
|
22
23
|
const [showModal, setShowModal] = (0, react_1.useState)(false);
|
@@ -61,20 +62,11 @@ const CommodityDetail = (_a) => {
|
|
61
62
|
window.removeEventListener('pageshow', initTime);
|
62
63
|
};
|
63
64
|
}, []);
|
64
|
-
const priceText = (0,
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
? (_g = (_f = product === null || product === void 0 ? void 0 : product.price) === null || _f === void 0 ? void 0 : _f.toLocaleString('zh', {
|
70
|
-
minimumFractionDigits: 0
|
71
|
-
})) !== null && _g !== void 0 ? _g : ''
|
72
|
-
: product === null || product === void 0 ? void 0 : product.price}`;
|
73
|
-
}
|
74
|
-
else {
|
75
|
-
return '$7,000';
|
76
|
-
}
|
77
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency, (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice]);
|
65
|
+
const priceText = (0, materials_1.getPriceText)({
|
66
|
+
product: product,
|
67
|
+
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
68
|
+
globalConfig
|
69
|
+
});
|
78
70
|
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
79
71
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
80
72
|
const renderContent = ({ isPost }) => {
|
@@ -95,6 +95,7 @@ declare const _default: ({
|
|
95
95
|
name: string[];
|
96
96
|
initialValue: string;
|
97
97
|
child?: undefined;
|
98
|
+
belong?: undefined;
|
98
99
|
} | {
|
99
100
|
type: string;
|
100
101
|
child: {
|
@@ -107,6 +108,7 @@ declare const _default: ({
|
|
107
108
|
options?: undefined;
|
108
109
|
name?: undefined;
|
109
110
|
initialValue?: undefined;
|
111
|
+
belong?: undefined;
|
110
112
|
} | {
|
111
113
|
type: string;
|
112
114
|
label: string;
|
@@ -118,6 +120,7 @@ declare const _default: ({
|
|
118
120
|
options?: undefined;
|
119
121
|
name?: undefined;
|
120
122
|
initialValue?: undefined;
|
123
|
+
belong?: undefined;
|
121
124
|
} | {
|
122
125
|
type: string;
|
123
126
|
label: string;
|
@@ -133,6 +136,7 @@ declare const _default: ({
|
|
133
136
|
options?: undefined;
|
134
137
|
name?: undefined;
|
135
138
|
initialValue?: undefined;
|
139
|
+
belong?: undefined;
|
136
140
|
} | {
|
137
141
|
label: string;
|
138
142
|
type: string;
|
@@ -140,6 +144,7 @@ declare const _default: ({
|
|
140
144
|
name?: undefined;
|
141
145
|
initialValue?: undefined;
|
142
146
|
child?: undefined;
|
147
|
+
belong?: undefined;
|
143
148
|
} | {
|
144
149
|
label: string;
|
145
150
|
type: string;
|
@@ -147,11 +152,13 @@ declare const _default: ({
|
|
147
152
|
options?: undefined;
|
148
153
|
initialValue?: undefined;
|
149
154
|
child?: undefined;
|
155
|
+
belong?: undefined;
|
150
156
|
} | {
|
151
157
|
label: string;
|
152
158
|
type: string;
|
153
159
|
name: string[];
|
154
160
|
initialValue: boolean;
|
161
|
+
belong: string;
|
155
162
|
options?: undefined;
|
156
163
|
child?: undefined;
|
157
164
|
})[];
|
@@ -13,11 +13,12 @@ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
|
13
13
|
const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
|
14
14
|
const tool_1 = require("../../../../core/utils/tool");
|
15
15
|
const CommodityGroup_1 = tslib_1.__importDefault(require("../../template/components/CommodityGroup"));
|
16
|
+
const materials_1 = require("../../../../core/utils/materials");
|
16
17
|
const CommodityDetailDiroNew = (_a) => {
|
17
18
|
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;
|
18
19
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
|
19
20
|
const [spread, setSpread] = (0, react_1.useState)(true);
|
20
|
-
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = (0, hooks_1.useSxpDataSource)();
|
21
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = (0, hooks_1.useSxpDataSource)();
|
21
22
|
const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
|
22
23
|
const [stopSlide, setStopSlide] = (0, react_1.useState)(false);
|
23
24
|
const [isBottom, setIsBottom] = (0, react_1.useState)(false);
|
@@ -65,20 +66,11 @@ const CommodityDetailDiroNew = (_a) => {
|
|
65
66
|
window.removeEventListener('pageshow', initTime);
|
66
67
|
};
|
67
68
|
}, []);
|
68
|
-
const priceText = (0,
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
? (_g = (_f = product === null || product === void 0 ? void 0 : product.price) === null || _f === void 0 ? void 0 : _f.toLocaleString('zh', {
|
74
|
-
minimumFractionDigits: 0
|
75
|
-
})) !== null && _g !== void 0 ? _g : ''
|
76
|
-
: product === null || product === void 0 ? void 0 : product.price}`;
|
77
|
-
}
|
78
|
-
else {
|
79
|
-
return '£102,300.00';
|
80
|
-
}
|
81
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency, (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice]);
|
69
|
+
const priceText = (0, materials_1.getPriceText)({
|
70
|
+
product,
|
71
|
+
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
72
|
+
globalConfig
|
73
|
+
});
|
82
74
|
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
83
75
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
84
76
|
const handleClickCollapse = () => {
|
@@ -95,6 +95,7 @@ declare const _default: ({
|
|
95
95
|
name: string[];
|
96
96
|
initialValue: string;
|
97
97
|
child?: undefined;
|
98
|
+
belong?: undefined;
|
98
99
|
} | {
|
99
100
|
type: string;
|
100
101
|
label: string;
|
@@ -106,6 +107,7 @@ declare const _default: ({
|
|
106
107
|
options?: undefined;
|
107
108
|
name?: undefined;
|
108
109
|
initialValue?: undefined;
|
110
|
+
belong?: undefined;
|
109
111
|
} | {
|
110
112
|
type: string;
|
111
113
|
label: string;
|
@@ -121,6 +123,7 @@ declare const _default: ({
|
|
121
123
|
options?: undefined;
|
122
124
|
name?: undefined;
|
123
125
|
initialValue?: undefined;
|
126
|
+
belong?: undefined;
|
124
127
|
} | {
|
125
128
|
label: string;
|
126
129
|
type: string;
|
@@ -128,6 +131,7 @@ declare const _default: ({
|
|
128
131
|
name?: undefined;
|
129
132
|
initialValue?: undefined;
|
130
133
|
child?: undefined;
|
134
|
+
belong?: undefined;
|
131
135
|
} | {
|
132
136
|
label: string;
|
133
137
|
type: string;
|
@@ -135,11 +139,13 @@ declare const _default: ({
|
|
135
139
|
options?: undefined;
|
136
140
|
initialValue?: undefined;
|
137
141
|
child?: undefined;
|
142
|
+
belong?: undefined;
|
138
143
|
} | {
|
139
144
|
label: string;
|
140
145
|
type: string;
|
141
146
|
name: string[];
|
142
147
|
initialValue: boolean;
|
148
|
+
belong: string;
|
143
149
|
options?: undefined;
|
144
150
|
child?: undefined;
|
145
151
|
})[];
|
@@ -9,30 +9,24 @@ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
|
9
9
|
const tool_1 = require("../../../../core/utils/tool");
|
10
10
|
const Img_1 = tslib_1.__importDefault(require("../../template/components/Img"));
|
11
11
|
const lodash_1 = require("lodash");
|
12
|
+
const materials_1 = require("../../../../core/utils/materials");
|
12
13
|
const CommodityList = (_a) => {
|
13
14
|
var _b, _c, _d;
|
14
15
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
|
15
|
-
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = (0, hooks_1.useSxpDataSource)();
|
16
|
+
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig } = (0, hooks_1.useSxpDataSource)();
|
16
17
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
17
18
|
const { popup } = (0, hooks_1.useEditor)();
|
18
19
|
const recData = isPost ? rec : popupDetailData;
|
19
20
|
const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
|
20
21
|
const index = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
21
22
|
const priceText = (0, react_1.useCallback)((product) => {
|
22
|
-
var _a
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
: product === null || product === void 0 ? void 0 : product.price}`;
|
30
|
-
}
|
31
|
-
else {
|
32
|
-
const p = 7000;
|
33
|
-
return `$${isToLocStr ? p === null || p === void 0 ? void 0 : p.toLocaleString() : p}`;
|
34
|
-
}
|
35
|
-
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice]);
|
23
|
+
var _a;
|
24
|
+
return (0, materials_1.getPriceText)({
|
25
|
+
product,
|
26
|
+
enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
27
|
+
globalConfig
|
28
|
+
});
|
29
|
+
}, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
|
36
30
|
const handleClick = (0, lodash_1.throttle)((item, multiCheckIndex) => {
|
37
31
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
38
32
|
eventSubject: 'clickCta',
|