@fonixtree/magic-design 0.1.86 → 0.1.88

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 (129) hide show
  1. package/es/common/CountDown/index.js +20 -11
  2. package/es/common/CropperModal/index.js +126 -0
  3. package/es/common/CropperModal/index.less +29 -0
  4. package/es/common/LinkModal/AffiliateStore/index.js +332 -0
  5. package/es/common/LinkModal/SelectVideoModal/index.js +3 -2
  6. package/es/common/LinkModal/index.js +14 -5
  7. package/es/common/UrlPicker/index.js +1 -10
  8. package/es/common/Video/QualityComponent/index.js +169 -0
  9. package/es/common/Video/QualityComponent/index.less +78 -0
  10. package/es/common/Video/index.js +142 -86
  11. package/es/common/VideoUpload/index.js +1 -1
  12. package/es/common/index.js +8 -0
  13. package/es/composite-comp/bol/components/Banner/mobile/index.js +4 -2
  14. package/es/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +3 -1
  15. package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-cashback.svg +9 -0
  16. package/es/composite-comp/common/components/AffiliateProductItem/index.js +25 -14
  17. package/es/composite-comp/common/components/AffiliateProductItem/index.less +31 -1
  18. package/es/composite-comp/dito/components/CommonFunctions/defaultJSON.js +1 -1
  19. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.js +8 -2
  20. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.less +5 -5
  21. package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +8 -1
  22. package/es/composite-comp/dito/components/MobileNavigation/mobile/index.js +11 -0
  23. package/es/composite-comp/dito/components/Orders/mobile/index.js +8 -3
  24. package/es/composite-comp/dito/components/Orders/mobile/index.less +6 -7
  25. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.js +142 -17
  26. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.less +10 -7
  27. package/es/composite-comp/dito/components/Recommend/mobile/index.js +4 -2
  28. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +13 -1
  29. package/es/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +1 -2
  30. package/es/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  31. package/es/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  32. package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/mobile/index.js +12 -10
  33. package/{lib/composite-comp/dito → es/composite-comp/nuri}/components/AffiliateRecommend/pc/index.js +12 -10
  34. package/{lib/composite-comp/dito → es/composite-comp/nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +1 -1
  35. package/es/constants/component-types.js +3 -3
  36. package/es/constants/index.js +1 -0
  37. package/es/core/Designer/ToolBarModal/index.js +5 -1
  38. package/es/core/Renderer/index.js +6 -2
  39. package/es/decorator/compositeDecorator.js +9 -5
  40. package/es/decorator/index.js +4 -1
  41. package/es/decorator/metaDecorator.js +6 -2
  42. package/es/locale/en/en.json +1 -1
  43. package/es/locale/es/es.json +2 -2
  44. package/es/locale/id/id.json +1 -1
  45. package/es/meta-comp/config-panels/TextConfig/index.js +1 -1
  46. package/es/utils/androidUtil.js +4 -0
  47. package/es/utils/businessUtil.js +17 -3
  48. package/es/utils/commonUtil.js +22 -6
  49. package/es/utils/coreUtil.js +67 -38
  50. package/lib/common/CountDown/index.js +20 -11
  51. package/lib/common/CropperModal/index.js +126 -0
  52. package/lib/common/CropperModal/index.less +29 -0
  53. package/lib/common/LinkModal/AffiliateStore/index.js +332 -0
  54. package/lib/common/LinkModal/SelectVideoModal/index.js +3 -2
  55. package/lib/common/LinkModal/index.js +14 -5
  56. package/lib/common/UrlPicker/index.js +1 -10
  57. package/lib/common/Video/QualityComponent/index.js +169 -0
  58. package/lib/common/Video/QualityComponent/index.less +78 -0
  59. package/lib/common/Video/index.js +142 -86
  60. package/lib/common/VideoUpload/index.js +1 -1
  61. package/lib/common/index.js +8 -0
  62. package/lib/composite-comp/bol/components/Banner/mobile/index.js +4 -2
  63. package/lib/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +3 -1
  64. package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-cashback.svg +9 -0
  65. package/lib/composite-comp/common/components/AffiliateProductItem/index.js +25 -14
  66. package/lib/composite-comp/common/components/AffiliateProductItem/index.less +31 -1
  67. package/lib/composite-comp/dito/components/CommonFunctions/defaultJSON.js +1 -1
  68. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.js +8 -2
  69. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.less +5 -5
  70. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +8 -1
  71. package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.js +11 -0
  72. package/lib/composite-comp/dito/components/Orders/mobile/index.js +8 -3
  73. package/lib/composite-comp/dito/components/Orders/mobile/index.less +6 -7
  74. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.js +142 -17
  75. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.less +10 -7
  76. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +4 -2
  77. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +13 -1
  78. package/lib/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +1 -2
  79. package/lib/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  80. package/lib/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  81. package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/mobile/index.js +12 -10
  82. package/{es/composite-comp/dito → lib/composite-comp/nuri}/components/AffiliateRecommend/pc/index.js +12 -10
  83. package/{es/composite-comp/dito → lib/composite-comp/nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +1 -1
  84. package/lib/constants/component-types.js +3 -3
  85. package/lib/constants/index.js +1 -0
  86. package/lib/core/Designer/ToolBarModal/index.js +5 -1
  87. package/lib/core/Renderer/index.js +6 -2
  88. package/lib/decorator/compositeDecorator.js +9 -5
  89. package/lib/decorator/index.js +4 -1
  90. package/lib/decorator/metaDecorator.js +6 -2
  91. package/lib/locale/en/en.json +1 -1
  92. package/lib/locale/es/es.json +2 -2
  93. package/lib/locale/id/id.json +1 -1
  94. package/lib/meta-comp/config-panels/TextConfig/index.js +1 -1
  95. package/lib/utils/androidUtil.js +4 -0
  96. package/lib/utils/businessUtil.js +17 -3
  97. package/lib/utils/commonUtil.js +22 -6
  98. package/lib/utils/coreUtil.js +67 -38
  99. package/package.json +2 -1
  100. package/es/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.less +0 -1
  101. package/lib/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.less +0 -1
  102. /package/es/common/Video/{components → RateComponent}/index.js +0 -0
  103. /package/es/common/Video/{components → RateComponent}/index.less +0 -0
  104. /package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/defaultJSON.js +0 -0
  105. /package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/index.js +0 -0
  106. /package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/mobile/index.less +0 -0
  107. /package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/pc/index.less +0 -0
  108. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +0 -0
  109. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  110. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +0 -0
  111. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  112. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/index.js +0 -0
  113. /package/es/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +0 -0
  114. /package/es/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/index.js +0 -0
  115. /package/es/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/index.less +0 -0
  116. /package/lib/common/Video/{components → RateComponent}/index.js +0 -0
  117. /package/lib/common/Video/{components → RateComponent}/index.less +0 -0
  118. /package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/defaultJSON.js +0 -0
  119. /package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/index.js +0 -0
  120. /package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/mobile/index.less +0 -0
  121. /package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/pc/index.less +0 -0
  122. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +0 -0
  123. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  124. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +0 -0
  125. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  126. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/index.js +0 -0
  127. /package/lib/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +0 -0
  128. /package/lib/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/index.js +0 -0
  129. /package/lib/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/index.less +0 -0
@@ -93,10 +93,14 @@ function metaDecorator(WrappedComponent) {
93
93
  var _c = _this.props,
94
94
  data = _c.data,
95
95
  GAData = _c.GAData;
96
- (0, _commonUtil.pushGA)(__assign(__assign({}, GAData), {
96
+
97
+ var eventData = __assign(__assign({}, GAData), {
97
98
  elementId: data.id,
98
99
  elementName: data.text || (GAData === null || GAData === void 0 ? void 0 : GAData.groupName)
99
- }));
100
+ });
101
+
102
+ (0, _commonUtil.pushGA)(eventData); // triggerBuryingPointEvent(eventData);
103
+
100
104
  return;
101
105
  } // 组织冒泡
102
106
 
@@ -1,4 +1,5 @@
1
1
  {
2
+ "SUBMIT": "Submit",
2
3
  "CANCELLED": "Cancelled",
3
4
  "DONE": "Done",
4
5
  "TO_RECEIVE": "To Receive",
@@ -128,7 +129,6 @@
128
129
  "MOVE_DOWN": "Move Down",
129
130
  "COPY": "Copy",
130
131
  "DELETE": "Delete",
131
- "DONE": "Done",
132
132
  "ADD_COMPONENT": "Add Component",
133
133
  "ALL": "ALL",
134
134
  "HOT": "Hot",
@@ -1,6 +1,7 @@
1
1
  {
2
+ "SUBMIT": "Submit",
2
3
  "CANCELLED": "Cancelled",
3
- "DONE": "Done",
4
+ "DONE": "Hecho",
4
5
  "TO_RECEIVE": "To Receive",
5
6
  "TO_SHIP": "To ship",
6
7
  "TO_PAY": "To Pay",
@@ -128,7 +129,6 @@
128
129
  "MOVE_DOWN": "Mover hacia abajo",
129
130
  "COPY": "Copiar",
130
131
  "DELETE": "Eliminar",
131
- "DONE": "Hecho",
132
132
  "ADD_COMPONENT": "Agregar Componente",
133
133
  "ALL": "TODO",
134
134
  "HOT": "Caliente",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "SUBMIT": "Submit",
2
3
  "CANCELLED": "Cancelled",
3
4
  "DONE": "Done",
4
5
  "TO_RECEIVE": "To Receive",
@@ -128,7 +129,6 @@
128
129
  "MOVE_DOWN": "Move Down",
129
130
  "COPY": "Copy",
130
131
  "DELETE": "Delete",
131
- "DONE": "Done",
132
132
  "ADD_COMPONENT": "Add Component",
133
133
  "ALL": "ALL",
134
134
  "HOT": "Hot",
@@ -278,7 +278,7 @@ function (_super) {
278
278
  showBgColor: true,
279
279
  showTextAlign: true,
280
280
  value: textData
281
- })), /*#__PURE__*/_react["default"].createElement(_common.Field, {
281
+ })), window.magicDesign.outputType != 'html' && /*#__PURE__*/_react["default"].createElement(_common.Field, {
282
282
  split: true,
283
283
  title: "URL"
284
284
  }, /*#__PURE__*/_react["default"].createElement(_common.UrlPicker, {
@@ -22,6 +22,10 @@ var browserVersion = function browserVersion() {
22
22
  weixin: u.indexOf('MicroMessenger') > -1,
23
23
  qq: u.match(/\sQQ/i) == ' qq',
24
24
  isApp: u.indexOf('app/CYLON-APP') > -1,
25
+ isNuriApp: u.indexOf('app/NURI-APP') > -1,
26
+ isDitoApp: u.indexOf('mydito') > -1,
27
+ ditoAndroidApp: u.indexOf('mydito') > -1 && (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1),
28
+ ditoIosApp: u.indexOf('mydito') > -1 && !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
25
29
  isAshitaApp: u.indexOf('app/ASHITA-APP') > -1
26
30
  };
27
31
  };
@@ -28,7 +28,8 @@ var newParseUrl = function newParseUrl(urlObj) {
28
28
  var type = urlObj.type,
29
29
  value = urlObj.value,
30
30
  offerId = urlObj.offerId,
31
- productId = urlObj.productId;
31
+ productId = urlObj.productId,
32
+ name = urlObj.name;
32
33
 
33
34
  switch (type) {
34
35
  // 锚点跳转
@@ -182,6 +183,18 @@ var newParseUrl = function newParseUrl(urlObj) {
182
183
  };
183
184
  break;
184
185
 
186
+ case _constants.urlTypeMap.AFFILIATE_STORE:
187
+ // 分销店铺
188
+ link = "/storeDetail/" + value;
189
+ params = {
190
+ action: 'jump',
191
+ params: {
192
+ type: 'AFFILIATE_STORE',
193
+ url: value
194
+ }
195
+ };
196
+ break;
197
+
185
198
  default:
186
199
  var map = {
187
200
  '/main/cart': 'CART',
@@ -204,8 +217,9 @@ var newParseUrl = function newParseUrl(urlObj) {
204
217
  params = {
205
218
  action: 'jump',
206
219
  params: {
207
- type: map[link],
208
- link: link
220
+ type: map[link] || name,
221
+ link: link,
222
+ url: link
209
223
  }
210
224
  };
211
225
  }
@@ -28,6 +28,7 @@ exports.shareLinkedin = shareLinkedin;
28
28
  exports.shareTwitter = shareTwitter;
29
29
  exports.sleep = sleep;
30
30
  exports.styleStringify = void 0;
31
+ exports.triggerBuryingPointEvent = triggerBuryingPointEvent;
31
32
 
32
33
  var _axios = _interopRequireDefault(require("axios"));
33
34
 
@@ -296,8 +297,8 @@ function commonFetch(url, data, method) {
296
297
  });
297
298
  }
298
299
 
299
- var navigateTo = function navigateTo(url) {
300
- console.log(url);
300
+ var navigateTo = function navigateTo(url, state) {
301
+ console.log('navigateTo', url);
301
302
 
302
303
  if (!url) {
303
304
  return;
@@ -311,7 +312,7 @@ var navigateTo = function navigateTo(url) {
311
312
  if (!appUrl && !h5Url.startsWith('/')) {
312
313
  window.location.href = h5Url;
313
314
  } else if (window.magicDesign.history) {
314
- window.magicDesign.history.push(url);
315
+ window.magicDesign.history.push(url, state);
315
316
  } else if (window.magicDesign.navigatePreUrl) {
316
317
  // 预览模式跳转
317
318
  if (h5Url.startsWith('/')) {
@@ -349,7 +350,7 @@ function goLogin(state, replaceFlag) {
349
350
  var signUrl = isFromSf === 'Y' ? '/sign-in-opt' : '/sign-in';
350
351
 
351
352
  if (replaceFlag) {
352
- Fishx.history.replace({
353
+ window.magicDesign.history.replace({
353
354
  pathname: signUrl,
354
355
  state: state
355
356
  });
@@ -750,14 +751,29 @@ function pushGA(data, eventName) {
750
751
  groupName: data.groupName,
751
752
  elementId: data.elementId,
752
753
  elementName: data.elementName
753
- };
754
- console.log('GA push', eventName, eventData);
754
+ }; // console.log('GA push', eventName, eventData);
755
+
755
756
  if (window.gtag) window.gtag('event', eventName, eventData);
756
757
  }
757
758
  } catch (error) {
758
759
  console.error(error);
759
760
  }
760
761
  }
762
+ /** 触发埋点事件
763
+ *
764
+ window.document.addEventListener('magic-design-burying-point', e => {
765
+ console.log(e.data);
766
+ });
767
+ */
768
+
769
+
770
+ function triggerBuryingPointEvent(data) {
771
+ var evt = new Event('magic-design-burying-point', {
772
+ bubbles: false
773
+ });
774
+ evt.data = data;
775
+ window.document.dispatchEvent(evt);
776
+ }
761
777
  /** react key 计算 */
762
778
 
763
779
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setMagicDesign = exports.renderPreview = exports.isPc = exports.isDesignMode = exports.isActiveFloor = exports.getVideoCover = exports.copyNode = exports.clickUrl = void 0;
6
+ exports.setMagicDesign = exports.renderPreview = exports.isPc = exports.isDesignMode = exports.isAutoAudit = exports.isActiveFloor = exports.getVideoCover = exports.copyNode = exports.clickUrl = void 0;
7
7
 
8
8
  var _uuid = require("uuid");
9
9
 
@@ -303,6 +303,8 @@ function isUrl(string) {
303
303
  }
304
304
 
305
305
  var clickUrl = function clickUrl(url) {
306
+ var _a;
307
+
306
308
  if (url === void 0) {
307
309
  url = '';
308
310
  }
@@ -313,19 +315,14 @@ var clickUrl = function clickUrl(url) {
313
315
  return;
314
316
  }
315
317
 
316
- var _a = _typeof(url) === 'object' ? (0, _businessUtil.newParseUrl)(url) : (0, _businessUtil.parseUrl)(url),
317
- link = _a.link,
318
- data = _a.data;
319
-
320
- var _b = data.params,
321
- params = _b === void 0 ? {} : _b;
322
- console.log('clicked data:', data);
323
- console.log({
324
- type: 'jumpBrowser',
325
- params: {
326
- url: params.link
327
- }
328
- });
318
+ var _b = _typeof(url) === 'object' ? (0, _businessUtil.newParseUrl)(url) : (0, _businessUtil.parseUrl)(url),
319
+ link = _b.link,
320
+ data = _b.data;
321
+
322
+ var _c = data.params,
323
+ params = _c === void 0 ? {} : _c; // console.log('clicked data:', data);
324
+ // console.log({ type: 'jumpBrowser', params: { url: params.link } });
325
+
329
326
  /** 锚点跳转 */
330
327
 
331
328
  if (params.type === 'ANCHOR') {
@@ -340,15 +337,29 @@ var clickUrl = function clickUrl(url) {
340
337
 
341
338
  if ((0, _androidUtil.browserVersion)().isAshitaApp) {
342
339
  (0, _androidUtil.sendToApp)(data);
343
- } else if ((0, _androidUtil.browserVersion)().isApp && params.link && params.link.startsWith('http')) {
344
- var urlTemp = "" + params.link + (params.link.includes('?') ? '&' : '?') + "userToken=" + (localStorage.getItem('h5Token') || ''); // 兼容Nuri的 绝对路径跳转
345
-
346
- (0, _androidUtil.sendToAndroid)({
347
- type: 'jumpBrowser',
348
- params: {
349
- url: urlTemp
350
- }
351
- });
340
+ } else if (params.link && params.link.startsWith('http')) {
341
+ // 跳转链接是个绝对路径
342
+ if (params.type === 'Gamezop') {
343
+ // Nuri 对接 Gamezop 特殊情况
344
+ (0, _androidUtil.sendToApp)(data);
345
+ } else if ((0, _androidUtil.browserVersion)().isApp || (0, _androidUtil.browserVersion)().isNuriApp) {
346
+ // Nuri 抽奖系统对接
347
+ var urlTemp = "" + params.link + (params.link.includes('?') ? '&' : '?') + "userToken=" + (localStorage.getItem('h5Token') || '');
348
+ (0, _androidUtil.sendToApp)({
349
+ type: 'jumpBrowser',
350
+ params: {
351
+ url: urlTemp
352
+ }
353
+ });
354
+ } else {
355
+ // 新开浏览器打开
356
+ (0, _androidUtil.sendToApp)({
357
+ type: 'jumpBrowser',
358
+ params: {
359
+ url: params.link
360
+ }
361
+ });
362
+ }
352
363
  } else {
353
364
  // 视频
354
365
  if (params.type === 'VIDEO') {
@@ -370,25 +381,33 @@ var clickUrl = function clickUrl(url) {
370
381
  }
371
382
 
372
383
  return;
373
- } // 输入的是完整的跳转地址
374
-
375
-
376
- if (isUrl(link)) {
377
- if (!link.includes(window.location.host)) {
378
- // 跳转外链 需要把userToken带上
379
- if (link.includes('?')) {
380
- var a = link + "&userToken=" + (localStorage.getItem('h5Token') || '');
381
- window.open(a);
384
+ } // 判断是否是nuri, nuri跳外链需要带token
385
+
386
+
387
+ if (((_a = window === null || window === void 0 ? void 0 : window.magicDesign) === null || _a === void 0 ? void 0 : _a.projectCode) === 'nuri') {
388
+ // 输入的是完整的跳转地址
389
+ if (isUrl(link)) {
390
+ if (params.type === 'Gamezop') {
391
+ // Nuri 对接游戏页面
392
+ window.open(link);
393
+ } else if (!link.includes(window.location.host)) {
394
+ // 跳转外链 需要把userToken带上
395
+ if (link.includes('?')) {
396
+ var a = link + "&userToken=" + (localStorage.getItem('h5Token') || '');
397
+ window.open(a);
398
+ } else {
399
+ var a = link + "?userToken=" + (localStorage.getItem('h5Token') || '');
400
+ window.open(a);
401
+ }
382
402
  } else {
383
- var a = link + "?userToken=" + (localStorage.getItem('h5Token') || '');
384
- window.open(a);
403
+ window.open(link);
385
404
  }
386
405
  } else {
387
- window.open(link);
406
+ (0, _commonUtil.navigateTo)(link);
388
407
  }
389
- } else {
390
- (0, _commonUtil.navigateTo)(link);
391
408
  }
409
+
410
+ (0, _commonUtil.navigateTo)(link);
392
411
  }
393
412
  };
394
413
 
@@ -434,5 +453,15 @@ var copyNode = function copyNode(value, parentId) {
434
453
  });
435
454
  return newNode;
436
455
  };
456
+ /**
457
+ * 是否开启自动审核
458
+ */
459
+
460
+
461
+ exports.copyNode = copyNode;
462
+
463
+ var isAutoAudit = function isAutoAudit() {
464
+ return window.magicDesign.autoAudit !== 'false' || window.partyType === partyTypeMap.PLATFORM;
465
+ };
437
466
 
438
- exports.copyNode = copyNode;
467
+ exports.isAutoAudit = isAutoAudit;
@@ -57,9 +57,11 @@ function (_super) {
57
57
  hour: '00',
58
58
  min: '00',
59
59
  second: '00',
60
- nowTime: _this.props.now
60
+ nowTime: Number(_this.props.now),
61
+ now: _this.props.now
61
62
  };
62
63
  _this.timer = null;
64
+ _this.preTime = '';
63
65
 
64
66
  _this.componentWillUnmount = function () {
65
67
  _this.clearTimer();
@@ -112,19 +114,26 @@ function (_super) {
112
114
  return _this;
113
115
  }
114
116
 
115
- CountDown.prototype.componentWillReceiveProps = function (nextProps) {
116
- var _this = this;
117
-
118
- if (nextProps.now !== this.props.now) {
119
- this.setState({
117
+ CountDown.getDerivedStateFromProps = function (nextProps, prevState) {
118
+ // 检查是否需要更新sortType
119
+ if (nextProps.now !== prevState.now) {
120
+ return {
121
+ now: nextProps.now,
120
122
  nowTime: nextProps.now
121
- }, function () {
122
- _this.clearTimer();
123
+ };
124
+ }
125
+
126
+ return null;
127
+ };
123
128
 
124
- _this.calcLastTime();
129
+ CountDown.prototype.componentDidUpdate = function () {
130
+ var now = this.state.now;
125
131
 
126
- _this.timer = setInterval(_this.calcLastTime, 1000);
127
- });
132
+ if (this.preTime != now) {
133
+ this.preTime = now;
134
+ this.clearTimer();
135
+ this.calcLastTime();
136
+ this.timer = setInterval(this.calcLastTime, 1000);
128
137
  }
129
138
  };
130
139
 
@@ -0,0 +1,126 @@
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
+ var _reactCropper = _interopRequireDefault(require("react-cropper"));
13
+
14
+ require("cropperjs/dist/cropper.css");
15
+
16
+ require("./index.less");
17
+
18
+ var _locale = require("../../locale");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
+
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); }
23
+
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; }
25
+
26
+ var __extends = void 0 && (void 0).__extends || function () {
27
+ var _extendStatics = function extendStatics(d, b) {
28
+ _extendStatics = Object.setPrototypeOf || {
29
+ __proto__: []
30
+ } instanceof Array && function (d, b) {
31
+ d.__proto__ = b;
32
+ } || function (d, b) {
33
+ for (var p in b) {
34
+ if (b.hasOwnProperty(p)) d[p] = b[p];
35
+ }
36
+ };
37
+
38
+ return _extendStatics(d, b);
39
+ };
40
+
41
+ return function (d, b) {
42
+ _extendStatics(d, b);
43
+
44
+ function __() {
45
+ this.constructor = d;
46
+ }
47
+
48
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
49
+ };
50
+ }();
51
+
52
+ var AComponent =
53
+ /** @class */
54
+ function (_super) {
55
+ __extends(AComponent, _super);
56
+
57
+ function AComponent() {
58
+ var _this = _super !== null && _super.apply(this, arguments) || this;
59
+
60
+ _this.state = {
61
+ src: ''
62
+ };
63
+
64
+ _this.onSubmit = function () {
65
+ _this.cropper.getCroppedCanvas().toBlob(function (blob) {
66
+ var fileName = _this.props.uploadedImageFile.name; // Vovi手机没有图片后缀
67
+
68
+ if (fileName && fileName.lastIndexOf('.') === -1) {
69
+ fileName = "file_" + new Date().getTime() + ".jpg";
70
+ }
71
+
72
+ var formData = new FormData();
73
+ formData.append('file', blob, fileName);
74
+
75
+ _this.props.onSubmit(formData);
76
+ });
77
+ };
78
+
79
+ return _this;
80
+ }
81
+
82
+ AComponent.prototype.componentDidMount = function () {
83
+ var _this = this;
84
+
85
+ var fileReader = new FileReader();
86
+
87
+ fileReader.onload = function (e) {
88
+ var dataURL = e.target.result;
89
+
90
+ _this.setState({
91
+ src: dataURL
92
+ });
93
+ };
94
+
95
+ fileReader.readAsDataURL(this.props.uploadedImageFile);
96
+ };
97
+
98
+ AComponent.prototype.render = function () {
99
+ var _this = this;
100
+
101
+ return /*#__PURE__*/_react["default"].createElement("div", {
102
+ className: "cropperModalWrap"
103
+ }, /*#__PURE__*/_react["default"].createElement(_reactCropper["default"], {
104
+ aspectRatio: 1,
105
+ className: "company-logo-cropper",
106
+ guides: false,
107
+ onInitialized: function onInitialized(cop) {
108
+ _this.cropper = cop;
109
+ },
110
+ src: this.state.src,
111
+ viewMode: 1,
112
+ zoomable: false
113
+ }), /*#__PURE__*/_react["default"].createElement("div", {
114
+ className: "btnWrap"
115
+ }, /*#__PURE__*/_react["default"].createElement("span", {
116
+ onClick: this.props.onClose
117
+ }, (0, _locale.i18n)('CANCEL')), /*#__PURE__*/_react["default"].createElement("span", {
118
+ onClick: this.onSubmit
119
+ }, (0, _locale.i18n)('SUBMIT'))));
120
+ };
121
+
122
+ return AComponent;
123
+ }(_react.Component);
124
+
125
+ var _default = AComponent;
126
+ exports["default"] = _default;
@@ -0,0 +1,29 @@
1
+ .cropperModalWrap {
2
+ background: #000;
3
+ position: fixed;
4
+ z-index: 1000;
5
+ top: 0;
6
+ bottom: 0;
7
+ left: 0;
8
+ right: 0;
9
+ display: flex;
10
+ justify-content: center;
11
+ align-items: center;
12
+
13
+ .btnWrap {
14
+ span {
15
+ color: #fff;
16
+ font-size: 18px;
17
+ position: absolute;
18
+ bottom: 10px;
19
+
20
+ &:first-child {
21
+ left: 12px;
22
+ }
23
+
24
+ &:last-child {
25
+ right: 12px;
26
+ }
27
+ }
28
+ }
29
+ }