@fonixtree/magic-design 0.1.86 → 0.1.87

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 (169) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/common/CountDown/index.js +20 -11
  3. package/es/common/CropperModal/index.js +126 -0
  4. package/es/common/CropperModal/index.less +29 -0
  5. package/es/common/LinkModal/AffiliateStore/index.js +332 -0
  6. package/es/common/LinkModal/SelectVideoModal/index.js +3 -2
  7. package/es/common/LinkModal/index.js +14 -5
  8. package/es/common/UrlPicker/index.js +1 -10
  9. package/es/common/Video/QualityComponent/index.js +169 -0
  10. package/es/common/Video/QualityComponent/index.less +78 -0
  11. package/es/common/Video/index.js +142 -86
  12. package/es/common/VideoUpload/index.js +1 -1
  13. package/es/common/index.js +8 -0
  14. package/es/composite-comp/bol/components/Banner/mobile/index.js +4 -2
  15. package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -4
  16. package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +3 -4
  17. package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +3 -4
  18. package/es/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +3 -4
  19. package/es/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +3 -4
  20. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +3 -4
  21. package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -4
  22. package/es/composite-comp/bol/config-panels/VideoConfig/VideoConfigGroup/index.js +3 -3
  23. package/es/composite-comp/bol/config-panels/WalletConfig/WalletConfigImageGroup/index.js +3 -4
  24. package/es/composite-comp/bol/config-panels/WalletNuriConfig/WalletNuriConfigImageGroup/index.js +3 -4
  25. package/es/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +3 -1
  26. package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-cashback.svg +9 -0
  27. package/es/composite-comp/common/components/AffiliateProductItem/index.js +25 -14
  28. package/es/composite-comp/common/components/AffiliateProductItem/index.less +31 -1
  29. package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +2 -15
  30. package/es/composite-comp/dito/components/CommonFunctions/defaultJSON.js +1 -1
  31. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.js +8 -2
  32. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.less +5 -5
  33. package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +8 -1
  34. package/es/composite-comp/dito/components/MobileNavigation/mobile/index.js +11 -0
  35. package/es/composite-comp/dito/components/Orders/mobile/index.js +8 -3
  36. package/es/composite-comp/dito/components/Orders/mobile/index.less +6 -7
  37. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.js +142 -17
  38. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.less +10 -7
  39. package/es/composite-comp/dito/components/Recommend/mobile/index.js +4 -2
  40. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +13 -1
  41. package/es/composite-comp/dito/config-panels/CommonFunctionsConfig/ConfigGroup/index.js +3 -4
  42. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/HeadNavConfigImageGroup/index.js +3 -4
  43. package/es/composite-comp/dito/config-panels/MenuNavigationConfig/MenuNavConfigImageGroup/index.js +3 -4
  44. package/es/composite-comp/dito/config-panels/MobileNavigationConfig/MobileNavigationConfigGroup/index.js +3 -4
  45. package/es/composite-comp/dito/config-panels/OrdersConfig/ConfigGroup/index.js +3 -4
  46. package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +3 -4
  47. package/es/composite-comp/dito/config-panels/PersonalInformationConfig/ConfigGroup/index.js +3 -4
  48. package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +2 -16
  49. package/es/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +1 -2
  50. package/es/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  51. package/es/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  52. package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/mobile/index.js +12 -10
  53. package/{lib/composite-comp/dito → es/composite-comp/nuri}/components/AffiliateRecommend/pc/index.js +12 -10
  54. package/{lib/composite-comp/dito → es/composite-comp/nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +3 -17
  55. package/es/constants/component-types.js +3 -3
  56. package/es/constants/index.js +1 -0
  57. package/es/core/Designer/ToolBarModal/index.js +5 -1
  58. package/es/core/Renderer/index.js +6 -2
  59. package/es/decorator/compositeDecorator.js +9 -5
  60. package/es/decorator/index.js +4 -1
  61. package/es/decorator/metaDecorator.js +6 -2
  62. package/es/locale/en/en.json +1 -1
  63. package/es/locale/es/es.json +2 -2
  64. package/es/locale/id/id.json +1 -1
  65. package/es/meta-comp/config-panels/TextConfig/index.js +1 -1
  66. package/es/utils/androidUtil.js +1 -0
  67. package/es/utils/businessUtil.js +12 -0
  68. package/es/utils/commonUtil.js +22 -6
  69. package/es/utils/coreUtil.js +40 -30
  70. package/lib/assets/fonts/.DS_Store +0 -0
  71. package/lib/common/CountDown/index.js +20 -11
  72. package/lib/common/CropperModal/index.js +126 -0
  73. package/lib/common/CropperModal/index.less +29 -0
  74. package/lib/common/LinkModal/AffiliateStore/index.js +332 -0
  75. package/lib/common/LinkModal/SelectVideoModal/index.js +3 -2
  76. package/lib/common/LinkModal/index.js +14 -5
  77. package/lib/common/UrlPicker/index.js +1 -10
  78. package/lib/common/Video/QualityComponent/index.js +169 -0
  79. package/lib/common/Video/QualityComponent/index.less +78 -0
  80. package/lib/common/Video/index.js +142 -86
  81. package/lib/common/VideoUpload/index.js +1 -1
  82. package/lib/common/index.js +8 -0
  83. package/lib/composite-comp/bol/components/Banner/mobile/index.js +4 -2
  84. package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -4
  85. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +3 -4
  86. package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +3 -4
  87. package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +3 -4
  88. package/lib/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +3 -4
  89. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +3 -4
  90. package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -4
  91. package/lib/composite-comp/bol/config-panels/VideoConfig/VideoConfigGroup/index.js +3 -3
  92. package/lib/composite-comp/bol/config-panels/WalletConfig/WalletConfigImageGroup/index.js +3 -4
  93. package/lib/composite-comp/bol/config-panels/WalletNuriConfig/WalletNuriConfigImageGroup/index.js +3 -4
  94. package/lib/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +3 -1
  95. package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-cashback.svg +9 -0
  96. package/lib/composite-comp/common/components/AffiliateProductItem/index.js +25 -14
  97. package/lib/composite-comp/common/components/AffiliateProductItem/index.less +31 -1
  98. package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +2 -15
  99. package/lib/composite-comp/dito/components/CommonFunctions/defaultJSON.js +1 -1
  100. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.js +8 -2
  101. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.less +5 -5
  102. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +8 -1
  103. package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.js +11 -0
  104. package/lib/composite-comp/dito/components/Orders/mobile/index.js +8 -3
  105. package/lib/composite-comp/dito/components/Orders/mobile/index.less +6 -7
  106. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.js +142 -17
  107. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.less +10 -7
  108. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +4 -2
  109. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +13 -1
  110. package/lib/composite-comp/dito/config-panels/CommonFunctionsConfig/ConfigGroup/index.js +3 -4
  111. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/HeadNavConfigImageGroup/index.js +3 -4
  112. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/MenuNavConfigImageGroup/index.js +3 -4
  113. package/lib/composite-comp/dito/config-panels/MobileNavigationConfig/MobileNavigationConfigGroup/index.js +3 -4
  114. package/lib/composite-comp/dito/config-panels/OrdersConfig/ConfigGroup/index.js +3 -4
  115. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +3 -4
  116. package/lib/composite-comp/dito/config-panels/PersonalInformationConfig/ConfigGroup/index.js +3 -4
  117. package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +2 -16
  118. package/lib/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +1 -2
  119. package/lib/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  120. package/lib/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  121. package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/mobile/index.js +12 -10
  122. package/{es/composite-comp/dito → lib/composite-comp/nuri}/components/AffiliateRecommend/pc/index.js +12 -10
  123. package/{es/composite-comp/dito → lib/composite-comp/nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +3 -17
  124. package/lib/constants/component-types.js +3 -3
  125. package/lib/constants/index.js +1 -0
  126. package/lib/core/Designer/ToolBarModal/index.js +5 -1
  127. package/lib/core/Renderer/index.js +6 -2
  128. package/lib/decorator/compositeDecorator.js +9 -5
  129. package/lib/decorator/index.js +4 -1
  130. package/lib/decorator/metaDecorator.js +6 -2
  131. package/lib/locale/en/en.json +1 -1
  132. package/lib/locale/es/es.json +2 -2
  133. package/lib/locale/id/id.json +1 -1
  134. package/lib/meta-comp/config-panels/TextConfig/index.js +1 -1
  135. package/lib/utils/androidUtil.js +1 -0
  136. package/lib/utils/businessUtil.js +12 -0
  137. package/lib/utils/commonUtil.js +22 -6
  138. package/lib/utils/coreUtil.js +40 -30
  139. package/package.json +2 -1
  140. package/es/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.less +0 -1
  141. package/lib/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.less +0 -1
  142. /package/es/common/Video/{components → RateComponent}/index.js +0 -0
  143. /package/es/common/Video/{components → RateComponent}/index.less +0 -0
  144. /package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/defaultJSON.js +0 -0
  145. /package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/index.js +0 -0
  146. /package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/mobile/index.less +0 -0
  147. /package/es/composite-comp/{dito → nuri}/components/AffiliateRecommend/pc/index.less +0 -0
  148. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +0 -0
  149. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  150. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +0 -0
  151. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  152. /package/es/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/index.js +0 -0
  153. /package/es/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +0 -0
  154. /package/es/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/index.js +0 -0
  155. /package/es/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/index.less +0 -0
  156. /package/lib/common/Video/{components → RateComponent}/index.js +0 -0
  157. /package/lib/common/Video/{components → RateComponent}/index.less +0 -0
  158. /package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/defaultJSON.js +0 -0
  159. /package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/index.js +0 -0
  160. /package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/mobile/index.less +0 -0
  161. /package/lib/composite-comp/{dito → nuri}/components/AffiliateRecommend/pc/index.less +0 -0
  162. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +0 -0
  163. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  164. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +0 -0
  165. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  166. /package/lib/composite-comp/{dito → nuri}/config-panels/AffiliateRecommendConfig/index.js +0 -0
  167. /package/lib/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +0 -0
  168. /package/lib/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/index.js +0 -0
  169. /package/lib/composite-comp/{dito → nuri}/second-config-panels/AffiliateRecommendSecondConfig/index.less +0 -0
@@ -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,13 +337,21 @@ var clickUrl = function clickUrl(url) {
340
337
 
341
338
  if ((0, _androidUtil.browserVersion)().isAshitaApp) {
342
339
  (0, _androidUtil.sendToApp)(data);
340
+ } else if ((0, _androidUtil.browserVersion)().isNuriApp && params.link && params.link.startsWith('http')) {
341
+ // 兼容Nuri app的 绝对路径跳转
342
+ var urlTemp = "" + params.link + (params.link.includes('?') ? '&' : '?') + "userToken=" + (localStorage.getItem('h5Token') || '');
343
+ (0, _androidUtil.sendToApp)({
344
+ type: 'jumpBrowser',
345
+ params: {
346
+ url: urlTemp
347
+ }
348
+ });
343
349
  } 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
-
350
+ // 别的app打开外链
346
351
  (0, _androidUtil.sendToAndroid)({
347
352
  type: 'jumpBrowser',
348
353
  params: {
349
- url: urlTemp
354
+ url: params.link
350
355
  }
351
356
  });
352
357
  } else {
@@ -370,25 +375,30 @@ var clickUrl = function clickUrl(url) {
370
375
  }
371
376
 
372
377
  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);
378
+ } // 判断是否是nuri, nuri跳外链需要带token
379
+
380
+
381
+ if (((_a = window === null || window === void 0 ? void 0 : window.magicDesign) === null || _a === void 0 ? void 0 : _a.projectCode) === 'nuri') {
382
+ // 输入的是完整的跳转地址
383
+ if (isUrl(link)) {
384
+ if (!link.includes(window.location.host)) {
385
+ // 跳转外链 需要把userToken带上
386
+ if (link.includes('?')) {
387
+ var a = link + "&userToken=" + (localStorage.getItem('h5Token') || '');
388
+ window.open(a);
389
+ } else {
390
+ var a = link + "?userToken=" + (localStorage.getItem('h5Token') || '');
391
+ window.open(a);
392
+ }
382
393
  } else {
383
- var a = link + "?userToken=" + (localStorage.getItem('h5Token') || '');
384
- window.open(a);
394
+ window.open(link);
385
395
  }
386
396
  } else {
387
- window.open(link);
397
+ (0, _commonUtil.navigateTo)(link);
388
398
  }
389
- } else {
390
- (0, _commonUtil.navigateTo)(link);
391
399
  }
400
+
401
+ (0, _commonUtil.navigateTo)(link);
392
402
  }
393
403
  };
394
404
 
Binary file
@@ -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
+ }
@@ -0,0 +1,332 @@
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"] = AffiliateStore;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _antd = require("antd");
13
+
14
+ var _commonUtil = require("../../../utils/commonUtil");
15
+
16
+ var _locale = require("../../../locale");
17
+
18
+ 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
+
20
+ 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; }
21
+
22
+ var __assign = void 0 && (void 0).__assign || function () {
23
+ __assign = Object.assign || function (t) {
24
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
25
+ s = arguments[i];
26
+
27
+ for (var p in s) {
28
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
29
+ }
30
+ }
31
+
32
+ return t;
33
+ };
34
+
35
+ return __assign.apply(this, arguments);
36
+ };
37
+
38
+ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) {
40
+ return value instanceof P ? value : new P(function (resolve) {
41
+ resolve(value);
42
+ });
43
+ }
44
+
45
+ return new (P || (P = Promise))(function (resolve, reject) {
46
+ function fulfilled(value) {
47
+ try {
48
+ step(generator.next(value));
49
+ } catch (e) {
50
+ reject(e);
51
+ }
52
+ }
53
+
54
+ function rejected(value) {
55
+ try {
56
+ step(generator["throw"](value));
57
+ } catch (e) {
58
+ reject(e);
59
+ }
60
+ }
61
+
62
+ function step(result) {
63
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
64
+ }
65
+
66
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
67
+ });
68
+ };
69
+
70
+ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
71
+ var _ = {
72
+ label: 0,
73
+ sent: function sent() {
74
+ if (t[0] & 1) throw t[1];
75
+ return t[1];
76
+ },
77
+ trys: [],
78
+ ops: []
79
+ },
80
+ f,
81
+ y,
82
+ t,
83
+ g;
84
+ return g = {
85
+ next: verb(0),
86
+ "throw": verb(1),
87
+ "return": verb(2)
88
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
89
+ return this;
90
+ }), g;
91
+
92
+ function verb(n) {
93
+ return function (v) {
94
+ return step([n, v]);
95
+ };
96
+ }
97
+
98
+ function step(op) {
99
+ if (f) throw new TypeError("Generator is already executing.");
100
+
101
+ while (_) {
102
+ try {
103
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
104
+ if (y = 0, t) op = [op[0] & 2, t.value];
105
+
106
+ switch (op[0]) {
107
+ case 0:
108
+ case 1:
109
+ t = op;
110
+ break;
111
+
112
+ case 4:
113
+ _.label++;
114
+ return {
115
+ value: op[1],
116
+ done: false
117
+ };
118
+
119
+ case 5:
120
+ _.label++;
121
+ y = op[1];
122
+ op = [0];
123
+ continue;
124
+
125
+ case 7:
126
+ op = _.ops.pop();
127
+
128
+ _.trys.pop();
129
+
130
+ continue;
131
+
132
+ default:
133
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
134
+ _ = 0;
135
+ continue;
136
+ }
137
+
138
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
139
+ _.label = op[1];
140
+ break;
141
+ }
142
+
143
+ if (op[0] === 6 && _.label < t[1]) {
144
+ _.label = t[1];
145
+ t = op;
146
+ break;
147
+ }
148
+
149
+ if (t && _.label < t[2]) {
150
+ _.label = t[2];
151
+
152
+ _.ops.push(op);
153
+
154
+ break;
155
+ }
156
+
157
+ if (t[2]) _.ops.pop();
158
+
159
+ _.trys.pop();
160
+
161
+ continue;
162
+ }
163
+
164
+ op = body.call(thisArg, _);
165
+ } catch (e) {
166
+ op = [6, e];
167
+ y = 0;
168
+ } finally {
169
+ f = t = 0;
170
+ }
171
+ }
172
+
173
+ if (op[0] & 5) throw op[1];
174
+ return {
175
+ value: op[0] ? op[1] : void 0,
176
+ done: true
177
+ };
178
+ }
179
+ };
180
+
181
+ var paginationParams = {
182
+ pageSize: 20,
183
+ pageIndex: 1
184
+ };
185
+
186
+ function AffiliateStore(props) {
187
+ var _this = this;
188
+
189
+ var _onChange = props.onChange;
190
+
191
+ var _a = (0, _react.useState)([]),
192
+ storeList = _a[0],
193
+ setStoreList = _a[1];
194
+
195
+ var _b = (0, _react.useState)(false),
196
+ loading = _b[0],
197
+ setLoading = _b[1];
198
+
199
+ var _c = (0, _react.useState)(''),
200
+ storeName = _c[0],
201
+ setStoreName = _c[1];
202
+
203
+ var queryStore = function queryStore(params) {
204
+ return __awaiter(_this, void 0, void 0, function () {
205
+ var res;
206
+ return __generator(this, function (_a) {
207
+ switch (_a.label) {
208
+ case 0:
209
+ setLoading(true);
210
+ return [4
211
+ /*yield*/
212
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/affiliate/store/query/page", params, 'GET')];
213
+
214
+ case 1:
215
+ res = _a.sent();
216
+ paginationParams.total = res.total;
217
+ setStoreList(res.list);
218
+ setLoading(false);
219
+ return [2
220
+ /*return*/
221
+ ];
222
+ }
223
+ });
224
+ });
225
+ };
226
+
227
+ (0, _react.useEffect)(function () {
228
+ queryStore(paginationParams);
229
+ }, []);
230
+ var columns = [{
231
+ title: 'Store ID',
232
+ dataIndex: 'shopId'
233
+ }, {
234
+ title: 'Store Name',
235
+ dataIndex: 'storeName'
236
+ }, {
237
+ title: 'Logo',
238
+ dataIndex: 'logo',
239
+ render: function render(val) {
240
+ return /*#__PURE__*/_react["default"].createElement("img", {
241
+ alt: "",
242
+ src: val,
243
+ style: {
244
+ maxWidth: '50px',
245
+ maxHeight: '50px'
246
+ }
247
+ });
248
+ }
249
+ }, {
250
+ title: 'Channel',
251
+ dataIndex: 'bindChannel'
252
+ }];
253
+ var rowSelection = {
254
+ onChange: function onChange(selectedRowKeys, selectedRow) {
255
+ _onChange({
256
+ value: selectedRow[0].affiliateStoreId,
257
+ name: selectedRow[0].storeName
258
+ });
259
+ },
260
+ type: 'radio'
261
+ };
262
+
263
+ var reset = function reset() {
264
+ setStoreName('');
265
+ queryStore(__assign({
266
+ storeName: ''
267
+ }, paginationParams));
268
+ };
269
+
270
+ return /*#__PURE__*/_react["default"].createElement("div", {
271
+ style: {
272
+ height: 550
273
+ }
274
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Form, {
275
+ labelCol: {
276
+ span: 6
277
+ },
278
+ layout: "horizontal"
279
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Row, {
280
+ gutter: 24
281
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
282
+ span: 12
283
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
284
+ label: "Store Name"
285
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
286
+ onChange: function onChange(e) {
287
+ return setStoreName(e.target.value);
288
+ },
289
+ size: "small",
290
+ value: storeName
291
+ }))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
292
+ span: 6
293
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
294
+ onClick: function onClick() {
295
+ setLoading(true);
296
+ paginationParams.pageIndex = 1;
297
+ queryStore(__assign({
298
+ storeName: storeName
299
+ }, paginationParams));
300
+ },
301
+ size: "small",
302
+ style: {
303
+ marginRight: 10
304
+ },
305
+ type: "primary"
306
+ }, (0, _locale.i18n)('QUERY')), /*#__PURE__*/_react["default"].createElement(_antd.Button, {
307
+ onClick: function onClick() {
308
+ reset();
309
+ },
310
+ size: "small"
311
+ }, (0, _locale.i18n)('CANCEL'))))), /*#__PURE__*/_react["default"].createElement(_antd.Table, {
312
+ bordered: false,
313
+ columns: columns,
314
+ dataSource: storeList,
315
+ defaultExpandAllRows: true,
316
+ loading: loading,
317
+ pagination: __assign(__assign({}, paginationParams), {
318
+ onChange: function onChange(page) {
319
+ paginationParams.pageIndex = page;
320
+ queryStore(__assign(__assign({}, paginationParams), {
321
+ storeName: storeName
322
+ }));
323
+ },
324
+ showSizeChanger: false
325
+ }),
326
+ rowKey: "affiliateStoreId",
327
+ rowSelection: rowSelection,
328
+ scroll: {
329
+ y: 400
330
+ }
331
+ }));
332
+ }
@@ -128,10 +128,11 @@ function (_super) {
128
128
  size: "20px",
129
129
  type: "icon-delete1"
130
130
  })))), this.videoSetting.sourceType === 'Upload' && /*#__PURE__*/_react["default"].createElement(_VideoUpload["default"], {
131
- onChange: function onChange(v, n) {
131
+ onChange: function onChange(v, n, id) {
132
132
  _this.onFieldChange({
133
133
  sourceUrl: v,
134
- name: n
134
+ name: n,
135
+ sourceId: id
135
136
  });
136
137
  },
137
138
  value: this.videoSetting.sourceUrl