pb-sxp-ui 1.2.10 → 1.3.1

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.
Files changed (100) hide show
  1. package/dist/index.cjs +700 -284
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +62 -2
  4. package/dist/index.js +700 -284
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +700 -284
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/FormatImage.js +1 -1
  15. package/es/core/components/SxpPageRender/Modal/index.js +34 -20
  16. package/es/core/components/SxpPageRender/Popup/index.js +2 -2
  17. package/es/core/components/SxpPageRender/ToggleButton/index.js +4 -1
  18. package/es/core/components/SxpPageRender/WaterFall/List.js +13 -18
  19. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +12 -17
  20. package/es/core/components/SxpPageRender/index.d.ts +6 -1
  21. package/es/core/components/SxpPageRender/index.js +73 -42
  22. package/es/core/components/SxpPageRender/typing.d.ts +2 -0
  23. package/es/core/context/EditorContext.js +2 -0
  24. package/es/core/context/SxpDataSourceProvider.d.ts +3 -2
  25. package/es/core/context/SxpDataSourceProvider.js +53 -33
  26. package/es/core/hooks/useEventReport.d.ts +1 -1
  27. package/es/core/hooks/useEventReport.js +10 -9
  28. package/es/core/utils/tool.d.ts +5 -1
  29. package/es/core/utils/tool.js +69 -1
  30. package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  31. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +13 -2
  32. package/es/materials/sxp/popup/CommodityDetail/index.js +60 -34
  33. package/es/materials/sxp/popup/CommodityDetail/material.js +4 -0
  34. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +28 -2
  35. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +52 -0
  36. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -2
  37. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +85 -51
  38. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  39. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +28 -2
  40. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +52 -0
  41. package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  42. package/es/materials/sxp/popup/Iframe/index.d.ts +16 -0
  43. package/es/materials/sxp/popup/Iframe/index.js +18 -0
  44. package/es/materials/sxp/popup/Iframe/material.d.ts +2 -0
  45. package/es/materials/sxp/popup/Iframe/material.js +21 -0
  46. package/es/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  47. package/es/materials/sxp/popup/Iframe/settingRender.js +12 -0
  48. package/es/materials/sxp/popup/Prompt/settingRender.js +16 -1
  49. package/es/materials/sxp/popup/index.d.ts +1 -0
  50. package/es/materials/sxp/popup/index.js +1 -0
  51. package/es/materials/sxp/template/Link/index.js +5 -11
  52. package/es/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  53. package/es/materials/sxp/template/Link/interactionRender.js +11 -0
  54. package/es/materials/sxp/template/Link/material.js +3 -1
  55. package/es/materials/sxp/template/components/EventProvider.d.ts +3 -2
  56. package/es/materials/sxp/template/components/EventProvider.js +3 -3
  57. package/lib/core/components/SxpPageRender/FormatImage.js +1 -1
  58. package/lib/core/components/SxpPageRender/Modal/index.js +34 -20
  59. package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
  60. package/lib/core/components/SxpPageRender/ToggleButton/index.js +3 -0
  61. package/lib/core/components/SxpPageRender/WaterFall/List.js +13 -18
  62. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +12 -17
  63. package/lib/core/components/SxpPageRender/index.d.ts +6 -1
  64. package/lib/core/components/SxpPageRender/index.js +72 -41
  65. package/lib/core/components/SxpPageRender/typing.d.ts +2 -0
  66. package/lib/core/context/EditorContext.js +2 -0
  67. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -2
  68. package/lib/core/context/SxpDataSourceProvider.js +53 -33
  69. package/lib/core/hooks/useEventReport.d.ts +1 -1
  70. package/lib/core/hooks/useEventReport.js +10 -9
  71. package/lib/core/utils/tool.d.ts +5 -1
  72. package/lib/core/utils/tool.js +73 -1
  73. package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  74. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +13 -2
  75. package/lib/materials/sxp/popup/CommodityDetail/index.js +60 -34
  76. package/lib/materials/sxp/popup/CommodityDetail/material.js +4 -0
  77. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +28 -2
  78. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +52 -0
  79. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -2
  80. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +85 -51
  81. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  82. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +28 -2
  83. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +52 -0
  84. package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  85. package/lib/materials/sxp/popup/Iframe/index.d.ts +16 -0
  86. package/lib/materials/sxp/popup/Iframe/index.js +20 -0
  87. package/lib/materials/sxp/popup/Iframe/material.d.ts +2 -0
  88. package/lib/materials/sxp/popup/Iframe/material.js +25 -0
  89. package/lib/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  90. package/lib/materials/sxp/popup/Iframe/settingRender.js +14 -0
  91. package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -1
  92. package/lib/materials/sxp/popup/index.d.ts +1 -0
  93. package/lib/materials/sxp/popup/index.js +1 -0
  94. package/lib/materials/sxp/template/Link/index.js +5 -11
  95. package/lib/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  96. package/lib/materials/sxp/template/Link/interactionRender.js +13 -0
  97. package/lib/materials/sxp/template/Link/material.js +3 -1
  98. package/lib/materials/sxp/template/components/EventProvider.d.ts +3 -2
  99. package/lib/materials/sxp/template/components/EventProvider.js +3 -3
  100. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIndexByblockType = exports.uuid = exports.setFontForText = exports.getUid = exports.generateRandomString = void 0;
3
+ exports.getCookie = exports.getSystem = exports.getDevice = exports.getBrowserInfo = exports.getIndexByblockType = exports.uuid = exports.setFontForText = exports.getUid = exports.generateRandomString = void 0;
4
4
  const uuid_1 = require("uuid");
5
5
  function uuid(len, radix) {
6
6
  const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
@@ -96,3 +96,75 @@ const setFontForText = (textContent, style) => {
96
96
  return content;
97
97
  };
98
98
  exports.setFontForText = setFontForText;
99
+ function getBrowserInfo() {
100
+ var _a, _b, _c, _d, _e, _f, _g;
101
+ let userAgent = self.navigator.userAgent;
102
+ if (!userAgent)
103
+ return 'Unknown';
104
+ if (/edge\/([\d\.]+)/i.exec(userAgent))
105
+ return `Edge ${(_a = /edge\/([\d\.]+)/i.exec(userAgent)) === null || _a === void 0 ? void 0 : _a[1]}`;
106
+ if (/edg\/([\d\.]+)/i.exec(userAgent))
107
+ return `Edge(Chromium) ${(_b = /edge\/([\d\.]+)/i.exec(userAgent)) === null || _b === void 0 ? void 0 : _b[1]}`;
108
+ if (/msie/i.test(userAgent))
109
+ return `Internet Explorer ${(_c = /msie ([\d\.]+)/i.exec(userAgent)) === null || _c === void 0 ? void 0 : _c[1]}`;
110
+ if (/Trident/i.test(userAgent))
111
+ return `Internet Explorer ${(_d = /rv:([\d\.]+)/i.exec(userAgent)) === null || _d === void 0 ? void 0 : _d[1]}`;
112
+ if (/chrome/i.test(userAgent))
113
+ return `Chrome ${(_e = /chrome\/([\d\.]+)/i.exec(userAgent)) === null || _e === void 0 ? void 0 : _e[1]}`;
114
+ if (/firefox/i.test(userAgent))
115
+ return `Firefox ${(_f = /firefox\/([\d\.]+)/i.exec(userAgent)) === null || _f === void 0 ? void 0 : _f[1]}`;
116
+ if (/safari/i.test(userAgent))
117
+ return `Safari ${(_g = /version\/([\d\.]+)/i.exec(userAgent)) === null || _g === void 0 ? void 0 : _g[1]}`;
118
+ return 'Unknown';
119
+ }
120
+ exports.getBrowserInfo = getBrowserInfo;
121
+ function getSystem() {
122
+ var _a, _b, _c;
123
+ let userAgent = self.navigator.userAgent;
124
+ if (!userAgent)
125
+ return 'Unknown';
126
+ if (/iphone/i.test(userAgent))
127
+ return `IOS ${(_a = userAgent.match(/OS\s(.*?)\slike/)) === null || _a === void 0 ? void 0 : _a[1]}`;
128
+ if (/android/i.test(userAgent))
129
+ return `Android ${(_b = userAgent.match(/Android\s(.*?)\;/)) === null || _b === void 0 ? void 0 : _b[1]}`;
130
+ if (/windows/i.test(userAgent))
131
+ return `Windows ${(_c = userAgent.match(/Windows\s(.*?)\;/)) === null || _c === void 0 ? void 0 : _c[1]}`;
132
+ if (/mac/i.test(userAgent))
133
+ return `Mac OS`;
134
+ return 'Unknown';
135
+ }
136
+ exports.getSystem = getSystem;
137
+ function getDevice() {
138
+ let userAgent = self.navigator.userAgent;
139
+ if (!userAgent)
140
+ return 'Unknown';
141
+ if (/iphone/i.test(userAgent))
142
+ return `iPhone`;
143
+ if (/android/i.test(userAgent)) {
144
+ var index1 = userAgent.indexOf('(');
145
+ var index2 = userAgent.indexOf(')');
146
+ if (index1 !== -1 && index2 !== -1) {
147
+ var value = userAgent.substring(index1 + 1, index2);
148
+ return `${value}`;
149
+ }
150
+ }
151
+ if (/windows/i.test(userAgent))
152
+ return `Windows`;
153
+ if (/mac/i.test(userAgent))
154
+ return `Mac`;
155
+ return 'Unknown';
156
+ }
157
+ exports.getDevice = getDevice;
158
+ function getCookie(val) {
159
+ const cookies = document.cookie;
160
+ const cookieArray = cookies.split(';');
161
+ let value = null;
162
+ cookieArray.forEach((cookie) => {
163
+ const [cookieName, cookieValue] = cookie.trim().split('=');
164
+ if (cookieName === val) {
165
+ value = cookieValue;
166
+ }
167
+ });
168
+ return value !== null && value !== void 0 ? value : '';
169
+ }
170
+ exports.getCookie = getCookie;
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = [
4
+ {
5
+ title: '弹窗背景',
6
+ child: [
7
+ {
8
+ type: 'Number',
9
+ label: '左右边距',
10
+ name: ['props', 'popupBg', 'horizontalMargin']
11
+ },
12
+ {
13
+ type: 'Number',
14
+ label: '下边距',
15
+ name: ['props', 'popupBg', 'bottomMargin']
16
+ }
17
+ ]
18
+ },
4
19
  {
5
20
  type: 'Text',
6
21
  label: '组件名称',
@@ -18,14 +18,16 @@ export interface ICommodityDetailProps {
18
18
  viewTime?: any;
19
19
  rec?: RecItemType;
20
20
  swiper: {
21
- dotsAlign: 'left' | 'center';
21
+ dotsAlign: 'left' | 'center' | 'right';
22
22
  delay: number;
23
23
  translateY?: number;
24
24
  };
25
25
  commodityStyles?: {
26
26
  title: CSSProperties;
27
27
  collection: CSSProperties;
28
- price: CSSProperties;
28
+ price: CSSProperties & {
29
+ enableFormattedPrice?: boolean;
30
+ };
29
31
  info: CSSProperties;
30
32
  taxInfo: CSSProperties;
31
33
  };
@@ -36,6 +38,15 @@ export interface ICommodityDetailProps {
36
38
  translateY?: number;
37
39
  style?: CSSProperties;
38
40
  };
41
+ popupBg?: {
42
+ horizontalMargin?: number;
43
+ bottomMargin?: number;
44
+ };
45
+ iframeIcon?: string;
46
+ commodityImgRatio?: {
47
+ w: number;
48
+ h: number;
49
+ };
39
50
  }
40
51
  declare const _default: React.NamedExoticComponent<ICommodityDetailProps>;
41
52
  export default _default;
@@ -14,14 +14,15 @@ const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/componen
14
14
  const tool_1 = require("../../../../core/utils/tool");
15
15
  const CommodityGroup_1 = tslib_1.__importDefault(require("../../template/components/CommodityGroup"));
16
16
  const CommodityDetail = (_a) => {
17
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
18
- var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
17
+ 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;
18
+ var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _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"]);
19
19
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = (0, hooks_1.useSxpDataSource)();
20
20
  const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
21
21
  const curTimeRef = (0, react_1.useRef)(null);
22
22
  const [showModal, setShowModal] = (0, react_1.useState)(false);
23
23
  const [show3DModal, setShow3DModal] = (0, react_1.useState)(false);
24
24
  const [checkCommodityIndex, setCheckCommodityIndex] = (0, react_1.useState)((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
25
+ const ref = (0, react_1.useRef)();
25
26
  const data = isPost ? rec : popupDetailData;
26
27
  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];
27
28
  let cta = isPost
@@ -61,17 +62,21 @@ const CommodityDetail = (_a) => {
61
62
  };
62
63
  }, []);
63
64
  const priceText = (0, react_1.useMemo)(() => {
64
- var _a, _b, _c, _d, _e;
65
+ var _a, _b, _c, _d, _e, _f, _g;
66
+ const isToLocStr = ((_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
65
67
  if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
66
- return `${(_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 : ''}${(_e = (_d = product === null || product === void 0 ? void 0 : product.price) === null || _d === void 0 ? void 0 : _d.toLocaleString('zh', {
67
- minimumFractionDigits: 0
68
- })) !== null && _e !== void 0 ? _e : ''}`;
68
+ return `${(_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.currency) === null || _c === void 0 ? void 0 : _c.split('-')[1]) === null || _d === void 0 ? void 0 : _d.toUpperCase()) !== null && _e !== void 0 ? _e : ''}${isToLocStr
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}`;
69
73
  }
70
74
  else {
71
75
  return '$7,000';
72
76
  }
73
- }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
74
- const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
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]);
78
+ 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
+ const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
75
80
  const renderContent = ({ isPost }) => {
76
81
  var _a, _b, _c, _d;
77
82
  return (react_1.default.createElement("div", null,
@@ -111,6 +116,10 @@ const CommodityDetail = (_a) => {
111
116
  popupCurTimeRef.current = new Date();
112
117
  setCheckCommodityIndex(index);
113
118
  checkCommodityIndexRef.current = index;
119
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
120
+ ref.current.swiper.slideTo(0);
121
+ ref.current.swiper.autoplay.start();
122
+ }
114
123
  }, []);
115
124
  const renderCommodityGroup = (0, react_1.useCallback)(() => {
116
125
  var _a, _b, _c;
@@ -118,25 +127,32 @@ const CommodityDetail = (_a) => {
118
127
  return;
119
128
  return (react_1.default.createElement(CommodityGroup_1.default, { 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 }));
120
129
  }, [checkCommodityIndex]);
130
+ const getDotsAlign = (0, react_1.useMemo)(() => {
131
+ const dotsAlignClass = {
132
+ left: 'commondityDetail-swiper-clickable-left',
133
+ center: 'commondityDetail-swiper-clickable-center',
134
+ right: 'commondityDetail-swiper-clickable-right'
135
+ };
136
+ return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
137
+ }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
138
+ const iframeUrl = ((_x = (_w = data === null || data === void 0 ? void 0 : data.video) === null || _w === void 0 ? void 0 : _w.bindProduct) === null || _x === void 0 ? void 0 : _x.remark) || ((_0 = (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProducts) === null || _z === void 0 ? void 0 : _z[0]) === null || _0 === void 0 ? void 0 : _0.remark) || ((_1 = data === null || data === void 0 ? void 0 : data.product) === null || _1 === void 0 ? void 0 : _1.remark);
121
139
  return (react_1.default.createElement(react_1.default.Fragment, null,
122
140
  react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign({}, style)) }, props),
123
- product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (react_1.default.createElement("div", { style: { position: 'relative' } },
124
- react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
141
+ react_1.default.createElement("div", { style: { position: 'relative' } },
142
+ product && ((_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: height, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
125
143
  clickable: true,
126
144
  bulletActiveClass: 'swipe-item-active-bullet',
127
- clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
128
- ? 'commondityDetail-swiper-clickable-left'
129
- : 'commondityDetail-swiper-clickable-center'
145
+ clickableClass: getDotsAlign
130
146
  }, loop: true, autoplay: {
131
147
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
132
- } },
133
- react_1.default.createElement(react_1.default.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
148
+ }, ref: ref },
149
+ react_1.default.createElement(react_1.default.Fragment, null, (_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.map((src) => {
134
150
  var _a;
135
151
  return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
136
152
  react_1.default.createElement("div", { style: {
137
153
  overflow: 'hidden',
138
154
  width,
139
- height: width
155
+ height
140
156
  } },
141
157
  react_1.default.createElement(FormatImage_1.default, { style: {
142
158
  height: '100%',
@@ -145,21 +161,30 @@ const CommodityDetail = (_a) => {
145
161
  display: 'block',
146
162
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
147
163
  }, 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 }))));
148
- }))))),
149
- !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
150
- position: 'relative',
151
- height: 0,
152
- width: '100%',
153
- paddingBottom: '100%',
154
- overflow: 'hidden'
155
- }) },
156
- react_1.default.createElement("img", { className: (0, css_1.css)({
157
- position: 'absolute',
158
- left: 0,
159
- top: 0,
160
- objectFit: 'cover',
161
- width: '100%'
162
- }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
164
+ })))),
165
+ !((_4 = product === null || product === void 0 ? void 0 : product.homePage) === null || _4 === void 0 ? void 0 : _4.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
166
+ height,
167
+ width
168
+ }) },
169
+ react_1.default.createElement("img", { className: (0, css_1.css)({
170
+ objectFit: 'cover',
171
+ width: '100%',
172
+ height: '100%'
173
+ }), src: (_5 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _5 !== void 0 ? _5 : bottom_image, alt: 'pdp image' }))),
174
+ (iframeUrl && iframeIcon) ||
175
+ (!product && iframeIcon && (react_1.default.createElement("div", { style: {
176
+ padding: '5px 10px',
177
+ display: 'flex',
178
+ alignItems: 'center',
179
+ position: 'absolute',
180
+ right: '10px',
181
+ bottom: '10px',
182
+ zIndex: 1,
183
+ background: '#fff',
184
+ borderRadius: '3px'
185
+ }, onClick: () => setShow3DModal(true) },
186
+ react_1.default.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
187
+ react_1.default.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
163
188
  renderCommodityGroup(),
164
189
  react_1.default.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
165
190
  renderBtn(),
@@ -167,10 +192,11 @@ const CommodityDetail = (_a) => {
167
192
  react_1.default.createElement("div", { style: { paddingBottom: '80px' } }, renderContent({ isPost: false })),
168
193
  renderBtn()),
169
194
  react_1.default.createElement(Modal_1.default, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
170
- react_1.default.createElement("iframe", { src: 'https://rimowa.threedium.co.uk/product-experience/latest/?sku=92573974&lang=en', style: {
195
+ react_1.default.createElement("iframe", { src: iframeUrl, style: {
171
196
  width: '100%',
172
- height: 'calc(100% - 40px)',
173
- marginTop: '40px'
197
+ height: 'calc(100% - 50px)',
198
+ marginTop: '40px',
199
+ border: 'none'
174
200
  } }))));
175
201
  };
176
202
  exports.default = (0, react_1.memo)(CommodityDetail);
@@ -55,6 +55,10 @@ const CommodityDetail = (0, create_1.createMaterial)(_1.default, {
55
55
  fontWeight: 'bold',
56
56
  textAlign: 'center',
57
57
  color: 'rgba(255, 255, 255, 0.9)'
58
+ },
59
+ commodityImgRatio: {
60
+ w: 1,
61
+ h: 1
58
62
  }
59
63
  },
60
64
  style: {}
@@ -1,6 +1,17 @@
1
1
  declare const _default: ({
2
2
  title: string;
3
3
  child: ({
4
+ type: string;
5
+ label: string;
6
+ child: {
7
+ type: string;
8
+ name: string[];
9
+ addonAfter: string;
10
+ }[];
11
+ options?: undefined;
12
+ name?: undefined;
13
+ addonAfter?: undefined;
14
+ } | {
4
15
  type: string;
5
16
  label: string;
6
17
  options: {
@@ -8,15 +19,15 @@ declare const _default: ({
8
19
  value: string;
9
20
  }[];
10
21
  name: string[];
11
- addonAfter?: undefined;
12
22
  child?: undefined;
23
+ addonAfter?: undefined;
13
24
  } | {
14
25
  type: string;
15
26
  name: string[];
16
27
  addonAfter: string;
17
28
  label?: undefined;
18
- options?: undefined;
19
29
  child?: undefined;
30
+ options?: undefined;
20
31
  } | {
21
32
  type: string;
22
33
  child: {
@@ -136,6 +147,13 @@ declare const _default: ({
136
147
  options?: undefined;
137
148
  initialValue?: undefined;
138
149
  child?: undefined;
150
+ } | {
151
+ label: string;
152
+ type: string;
153
+ name: string[];
154
+ initialValue: boolean;
155
+ options?: undefined;
156
+ child?: undefined;
139
157
  })[];
140
158
  }[];
141
159
  } | {
@@ -201,5 +219,13 @@ declare const _default: ({
201
219
  initialValue?: undefined;
202
220
  child?: undefined;
203
221
  })[];
222
+ } | {
223
+ title: string;
224
+ child: {
225
+ label: string;
226
+ type: string;
227
+ name: string[];
228
+ text: string;
229
+ }[];
204
230
  })[];
205
231
  export default _default;
@@ -1,9 +1,40 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = [
4
+ {
5
+ title: '弹窗背景',
6
+ child: [
7
+ {
8
+ type: 'Number',
9
+ label: '左右边距',
10
+ name: ['props', 'popupBg', 'horizontalMargin']
11
+ },
12
+ {
13
+ type: 'Number',
14
+ label: '下边距',
15
+ name: ['props', 'popupBg', 'bottomMargin']
16
+ }
17
+ ]
18
+ },
4
19
  {
5
20
  title: '商品图片',
6
21
  child: [
22
+ {
23
+ type: 'Group',
24
+ label: '宽高比',
25
+ child: [
26
+ {
27
+ type: 'Number',
28
+ name: ['props', 'commodityImgRatio', 'w'],
29
+ addonAfter: 'w'
30
+ },
31
+ {
32
+ type: 'Number',
33
+ name: ['props', 'commodityImgRatio', 'h'],
34
+ addonAfter: 'h'
35
+ }
36
+ ]
37
+ },
7
38
  {
8
39
  type: 'Radius',
9
40
  label: '轮播指示器',
@@ -15,6 +46,10 @@ exports.default = [
15
46
  {
16
47
  label: '居中',
17
48
  value: 'center'
49
+ },
50
+ {
51
+ label: '居右',
52
+ value: 'right'
18
53
  }
19
54
  ],
20
55
  name: ['props', 'swiper', 'dotsAlign']
@@ -179,6 +214,12 @@ exports.default = [
179
214
  {
180
215
  label: '间距',
181
216
  type: 'TextSpace'
217
+ },
218
+ {
219
+ label: '价格千分符展示',
220
+ type: 'Switch',
221
+ name: ['enableFormattedPrice'],
222
+ initialValue: true
182
223
  }
183
224
  ]
184
225
  }
@@ -271,5 +312,16 @@ exports.default = [
271
312
  name: ['props', 'buttonStyle']
272
313
  }
273
314
  ]
315
+ },
316
+ {
317
+ title: 'Iframe商品弹窗',
318
+ child: [
319
+ {
320
+ label: '弹窗按钮',
321
+ type: 'Upload',
322
+ name: ['props', 'iframeIcon'],
323
+ text: '建议尺寸:106 * 41'
324
+ }
325
+ ]
274
326
  }
275
327
  ];
@@ -18,14 +18,16 @@ export interface ICommodityDetailDiroNewProps {
18
18
  unfoldText?: string;
19
19
  };
20
20
  swiper: {
21
- dotsAlign: 'left' | 'center';
21
+ dotsAlign: 'left' | 'center' | 'right';
22
22
  delay: number;
23
23
  translateY?: number;
24
24
  };
25
25
  commodityStyles?: {
26
26
  title: CSSProperties;
27
27
  collection: CSSProperties;
28
- price: CSSProperties;
28
+ price: CSSProperties & {
29
+ enableFormattedPrice?: boolean;
30
+ };
29
31
  taxInfo: CSSProperties;
30
32
  info: CSSProperties;
31
33
  };
@@ -36,6 +38,15 @@ export interface ICommodityDetailDiroNewProps {
36
38
  translateY?: number;
37
39
  style?: CSSProperties;
38
40
  };
41
+ popupBg?: {
42
+ horizontalMargin?: number;
43
+ bottomMargin?: number;
44
+ };
45
+ iframeIcon?: string;
46
+ commodityImgRatio?: {
47
+ w: number;
48
+ h: number;
49
+ };
39
50
  }
40
51
  declare const _default: React.NamedExoticComponent<ICommodityDetailDiroNewProps>;
41
52
  export default _default;