@fonixtree/magic-design 2.0.89 → 2.0.91

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 (31) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/common/LinkModal/index.js +8 -5
  3. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.js +7 -1
  4. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.less +3 -3
  5. package/es/composite-comp/dito/components/Orders/mobile/index.js +6 -1
  6. package/es/composite-comp/dito/components/Orders/mobile/index.less +5 -1
  7. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.js +6 -1
  8. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.less +7 -5
  9. package/es/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  10. package/es/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  11. package/es/constants/index.js +1 -0
  12. package/es/decorator/index.js +4 -1
  13. package/es/utils/businessUtil.js +12 -0
  14. package/es/utils/commonUtil.js +6 -4
  15. package/es/utils/coreUtil.js +3 -8
  16. package/lib/assets/fonts/.DS_Store +0 -0
  17. package/lib/common/LinkModal/index.js +8 -5
  18. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.js +7 -1
  19. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.less +3 -3
  20. package/lib/composite-comp/dito/components/Orders/mobile/index.js +6 -1
  21. package/lib/composite-comp/dito/components/Orders/mobile/index.less +5 -1
  22. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.js +6 -1
  23. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.less +7 -5
  24. package/lib/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  25. package/lib/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  26. package/lib/constants/index.js +1 -0
  27. package/lib/decorator/index.js +4 -1
  28. package/lib/utils/businessUtil.js +12 -0
  29. package/lib/utils/commonUtil.js +6 -4
  30. package/lib/utils/coreUtil.js +3 -8
  31. package/package.json +1 -1
Binary file
@@ -234,7 +234,7 @@ var LinkModal = function LinkModal(props) {
234
234
 
235
235
  var getLinkTypes = function getLinkTypes() {
236
236
  return __awaiter(void 0, void 0, void 0, function () {
237
- var types, type;
237
+ var types, type_1;
238
238
  return __generator(this, function (_a) {
239
239
  switch (_a.label) {
240
240
  case 0:
@@ -248,12 +248,15 @@ var LinkModal = function LinkModal(props) {
248
248
  types = _a.sent();
249
249
 
250
250
  if (onlySpecificCode) {
251
- type = types.filter(function (item) {
252
- return item.linkTypeCode === onlySpecificCode;
251
+ type_1 = [];
252
+ onlySpecificCode.forEach(function (code) {
253
+ type_1.push(types.find(function (item) {
254
+ return item.linkTypeCode === code;
255
+ }));
253
256
  });
254
257
 
255
- if (type.length > 0) {
256
- types = type;
258
+ if (type_1.length > 0) {
259
+ types = type_1;
257
260
  }
258
261
  }
259
262
 
@@ -79,9 +79,15 @@ function (_super) {
79
79
  onClick: function onClick() {
80
80
  return _this.onItemClick(item);
81
81
  }
82
- }, /*#__PURE__*/_react["default"].createElement("div", null, item.image.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
82
+ }, /*#__PURE__*/_react["default"].createElement("div", {
83
+ className: "content-wrap",
84
+ style: {
85
+ pointerEvents: window.magicDesign.mode == 'designer' ? 'auto' : 'none'
86
+ }
87
+ }, item.image.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
83
88
  className: "img",
84
89
  data: item.image,
90
+ disabled: true,
85
91
  maxWidth: "100%"
86
92
  }), item.title.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
87
93
  className: "title",
@@ -14,16 +14,16 @@
14
14
  justify-content: space-between;
15
15
  align-items: center;
16
16
  }
17
- .common-functions-mobile ul li > div {
17
+ .common-functions-mobile ul li .content-wrap {
18
18
  display: flex;
19
19
  align-items: center;
20
20
  }
21
- .common-functions-mobile ul li > div .img {
21
+ .common-functions-mobile ul li .content-wrap .img {
22
22
  width: 0.56rem;
23
23
  height: 0.56rem;
24
24
  margin-right: 0.08rem;
25
25
  }
26
- .common-functions-mobile ul li > div .title {
26
+ .common-functions-mobile ul li .content-wrap .title {
27
27
  font-size: 0.28rem;
28
28
  font-weight: 500;
29
29
  line-height: 0.4rem;
@@ -323,6 +323,11 @@ function (_super) {
323
323
  onClick: function onClick() {
324
324
  return _this.onItemClick(item.sourceType);
325
325
  }
326
+ }, /*#__PURE__*/_react["default"].createElement("div", {
327
+ className: "content-wrap",
328
+ style: {
329
+ pointerEvents: window.magicDesign.mode == 'designer' ? 'auto' : 'none'
330
+ }
326
331
  }, /*#__PURE__*/_react["default"].createElement("div", {
327
332
  className: "img-wrap"
328
333
  }, item.image.open && _this.getImageHtml(item)), item.title.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
@@ -331,7 +336,7 @@ function (_super) {
331
336
  onTextInput: function onTextInput(text) {
332
337
  item.title.text = text;
333
338
  }
334
- }));
339
+ })));
335
340
  }))));
336
341
  };
337
342
 
@@ -44,11 +44,15 @@
44
44
  margin-bottom: 0.02rem;
45
45
  }
46
46
  .orders-mobile .fixed-wrap .list .item {
47
+ display: flex;
48
+ flex: 1 1;
49
+ }
50
+ .orders-mobile .fixed-wrap .list .item .content-wrap {
51
+ width: 100%;
47
52
  display: flex;
48
53
  flex-direction: column;
49
54
  justify-content: center;
50
55
  align-items: center;
51
- flex: 1;
52
56
  }
53
57
  .orders-mobile .fixed-wrap .list .item .img-wrap {
54
58
  position: relative;
@@ -551,6 +551,11 @@ function (_super) {
551
551
  onClick: function onClick() {
552
552
  return _this.onItemClick(item.sourceType);
553
553
  }
554
+ }, /*#__PURE__*/_react["default"].createElement("div", {
555
+ className: "content-wrap",
556
+ style: {
557
+ pointerEvents: window.magicDesign.mode == 'designer' ? 'auto' : 'none'
558
+ }
554
559
  }, item.number.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
555
560
  className: "number",
556
561
  data: __assign(__assign({}, item.number), {
@@ -563,7 +568,7 @@ function (_super) {
563
568
  onTextInput: function onTextInput(text) {
564
569
  item.title.text = text;
565
570
  }
566
- }));
571
+ })));
567
572
  })), editImgModalVisible && /*#__PURE__*/_react["default"].createElement(_common.CropperModal, {
568
573
  onClose: function onClose() {
569
574
  _this.setState({
@@ -96,11 +96,6 @@
96
96
  margin-top: 0.48rem;
97
97
  }
98
98
  .personal-information-mobile .bottom .item {
99
- display: flex;
100
- flex-direction: column;
101
- justify-content: flex-start;
102
- align-items: center;
103
- flex: 1;
104
99
  position: relative;
105
100
  }
106
101
  .personal-information-mobile .bottom .item:after {
@@ -116,6 +111,13 @@
116
111
  .personal-information-mobile .bottom .item:last-child:after {
117
112
  display: none;
118
113
  }
114
+ .personal-information-mobile .bottom .item .content-wrap {
115
+ display: flex;
116
+ flex-direction: column;
117
+ justify-content: flex-start;
118
+ align-items: center;
119
+ flex: 1;
120
+ }
119
121
  .personal-information-mobile .bottom .item .number {
120
122
  width: 70% !important;
121
123
  font-size: 0.36rem;
@@ -71,7 +71,7 @@ function (_super) {
71
71
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
72
72
  data: panelProps.image,
73
73
  needHover: false,
74
- onlySpecificCode: "FunctionPage"
74
+ onlySpecificCode: ['CustomizedPage', 'FunctionPage']
75
75
  }),
76
76
  metaOption: panelProps.image
77
77
  }];
@@ -71,7 +71,7 @@ function (_super) {
71
71
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
72
72
  data: panelProps.image,
73
73
  needClickArea: false,
74
- onlySpecificCode: "FunctionPage"
74
+ onlySpecificCode: ['CustomizedPage', 'FunctionPage']
75
75
  }),
76
76
  metaOption: panelProps.image
77
77
  }];
@@ -84,6 +84,7 @@ var urlTypeMap = {
84
84
  MINI_APP: 'MiniApp',
85
85
  STORE: 'Store',
86
86
  AFFILIATE_PRODUCT: 'AffiliateProduct',
87
+ AFFILIATE_STORE: 'AffiliateStore',
87
88
  ANCHOR: 'Anchor'
88
89
  };
89
90
  exports.urlTypeMap = urlTypeMap;
@@ -55,11 +55,14 @@ function shouldUpdate() {
55
55
  descriptor.value = function (nextProps, nextState) {
56
56
  var nowPropsJson = JSON.stringify(nextProps);
57
57
  var nowStateJson = JSON.stringify(nextState);
58
+ var nowDevice = window.magicDesign.device;
58
59
  var should1 = nowPropsJson != this.preProps;
59
60
  var should2 = nowStateJson != this.preState;
61
+ var should3 = nowDevice != this.preDevice;
60
62
  this.preProps = nowPropsJson;
61
63
  this.preState = nowStateJson;
62
- var result = should1 || should2;
64
+ this.preDevice = nowDevice;
65
+ var result = should1 || should2 || should3;
63
66
  return result && fn.apply(this, {
64
67
  nextProps: nextProps
65
68
  });
@@ -182,6 +182,18 @@ var newParseUrl = function newParseUrl(urlObj) {
182
182
  };
183
183
  break;
184
184
 
185
+ case _constants.urlTypeMap.AFFILIATE_STORE:
186
+ // 分销店铺
187
+ link = "/storeDetail/" + value;
188
+ params = {
189
+ action: 'jump',
190
+ params: {
191
+ type: 'AFFILIATE_STORE',
192
+ url: value
193
+ }
194
+ };
195
+ break;
196
+
185
197
  default:
186
198
  var map = {
187
199
  '/main/cart': 'CART',
@@ -296,7 +296,9 @@ function commonFetch(url, data, method) {
296
296
  });
297
297
  }
298
298
 
299
- var navigateTo = function navigateTo(url) {
299
+ var navigateTo = function navigateTo(url, state) {
300
+ console.log('navigateTo', url);
301
+
300
302
  if (!url) {
301
303
  return;
302
304
  }
@@ -309,7 +311,7 @@ var navigateTo = function navigateTo(url) {
309
311
  if (!appUrl && !h5Url.startsWith('/')) {
310
312
  window.location.href = h5Url;
311
313
  } else if (window.magicDesign.history) {
312
- window.magicDesign.history.push(url);
314
+ window.magicDesign.history.push(url, state);
313
315
  } else if (window.magicDesign.navigatePreUrl) {
314
316
  // 预览模式跳转
315
317
  if (h5Url.startsWith('/')) {
@@ -748,8 +750,8 @@ function pushGA(data, eventName) {
748
750
  groupName: data.groupName,
749
751
  elementId: data.elementId,
750
752
  elementName: data.elementName
751
- };
752
- console.log('GA push', eventName, eventData);
753
+ }; // console.log('GA push', eventName, eventData);
754
+
753
755
  if (window.gtag) window.gtag('event', eventName, eventData);
754
756
  }
755
757
  } catch (error) {
@@ -320,14 +320,9 @@ var clickUrl = function clickUrl(url) {
320
320
  data = _b.data;
321
321
 
322
322
  var _c = data.params,
323
- params = _c === void 0 ? {} : _c;
324
- console.log('clicked data:', data);
325
- console.log({
326
- type: 'jumpBrowser',
327
- params: {
328
- url: params.link
329
- }
330
- });
323
+ params = _c === void 0 ? {} : _c; // console.log('clicked data:', data);
324
+ // console.log({ type: 'jumpBrowser', params: { url: params.link } });
325
+
331
326
  /** 锚点跳转 */
332
327
 
333
328
  if (params.type === 'ANCHOR') {
Binary file
@@ -234,7 +234,7 @@ var LinkModal = function LinkModal(props) {
234
234
 
235
235
  var getLinkTypes = function getLinkTypes() {
236
236
  return __awaiter(void 0, void 0, void 0, function () {
237
- var types, type;
237
+ var types, type_1;
238
238
  return __generator(this, function (_a) {
239
239
  switch (_a.label) {
240
240
  case 0:
@@ -248,12 +248,15 @@ var LinkModal = function LinkModal(props) {
248
248
  types = _a.sent();
249
249
 
250
250
  if (onlySpecificCode) {
251
- type = types.filter(function (item) {
252
- return item.linkTypeCode === onlySpecificCode;
251
+ type_1 = [];
252
+ onlySpecificCode.forEach(function (code) {
253
+ type_1.push(types.find(function (item) {
254
+ return item.linkTypeCode === code;
255
+ }));
253
256
  });
254
257
 
255
- if (type.length > 0) {
256
- types = type;
258
+ if (type_1.length > 0) {
259
+ types = type_1;
257
260
  }
258
261
  }
259
262
 
@@ -79,9 +79,15 @@ function (_super) {
79
79
  onClick: function onClick() {
80
80
  return _this.onItemClick(item);
81
81
  }
82
- }, /*#__PURE__*/_react["default"].createElement("div", null, item.image.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
82
+ }, /*#__PURE__*/_react["default"].createElement("div", {
83
+ className: "content-wrap",
84
+ style: {
85
+ pointerEvents: window.magicDesign.mode == 'designer' ? 'auto' : 'none'
86
+ }
87
+ }, item.image.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
83
88
  className: "img",
84
89
  data: item.image,
90
+ disabled: true,
85
91
  maxWidth: "100%"
86
92
  }), item.title.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
87
93
  className: "title",
@@ -14,16 +14,16 @@
14
14
  justify-content: space-between;
15
15
  align-items: center;
16
16
  }
17
- .common-functions-mobile ul li > div {
17
+ .common-functions-mobile ul li .content-wrap {
18
18
  display: flex;
19
19
  align-items: center;
20
20
  }
21
- .common-functions-mobile ul li > div .img {
21
+ .common-functions-mobile ul li .content-wrap .img {
22
22
  width: 0.56rem;
23
23
  height: 0.56rem;
24
24
  margin-right: 0.08rem;
25
25
  }
26
- .common-functions-mobile ul li > div .title {
26
+ .common-functions-mobile ul li .content-wrap .title {
27
27
  font-size: 0.28rem;
28
28
  font-weight: 500;
29
29
  line-height: 0.4rem;
@@ -323,6 +323,11 @@ function (_super) {
323
323
  onClick: function onClick() {
324
324
  return _this.onItemClick(item.sourceType);
325
325
  }
326
+ }, /*#__PURE__*/_react["default"].createElement("div", {
327
+ className: "content-wrap",
328
+ style: {
329
+ pointerEvents: window.magicDesign.mode == 'designer' ? 'auto' : 'none'
330
+ }
326
331
  }, /*#__PURE__*/_react["default"].createElement("div", {
327
332
  className: "img-wrap"
328
333
  }, item.image.open && _this.getImageHtml(item)), item.title.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
@@ -331,7 +336,7 @@ function (_super) {
331
336
  onTextInput: function onTextInput(text) {
332
337
  item.title.text = text;
333
338
  }
334
- }));
339
+ })));
335
340
  }))));
336
341
  };
337
342
 
@@ -44,11 +44,15 @@
44
44
  margin-bottom: 0.02rem;
45
45
  }
46
46
  .orders-mobile .fixed-wrap .list .item {
47
+ display: flex;
48
+ flex: 1 1;
49
+ }
50
+ .orders-mobile .fixed-wrap .list .item .content-wrap {
51
+ width: 100%;
47
52
  display: flex;
48
53
  flex-direction: column;
49
54
  justify-content: center;
50
55
  align-items: center;
51
- flex: 1;
52
56
  }
53
57
  .orders-mobile .fixed-wrap .list .item .img-wrap {
54
58
  position: relative;
@@ -551,6 +551,11 @@ function (_super) {
551
551
  onClick: function onClick() {
552
552
  return _this.onItemClick(item.sourceType);
553
553
  }
554
+ }, /*#__PURE__*/_react["default"].createElement("div", {
555
+ className: "content-wrap",
556
+ style: {
557
+ pointerEvents: window.magicDesign.mode == 'designer' ? 'auto' : 'none'
558
+ }
554
559
  }, item.number.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
555
560
  className: "number",
556
561
  data: __assign(__assign({}, item.number), {
@@ -563,7 +568,7 @@ function (_super) {
563
568
  onTextInput: function onTextInput(text) {
564
569
  item.title.text = text;
565
570
  }
566
- }));
571
+ })));
567
572
  })), editImgModalVisible && /*#__PURE__*/_react["default"].createElement(_common.CropperModal, {
568
573
  onClose: function onClose() {
569
574
  _this.setState({
@@ -96,11 +96,6 @@
96
96
  margin-top: 0.48rem;
97
97
  }
98
98
  .personal-information-mobile .bottom .item {
99
- display: flex;
100
- flex-direction: column;
101
- justify-content: flex-start;
102
- align-items: center;
103
- flex: 1;
104
99
  position: relative;
105
100
  }
106
101
  .personal-information-mobile .bottom .item:after {
@@ -116,6 +111,13 @@
116
111
  .personal-information-mobile .bottom .item:last-child:after {
117
112
  display: none;
118
113
  }
114
+ .personal-information-mobile .bottom .item .content-wrap {
115
+ display: flex;
116
+ flex-direction: column;
117
+ justify-content: flex-start;
118
+ align-items: center;
119
+ flex: 1;
120
+ }
119
121
  .personal-information-mobile .bottom .item .number {
120
122
  width: 70% !important;
121
123
  font-size: 0.36rem;
@@ -71,7 +71,7 @@ function (_super) {
71
71
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
72
72
  data: panelProps.image,
73
73
  needHover: false,
74
- onlySpecificCode: "FunctionPage"
74
+ onlySpecificCode: ['CustomizedPage', 'FunctionPage']
75
75
  }),
76
76
  metaOption: panelProps.image
77
77
  }];
@@ -71,7 +71,7 @@ function (_super) {
71
71
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
72
72
  data: panelProps.image,
73
73
  needClickArea: false,
74
- onlySpecificCode: "FunctionPage"
74
+ onlySpecificCode: ['CustomizedPage', 'FunctionPage']
75
75
  }),
76
76
  metaOption: panelProps.image
77
77
  }];
@@ -84,6 +84,7 @@ var urlTypeMap = {
84
84
  MINI_APP: 'MiniApp',
85
85
  STORE: 'Store',
86
86
  AFFILIATE_PRODUCT: 'AffiliateProduct',
87
+ AFFILIATE_STORE: 'AffiliateStore',
87
88
  ANCHOR: 'Anchor'
88
89
  };
89
90
  exports.urlTypeMap = urlTypeMap;
@@ -55,11 +55,14 @@ function shouldUpdate() {
55
55
  descriptor.value = function (nextProps, nextState) {
56
56
  var nowPropsJson = JSON.stringify(nextProps);
57
57
  var nowStateJson = JSON.stringify(nextState);
58
+ var nowDevice = window.magicDesign.device;
58
59
  var should1 = nowPropsJson != this.preProps;
59
60
  var should2 = nowStateJson != this.preState;
61
+ var should3 = nowDevice != this.preDevice;
60
62
  this.preProps = nowPropsJson;
61
63
  this.preState = nowStateJson;
62
- var result = should1 || should2;
64
+ this.preDevice = nowDevice;
65
+ var result = should1 || should2 || should3;
63
66
  return result && fn.apply(this, {
64
67
  nextProps: nextProps
65
68
  });
@@ -182,6 +182,18 @@ var newParseUrl = function newParseUrl(urlObj) {
182
182
  };
183
183
  break;
184
184
 
185
+ case _constants.urlTypeMap.AFFILIATE_STORE:
186
+ // 分销店铺
187
+ link = "/storeDetail/" + value;
188
+ params = {
189
+ action: 'jump',
190
+ params: {
191
+ type: 'AFFILIATE_STORE',
192
+ url: value
193
+ }
194
+ };
195
+ break;
196
+
185
197
  default:
186
198
  var map = {
187
199
  '/main/cart': 'CART',
@@ -296,7 +296,9 @@ function commonFetch(url, data, method) {
296
296
  });
297
297
  }
298
298
 
299
- var navigateTo = function navigateTo(url) {
299
+ var navigateTo = function navigateTo(url, state) {
300
+ console.log('navigateTo', url);
301
+
300
302
  if (!url) {
301
303
  return;
302
304
  }
@@ -309,7 +311,7 @@ var navigateTo = function navigateTo(url) {
309
311
  if (!appUrl && !h5Url.startsWith('/')) {
310
312
  window.location.href = h5Url;
311
313
  } else if (window.magicDesign.history) {
312
- window.magicDesign.history.push(url);
314
+ window.magicDesign.history.push(url, state);
313
315
  } else if (window.magicDesign.navigatePreUrl) {
314
316
  // 预览模式跳转
315
317
  if (h5Url.startsWith('/')) {
@@ -748,8 +750,8 @@ function pushGA(data, eventName) {
748
750
  groupName: data.groupName,
749
751
  elementId: data.elementId,
750
752
  elementName: data.elementName
751
- };
752
- console.log('GA push', eventName, eventData);
753
+ }; // console.log('GA push', eventName, eventData);
754
+
753
755
  if (window.gtag) window.gtag('event', eventName, eventData);
754
756
  }
755
757
  } catch (error) {
@@ -320,14 +320,9 @@ var clickUrl = function clickUrl(url) {
320
320
  data = _b.data;
321
321
 
322
322
  var _c = data.params,
323
- params = _c === void 0 ? {} : _c;
324
- console.log('clicked data:', data);
325
- console.log({
326
- type: 'jumpBrowser',
327
- params: {
328
- url: params.link
329
- }
330
- });
323
+ params = _c === void 0 ? {} : _c; // console.log('clicked data:', data);
324
+ // console.log({ type: 'jumpBrowser', params: { url: params.link } });
325
+
331
326
  /** 锚点跳转 */
332
327
 
333
328
  if (params.type === 'ANCHOR') {
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.89",
4
+ "version": "2.0.91",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",