@fonixtree/magic-design 2.0.71 → 2.0.73

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 (45) hide show
  1. package/es/common/AffiliateProductModal/index.js +1 -1
  2. package/es/common/AffiliateProductModal/index.less +1 -1
  3. package/es/common/Button/index.less +0 -1
  4. package/es/common/LinkModal/FilteredProductModal/index.js +154 -104
  5. package/es/common/LinkModal/FilteredProductModal/index.less +7 -0
  6. package/es/common/LinkModal/ProductDetailPage/index.js +92 -57
  7. package/es/common/LinkModal/ProductDetailPage/index.less +6 -1
  8. package/es/common/ProductModal/index.js +124 -87
  9. package/es/common/ProductModal/index.less +7 -1
  10. package/es/common/ProductSource/index.js +82 -21
  11. package/es/composite-comp/dito/components/HeadNavigation/defaultJSON.js +22 -17
  12. package/es/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
  13. package/es/composite-comp/dito/components/Recommend/mobile/index.js +26 -23
  14. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +25 -27
  15. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
  16. package/es/constants/index.js +12 -3
  17. package/es/core/Designer/QuickMenuBar/index.js +9 -1
  18. package/es/core/Designer/index.js +11 -1
  19. package/es/locale/en/en.json +4 -1
  20. package/es/locale/es/es.json +4 -1
  21. package/es/locale/id/id.json +4 -1
  22. package/es/utils/commonUtil.js +14 -6
  23. package/lib/common/AffiliateProductModal/index.js +1 -1
  24. package/lib/common/AffiliateProductModal/index.less +1 -1
  25. package/lib/common/Button/index.less +0 -1
  26. package/lib/common/LinkModal/FilteredProductModal/index.js +154 -104
  27. package/lib/common/LinkModal/FilteredProductModal/index.less +7 -0
  28. package/lib/common/LinkModal/ProductDetailPage/index.js +92 -57
  29. package/lib/common/LinkModal/ProductDetailPage/index.less +6 -1
  30. package/lib/common/ProductModal/index.js +124 -87
  31. package/lib/common/ProductModal/index.less +7 -1
  32. package/lib/common/ProductSource/index.js +82 -21
  33. package/lib/composite-comp/dito/components/HeadNavigation/defaultJSON.js +22 -17
  34. package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
  35. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +26 -23
  36. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +25 -27
  37. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
  38. package/lib/constants/index.js +12 -3
  39. package/lib/core/Designer/QuickMenuBar/index.js +9 -1
  40. package/lib/core/Designer/index.js +11 -1
  41. package/lib/locale/en/en.json +4 -1
  42. package/lib/locale/es/es.json +4 -1
  43. package/lib/locale/id/id.json +4 -1
  44. package/lib/utils/commonUtil.js +14 -6
  45. package/package.json +1 -1
@@ -308,14 +308,14 @@ function (_super) {
308
308
 
309
309
  _this.getProductList = function (index) {
310
310
  return __awaiter(_this, void 0, void 0, function () {
311
- var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d, intelligentType, _e, intelligentValue, _f, maxProdNum, newData, res, res, e_1, _cache;
311
+ var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d, prodType, _e, intelligentType, _f, intelligentValue, _g, maxProdNum, newData, params, res, res, e_1, _cache;
312
312
 
313
- var _g, _h, _j;
313
+ var _h, _j, _k;
314
314
 
315
315
  var _this = this;
316
316
 
317
- return __generator(this, function (_k) {
318
- switch (_k.label) {
317
+ return __generator(this, function (_l) {
318
+ switch (_l.label) {
319
319
  case 0:
320
320
  panelProps = this.props.panelProps;
321
321
  groupSource = this.state.groupSource;
@@ -327,7 +327,7 @@ function (_super) {
327
327
 
328
328
  if (cache) {
329
329
  if ("products" + index in cache) {
330
- this.setState((_g = {}, _g["products" + index] = cache["products" + index], _g), function () {
330
+ this.setState((_h = {}, _h["products" + index] = cache["products" + index], _h), function () {
331
331
  _this.resetLayout();
332
332
  });
333
333
  /** 如果数据未过期 */
@@ -339,12 +339,12 @@ function (_super) {
339
339
  }
340
340
  }
341
341
 
342
- _a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.intelligentType, intelligentType = _d === void 0 ? '' : _d, _e = _a.intelligentValue, intelligentValue = _e === void 0 ? [] : _e, _f = _a.maxProdNum, maxProdNum = _f === void 0 ? 10 : _f;
342
+ _a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.prodType, prodType = _d === void 0 ? '' : _d, _e = _a.intelligentType, intelligentType = _e === void 0 ? '' : _e, _f = _a.intelligentValue, intelligentValue = _f === void 0 ? [] : _f, _g = _a.maxProdNum, maxProdNum = _g === void 0 ? 10 : _g;
343
343
  newData = [];
344
- _k.label = 1;
344
+ _l.label = 1;
345
345
 
346
346
  case 1:
347
- _k.trys.push([1, 9,, 10]);
347
+ _l.trys.push([1, 9,, 10]);
348
348
 
349
349
  if (!(groupSource.length > 0)) return [3
350
350
  /*break*/
@@ -352,22 +352,25 @@ function (_super) {
352
352
  if (!(sourceType === 'select')) return [3
353
353
  /*break*/
354
354
  , 3];
355
+ if (!prodIds) return [2
356
+ /*return*/
357
+ ];
358
+ params = {
359
+ state: 'A'
360
+ };
355
361
 
356
- if (!prodIds) {
357
- return [2
358
- /*return*/
359
- ];
362
+ if (prodType === 'spu') {
363
+ params.offers = prodIds;
364
+ } else {
365
+ params.products = prodIds;
360
366
  }
361
367
 
362
368
  return [4
363
369
  /*yield*/
364
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/products', {
365
- products: prodIds,
366
- state: 'A'
367
- }, 'GET')];
370
+ , (0, _commonUtil.commonFetch)('/designer/v1/h5/products', params, 'GET')];
368
371
 
369
372
  case 2:
370
- res = _k.sent();
373
+ res = _l.sent();
371
374
  newData = __spreadArrays(res.list);
372
375
  return [3
373
376
  /*break*/
@@ -390,7 +393,7 @@ function (_super) {
390
393
  }, 'POST')];
391
394
 
392
395
  case 4:
393
- res = _k.sent();
396
+ res = _l.sent();
394
397
  newData = __spreadArrays(res.pageInfo.list);
395
398
  return [3
396
399
  /*break*/
@@ -398,7 +401,7 @@ function (_super) {
398
401
 
399
402
  case 5:
400
403
  newData = [];
401
- _k.label = 6;
404
+ _l.label = 6;
402
405
 
403
406
  case 6:
404
407
  return [3
@@ -407,7 +410,7 @@ function (_super) {
407
410
 
408
411
  case 7:
409
412
  newData = [];
410
- _k.label = 8;
413
+ _l.label = 8;
411
414
 
412
415
  case 8:
413
416
  return [3
@@ -415,7 +418,7 @@ function (_super) {
415
418
  , 10];
416
419
 
417
420
  case 9:
418
- e_1 = _k.sent();
421
+ e_1 = _l.sent();
419
422
  newData = [];
420
423
  return [3
421
424
  /*break*/
@@ -424,10 +427,10 @@ function (_super) {
424
427
  case 10:
425
428
  if (!(0, _coreUtil.isDesignMode)()) {
426
429
  _cache = (0, _storeUtil.getMagicStore)("recommend_" + pageId + "_" + recommendId);
427
- (0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (_h = {}, _h["products" + index] = newData, _h.endTime = Date.now() + 3 * 60 * 1000, _h)));
430
+ (0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (_j = {}, _j["products" + index] = newData, _j.endTime = Date.now() + 3 * 60 * 1000, _j)));
428
431
  }
429
432
 
430
- this.setState((_j = {}, _j["products" + index] = newData, _j), function () {
433
+ this.setState((_k = {}, _k["products" + index] = newData, _k), function () {
431
434
  _this.resetLayout();
432
435
  });
433
436
  return [2
@@ -7,8 +7,6 @@ exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _antd = require("antd");
11
-
12
10
  var _HeadNavConfigImageGroup = _interopRequireDefault(require("./HeadNavConfigImageGroup"));
13
11
 
14
12
  var _Collapse = _interopRequireDefault(require("../../../../common/Collapse"));
@@ -19,8 +17,6 @@ var _locale = require("../../../../locale");
19
17
 
20
18
  var _coreUtil = require("../../../../utils/coreUtil");
21
19
 
22
- var _common = require("../../../../common");
23
-
24
20
  require("./index.less");
25
21
 
26
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -65,25 +61,30 @@ function (_super) {
65
61
  _this.setState({});
66
62
  };
67
63
 
68
- _this.getDisplayPage = function () {
69
- var data = _this.props.data;
70
- return /*#__PURE__*/_react["default"].createElement(_common.Field, null, data.displayPage.map(function (one) {
71
- return /*#__PURE__*/_react["default"].createElement("div", {
72
- key: one.name,
73
- className: "head-navigation-display-wrap"
74
- }, /*#__PURE__*/_react["default"].createElement(_antd.Checkbox, {
75
- checked: one.state,
76
- onChange: function onChange(e) {
77
- one.state = e.target.checked;
78
-
79
- _this.selfRender();
80
- }
81
- }, one.name));
82
- }));
83
- };
84
-
85
64
  return _this;
86
- }
65
+ } // getDisplayPage = () => {
66
+ // const { data } = this.props;
67
+ // return (
68
+ // <Field>
69
+ // {
70
+ // data.displayPage.map(one => (
71
+ // <div key={one.name} className="head-navigation-display-wrap">
72
+ // <Checkbox
73
+ // checked={one.state}
74
+ // onChange={e => {
75
+ // one.state = e.target.checked;
76
+ // this.selfRender();
77
+ // }}
78
+ // >
79
+ // {one.name}
80
+ // </Checkbox>
81
+ // </div>
82
+ // ))
83
+ // }
84
+ // </Field>
85
+ // );
86
+ // }
87
+
87
88
 
88
89
  HeadNavConfigImageGroup.prototype.render = function () {
89
90
  var data = this.props.data;
@@ -98,11 +99,8 @@ function (_super) {
98
99
  value: /*#__PURE__*/_react["default"].createElement(_HeadNavConfigImageGroup["default"], {
99
100
  source: data.groupSource
100
101
  })
101
- }, {
102
- key: 'headNavigation3',
103
- name: (0, _locale.i18n)('DISPLAY_PAGE'),
104
- value: this.getDisplayPage()
105
- }, {
102
+ }, // { key: 'headNavigation3', name: i18n('DISPLAY_PAGE'), value: this.getDisplayPage() },
103
+ {
106
104
  key: 'headNavigation2',
107
105
  name: (0, _locale.i18n)('BACKGROUND'),
108
106
  value: /*#__PURE__*/_react["default"].createElement(_BackgroundConfig["default"], {
@@ -114,11 +114,13 @@ function (_super) {
114
114
  }, (0, _locale.i18n)('AI_RECOMMENDATION')))), /*#__PURE__*/_react["default"].createElement("div", {
115
115
  className: "greyBg"
116
116
  }, panelProps.sourceType === 'select' && /*#__PURE__*/_react["default"].createElement(_common.ProductSource, {
117
- onChange: function onChange(v) {
118
- panelProps.prodIds = v;
117
+ onChange: function onChange(ids, type) {
118
+ panelProps.prodIds = ids;
119
+ panelProps.prodType = type;
119
120
 
120
121
  _this.selfRender();
121
122
  },
123
+ prodType: panelProps.prodType,
122
124
  value: panelProps.prodIds
123
125
  }), panelProps.sourceType === 'recommend' && /*#__PURE__*/_react["default"].createElement(_AIRecommendation["default"], {
124
126
  onChange: function onChange(val) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.walletType = exports.urlTypeMap = exports.urlType = exports.respCodeMap = exports.quickMenuCode = exports.partyTypeMap = exports.metaType = exports.metaInst = exports.metaInsType = exports.magicMode = exports.eventType = exports.deviceTypeWidthMap = exports.deviceTypeMap = exports.compInfoMap = exports.STORAGE_KEY = exports.CREDIT_STATE = void 0;
6
+ exports.walletType = exports.urlTypeMap = exports.urlType = exports.tempTypeMap = exports.respCodeMap = exports.quickMenuCode = exports.partyTypeMap = exports.metaType = exports.metaInst = exports.metaInsType = exports.magicMode = exports.eventType = exports.deviceTypeWidthMap = exports.deviceTypeMap = exports.compInfoMap = exports.STORAGE_KEY = exports.CREDIT_STATE = void 0;
7
7
  var STORAGE_KEY = {
8
8
  LOCALE: 'magicLocale',
9
9
  MAGIC_RENDER_HTML: 'MAGIC_RENDER_HTML',
@@ -98,7 +98,9 @@ var quickMenuCode = {
98
98
  PUBLISH: 'PUBLISH',
99
99
  PUBLISH_LATER: 'PUBLISH_LATER',
100
100
  MODE_PC: 'MODE_PC',
101
- MODE_PHONE: 'MODE_PHONE'
101
+ MODE_PHONE: 'MODE_PHONE',
102
+ PUSH: 'PUSH',
103
+ SET_AS_TEMPLATE: 'SET_AS_TEMPLATE'
102
104
  };
103
105
  exports.quickMenuCode = quickMenuCode;
104
106
  var compInfoMap = {
@@ -262,4 +264,11 @@ var partyTypeMap = {
262
264
  'operation/v1': 'P',
263
265
  'trade/v1': 'S'
264
266
  };
265
- exports.partyTypeMap = partyTypeMap;
267
+ /** 模版类型 */
268
+
269
+ exports.partyTypeMap = partyTypeMap;
270
+ var tempTypeMap = {
271
+ PAGE: 'Page',
272
+ TEMPLATE: 'TemplateLibrary'
273
+ };
274
+ exports.tempTypeMap = tempTypeMap;
@@ -183,7 +183,15 @@ function (_super) {
183
183
  type: "light"
184
184
  }, (0, _locale.i18n)('SAVE'))) : /*#__PURE__*/_react["default"].createElement("div", {
185
185
  className: "menu_right"
186
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
186
+ }, window.magicDesign.templateType === _constants.tempTypeMap.PAGE ? /*#__PURE__*/_react["default"].createElement(_Button["default"], {
187
+ "data-code": _constants.quickMenuCode.SET_AS_TEMPLATE,
188
+ onClick: this.onBtnClick,
189
+ type: "text"
190
+ }, (0, _locale.i18n)('SET_AS_TEMPLATE')) : /*#__PURE__*/_react["default"].createElement(_Button["default"], {
191
+ "data-code": _constants.quickMenuCode.PUSH,
192
+ onClick: this.onBtnClick,
193
+ type: "text"
194
+ }, (0, _locale.i18n)('PUSH')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
187
195
  "data-code": _constants.quickMenuCode.PREVIEW,
188
196
  onClick: this.onBtnClick
189
197
  }, (0, _locale.i18n)('PREVIEW')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
@@ -467,7 +467,9 @@ function (_super) {
467
467
  var _a = _this.props,
468
468
  onPublish = _a.onPublish,
469
469
  onSave = _a.onSave,
470
- onPreviews = _a.onPreviews;
470
+ onPreviews = _a.onPreviews,
471
+ onPush = _a.onPush,
472
+ onSetAsTemp = _a.onSetAsTemp;
471
473
  var _b = _this.state,
472
474
  device = _b.device,
473
475
  MPageData = _b.MPageData;
@@ -502,6 +504,14 @@ function (_super) {
502
504
 
503
505
  break;
504
506
 
507
+ case _constants.quickMenuCode.PUSH:
508
+ onPush(handleParams);
509
+ break;
510
+
511
+ case _constants.quickMenuCode.SET_AS_TEMPLATE:
512
+ onSetAsTemp(handleParams);
513
+ break;
514
+
505
515
  case _constants.quickMenuCode.PUBLISH:
506
516
  onPublish(handleParams);
507
517
  break;
@@ -1,4 +1,6 @@
1
1
  {
2
+ "PUSH": "Push",
3
+ "SET_AS_TEMPLATE": "Set as Template",
2
4
  "DISPLAY_PAGE": "Display page",
3
5
  "NAME": "Name",
4
6
  "ADD_MENU": "Add Menu",
@@ -95,7 +97,8 @@
95
97
  "BANNER_HEIGHT": "Banner Height",
96
98
  "IMAGE": "Image",
97
99
  "PRODUCT_NAME": "Product Name",
98
- "PRODUCT_CODE": "Product Code",
100
+ "SKU_CODE": "SKU Code",
101
+ "SPU_CODE": "SPU Code",
99
102
  "SKU": "SKU",
100
103
  "PRICE": "Price",
101
104
  "BRAND": "Brand",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "PUSH": "Push",
3
+ "SET_AS_TEMPLATE": "Set as Template",
2
4
  "DISPLAY_PAGE": "Display page",
3
5
  "NAME": "Name",
4
6
  "ADD_MENU": "Add Menu",
@@ -95,7 +97,8 @@
95
97
  "BANNER_HEIGHT": "Altura del banner",
96
98
  "IMAGE": "Imagen",
97
99
  "PRODUCT_NAME": "Nombre del producto",
98
- "PRODUCT_CODE": "Código de producto",
100
+ "SKU_CODE": "Código SKU",
101
+ "SPU_CODE": "Código spu",
99
102
  "SKU": "SKU",
100
103
  "PRICE": "Precio",
101
104
  "BRAND": "Marca",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "PUSH": "Push",
3
+ "SET_AS_TEMPLATE": "Set as Template",
2
4
  "DISPLAY_PAGE": "Display page",
3
5
  "NAME": "Name",
4
6
  "ADD_MENU": "Add Menu",
@@ -95,7 +97,8 @@
95
97
  "BANNER_HEIGHT": "Banner Height",
96
98
  "IMAGE": "Image",
97
99
  "PRODUCT_NAME": "Product Name",
98
- "PRODUCT_CODE": "Product Code",
100
+ "SKU_CODE": "SKU Code",
101
+ "SPU_CODE": "SPU Code",
99
102
  "SKU": "SKU",
100
103
  "PRICE": "Price",
101
104
  "BRAND": "Brand",
@@ -291,14 +291,22 @@ var navigateTo = function navigateTo(url) {
291
291
  return;
292
292
  }
293
293
 
294
- if (url.startsWith('/')) {
295
- if (window.magicDesign.history && !window.magicDesign.navigatePreUrl) {
296
- window.magicDesign.history.push(url);
297
- } else {
294
+ var _a = url.split(';'),
295
+ h5Url = _a[0],
296
+ appUrl = _a[1]; // 未配置App路径并且h5绝对路径时直接跳转,其他情况让业务层处理
297
+
298
+
299
+ if (!appUrl && !h5Url.startsWith('/')) {
300
+ window.location.href = h5Url;
301
+ } else if (window.magicDesign.history) {
302
+ window.magicDesign.history.push(url);
303
+ } else if (window.magicDesign.navigatePreUrl) {
304
+ // 预览模式跳转
305
+ if (h5Url.startsWith('/')) {
298
306
  window.location.href = "" + window.magicDesign.navigatePreUrl + url;
307
+ } else {
308
+ window.location.href = h5Url;
299
309
  }
300
- } else {
301
- window.location.href = url;
302
310
  }
303
311
  };
304
312
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "2.0.71",
4
+ "version": "2.0.73",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",