@fonixtree/magic-design 1.0.109 → 1.0.111

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 (43) hide show
  1. package/es/assets/fonts/Montserrat-Bold.ttf +0 -0
  2. package/es/assets/fonts/Montserrat-Medium.ttf +0 -0
  3. package/es/assets/fonts/Montserrat-Regular.ttf +0 -0
  4. package/es/assets/fonts/Montserrat-SemiBold.ttf +0 -0
  5. package/es/common/ErrorBoundary/index.js +90 -0
  6. package/es/common/index.js +8 -0
  7. package/es/composite-comp/common/components/ProductItem/index.js +1 -1
  8. package/es/composite-comp/common/config-panels/BackgroundConfig/index.js +65 -3
  9. package/es/composite-comp/dito/components/AffiliateRecommend/mobile/index.js +1 -1
  10. package/es/composite-comp/dito/components/AffiliateRecommend/mobile/index.less +15 -15
  11. package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +6 -0
  12. package/es/composite-comp/dito/components/GroupBuy/mobile/index.js +8 -5
  13. package/es/composite-comp/dito/components/Recommend/defaultJSON.js +7 -1
  14. package/es/composite-comp/dito/components/Recommend/mobile/index.js +17 -1
  15. package/es/composite-comp/dito/components/Recommend/mobile/index.less +13 -1
  16. package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +1 -0
  17. package/es/core/Designer/index.js +2 -2
  18. package/es/decorator/compositeDecorator.js +27 -2
  19. package/es/locale/en/en.json +2 -0
  20. package/es/locale/es/es.json +2 -0
  21. package/es/locale/id/id.json +2 -0
  22. package/lib/assets/fonts/Montserrat-Bold.ttf +0 -0
  23. package/lib/assets/fonts/Montserrat-Medium.ttf +0 -0
  24. package/lib/assets/fonts/Montserrat-Regular.ttf +0 -0
  25. package/lib/assets/fonts/Montserrat-SemiBold.ttf +0 -0
  26. package/lib/common/ErrorBoundary/index.js +90 -0
  27. package/lib/common/index.js +8 -0
  28. package/lib/composite-comp/common/components/ProductItem/index.js +1 -1
  29. package/lib/composite-comp/common/config-panels/BackgroundConfig/index.js +65 -3
  30. package/lib/composite-comp/dito/components/AffiliateRecommend/mobile/index.js +1 -1
  31. package/lib/composite-comp/dito/components/AffiliateRecommend/mobile/index.less +15 -15
  32. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +6 -0
  33. package/lib/composite-comp/dito/components/GroupBuy/mobile/index.js +8 -5
  34. package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +7 -1
  35. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +17 -1
  36. package/lib/composite-comp/dito/components/Recommend/mobile/index.less +13 -1
  37. package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +1 -0
  38. package/lib/core/Designer/index.js +2 -2
  39. package/lib/decorator/compositeDecorator.js +27 -2
  40. package/lib/locale/en/en.json +2 -0
  41. package/lib/locale/es/es.json +2 -0
  42. package/lib/locale/id/id.json +2 -0
  43. package/package.json +1 -1
Binary file
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+
16
+ var __extends = void 0 && (void 0).__extends || function () {
17
+ var _extendStatics = function extendStatics(d, b) {
18
+ _extendStatics = Object.setPrototypeOf || {
19
+ __proto__: []
20
+ } instanceof Array && function (d, b) {
21
+ d.__proto__ = b;
22
+ } || function (d, b) {
23
+ for (var p in b) {
24
+ if (b.hasOwnProperty(p)) d[p] = b[p];
25
+ }
26
+ };
27
+
28
+ return _extendStatics(d, b);
29
+ };
30
+
31
+ return function (d, b) {
32
+ _extendStatics(d, b);
33
+
34
+ function __() {
35
+ this.constructor = d;
36
+ }
37
+
38
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
39
+ };
40
+ }();
41
+
42
+ var ErrorBoundary =
43
+ /** @class */
44
+ function (_super) {
45
+ __extends(ErrorBoundary, _super);
46
+
47
+ function ErrorBoundary(props) {
48
+ var _this = _super.call(this, props) || this;
49
+
50
+ _this.state = {
51
+ hasError: false
52
+ };
53
+ return _this;
54
+ }
55
+
56
+ ErrorBoundary.getDerivedStateFromError = function (error) {
57
+ // 更新 state 以触发备用 UI 渲染
58
+ return {
59
+ hasError: true
60
+ };
61
+ };
62
+
63
+ ErrorBoundary.prototype.componentDidCatch = function (error, errorInfo) {
64
+ // 可以在这里将错误信息发送给日志系统
65
+ console.error('Error caught by ErrorBoundary:', error, errorInfo);
66
+ };
67
+
68
+ ErrorBoundary.prototype.render = function () {
69
+ if (this.state.hasError) {
70
+ // 自定义错误 UI
71
+ if (window.magicDesign.mode === 'renderer') {
72
+ return null;
73
+ }
74
+
75
+ return /*#__PURE__*/_react["default"].createElement("div", {
76
+ style: {
77
+ textAlign: 'center',
78
+ padding: '10px'
79
+ }
80
+ }, /*#__PURE__*/_react["default"].createElement("h2", null, this.props.name, " Components updated"), /*#__PURE__*/_react["default"].createElement("p", null, "Please delete the component and add it again!"));
81
+ }
82
+
83
+ return this.props.children;
84
+ };
85
+
86
+ return ErrorBoundary;
87
+ }(_react.Component);
88
+
89
+ var _default = ErrorBoundary;
90
+ exports["default"] = _default;
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "CropperModal", {
45
45
  return _CropperModal["default"];
46
46
  }
47
47
  });
48
+ Object.defineProperty(exports, "ErrorBoundary", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _ErrorBoundary["default"];
52
+ }
53
+ });
48
54
  Object.defineProperty(exports, "Field", {
49
55
  enumerable: true,
50
56
  get: function get() {
@@ -204,4 +210,6 @@ var _CropperModal = _interopRequireDefault(require("./CropperModal"));
204
210
 
205
211
  var _NewImg = _interopRequireDefault(require("./NewImg"));
206
212
 
213
+ var _ErrorBoundary = _interopRequireDefault(require("./ErrorBoundary"));
214
+
207
215
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -163,7 +163,7 @@ function (_super) {
163
163
  return onItemClick();
164
164
  },
165
165
  style: {
166
- width: imgWidth + 2
166
+ width: imgWidth
167
167
  }
168
168
  }, rest), /*#__PURE__*/_react["default"].createElement("div", {
169
169
  className: "img-wrap"
@@ -58,9 +58,23 @@ function (_super) {
58
58
  BackgroundConfig.prototype.render = function () {
59
59
  var _this = this;
60
60
 
61
- var data = this.props.data;
61
+ var _a, _b, _c, _d, _e;
62
+
63
+ var _f = this.props,
64
+ data = _f.data,
65
+ component = _f.component;
66
+
67
+ if (!data.tabBackground) {
68
+ data.tabBackground = {
69
+ opacity: 100,
70
+ color: '#232F46',
71
+ image: '',
72
+ tabBgType: 'color'
73
+ };
74
+ }
75
+
62
76
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
63
- title: (0, _locale.i18n)('BACKGROUND')
77
+ title: component === 'recommend' ? (0, _locale.i18n)('PRODUCT_BACKGROUND') : (0, _locale.i18n)('BACKGROUND')
64
78
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
65
79
  onChange: function onChange(bgType) {
66
80
  data.bgType = bgType;
@@ -101,6 +115,48 @@ function (_super) {
101
115
  _this.selfRender();
102
116
  },
103
117
  value: data.image
118
+ })), component === 'recommend' && /*#__PURE__*/_react["default"].createElement(_common.Field, {
119
+ title: (0, _locale.i18n)('TAB_BACKGROUND')
120
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
121
+ onChange: function onChange(tabBgType) {
122
+ data.tabBackground.tabBgType = tabBgType;
123
+
124
+ _this.selfRender();
125
+ },
126
+ style: {
127
+ marginBottom: '15px'
128
+ },
129
+ value: (_a = data.tabBackground) === null || _a === void 0 ? void 0 : _a.tabBgType
130
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
131
+ value: "color"
132
+ }, (0, _locale.i18n)('COLOR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
133
+ value: "image"
134
+ }, (0, _locale.i18n)('IMAGE'))), ((_b = data.tabBackground) === null || _b === void 0 ? void 0 : _b.tabBgType) === 'color' ? /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
135
+ colorType: "rgba",
136
+ onChange: function onChange(v) {
137
+ data.tabBackground.opacity = 1;
138
+ data.tabBackground.color = v;
139
+
140
+ _this.selfRender();
141
+ },
142
+ value: (_c = data.tabBackground) === null || _c === void 0 ? void 0 : _c.color
143
+ }) : /*#__PURE__*/_react["default"].createElement(_common.ImagePicker, {
144
+ imageSelectedWay: ((_d = data.tabBackground) === null || _d === void 0 ? void 0 : _d.imageSelectedWay) || {
145
+ pc: '',
146
+ mobile: ''
147
+ },
148
+ onChange: function onChange(v, way) {
149
+ if (v) {
150
+ data.tabBackground.image = v.url;
151
+ }
152
+
153
+ if (way) {
154
+ data.tabBackground.imageSelectedWay = way;
155
+ }
156
+
157
+ _this.selfRender();
158
+ },
159
+ value: (_e = data.tabBackground) === null || _e === void 0 ? void 0 : _e.image
104
160
  })));
105
161
  };
106
162
 
@@ -109,7 +165,13 @@ function (_super) {
109
165
  opacity: 100,
110
166
  color: '#232F46',
111
167
  image: '',
112
- bgType: 'color'
168
+ bgType: 'color',
169
+ tabBackground: {
170
+ opacity: 100,
171
+ color: '#232F46',
172
+ image: '',
173
+ tabBgType: 'color'
174
+ }
113
175
  }
114
176
  };
115
177
  return BackgroundConfig;
@@ -551,7 +551,7 @@ function (_super) {
551
551
  if (layout === 'layout1' && contentWidth) imgHeight = (contentWidth - 12) / 2;
552
552
  if (layout === 'layout3' && contentWidth) imgHeight = (contentWidth - 12 * 2) / 3;
553
553
  return /*#__PURE__*/_react["default"].createElement("div", {
554
- className: "m-recommend-mobile recommend_" + panelProps.id
554
+ className: "m-affiliate-recommend-mobile recommend_" + panelProps.id
555
555
  }, !hideTabs && /*#__PURE__*/_react["default"].createElement("div", {
556
556
  className: "tab-select-wrap"
557
557
  }, groupSource.map(function (tab, index) {
@@ -1,16 +1,16 @@
1
- .m-recommend-mobile {
1
+ .m-affiliate-recommend-mobile {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  }
5
- .m-recommend-mobile .cylon-tabs-nav-operations {
5
+ .m-affiliate-recommend-mobile .cylon-tabs-nav-operations {
6
6
  display: none !important;
7
7
  }
8
- .m-recommend-mobile ::-webkit-scrollbar {
8
+ .m-affiliate-recommend-mobile ::-webkit-scrollbar {
9
9
  width: 0;
10
10
  height: 0;
11
11
  display: none;
12
12
  }
13
- .m-recommend-mobile .tab-select-wrap {
13
+ .m-affiliate-recommend-mobile .tab-select-wrap {
14
14
  display: flex;
15
15
  align-items: center;
16
16
  height: 1rem;
@@ -19,7 +19,7 @@
19
19
  position: relative;
20
20
  margin-bottom: 0.3rem;
21
21
  }
22
- .m-recommend-mobile .tab-select-wrap .tabTitle {
22
+ .m-affiliate-recommend-mobile .tab-select-wrap .tabTitle {
23
23
  display: flex;
24
24
  align-items: center;
25
25
  text-align: center;
@@ -30,12 +30,12 @@
30
30
  white-space: nowrap;
31
31
  flex-direction: column;
32
32
  }
33
- .m-recommend-mobile .tab-select-wrap .tabTitle img {
33
+ .m-affiliate-recommend-mobile .tab-select-wrap .tabTitle img {
34
34
  height: 0.4rem;
35
35
  width: 0.4rem;
36
36
  margin-bottom: 0.04rem;
37
37
  }
38
- .m-recommend-mobile .tab-select-wrap .active-line {
38
+ .m-affiliate-recommend-mobile .tab-select-wrap .active-line {
39
39
  position: absolute;
40
40
  bottom: 0;
41
41
  width: 4rem;
@@ -44,11 +44,11 @@
44
44
  transition: 0.2s all linear;
45
45
  border-radius: 0.03rem;
46
46
  }
47
- .m-recommend-mobile .macyContainer {
47
+ .m-affiliate-recommend-mobile .macyContainer {
48
48
  display: flex;
49
49
  margin: 0 0.32rem;
50
50
  }
51
- .m-recommend-mobile .scrollContainer {
51
+ .m-affiliate-recommend-mobile .scrollContainer {
52
52
  display: flex;
53
53
  flex-direction: row;
54
54
  align-items: center;
@@ -56,26 +56,26 @@
56
56
  overflow-x: auto;
57
57
  padding-bottom: 0.3rem;
58
58
  }
59
- .m-recommend-mobile .scrollContainer.pl_140 {
59
+ .m-affiliate-recommend-mobile .scrollContainer.pl_140 {
60
60
  padding-left: 2.8rem;
61
61
  }
62
- .m-recommend-mobile .scrollContainer .scrollProductList {
62
+ .m-affiliate-recommend-mobile .scrollContainer .scrollProductList {
63
63
  display: flex;
64
64
  flex-direction: row;
65
65
  align-items: flex-start;
66
66
  }
67
- .m-recommend-mobile .scrollContainer .scrollProductList .productCard {
67
+ .m-affiliate-recommend-mobile .scrollContainer .scrollProductList .productCard {
68
68
  margin-right: 0.24rem;
69
69
  }
70
- .m-recommend-mobile .scrollContainer .scrollProductListRow {
70
+ .m-affiliate-recommend-mobile .scrollContainer .scrollProductListRow {
71
71
  display: flex;
72
72
  flex-direction: row;
73
73
  align-items: flex-start;
74
74
  }
75
- .m-recommend-mobile .scrollContainer .scrollProductListRow .productCardRow {
75
+ .m-affiliate-recommend-mobile .scrollContainer .scrollProductListRow .productCardRow {
76
76
  margin-right: 0.16rem;
77
77
  }
78
- .m-recommend-mobile .btnSeeAll {
78
+ .m-affiliate-recommend-mobile .btnSeeAll {
79
79
  display: block;
80
80
  width: fit-content;
81
81
  min-width: 1.6rem;
@@ -78,10 +78,12 @@
78
78
  .m-flash-deal-mobile .flash-deal-list-vertical .m-product-item-wrap {
79
79
  width: 2.44rem;
80
80
  margin-right: 0.16rem;
81
+ border-radius: 0.16rem;
81
82
  }
82
83
  .m-flash-deal-mobile .flash-deal-list-vertical .m-product-item-wrap .product-img {
83
84
  height: 2.4rem;
84
85
  width: 2.4rem;
86
+ border-radius: 0.16rem 0.16rem 0 0;
85
87
  }
86
88
  .m-flash-deal-mobile .flash-deal-list-horizontal {
87
89
  display: flex;
@@ -92,6 +94,10 @@
92
94
  }
93
95
  .m-flash-deal-mobile .flash-deal-list-horizontal .m-product-item-wrap {
94
96
  width: 100%;
97
+ border-radius: 0.16rem;
98
+ }
99
+ .m-flash-deal-mobile .flash-deal-list-horizontal .m-product-item-wrap .product-img {
100
+ border-radius: 0.16rem 0 0 0.16rem;
95
101
  }
96
102
  .m-flash-deal-mobile .flash-deal-list-horizontal .m-product-item-wrap .content-wrap {
97
103
  flex: 1;
@@ -246,8 +246,11 @@ function (_super) {
246
246
  _this.getData = function () {
247
247
  return __awaiter(_this, void 0, void 0, function () {
248
248
  var res;
249
- return __generator(this, function (_a) {
250
- switch (_a.label) {
249
+
250
+ var _a, _b;
251
+
252
+ return __generator(this, function (_c) {
253
+ switch (_c.label) {
251
254
  case 0:
252
255
  return [4
253
256
  /*yield*/
@@ -256,14 +259,14 @@ function (_super) {
256
259
  }, 'GET')];
257
260
 
258
261
  case 1:
259
- res = _a.sent();
262
+ res = _c.sent();
260
263
 
261
264
  if (!(0, _coreUtil.isDesignMode)()) {
262
- (0, _storeUtil.setMagicStore)("groupBuy_" + (window.magicDesign.pageId || '') + "_" + this.props.panelProps.id, res.pageInfo.list);
265
+ (0, _storeUtil.setMagicStore)("groupBuy_" + (window.magicDesign.pageId || '') + "_" + this.props.panelProps.id, (_a = res.pageInfo) === null || _a === void 0 ? void 0 : _a.list);
263
266
  }
264
267
 
265
268
  this.setState({
266
- list: res.pageInfo.list
269
+ list: (_b = res.pageInfo) === null || _b === void 0 ? void 0 : _b.list
267
270
  });
268
271
  return [2
269
272
  /*return*/
@@ -304,7 +304,13 @@ var getDefaultJSON = function getDefaultJSON() {
304
304
  opacity: 100,
305
305
  color: '#fff',
306
306
  image: '',
307
- bgType: 'color'
307
+ bgType: 'color',
308
+ tabBackground: {
309
+ opacity: 100,
310
+ color: '#fff',
311
+ image: '',
312
+ tabBgType: 'color'
313
+ }
308
314
  }
309
315
  };
310
316
  };
@@ -587,10 +587,26 @@ function (_super) {
587
587
  }, 140);
588
588
  if (layout === 'layout1' && contentWidth) imgHeight = (contentWidth - 12) / 2;
589
589
  if (layout === 'layout3' && contentWidth) imgHeight = (contentWidth - 12 * 2) / 3;
590
+ var background = panelProps.background.tabBackground;
591
+ var tabStyle = {};
592
+
593
+ if (background) {
594
+ if (background.tabBgType === 'color') {
595
+ tabStyle.backgroundColor = background.color;
596
+ tabStyle.opacity = background.opacity ? background.opacity : 1;
597
+ } else {
598
+ tabStyle.backgroundImage = "url(" + background.image + ")";
599
+ tabStyle.backgroundPosition = 'center center';
600
+ tabStyle.backgroundSize = 'cover';
601
+ tabStyle.backgroundRepeat = 'no-repeat';
602
+ }
603
+ }
604
+
590
605
  return /*#__PURE__*/_react["default"].createElement("div", {
591
606
  className: "m-recommend-mobile recommend_" + panelProps.id
592
607
  }, !hideTabs && /*#__PURE__*/_react["default"].createElement("div", {
593
- className: "tab-select-wrap"
608
+ className: "tab-select-wrap",
609
+ style: tabStyle
594
610
  }, groupSource.map(function (tab, index) {
595
611
  var _image = index == tabIndex && tab.hover.open && tab.hover.image.open ? tab.hover.image : tab.image;
596
612
 
@@ -65,7 +65,7 @@
65
65
  align-items: flex-start;
66
66
  }
67
67
  .m-recommend-mobile .scrollContainer .scrollProductList .productCard {
68
- margin-right: 0.24rem;
68
+ margin-right: 0.16rem;
69
69
  }
70
70
  .m-recommend-mobile .btnSeeAll {
71
71
  display: block;
@@ -74,3 +74,15 @@
74
74
  margin: 0 auto;
75
75
  flex: none;
76
76
  }
77
+ .m-recommend-mobile .m-product-item-wrap {
78
+ border-radius: 0.16rem;
79
+ }
80
+ .m-recommend-mobile .m-product-item-wrap .img-wrap .product-img {
81
+ border-radius: 0.16rem 0.16rem 0 0;
82
+ }
83
+ .m-recommend-mobile .m-product-item-wrap.horizontal .img-wrap .product-img {
84
+ border-radius: 0.16rem 0 0 0.16rem;
85
+ }
86
+ .m-recommend-mobile .scrollContainer .m-product-item-wrap {
87
+ border: none;
88
+ }
@@ -124,6 +124,7 @@ function (_super) {
124
124
  key: '5',
125
125
  name: (0, _locale.i18n)('BACKGROUND'),
126
126
  value: /*#__PURE__*/_react["default"].createElement(_BackgroundConfig["default"], {
127
+ component: "recommend",
127
128
  data: data.background
128
129
  })
129
130
  }],
@@ -386,6 +386,8 @@ function (_super) {
386
386
 
387
387
  _this.closeConfigPanel();
388
388
 
389
+ window.magicDesign.device = device;
390
+
389
391
  _this.setState(__assign(__assign({}, _this.state), {
390
392
  device: device
391
393
  }));
@@ -395,8 +397,6 @@ function (_super) {
395
397
  _mobx.store.setState({
396
398
  clickedFloor: ''
397
399
  });
398
-
399
- window.magicDesign.device = device;
400
400
  };
401
401
 
402
402
  _this.onAdd = function () {
@@ -15,6 +15,10 @@ var _constants = require("../constants");
15
15
 
16
16
  var _commonUtil = require("../utils/commonUtil");
17
17
 
18
+ var _storeUtil = require("../utils/storeUtil");
19
+
20
+ var _common = require("../common");
21
+
18
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
23
 
20
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -84,8 +88,27 @@ function compositeDecorator(WrappedComponent) {
84
88
  _this.state = {
85
89
  clickedFloor: '',
86
90
  hoveredFloor: ''
91
+ };
92
+
93
+ _this.switchLanguage = function (value) {
94
+ // const lang = 'ar';
95
+ (0, _storeUtil.setStore)(STORAGE_KEY.LOCALE, value); // 实时更新问题待优化;
96
+ };
97
+
98
+ _this.getUserAddress = function (value) {
99
+ // const info = {
100
+ // address: '简短地址',
101
+ // customer: '客户名称',
102
+ // tel: '客户手机号',
103
+ // longitude: '经度',
104
+ // latitude: '纬度',
105
+ // };
106
+ _mobx.store.setState({
107
+ locationInfo: value || {}
108
+ });
87
109
  }; // 复合组件点击事件
88
110
 
111
+
89
112
  _this.onCompositeCompClick = function (event) {
90
113
  if (window.magicDesign.mode === 'renderer') {
91
114
  return;
@@ -274,7 +297,7 @@ function compositeDecorator(WrappedComponent) {
274
297
  };
275
298
 
276
299
  Wrapper.prototype.render = function () {
277
- var _a;
300
+ var _a, _b;
278
301
 
279
302
  var nodeData = this.props.nodeData;
280
303
  var clickedFloor = this.state.clickedFloor;
@@ -291,7 +314,9 @@ function compositeDecorator(WrappedComponent) {
291
314
  style: floorNameStyle
292
315
  }, (_a = _constants.compInfoMap[nodeData.type]) === null || _a === void 0 ? void 0 : _a.name)), /*#__PURE__*/_react["default"].createElement("div", {
293
316
  style: (0, _commonUtil.pxToRem)(this.getWrapStyle())
294
- }, /*#__PURE__*/_react["default"].createElement(WrappedComponent, this.props)));
317
+ }, /*#__PURE__*/_react["default"].createElement(_common.ErrorBoundary, {
318
+ name: (_b = _constants.compInfoMap[nodeData.type]) === null || _b === void 0 ? void 0 : _b.name
319
+ }, /*#__PURE__*/_react["default"].createElement(WrappedComponent, this.props))));
295
320
  };
296
321
 
297
322
  Wrapper.getDefaultJSON = WrappedComponent.getDefaultJSON;
@@ -1,4 +1,6 @@
1
1
  {
2
+ "TAB_BACKGROUND": "Tab Background",
3
+ "PRODUCT_BACKGROUND": "Product Background",
2
4
  "MISSION_NAME": "Mission Name",
3
5
  "COUNT_DOWN": "Count Down",
4
6
  "SEARCH_BAR_PLACEHOLDER": "Search Bar Placeholder",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "TAB_BACKGROUND": "Tab Background",
3
+ "PRODUCT_BACKGROUND": "Product Background",
2
4
  "MISSION_NAME": "Mission Name",
3
5
  "COUNT_DOWN": "Count Down",
4
6
  "SEARCH_BAR_PLACEHOLDER": "Search Bar Placeholder",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "TAB_BACKGROUND": "Tab Background",
3
+ "PRODUCT_BACKGROUND": "Product Background",
2
4
  "MISSION_NAME": "Mission Name",
3
5
  "COUNT_DOWN": "Count Down",
4
6
  "SEARCH_BAR_PLACEHOLDER": "Search Bar Placeholder",
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+
16
+ var __extends = void 0 && (void 0).__extends || function () {
17
+ var _extendStatics = function extendStatics(d, b) {
18
+ _extendStatics = Object.setPrototypeOf || {
19
+ __proto__: []
20
+ } instanceof Array && function (d, b) {
21
+ d.__proto__ = b;
22
+ } || function (d, b) {
23
+ for (var p in b) {
24
+ if (b.hasOwnProperty(p)) d[p] = b[p];
25
+ }
26
+ };
27
+
28
+ return _extendStatics(d, b);
29
+ };
30
+
31
+ return function (d, b) {
32
+ _extendStatics(d, b);
33
+
34
+ function __() {
35
+ this.constructor = d;
36
+ }
37
+
38
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
39
+ };
40
+ }();
41
+
42
+ var ErrorBoundary =
43
+ /** @class */
44
+ function (_super) {
45
+ __extends(ErrorBoundary, _super);
46
+
47
+ function ErrorBoundary(props) {
48
+ var _this = _super.call(this, props) || this;
49
+
50
+ _this.state = {
51
+ hasError: false
52
+ };
53
+ return _this;
54
+ }
55
+
56
+ ErrorBoundary.getDerivedStateFromError = function (error) {
57
+ // 更新 state 以触发备用 UI 渲染
58
+ return {
59
+ hasError: true
60
+ };
61
+ };
62
+
63
+ ErrorBoundary.prototype.componentDidCatch = function (error, errorInfo) {
64
+ // 可以在这里将错误信息发送给日志系统
65
+ console.error('Error caught by ErrorBoundary:', error, errorInfo);
66
+ };
67
+
68
+ ErrorBoundary.prototype.render = function () {
69
+ if (this.state.hasError) {
70
+ // 自定义错误 UI
71
+ if (window.magicDesign.mode === 'renderer') {
72
+ return null;
73
+ }
74
+
75
+ return /*#__PURE__*/_react["default"].createElement("div", {
76
+ style: {
77
+ textAlign: 'center',
78
+ padding: '10px'
79
+ }
80
+ }, /*#__PURE__*/_react["default"].createElement("h2", null, this.props.name, " Components updated"), /*#__PURE__*/_react["default"].createElement("p", null, "Please delete the component and add it again!"));
81
+ }
82
+
83
+ return this.props.children;
84
+ };
85
+
86
+ return ErrorBoundary;
87
+ }(_react.Component);
88
+
89
+ var _default = ErrorBoundary;
90
+ exports["default"] = _default;
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "CropperModal", {
45
45
  return _CropperModal["default"];
46
46
  }
47
47
  });
48
+ Object.defineProperty(exports, "ErrorBoundary", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _ErrorBoundary["default"];
52
+ }
53
+ });
48
54
  Object.defineProperty(exports, "Field", {
49
55
  enumerable: true,
50
56
  get: function get() {
@@ -204,4 +210,6 @@ var _CropperModal = _interopRequireDefault(require("./CropperModal"));
204
210
 
205
211
  var _NewImg = _interopRequireDefault(require("./NewImg"));
206
212
 
213
+ var _ErrorBoundary = _interopRequireDefault(require("./ErrorBoundary"));
214
+
207
215
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -163,7 +163,7 @@ function (_super) {
163
163
  return onItemClick();
164
164
  },
165
165
  style: {
166
- width: imgWidth + 2
166
+ width: imgWidth
167
167
  }
168
168
  }, rest), /*#__PURE__*/_react["default"].createElement("div", {
169
169
  className: "img-wrap"
@@ -58,9 +58,23 @@ function (_super) {
58
58
  BackgroundConfig.prototype.render = function () {
59
59
  var _this = this;
60
60
 
61
- var data = this.props.data;
61
+ var _a, _b, _c, _d, _e;
62
+
63
+ var _f = this.props,
64
+ data = _f.data,
65
+ component = _f.component;
66
+
67
+ if (!data.tabBackground) {
68
+ data.tabBackground = {
69
+ opacity: 100,
70
+ color: '#232F46',
71
+ image: '',
72
+ tabBgType: 'color'
73
+ };
74
+ }
75
+
62
76
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
63
- title: (0, _locale.i18n)('BACKGROUND')
77
+ title: component === 'recommend' ? (0, _locale.i18n)('PRODUCT_BACKGROUND') : (0, _locale.i18n)('BACKGROUND')
64
78
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
65
79
  onChange: function onChange(bgType) {
66
80
  data.bgType = bgType;
@@ -101,6 +115,48 @@ function (_super) {
101
115
  _this.selfRender();
102
116
  },
103
117
  value: data.image
118
+ })), component === 'recommend' && /*#__PURE__*/_react["default"].createElement(_common.Field, {
119
+ title: (0, _locale.i18n)('TAB_BACKGROUND')
120
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
121
+ onChange: function onChange(tabBgType) {
122
+ data.tabBackground.tabBgType = tabBgType;
123
+
124
+ _this.selfRender();
125
+ },
126
+ style: {
127
+ marginBottom: '15px'
128
+ },
129
+ value: (_a = data.tabBackground) === null || _a === void 0 ? void 0 : _a.tabBgType
130
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
131
+ value: "color"
132
+ }, (0, _locale.i18n)('COLOR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
133
+ value: "image"
134
+ }, (0, _locale.i18n)('IMAGE'))), ((_b = data.tabBackground) === null || _b === void 0 ? void 0 : _b.tabBgType) === 'color' ? /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
135
+ colorType: "rgba",
136
+ onChange: function onChange(v) {
137
+ data.tabBackground.opacity = 1;
138
+ data.tabBackground.color = v;
139
+
140
+ _this.selfRender();
141
+ },
142
+ value: (_c = data.tabBackground) === null || _c === void 0 ? void 0 : _c.color
143
+ }) : /*#__PURE__*/_react["default"].createElement(_common.ImagePicker, {
144
+ imageSelectedWay: ((_d = data.tabBackground) === null || _d === void 0 ? void 0 : _d.imageSelectedWay) || {
145
+ pc: '',
146
+ mobile: ''
147
+ },
148
+ onChange: function onChange(v, way) {
149
+ if (v) {
150
+ data.tabBackground.image = v.url;
151
+ }
152
+
153
+ if (way) {
154
+ data.tabBackground.imageSelectedWay = way;
155
+ }
156
+
157
+ _this.selfRender();
158
+ },
159
+ value: (_e = data.tabBackground) === null || _e === void 0 ? void 0 : _e.image
104
160
  })));
105
161
  };
106
162
 
@@ -109,7 +165,13 @@ function (_super) {
109
165
  opacity: 100,
110
166
  color: '#232F46',
111
167
  image: '',
112
- bgType: 'color'
168
+ bgType: 'color',
169
+ tabBackground: {
170
+ opacity: 100,
171
+ color: '#232F46',
172
+ image: '',
173
+ tabBgType: 'color'
174
+ }
113
175
  }
114
176
  };
115
177
  return BackgroundConfig;
@@ -551,7 +551,7 @@ function (_super) {
551
551
  if (layout === 'layout1' && contentWidth) imgHeight = (contentWidth - 12) / 2;
552
552
  if (layout === 'layout3' && contentWidth) imgHeight = (contentWidth - 12 * 2) / 3;
553
553
  return /*#__PURE__*/_react["default"].createElement("div", {
554
- className: "m-recommend-mobile recommend_" + panelProps.id
554
+ className: "m-affiliate-recommend-mobile recommend_" + panelProps.id
555
555
  }, !hideTabs && /*#__PURE__*/_react["default"].createElement("div", {
556
556
  className: "tab-select-wrap"
557
557
  }, groupSource.map(function (tab, index) {
@@ -1,16 +1,16 @@
1
- .m-recommend-mobile {
1
+ .m-affiliate-recommend-mobile {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  }
5
- .m-recommend-mobile .cylon-tabs-nav-operations {
5
+ .m-affiliate-recommend-mobile .cylon-tabs-nav-operations {
6
6
  display: none !important;
7
7
  }
8
- .m-recommend-mobile ::-webkit-scrollbar {
8
+ .m-affiliate-recommend-mobile ::-webkit-scrollbar {
9
9
  width: 0;
10
10
  height: 0;
11
11
  display: none;
12
12
  }
13
- .m-recommend-mobile .tab-select-wrap {
13
+ .m-affiliate-recommend-mobile .tab-select-wrap {
14
14
  display: flex;
15
15
  align-items: center;
16
16
  height: 1rem;
@@ -19,7 +19,7 @@
19
19
  position: relative;
20
20
  margin-bottom: 0.3rem;
21
21
  }
22
- .m-recommend-mobile .tab-select-wrap .tabTitle {
22
+ .m-affiliate-recommend-mobile .tab-select-wrap .tabTitle {
23
23
  display: flex;
24
24
  align-items: center;
25
25
  text-align: center;
@@ -30,12 +30,12 @@
30
30
  white-space: nowrap;
31
31
  flex-direction: column;
32
32
  }
33
- .m-recommend-mobile .tab-select-wrap .tabTitle img {
33
+ .m-affiliate-recommend-mobile .tab-select-wrap .tabTitle img {
34
34
  height: 0.4rem;
35
35
  width: 0.4rem;
36
36
  margin-bottom: 0.04rem;
37
37
  }
38
- .m-recommend-mobile .tab-select-wrap .active-line {
38
+ .m-affiliate-recommend-mobile .tab-select-wrap .active-line {
39
39
  position: absolute;
40
40
  bottom: 0;
41
41
  width: 4rem;
@@ -44,11 +44,11 @@
44
44
  transition: 0.2s all linear;
45
45
  border-radius: 0.03rem;
46
46
  }
47
- .m-recommend-mobile .macyContainer {
47
+ .m-affiliate-recommend-mobile .macyContainer {
48
48
  display: flex;
49
49
  margin: 0 0.32rem;
50
50
  }
51
- .m-recommend-mobile .scrollContainer {
51
+ .m-affiliate-recommend-mobile .scrollContainer {
52
52
  display: flex;
53
53
  flex-direction: row;
54
54
  align-items: center;
@@ -56,26 +56,26 @@
56
56
  overflow-x: auto;
57
57
  padding-bottom: 0.3rem;
58
58
  }
59
- .m-recommend-mobile .scrollContainer.pl_140 {
59
+ .m-affiliate-recommend-mobile .scrollContainer.pl_140 {
60
60
  padding-left: 2.8rem;
61
61
  }
62
- .m-recommend-mobile .scrollContainer .scrollProductList {
62
+ .m-affiliate-recommend-mobile .scrollContainer .scrollProductList {
63
63
  display: flex;
64
64
  flex-direction: row;
65
65
  align-items: flex-start;
66
66
  }
67
- .m-recommend-mobile .scrollContainer .scrollProductList .productCard {
67
+ .m-affiliate-recommend-mobile .scrollContainer .scrollProductList .productCard {
68
68
  margin-right: 0.24rem;
69
69
  }
70
- .m-recommend-mobile .scrollContainer .scrollProductListRow {
70
+ .m-affiliate-recommend-mobile .scrollContainer .scrollProductListRow {
71
71
  display: flex;
72
72
  flex-direction: row;
73
73
  align-items: flex-start;
74
74
  }
75
- .m-recommend-mobile .scrollContainer .scrollProductListRow .productCardRow {
75
+ .m-affiliate-recommend-mobile .scrollContainer .scrollProductListRow .productCardRow {
76
76
  margin-right: 0.16rem;
77
77
  }
78
- .m-recommend-mobile .btnSeeAll {
78
+ .m-affiliate-recommend-mobile .btnSeeAll {
79
79
  display: block;
80
80
  width: fit-content;
81
81
  min-width: 1.6rem;
@@ -78,10 +78,12 @@
78
78
  .m-flash-deal-mobile .flash-deal-list-vertical .m-product-item-wrap {
79
79
  width: 2.44rem;
80
80
  margin-right: 0.16rem;
81
+ border-radius: 0.16rem;
81
82
  }
82
83
  .m-flash-deal-mobile .flash-deal-list-vertical .m-product-item-wrap .product-img {
83
84
  height: 2.4rem;
84
85
  width: 2.4rem;
86
+ border-radius: 0.16rem 0.16rem 0 0;
85
87
  }
86
88
  .m-flash-deal-mobile .flash-deal-list-horizontal {
87
89
  display: flex;
@@ -92,6 +94,10 @@
92
94
  }
93
95
  .m-flash-deal-mobile .flash-deal-list-horizontal .m-product-item-wrap {
94
96
  width: 100%;
97
+ border-radius: 0.16rem;
98
+ }
99
+ .m-flash-deal-mobile .flash-deal-list-horizontal .m-product-item-wrap .product-img {
100
+ border-radius: 0.16rem 0 0 0.16rem;
95
101
  }
96
102
  .m-flash-deal-mobile .flash-deal-list-horizontal .m-product-item-wrap .content-wrap {
97
103
  flex: 1;
@@ -246,8 +246,11 @@ function (_super) {
246
246
  _this.getData = function () {
247
247
  return __awaiter(_this, void 0, void 0, function () {
248
248
  var res;
249
- return __generator(this, function (_a) {
250
- switch (_a.label) {
249
+
250
+ var _a, _b;
251
+
252
+ return __generator(this, function (_c) {
253
+ switch (_c.label) {
251
254
  case 0:
252
255
  return [4
253
256
  /*yield*/
@@ -256,14 +259,14 @@ function (_super) {
256
259
  }, 'GET')];
257
260
 
258
261
  case 1:
259
- res = _a.sent();
262
+ res = _c.sent();
260
263
 
261
264
  if (!(0, _coreUtil.isDesignMode)()) {
262
- (0, _storeUtil.setMagicStore)("groupBuy_" + (window.magicDesign.pageId || '') + "_" + this.props.panelProps.id, res.pageInfo.list);
265
+ (0, _storeUtil.setMagicStore)("groupBuy_" + (window.magicDesign.pageId || '') + "_" + this.props.panelProps.id, (_a = res.pageInfo) === null || _a === void 0 ? void 0 : _a.list);
263
266
  }
264
267
 
265
268
  this.setState({
266
- list: res.pageInfo.list
269
+ list: (_b = res.pageInfo) === null || _b === void 0 ? void 0 : _b.list
267
270
  });
268
271
  return [2
269
272
  /*return*/
@@ -304,7 +304,13 @@ var getDefaultJSON = function getDefaultJSON() {
304
304
  opacity: 100,
305
305
  color: '#fff',
306
306
  image: '',
307
- bgType: 'color'
307
+ bgType: 'color',
308
+ tabBackground: {
309
+ opacity: 100,
310
+ color: '#fff',
311
+ image: '',
312
+ tabBgType: 'color'
313
+ }
308
314
  }
309
315
  };
310
316
  };
@@ -587,10 +587,26 @@ function (_super) {
587
587
  }, 140);
588
588
  if (layout === 'layout1' && contentWidth) imgHeight = (contentWidth - 12) / 2;
589
589
  if (layout === 'layout3' && contentWidth) imgHeight = (contentWidth - 12 * 2) / 3;
590
+ var background = panelProps.background.tabBackground;
591
+ var tabStyle = {};
592
+
593
+ if (background) {
594
+ if (background.tabBgType === 'color') {
595
+ tabStyle.backgroundColor = background.color;
596
+ tabStyle.opacity = background.opacity ? background.opacity : 1;
597
+ } else {
598
+ tabStyle.backgroundImage = "url(" + background.image + ")";
599
+ tabStyle.backgroundPosition = 'center center';
600
+ tabStyle.backgroundSize = 'cover';
601
+ tabStyle.backgroundRepeat = 'no-repeat';
602
+ }
603
+ }
604
+
590
605
  return /*#__PURE__*/_react["default"].createElement("div", {
591
606
  className: "m-recommend-mobile recommend_" + panelProps.id
592
607
  }, !hideTabs && /*#__PURE__*/_react["default"].createElement("div", {
593
- className: "tab-select-wrap"
608
+ className: "tab-select-wrap",
609
+ style: tabStyle
594
610
  }, groupSource.map(function (tab, index) {
595
611
  var _image = index == tabIndex && tab.hover.open && tab.hover.image.open ? tab.hover.image : tab.image;
596
612
 
@@ -65,7 +65,7 @@
65
65
  align-items: flex-start;
66
66
  }
67
67
  .m-recommend-mobile .scrollContainer .scrollProductList .productCard {
68
- margin-right: 0.24rem;
68
+ margin-right: 0.16rem;
69
69
  }
70
70
  .m-recommend-mobile .btnSeeAll {
71
71
  display: block;
@@ -74,3 +74,15 @@
74
74
  margin: 0 auto;
75
75
  flex: none;
76
76
  }
77
+ .m-recommend-mobile .m-product-item-wrap {
78
+ border-radius: 0.16rem;
79
+ }
80
+ .m-recommend-mobile .m-product-item-wrap .img-wrap .product-img {
81
+ border-radius: 0.16rem 0.16rem 0 0;
82
+ }
83
+ .m-recommend-mobile .m-product-item-wrap.horizontal .img-wrap .product-img {
84
+ border-radius: 0.16rem 0 0 0.16rem;
85
+ }
86
+ .m-recommend-mobile .scrollContainer .m-product-item-wrap {
87
+ border: none;
88
+ }
@@ -124,6 +124,7 @@ function (_super) {
124
124
  key: '5',
125
125
  name: (0, _locale.i18n)('BACKGROUND'),
126
126
  value: /*#__PURE__*/_react["default"].createElement(_BackgroundConfig["default"], {
127
+ component: "recommend",
127
128
  data: data.background
128
129
  })
129
130
  }],
@@ -386,6 +386,8 @@ function (_super) {
386
386
 
387
387
  _this.closeConfigPanel();
388
388
 
389
+ window.magicDesign.device = device;
390
+
389
391
  _this.setState(__assign(__assign({}, _this.state), {
390
392
  device: device
391
393
  }));
@@ -395,8 +397,6 @@ function (_super) {
395
397
  _mobx.store.setState({
396
398
  clickedFloor: ''
397
399
  });
398
-
399
- window.magicDesign.device = device;
400
400
  };
401
401
 
402
402
  _this.onAdd = function () {
@@ -15,6 +15,10 @@ var _constants = require("../constants");
15
15
 
16
16
  var _commonUtil = require("../utils/commonUtil");
17
17
 
18
+ var _storeUtil = require("../utils/storeUtil");
19
+
20
+ var _common = require("../common");
21
+
18
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
23
 
20
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -84,8 +88,27 @@ function compositeDecorator(WrappedComponent) {
84
88
  _this.state = {
85
89
  clickedFloor: '',
86
90
  hoveredFloor: ''
91
+ };
92
+
93
+ _this.switchLanguage = function (value) {
94
+ // const lang = 'ar';
95
+ (0, _storeUtil.setStore)(STORAGE_KEY.LOCALE, value); // 实时更新问题待优化;
96
+ };
97
+
98
+ _this.getUserAddress = function (value) {
99
+ // const info = {
100
+ // address: '简短地址',
101
+ // customer: '客户名称',
102
+ // tel: '客户手机号',
103
+ // longitude: '经度',
104
+ // latitude: '纬度',
105
+ // };
106
+ _mobx.store.setState({
107
+ locationInfo: value || {}
108
+ });
87
109
  }; // 复合组件点击事件
88
110
 
111
+
89
112
  _this.onCompositeCompClick = function (event) {
90
113
  if (window.magicDesign.mode === 'renderer') {
91
114
  return;
@@ -274,7 +297,7 @@ function compositeDecorator(WrappedComponent) {
274
297
  };
275
298
 
276
299
  Wrapper.prototype.render = function () {
277
- var _a;
300
+ var _a, _b;
278
301
 
279
302
  var nodeData = this.props.nodeData;
280
303
  var clickedFloor = this.state.clickedFloor;
@@ -291,7 +314,9 @@ function compositeDecorator(WrappedComponent) {
291
314
  style: floorNameStyle
292
315
  }, (_a = _constants.compInfoMap[nodeData.type]) === null || _a === void 0 ? void 0 : _a.name)), /*#__PURE__*/_react["default"].createElement("div", {
293
316
  style: (0, _commonUtil.pxToRem)(this.getWrapStyle())
294
- }, /*#__PURE__*/_react["default"].createElement(WrappedComponent, this.props)));
317
+ }, /*#__PURE__*/_react["default"].createElement(_common.ErrorBoundary, {
318
+ name: (_b = _constants.compInfoMap[nodeData.type]) === null || _b === void 0 ? void 0 : _b.name
319
+ }, /*#__PURE__*/_react["default"].createElement(WrappedComponent, this.props))));
295
320
  };
296
321
 
297
322
  Wrapper.getDefaultJSON = WrappedComponent.getDefaultJSON;
@@ -1,4 +1,6 @@
1
1
  {
2
+ "TAB_BACKGROUND": "Tab Background",
3
+ "PRODUCT_BACKGROUND": "Product Background",
2
4
  "MISSION_NAME": "Mission Name",
3
5
  "COUNT_DOWN": "Count Down",
4
6
  "SEARCH_BAR_PLACEHOLDER": "Search Bar Placeholder",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "TAB_BACKGROUND": "Tab Background",
3
+ "PRODUCT_BACKGROUND": "Product Background",
2
4
  "MISSION_NAME": "Mission Name",
3
5
  "COUNT_DOWN": "Count Down",
4
6
  "SEARCH_BAR_PLACEHOLDER": "Search Bar Placeholder",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "TAB_BACKGROUND": "Tab Background",
3
+ "PRODUCT_BACKGROUND": "Product Background",
2
4
  "MISSION_NAME": "Mission Name",
3
5
  "COUNT_DOWN": "Count Down",
4
6
  "SEARCH_BAR_PLACEHOLDER": "Search Bar Placeholder",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.109",
4
+ "version": "1.0.111",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",