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
@@ -6,6 +6,7 @@ import { storeAndLoadFeUserId, AGREE_POLICY } from '../utils/localStore';
6
6
  import { useIconLink } from '../components/SxpPageRender/useIconLink';
7
7
  import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../utils/event';
8
8
  import Consent from '../components/Consent';
9
+ import { getBrowserInfo, getCookie, getDevice, getSystem } from '../utils/tool';
9
10
  export const SxpDataSourceContext = createContext({
10
11
  rtcList: [],
11
12
  tagList: []
@@ -15,7 +16,7 @@ var DataSourceType;
15
16
  DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
16
17
  })(DataSourceType || (DataSourceType = {}));
17
18
  export const DEFAULT_TAG = 'FOR U';
18
- const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false, utmParameter }) => {
19
+ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false, utmParameter, channelQueryList }) => {
19
20
  var _a, _b, _c;
20
21
  const [rtcList, setRtcList] = useState([]);
21
22
  const [tagList, setTagList] = useState([]);
@@ -93,15 +94,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
93
94
  }, [bffDataSource]);
94
95
  const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
95
96
  var _d, _e, _f, _g, _h;
96
- query = {
97
- maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
98
- defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
99
- 'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
100
- 'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
101
- hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
102
- traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo,
103
- themeTag: query === null || query === void 0 ? void 0 : query.themeTag
104
- };
97
+ query = Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` }));
105
98
  if (utmVal) {
106
99
  const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
107
100
  var _a, _b;
@@ -110,6 +103,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
110
103
  })) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
111
104
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
112
105
  }
106
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isEditor) {
107
+ query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.join('&') }));
108
+ }
113
109
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
114
110
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
115
111
  return undefined;
@@ -117,29 +113,26 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
117
113
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
118
114
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
119
115
  return result === null || result === void 0 ? void 0 : result.data;
120
- }), [bffFetch, utmVal, maxSize, defaultSize]);
116
+ }), [bffFetch, utmVal, maxSize, defaultSize, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, channelQueryList, isEditor]);
121
117
  const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
118
+ var _j, _k, _l, _m;
122
119
  if (rtcList.length <= 0) {
123
120
  return;
124
121
  }
125
- const data = yield getRecommendVideos({
126
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
127
- 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
128
- 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
129
- themeTag: themeTag.current
130
- });
122
+ const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
123
+ const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_j = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _j === void 0 ? void 0 : _j.itemId) && { productFilter: (_k = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _k === void 0 ? void 0 : _k.itemId })), (((_l = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _l === void 0 ? void 0 : _l.itemId) && { contentFilter: (_m = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _m === void 0 ? void 0 : _m.itemId })), { themeTag: themeTag.current }));
131
124
  setRtcList(rtcList.concat(getFilterRecList(data)));
132
125
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
133
126
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
134
127
  const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
135
- if (!enableReportEvent) {
128
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
136
129
  return;
137
130
  }
138
131
  if (!userInfo) {
139
132
  userInfo = {};
140
133
  }
141
134
  const sessionID = storeAndLoadFeSessionId();
142
- const ef = Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo);
135
+ const ef = Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), { sxpDevice: getDevice(), sxpSystem: getSystem(), sxpBrowser: getBrowserInfo() });
143
136
  const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
144
137
  const realEventInfo = Object.entries(ef)
145
138
  .map(([k, v]) => v && { name: k, value: v })
@@ -153,11 +146,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
153
146
  body: { userInfo: realUserInfo, eventInfo: realEventInfo },
154
147
  type: 'beacon'
155
148
  });
156
- }, [bffFetch, curReqInfo, enableReportEvent]);
149
+ }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
157
150
  const bffFbReport = useCallback((_a) => {
158
- var _b;
151
+ var _b, _c;
159
152
  var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
160
- if (!enableReportEvent || !enabledMetaConversionApi) {
153
+ if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
161
154
  return;
162
155
  }
163
156
  const fakeUserId = storeAndLoadFeUserId();
@@ -168,12 +161,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
168
161
  actionSource,
169
162
  eventSourceUrl,
170
163
  userData: {
171
- externalId: fakeUserId
164
+ externalId: fakeUserId,
165
+ fbc: `fb.2.${new Date().getTime()}.${getCookie('_fbc')}`,
166
+ fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}`,
167
+ client_user_agent: (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent
172
168
  }
173
169
  },
174
170
  type: 'beacon'
175
171
  });
176
- }, [bffFetch, enableReportEvent, enabledMetaConversionApi]);
172
+ }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
177
173
  const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
178
174
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
179
175
  return res === null || res === void 0 ? void 0 : res.success;
@@ -187,24 +183,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
187
183
  return res === null || res === void 0 ? void 0 : res.success;
188
184
  }), [bffFetch]);
189
185
  const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
190
- var _j, _k, _l, _m, _o;
186
+ var _o, _p, _q, _r, _s;
191
187
  if (!utmVal || !isShowTag)
192
188
  return;
193
189
  try {
194
- const val = (_l = (_k = (_j = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _j === void 0 ? void 0 : _j.filter((val) => {
190
+ const val = (_q = (_p = (_o = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _o === void 0 ? void 0 : _o.filter((val) => {
195
191
  var _a, _b;
196
192
  const key = val.split('=')[0];
197
193
  return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
198
- })) === null || _k === void 0 ? void 0 : _k.join('&')) !== null && _l !== void 0 ? _l : '';
194
+ })) === null || _p === void 0 ? void 0 : _p.join('&')) !== null && _q !== void 0 ? _q : '';
199
195
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
200
- setTagList((_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.tags) !== null && _o !== void 0 ? _o : []);
196
+ setTagList((_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []);
201
197
  }
202
198
  catch (e) {
203
199
  console.log('e', e);
204
200
  }
205
201
  }), [bffFetch, utmVal, isShowTag]);
206
202
  const ctaEvent = useCallback((eventInfo, rec, product, position) => {
207
- 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;
203
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
208
204
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
209
205
  const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
210
206
  let fromKName = '';
@@ -217,8 +213,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
217
213
  else if ((_g = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.imgUrls) === null || _g === void 0 ? void 0 : _g.length) {
218
214
  fromKName = 'imagePage';
219
215
  }
216
+ const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
220
217
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
221
- eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_2 = (_z = (_u = (_q = (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_t = (_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProduct) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : (_y = (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.bindProducts) === null || _w === void 0 ? void 0 : _w[0]) === null || _x === void 0 ? void 0 : _x.bindCta) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_1 = (_0 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : '', fromKName, fromKPage: (_3 = location === null || location === void 0 ? void 0 : location.href) !== null && _3 !== void 0 ? _3 : '' })
218
+ eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '' })
222
219
  });
223
220
  }, [bffEventReport, isFromHashtag]);
224
221
  const h5EnterLink = useCallback(() => {
@@ -4,7 +4,7 @@ import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
4
4
  export function useEventReport() {
5
5
  const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
6
6
  const jumpToWeb = useCallback((data, product, cta, position) => {
7
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
7
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
8
8
  let fromKName = '';
9
9
  if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
10
10
  fromKName = 'pdpPage';
@@ -21,21 +21,22 @@ export function useEventReport() {
21
21
  else if (data === null || data === void 0 ? void 0 : data.product) {
22
22
  fromKName = 'productPage';
23
23
  }
24
+ 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;
24
25
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
25
26
  eventInfo: {
26
27
  eventSubject: 'jumpToWeb',
27
28
  eventDescription: 'User jumped to website',
28
- productId: (_h = product === null || product === void 0 ? void 0 : product.itemId) !== null && _h !== void 0 ? _h : '',
29
- productName: (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : '',
29
+ productId: (_r = product === null || product === void 0 ? void 0 : product.itemId) !== null && _r !== void 0 ? _r : '',
30
+ productName: (_s = product === null || product === void 0 ? void 0 : product.title) !== null && _s !== void 0 ? _s : '',
30
31
  price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
31
- productCollection: (_k = product === null || product === void 0 ? void 0 : product.collection) !== null && _k !== void 0 ? _k : '',
32
+ productCollection: (_t = product === null || product === void 0 ? void 0 : product.collection) !== null && _t !== void 0 ? _t : '',
32
33
  fromKName,
33
34
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
34
- contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
35
+ contentTags: contentTags ? JSON.stringify(contentTags) : '',
35
36
  position: position + '',
36
- contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
37
- ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
38
- 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 : ''
37
+ 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 : '',
38
+ ctatId: (_w = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _w !== void 0 ? _w : '',
39
+ 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 : ''
39
40
  }
40
41
  });
41
42
  }, [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 };
@@ -88,4 +88,72 @@ export const setFontForText = (textContent, style) => {
88
88
  }
89
89
  return content;
90
90
  };
91
- export { uuid, getIndexByblockType };
91
+ function getBrowserInfo() {
92
+ var _a, _b, _c, _d, _e, _f, _g;
93
+ let userAgent = self.navigator.userAgent;
94
+ if (!userAgent)
95
+ return 'Unknown';
96
+ if (/edge\/([\d\.]+)/i.exec(userAgent))
97
+ return `Edge ${(_a = /edge\/([\d\.]+)/i.exec(userAgent)) === null || _a === void 0 ? void 0 : _a[1]}`;
98
+ if (/edg\/([\d\.]+)/i.exec(userAgent))
99
+ return `Edge(Chromium) ${(_b = /edge\/([\d\.]+)/i.exec(userAgent)) === null || _b === void 0 ? void 0 : _b[1]}`;
100
+ if (/msie/i.test(userAgent))
101
+ return `Internet Explorer ${(_c = /msie ([\d\.]+)/i.exec(userAgent)) === null || _c === void 0 ? void 0 : _c[1]}`;
102
+ if (/Trident/i.test(userAgent))
103
+ return `Internet Explorer ${(_d = /rv:([\d\.]+)/i.exec(userAgent)) === null || _d === void 0 ? void 0 : _d[1]}`;
104
+ if (/chrome/i.test(userAgent))
105
+ return `Chrome ${(_e = /chrome\/([\d\.]+)/i.exec(userAgent)) === null || _e === void 0 ? void 0 : _e[1]}`;
106
+ if (/firefox/i.test(userAgent))
107
+ return `Firefox ${(_f = /firefox\/([\d\.]+)/i.exec(userAgent)) === null || _f === void 0 ? void 0 : _f[1]}`;
108
+ if (/safari/i.test(userAgent))
109
+ return `Safari ${(_g = /version\/([\d\.]+)/i.exec(userAgent)) === null || _g === void 0 ? void 0 : _g[1]}`;
110
+ return 'Unknown';
111
+ }
112
+ function getSystem() {
113
+ var _a, _b, _c;
114
+ let userAgent = self.navigator.userAgent;
115
+ if (!userAgent)
116
+ return 'Unknown';
117
+ if (/iphone/i.test(userAgent))
118
+ return `IOS ${(_a = userAgent.match(/OS\s(.*?)\slike/)) === null || _a === void 0 ? void 0 : _a[1]}`;
119
+ if (/android/i.test(userAgent))
120
+ return `Android ${(_b = userAgent.match(/Android\s(.*?)\;/)) === null || _b === void 0 ? void 0 : _b[1]}`;
121
+ if (/windows/i.test(userAgent))
122
+ return `Windows ${(_c = userAgent.match(/Windows\s(.*?)\;/)) === null || _c === void 0 ? void 0 : _c[1]}`;
123
+ if (/mac/i.test(userAgent))
124
+ return `Mac OS`;
125
+ return 'Unknown';
126
+ }
127
+ function getDevice() {
128
+ let userAgent = self.navigator.userAgent;
129
+ if (!userAgent)
130
+ return 'Unknown';
131
+ if (/iphone/i.test(userAgent))
132
+ return `iPhone`;
133
+ if (/android/i.test(userAgent)) {
134
+ var index1 = userAgent.indexOf('(');
135
+ var index2 = userAgent.indexOf(')');
136
+ if (index1 !== -1 && index2 !== -1) {
137
+ var value = userAgent.substring(index1 + 1, index2);
138
+ return `${value}`;
139
+ }
140
+ }
141
+ if (/windows/i.test(userAgent))
142
+ return `Windows`;
143
+ if (/mac/i.test(userAgent))
144
+ return `Mac`;
145
+ return 'Unknown';
146
+ }
147
+ function getCookie(val) {
148
+ const cookies = document.cookie;
149
+ const cookieArray = cookies.split(';');
150
+ let value = null;
151
+ cookieArray.forEach((cookie) => {
152
+ const [cookieName, cookieValue] = cookie.trim().split('=');
153
+ if (cookieName === val) {
154
+ value = cookieValue;
155
+ }
156
+ });
157
+ return value !== null && value !== void 0 ? value : '';
158
+ }
159
+ export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie };
@@ -1,4 +1,19 @@
1
1
  export default [
2
+ {
3
+ title: '弹窗背景',
4
+ child: [
5
+ {
6
+ type: 'Number',
7
+ label: '左右边距',
8
+ name: ['props', 'popupBg', 'horizontalMargin']
9
+ },
10
+ {
11
+ type: 'Number',
12
+ label: '下边距',
13
+ name: ['props', 'popupBg', 'bottomMargin']
14
+ }
15
+ ]
16
+ },
2
17
  {
3
18
  type: 'Text',
4
19
  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;
@@ -12,8 +12,8 @@ import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
12
12
  import { setFontForText } from '../../../../core/utils/tool';
13
13
  import CommodityGroup from '../../template/components/CommodityGroup';
14
14
  const CommodityDetail = (_a) => {
15
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
16
- var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
15
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
16
+ var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
17
17
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
18
18
  const { jumpToWeb, productView } = useEventReport();
19
19
  const curTimeRef = useRef(null);
@@ -69,7 +69,8 @@ const CommodityDetail = (_a) => {
69
69
  return '$7,000';
70
70
  }
71
71
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
72
- const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
72
+ 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;
73
+ const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
73
74
  const renderContent = ({ isPost }) => {
74
75
  var _a, _b, _c, _d;
75
76
  return (React.createElement("div", null,
@@ -116,25 +117,32 @@ const CommodityDetail = (_a) => {
116
117
  return;
117
118
  return (React.createElement(CommodityGroup, { 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 }));
118
119
  }, [checkCommodityIndex]);
120
+ const getDotsAlign = useMemo(() => {
121
+ const dotsAlignClass = {
122
+ left: 'commondityDetail-swiper-clickable-left',
123
+ center: 'commondityDetail-swiper-clickable-center',
124
+ right: 'commondityDetail-swiper-clickable-right'
125
+ };
126
+ return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
127
+ }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
128
+ 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);
119
129
  return (React.createElement(React.Fragment, null,
120
130
  React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
121
- product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (React.createElement("div", { style: { position: 'relative' } },
122
- React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
131
+ React.createElement("div", { style: { position: 'relative' } },
132
+ product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
123
133
  clickable: true,
124
134
  bulletActiveClass: 'swipe-item-active-bullet',
125
- clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
126
- ? 'commondityDetail-swiper-clickable-left'
127
- : 'commondityDetail-swiper-clickable-center'
135
+ clickableClass: getDotsAlign
128
136
  }, loop: true, autoplay: {
129
137
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
130
138
  } },
131
- React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
139
+ React.createElement(React.Fragment, null, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
132
140
  var _a;
133
141
  return (React.createElement(SwiperSlide, { key: src },
134
142
  React.createElement("div", { style: {
135
143
  overflow: 'hidden',
136
144
  width,
137
- height: width
145
+ height
138
146
  } },
139
147
  React.createElement(FormatImage, { style: {
140
148
  height: '100%',
@@ -143,21 +151,30 @@ const CommodityDetail = (_a) => {
143
151
  display: 'block',
144
152
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
145
153
  }, 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 }))));
146
- }))))),
147
- !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
148
- position: 'relative',
149
- height: 0,
150
- width: '100%',
151
- paddingBottom: '100%',
152
- overflow: 'hidden'
153
- }) },
154
- React.createElement("img", { className: css({
155
- position: 'absolute',
156
- left: 0,
157
- top: 0,
158
- objectFit: 'cover',
159
- width: '100%'
160
- }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
154
+ })))),
155
+ !((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (React.createElement("div", { className: css({
156
+ height,
157
+ width
158
+ }) },
159
+ React.createElement("img", { className: css({
160
+ objectFit: 'cover',
161
+ width: '100%',
162
+ height: '100%'
163
+ }), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
164
+ (iframeUrl && iframeIcon) ||
165
+ (!product && iframeIcon && (React.createElement("div", { style: {
166
+ padding: '5px 10px',
167
+ display: 'flex',
168
+ alignItems: 'center',
169
+ position: 'absolute',
170
+ right: '10px',
171
+ bottom: '10px',
172
+ zIndex: 1,
173
+ background: '#fff',
174
+ borderRadius: '3px'
175
+ }, onClick: () => setShow3DModal(true) },
176
+ React.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
177
+ React.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
161
178
  renderCommodityGroup(),
162
179
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
163
180
  renderBtn(),
@@ -165,10 +182,11 @@ const CommodityDetail = (_a) => {
165
182
  React.createElement("div", { style: { paddingBottom: '80px' } }, renderContent({ isPost: false })),
166
183
  renderBtn()),
167
184
  React.createElement(Modal, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
168
- React.createElement("iframe", { src: 'https://rimowa.threedium.co.uk/product-experience/latest/?sku=92573974&lang=en', style: {
185
+ React.createElement("iframe", { src: iframeUrl, style: {
169
186
  width: '100%',
170
- height: 'calc(100% - 40px)',
171
- marginTop: '40px'
187
+ height: 'calc(100% - 50px)',
188
+ marginTop: '40px',
189
+ border: 'none'
172
190
  } }))));
173
191
  };
174
192
  export default memo(CommodityDetail);
@@ -51,6 +51,10 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
51
51
  fontWeight: 'bold',
52
52
  textAlign: 'center',
53
53
  color: 'rgba(255, 255, 255, 0.9)'
54
+ },
55
+ commodityImgRatio: {
56
+ w: 1,
57
+ h: 1
54
58
  }
55
59
  },
56
60
  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,7 +1,38 @@
1
1
  export default [
2
+ {
3
+ title: '弹窗背景',
4
+ child: [
5
+ {
6
+ type: 'Number',
7
+ label: '左右边距',
8
+ name: ['props', 'popupBg', 'horizontalMargin']
9
+ },
10
+ {
11
+ type: 'Number',
12
+ label: '下边距',
13
+ name: ['props', 'popupBg', 'bottomMargin']
14
+ }
15
+ ]
16
+ },
2
17
  {
3
18
  title: '商品图片',
4
19
  child: [
20
+ {
21
+ type: 'Group',
22
+ label: '宽高比',
23
+ child: [
24
+ {
25
+ type: 'Number',
26
+ name: ['props', 'commodityImgRatio', 'w'],
27
+ addonAfter: 'w'
28
+ },
29
+ {
30
+ type: 'Number',
31
+ name: ['props', 'commodityImgRatio', 'h'],
32
+ addonAfter: 'h'
33
+ }
34
+ ]
35
+ },
5
36
  {
6
37
  type: 'Radius',
7
38
  label: '轮播指示器',
@@ -13,6 +44,10 @@ export default [
13
44
  {
14
45
  label: '居中',
15
46
  value: 'center'
47
+ },
48
+ {
49
+ label: '居右',
50
+ value: 'right'
16
51
  }
17
52
  ],
18
53
  name: ['props', 'swiper', 'dotsAlign']
@@ -260,5 +295,16 @@ export default [
260
295
  name: ['props', 'buttonStyle']
261
296
  }
262
297
  ]
298
+ },
299
+ {
300
+ title: 'Iframe商品弹窗',
301
+ child: [
302
+ {
303
+ label: '弹窗按钮',
304
+ type: 'Upload',
305
+ name: ['props', 'iframeIcon'],
306
+ text: '建议尺寸:106 * 41'
307
+ }
308
+ ]
263
309
  }
264
310
  ];
@@ -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;