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.
Files changed (96) hide show
  1. package/dist/index.cjs +611 -260
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +62 -2
  4. package/dist/index.js +611 -260
  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 +611 -260
  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 +19 -17
  15. package/es/core/components/SxpPageRender/Modal/index.js +33 -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 +5 -14
  19. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
  20. package/es/core/components/SxpPageRender/index.d.ts +6 -1
  21. package/es/core/components/SxpPageRender/index.js +46 -23
  22. package/es/core/components/SxpPageRender/typing.d.ts +2 -0
  23. package/es/core/context/SxpDataSourceProvider.d.ts +3 -2
  24. package/es/core/context/SxpDataSourceProvider.js +27 -30
  25. package/es/core/hooks/useEventReport.js +9 -8
  26. package/es/core/utils/tool.d.ts +5 -1
  27. package/es/core/utils/tool.js +69 -1
  28. package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  29. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
  30. package/es/materials/sxp/popup/CommodityDetail/index.js +46 -28
  31. package/es/materials/sxp/popup/CommodityDetail/material.js +4 -0
  32. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
  33. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
  34. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
  35. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
  36. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  37. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
  38. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
  39. package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  40. package/es/materials/sxp/popup/Iframe/index.d.ts +16 -0
  41. package/es/materials/sxp/popup/Iframe/index.js +18 -0
  42. package/es/materials/sxp/popup/Iframe/material.d.ts +2 -0
  43. package/es/materials/sxp/popup/Iframe/material.js +21 -0
  44. package/es/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  45. package/es/materials/sxp/popup/Iframe/settingRender.js +12 -0
  46. package/es/materials/sxp/popup/Prompt/settingRender.js +16 -1
  47. package/es/materials/sxp/popup/index.d.ts +1 -0
  48. package/es/materials/sxp/popup/index.js +1 -0
  49. package/es/materials/sxp/template/Link/index.js +5 -11
  50. package/es/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  51. package/es/materials/sxp/template/Link/interactionRender.js +11 -0
  52. package/es/materials/sxp/template/Link/material.js +3 -1
  53. package/es/materials/sxp/template/components/EventProvider.d.ts +3 -2
  54. package/es/materials/sxp/template/components/EventProvider.js +3 -3
  55. package/lib/core/components/SxpPageRender/FormatImage.js +19 -17
  56. package/lib/core/components/SxpPageRender/Modal/index.js +33 -20
  57. package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
  58. package/lib/core/components/SxpPageRender/ToggleButton/index.js +3 -0
  59. package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -14
  60. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
  61. package/lib/core/components/SxpPageRender/index.d.ts +6 -1
  62. package/lib/core/components/SxpPageRender/index.js +46 -23
  63. package/lib/core/components/SxpPageRender/typing.d.ts +2 -0
  64. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -2
  65. package/lib/core/context/SxpDataSourceProvider.js +27 -30
  66. package/lib/core/hooks/useEventReport.js +9 -8
  67. package/lib/core/utils/tool.d.ts +5 -1
  68. package/lib/core/utils/tool.js +73 -1
  69. package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  70. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
  71. package/lib/materials/sxp/popup/CommodityDetail/index.js +46 -28
  72. package/lib/materials/sxp/popup/CommodityDetail/material.js +4 -0
  73. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
  74. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
  75. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
  76. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
  77. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  78. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
  79. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
  80. package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  81. package/lib/materials/sxp/popup/Iframe/index.d.ts +16 -0
  82. package/lib/materials/sxp/popup/Iframe/index.js +20 -0
  83. package/lib/materials/sxp/popup/Iframe/material.d.ts +2 -0
  84. package/lib/materials/sxp/popup/Iframe/material.js +25 -0
  85. package/lib/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  86. package/lib/materials/sxp/popup/Iframe/settingRender.js +14 -0
  87. package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -1
  88. package/lib/materials/sxp/popup/index.d.ts +1 -0
  89. package/lib/materials/sxp/popup/index.js +1 -0
  90. package/lib/materials/sxp/template/Link/index.js +5 -11
  91. package/lib/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  92. package/lib/materials/sxp/template/Link/interactionRender.js +13 -0
  93. package/lib/materials/sxp/template/Link/material.js +3 -1
  94. package/lib/materials/sxp/template/components/EventProvider.d.ts +3 -2
  95. package/lib/materials/sxp/template/components/EventProvider.js +3 -3
  96. package/package.json +1 -1
@@ -7,7 +7,7 @@ const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
7
7
  function useEventReport() {
8
8
  const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = (0, useSxpDataSource_1.useSxpDataSource)();
9
9
  const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position) => {
10
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
10
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
11
11
  let fromKName = '';
12
12
  if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
13
13
  fromKName = 'pdpPage';
@@ -24,21 +24,22 @@ function useEventReport() {
24
24
  else if (data === null || data === void 0 ? void 0 : data.product) {
25
25
  fromKName = 'productPage';
26
26
  }
27
+ 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;
27
28
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
28
29
  eventInfo: {
29
30
  eventSubject: 'jumpToWeb',
30
31
  eventDescription: 'User jumped to website',
31
- productId: (_h = product === null || product === void 0 ? void 0 : product.itemId) !== null && _h !== void 0 ? _h : '',
32
- productName: (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : '',
32
+ productId: (_r = product === null || product === void 0 ? void 0 : product.itemId) !== null && _r !== void 0 ? _r : '',
33
+ productName: (_s = product === null || product === void 0 ? void 0 : product.title) !== null && _s !== void 0 ? _s : '',
33
34
  price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
34
- productCollection: (_k = product === null || product === void 0 ? void 0 : product.collection) !== null && _k !== void 0 ? _k : '',
35
+ productCollection: (_t = product === null || product === void 0 ? void 0 : product.collection) !== null && _t !== void 0 ? _t : '',
35
36
  fromKName,
36
37
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
37
- contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
38
+ contentTags: contentTags ? JSON.stringify(contentTags) : '',
38
39
  position: position + '',
39
- contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
40
- ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
41
- traceInfo: (_1 = (_y = (_w = (_s = (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : (_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_v = (_u = (_t = data === null || data === void 0 ? void 0 : data.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = data === null || data === void 0 ? void 0 : data.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = data === null || data === void 0 ? void 0 : data.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : ''
40
+ 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 : '',
41
+ ctatId: (_w = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _w !== void 0 ? _w : '',
42
+ 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 : ''
42
43
  }
43
44
  });
44
45
  }, [bffEventReport, popupDetailData, isFromHashtag]);
@@ -7,4 +7,8 @@ interface IfontType {
7
7
  'fontFamily-en': string;
8
8
  }
9
9
  export declare const setFontForText: (textContent?: string | null, style?: IfontType | any) => string;
10
- export { uuid, getIndexByblockType };
10
+ declare function getBrowserInfo(): string;
11
+ declare function getSystem(): string;
12
+ declare function getDevice(): string;
13
+ declare function getCookie(val: string): string;
14
+ export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie };
@@ -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,7 +18,7 @@ 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
  };
@@ -36,6 +36,15 @@ export interface ICommodityDetailProps {
36
36
  translateY?: number;
37
37
  style?: CSSProperties;
38
38
  };
39
+ popupBg?: {
40
+ horizontalMargin?: number;
41
+ bottomMargin?: number;
42
+ };
43
+ iframeIcon?: string;
44
+ commodityImgRatio?: {
45
+ w: number;
46
+ h: number;
47
+ };
39
48
  }
40
49
  declare const _default: React.NamedExoticComponent<ICommodityDetailProps>;
41
50
  export default _default;
@@ -14,8 +14,8 @@ 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;
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);
@@ -71,7 +71,8 @@ const CommodityDetail = (_a) => {
71
71
  return '$7,000';
72
72
  }
73
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;
74
+ 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;
75
+ const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
75
76
  const renderContent = ({ isPost }) => {
76
77
  var _a, _b, _c, _d;
77
78
  return (react_1.default.createElement("div", null,
@@ -118,25 +119,32 @@ const CommodityDetail = (_a) => {
118
119
  return;
119
120
  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
121
  }, [checkCommodityIndex]);
122
+ const getDotsAlign = (0, react_1.useMemo)(() => {
123
+ const dotsAlignClass = {
124
+ left: 'commondityDetail-swiper-clickable-left',
125
+ center: 'commondityDetail-swiper-clickable-center',
126
+ right: 'commondityDetail-swiper-clickable-right'
127
+ };
128
+ return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
129
+ }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
130
+ 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);
121
131
  return (react_1.default.createElement(react_1.default.Fragment, null,
122
132
  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: {
133
+ react_1.default.createElement("div", { style: { position: 'relative' } },
134
+ product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: height, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
125
135
  clickable: true,
126
136
  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'
137
+ clickableClass: getDotsAlign
130
138
  }, loop: true, autoplay: {
131
139
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
132
140
  } },
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) => {
141
+ react_1.default.createElement(react_1.default.Fragment, null, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
134
142
  var _a;
135
143
  return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
136
144
  react_1.default.createElement("div", { style: {
137
145
  overflow: 'hidden',
138
146
  width,
139
- height: width
147
+ height
140
148
  } },
141
149
  react_1.default.createElement(FormatImage_1.default, { style: {
142
150
  height: '100%',
@@ -145,21 +153,30 @@ const CommodityDetail = (_a) => {
145
153
  display: 'block',
146
154
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
147
155
  }, 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' }))),
156
+ })))),
157
+ !((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
158
+ height,
159
+ width
160
+ }) },
161
+ react_1.default.createElement("img", { className: (0, css_1.css)({
162
+ objectFit: 'cover',
163
+ width: '100%',
164
+ height: '100%'
165
+ }), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
166
+ (iframeUrl && iframeIcon) ||
167
+ (!product && iframeIcon && (react_1.default.createElement("div", { style: {
168
+ padding: '5px 10px',
169
+ display: 'flex',
170
+ alignItems: 'center',
171
+ position: 'absolute',
172
+ right: '10px',
173
+ bottom: '10px',
174
+ zIndex: 1,
175
+ background: '#fff',
176
+ borderRadius: '3px'
177
+ }, onClick: () => setShow3DModal(true) },
178
+ react_1.default.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
179
+ react_1.default.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
163
180
  renderCommodityGroup(),
164
181
  react_1.default.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
165
182
  renderBtn(),
@@ -167,10 +184,11 @@ const CommodityDetail = (_a) => {
167
184
  react_1.default.createElement("div", { style: { paddingBottom: '80px' } }, renderContent({ isPost: false })),
168
185
  renderBtn()),
169
186
  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: {
187
+ react_1.default.createElement("iframe", { src: iframeUrl, style: {
171
188
  width: '100%',
172
- height: 'calc(100% - 40px)',
173
- marginTop: '40px'
189
+ height: 'calc(100% - 50px)',
190
+ marginTop: '40px',
191
+ border: 'none'
174
192
  } }))));
175
193
  };
176
194
  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: {
@@ -195,5 +206,13 @@ declare const _default: ({
195
206
  name?: undefined;
196
207
  initialValue?: undefined;
197
208
  })[];
209
+ } | {
210
+ title: string;
211
+ child: {
212
+ label: string;
213
+ type: string;
214
+ name: string[];
215
+ text: string;
216
+ }[];
198
217
  })[];
199
218
  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']
@@ -262,5 +297,16 @@ exports.default = [
262
297
  name: ['props', 'buttonStyle']
263
298
  }
264
299
  ]
300
+ },
301
+ {
302
+ title: 'Iframe商品弹窗',
303
+ child: [
304
+ {
305
+ label: '弹窗按钮',
306
+ type: 'Upload',
307
+ name: ['props', 'iframeIcon'],
308
+ text: '建议尺寸:106 * 41'
309
+ }
310
+ ]
265
311
  }
266
312
  ];
@@ -18,7 +18,7 @@ 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
  };
@@ -36,6 +36,15 @@ export interface ICommodityDetailDiroNewProps {
36
36
  translateY?: number;
37
37
  style?: CSSProperties;
38
38
  };
39
+ popupBg?: {
40
+ horizontalMargin?: number;
41
+ bottomMargin?: number;
42
+ };
43
+ iframeIcon?: string;
44
+ commodityImgRatio?: {
45
+ w: number;
46
+ h: number;
47
+ };
39
48
  }
40
49
  declare const _default: React.NamedExoticComponent<ICommodityDetailDiroNewProps>;
41
50
  export default _default;