@fonixtree/magic-design 0.1.93 → 0.2.2

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 (247) hide show
  1. package/es/assets/fonts/magic-box-iconfont.css +7 -35
  2. package/es/assets/fonts/magic-box-iconfont.css.bak +4 -8
  3. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  4. package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
  5. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  6. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  7. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  8. package/es/assets/less/button.less +0 -5
  9. package/es/common/AffiliateProductModal/index.js +1 -1
  10. package/es/common/AffiliateProductModal/index.less +1 -1
  11. package/es/common/Button/index.less +1 -0
  12. package/es/common/CountDown/index.js +11 -20
  13. package/es/common/GroupList/index.js +2 -7
  14. package/es/common/LinkModal/BundleCampaign/index.js +2 -2
  15. package/es/common/LinkModal/CouponTable/index.js +1 -1
  16. package/es/common/LinkModal/CustomTable/index.js +0 -1
  17. package/es/common/LinkModal/FilteredProductModal/index.js +106 -82
  18. package/es/common/LinkModal/FilteredProductModal/index.less +0 -1
  19. package/es/common/LinkModal/ProductDetailPage/index.js +60 -115
  20. package/es/common/LinkModal/ProductDetailPage/index.less +1 -6
  21. package/es/common/LinkModal/SelectVideoModal/index.js +2 -3
  22. package/es/common/LinkModal/index.js +5 -20
  23. package/es/common/MagicLink/index.js +2 -2
  24. package/es/common/ProductModal/index.js +124 -181
  25. package/es/common/ProductModal/index.less +1 -7
  26. package/es/common/ProductSource/index.js +21 -81
  27. package/es/common/UrlPicker/index.js +10 -51
  28. package/es/common/Video/index.js +86 -142
  29. package/es/common/VideoUpload/index.js +1 -1
  30. package/es/common/index.js +0 -8
  31. package/es/composite-comp/bol/components/Banner/mobile/index.js +2 -4
  32. package/es/composite-comp/bol/components/WalletNuri/mobile/index.js +8 -4
  33. package/es/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +1 -3
  34. package/es/composite-comp/common/components/AffiliateProductItem/index.js +20 -22
  35. package/es/composite-comp/common/components/AffiliateProductItem/index.less +1 -31
  36. package/es/composite-comp/common/config-panels/SpacingConfig/index.js +0 -1
  37. package/{lib/composite-comp/nuri → es/composite-comp/dito}/components/AffiliateRecommend/mobile/index.js +10 -12
  38. package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/pc/index.js +10 -12
  39. package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -8
  40. package/es/composite-comp/dito/components/HeadNavigation/defaultJSON.js +17 -22
  41. package/es/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
  42. package/es/composite-comp/dito/components/MobileNavigation/mobile/index.js +0 -11
  43. package/es/composite-comp/dito/components/Recommend/mobile/index.js +26 -31
  44. package/es/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  45. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +1 -13
  46. package/{lib/composite-comp/nuri → es/composite-comp/dito}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +1 -1
  47. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +27 -25
  48. package/es/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  49. package/es/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  50. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +2 -4
  51. package/es/constants/component-types.js +6 -24
  52. package/es/constants/index.js +5 -52
  53. package/es/core/Designer/ChatRobot/components/SearchCondition/index.js +16 -34
  54. package/es/core/Designer/ChatRobot/index.js +4 -49
  55. package/es/core/Designer/ConfigPanel/index.js +0 -6
  56. package/es/core/Designer/FonixtreeGpt/index.js +29 -222
  57. package/es/core/Designer/PageCompList/index.js +1 -1
  58. package/es/core/Designer/QuickMenuBar/index.js +2 -6
  59. package/es/core/Designer/ToolBarModal/index.js +1 -5
  60. package/es/core/Designer/index.js +1 -12
  61. package/es/core/Renderer/index.js +2 -6
  62. package/es/decorator/compositeDecorator.js +6 -10
  63. package/es/decorator/index.js +1 -4
  64. package/es/decorator/metaDecorator.js +3 -7
  65. package/es/locale/en/en.json +2 -20
  66. package/es/locale/es/es.json +2 -20
  67. package/es/locale/id/id.json +2 -20
  68. package/es/meta-comp/config-panels/TextConfig/index.js +1 -1
  69. package/es/mobx/index.js +3 -9
  70. package/es/utils/androidUtil.js +2 -17
  71. package/es/utils/businessUtil.js +5 -54
  72. package/es/utils/commonUtil.js +13 -151
  73. package/es/utils/coreUtil.js +24 -89
  74. package/lib/assets/fonts/magic-box-iconfont.css +7 -35
  75. package/lib/assets/fonts/magic-box-iconfont.css.bak +4 -8
  76. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  77. package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
  78. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  79. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  80. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  81. package/lib/assets/less/button.less +0 -5
  82. package/lib/common/AffiliateProductModal/index.js +1 -1
  83. package/lib/common/AffiliateProductModal/index.less +1 -1
  84. package/lib/common/Button/index.less +1 -0
  85. package/lib/common/CountDown/index.js +11 -20
  86. package/lib/common/GroupList/index.js +2 -7
  87. package/lib/common/LinkModal/BundleCampaign/index.js +2 -2
  88. package/lib/common/LinkModal/CouponTable/index.js +1 -1
  89. package/lib/common/LinkModal/CustomTable/index.js +0 -1
  90. package/lib/common/LinkModal/FilteredProductModal/index.js +106 -82
  91. package/lib/common/LinkModal/FilteredProductModal/index.less +0 -1
  92. package/lib/common/LinkModal/ProductDetailPage/index.js +60 -115
  93. package/lib/common/LinkModal/ProductDetailPage/index.less +1 -6
  94. package/lib/common/LinkModal/SelectVideoModal/index.js +2 -3
  95. package/lib/common/LinkModal/index.js +5 -20
  96. package/lib/common/MagicLink/index.js +2 -2
  97. package/lib/common/ProductModal/index.js +124 -181
  98. package/lib/common/ProductModal/index.less +1 -7
  99. package/lib/common/ProductSource/index.js +21 -81
  100. package/lib/common/UrlPicker/index.js +10 -51
  101. package/lib/common/Video/index.js +86 -142
  102. package/lib/common/VideoUpload/index.js +1 -1
  103. package/lib/common/index.js +0 -8
  104. package/lib/composite-comp/bol/components/Banner/mobile/index.js +2 -4
  105. package/lib/composite-comp/bol/components/WalletNuri/mobile/index.js +8 -4
  106. package/lib/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +1 -3
  107. package/lib/composite-comp/common/components/AffiliateProductItem/index.js +20 -22
  108. package/lib/composite-comp/common/components/AffiliateProductItem/index.less +1 -31
  109. package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +0 -1
  110. package/{es/composite-comp/nuri → lib/composite-comp/dito}/components/AffiliateRecommend/mobile/index.js +10 -12
  111. package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/pc/index.js +10 -12
  112. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -8
  113. package/lib/composite-comp/dito/components/HeadNavigation/defaultJSON.js +17 -22
  114. package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
  115. package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.js +0 -11
  116. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +26 -31
  117. package/lib/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  118. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +1 -13
  119. package/{es/composite-comp/nuri → lib/composite-comp/dito}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +1 -1
  120. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +27 -25
  121. package/lib/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  122. package/lib/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  123. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +2 -4
  124. package/lib/constants/component-types.js +6 -24
  125. package/lib/constants/index.js +5 -52
  126. package/lib/core/Designer/ChatRobot/components/SearchCondition/index.js +16 -34
  127. package/lib/core/Designer/ChatRobot/index.js +4 -49
  128. package/lib/core/Designer/ConfigPanel/index.js +0 -6
  129. package/lib/core/Designer/FonixtreeGpt/index.js +29 -222
  130. package/lib/core/Designer/PageCompList/index.js +1 -1
  131. package/lib/core/Designer/QuickMenuBar/index.js +2 -6
  132. package/lib/core/Designer/ToolBarModal/index.js +1 -5
  133. package/lib/core/Designer/index.js +1 -12
  134. package/lib/core/Renderer/index.js +2 -6
  135. package/lib/decorator/compositeDecorator.js +6 -10
  136. package/lib/decorator/index.js +1 -4
  137. package/lib/decorator/metaDecorator.js +3 -7
  138. package/lib/locale/en/en.json +2 -20
  139. package/lib/locale/es/es.json +2 -20
  140. package/lib/locale/id/id.json +2 -20
  141. package/lib/meta-comp/config-panels/TextConfig/index.js +1 -1
  142. package/lib/mobx/index.js +3 -9
  143. package/lib/utils/androidUtil.js +2 -17
  144. package/lib/utils/businessUtil.js +5 -54
  145. package/lib/utils/commonUtil.js +13 -151
  146. package/lib/utils/coreUtil.js +24 -89
  147. package/package.json +1 -2
  148. package/es/common/CropperModal/index.js +0 -126
  149. package/es/common/CropperModal/index.less +0 -29
  150. package/es/common/LinkModal/AffiliatePlatform/index.js +0 -326
  151. package/es/common/LinkModal/AffiliateStore/index.js +0 -332
  152. package/es/common/ProductModal/SortableImageList/index.js +0 -118
  153. package/es/common/ProductModal/SortableImageList/index.less +0 -3
  154. package/es/common/UrlPicker/AnchorModal/index.js +0 -170
  155. package/es/common/UrlPicker/AnchorModal/index.less +0 -21
  156. package/es/common/Video/QualityComponent/index.js +0 -169
  157. package/es/common/Video/QualityComponent/index.less +0 -78
  158. package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-cashback.svg +0 -9
  159. package/es/composite-comp/dito/components/CommonFunctions/defaultJSON.js +0 -92
  160. package/es/composite-comp/dito/components/CommonFunctions/index.js +0 -84
  161. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.js +0 -113
  162. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.less +0 -30
  163. package/es/composite-comp/dito/components/Orders/defaultJSON.js +0 -89
  164. package/es/composite-comp/dito/components/Orders/index.js +0 -84
  165. package/es/composite-comp/dito/components/Orders/mobile/index.js +0 -350
  166. package/es/composite-comp/dito/components/Orders/mobile/index.less +0 -86
  167. package/es/composite-comp/dito/components/PersonalInformation/defaultJSON.js +0 -95
  168. package/es/composite-comp/dito/components/PersonalInformation/index.js +0 -84
  169. package/es/composite-comp/dito/components/PersonalInformation/mobile/images/avatar.png +0 -0
  170. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.js +0 -592
  171. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.less +0 -135
  172. package/es/composite-comp/dito/config-panels/CommonFunctionsConfig/ConfigGroup/index.js +0 -128
  173. package/es/composite-comp/dito/config-panels/CommonFunctionsConfig/index.js +0 -113
  174. package/es/composite-comp/dito/config-panels/OrdersConfig/ConfigGroup/index.js +0 -131
  175. package/es/composite-comp/dito/config-panels/OrdersConfig/index.js +0 -114
  176. package/es/composite-comp/dito/config-panels/PersonalInformationConfig/ConfigGroup/index.js +0 -131
  177. package/es/composite-comp/dito/config-panels/PersonalInformationConfig/index.js +0 -118
  178. package/es/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +0 -121
  179. package/es/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.js +0 -148
  180. package/es/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.less +0 -9
  181. package/es/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.js +0 -143
  182. package/es/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.less +0 -9
  183. package/es/mobx/UserState.js +0 -144
  184. package/lib/common/CropperModal/index.js +0 -126
  185. package/lib/common/CropperModal/index.less +0 -29
  186. package/lib/common/LinkModal/AffiliatePlatform/index.js +0 -326
  187. package/lib/common/LinkModal/AffiliateStore/index.js +0 -332
  188. package/lib/common/ProductModal/SortableImageList/index.js +0 -118
  189. package/lib/common/ProductModal/SortableImageList/index.less +0 -3
  190. package/lib/common/UrlPicker/AnchorModal/index.js +0 -170
  191. package/lib/common/UrlPicker/AnchorModal/index.less +0 -21
  192. package/lib/common/Video/QualityComponent/index.js +0 -169
  193. package/lib/common/Video/QualityComponent/index.less +0 -78
  194. package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-cashback.svg +0 -9
  195. package/lib/composite-comp/dito/components/CommonFunctions/defaultJSON.js +0 -92
  196. package/lib/composite-comp/dito/components/CommonFunctions/index.js +0 -84
  197. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.js +0 -113
  198. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.less +0 -30
  199. package/lib/composite-comp/dito/components/Orders/defaultJSON.js +0 -89
  200. package/lib/composite-comp/dito/components/Orders/index.js +0 -84
  201. package/lib/composite-comp/dito/components/Orders/mobile/index.js +0 -350
  202. package/lib/composite-comp/dito/components/Orders/mobile/index.less +0 -86
  203. package/lib/composite-comp/dito/components/PersonalInformation/defaultJSON.js +0 -95
  204. package/lib/composite-comp/dito/components/PersonalInformation/index.js +0 -84
  205. package/lib/composite-comp/dito/components/PersonalInformation/mobile/images/avatar.png +0 -0
  206. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.js +0 -592
  207. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.less +0 -135
  208. package/lib/composite-comp/dito/config-panels/CommonFunctionsConfig/ConfigGroup/index.js +0 -128
  209. package/lib/composite-comp/dito/config-panels/CommonFunctionsConfig/index.js +0 -113
  210. package/lib/composite-comp/dito/config-panels/OrdersConfig/ConfigGroup/index.js +0 -131
  211. package/lib/composite-comp/dito/config-panels/OrdersConfig/index.js +0 -114
  212. package/lib/composite-comp/dito/config-panels/PersonalInformationConfig/ConfigGroup/index.js +0 -131
  213. package/lib/composite-comp/dito/config-panels/PersonalInformationConfig/index.js +0 -118
  214. package/lib/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +0 -121
  215. package/lib/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.js +0 -148
  216. package/lib/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.less +0 -9
  217. package/lib/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.js +0 -143
  218. package/lib/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.less +0 -9
  219. package/lib/mobx/UserState.js +0 -144
  220. /package/es/common/Video/{RateComponent → components}/index.js +0 -0
  221. /package/es/common/Video/{RateComponent → components}/index.less +0 -0
  222. /package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/defaultJSON.js +0 -0
  223. /package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/index.js +0 -0
  224. /package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/mobile/index.less +0 -0
  225. /package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/pc/index.less +0 -0
  226. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +0 -0
  227. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  228. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +0 -0
  229. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  230. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/index.js +0 -0
  231. /package/es/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +0 -0
  232. /package/es/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/index.js +0 -0
  233. /package/es/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/index.less +0 -0
  234. /package/lib/common/Video/{RateComponent → components}/index.js +0 -0
  235. /package/lib/common/Video/{RateComponent → components}/index.less +0 -0
  236. /package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/defaultJSON.js +0 -0
  237. /package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/index.js +0 -0
  238. /package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/mobile/index.less +0 -0
  239. /package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/pc/index.less +0 -0
  240. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +0 -0
  241. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  242. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +0 -0
  243. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  244. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/index.js +0 -0
  245. /package/lib/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +0 -0
  246. /package/lib/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/index.js +0 -0
  247. /package/lib/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/index.less +0 -0
@@ -128,11 +128,10 @@ 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, id) {
131
+ onChange: function onChange(v, n) {
132
132
  _this.onFieldChange({
133
133
  sourceUrl: v,
134
- name: n,
135
- sourceId: id
134
+ name: n
136
135
  });
137
136
  },
138
137
  value: this.videoSetting.sourceUrl
@@ -37,10 +37,6 @@ var _StoreCatgTable = _interopRequireDefault(require("./StoreCatgTable"));
37
37
 
38
38
  var _AffiliateProductTable = _interopRequireDefault(require("./AffiliateProductTable"));
39
39
 
40
- var _AffiliateStore = _interopRequireDefault(require("./AffiliateStore"));
41
-
42
- var _AffiliatePlatform = _interopRequireDefault(require("./AffiliatePlatform"));
43
-
44
40
  var _locale = require("../../locale");
45
41
 
46
42
  var _commonUtil = require("../../utils/commonUtil");
@@ -236,7 +232,7 @@ var LinkModal = function LinkModal(props) {
236
232
 
237
233
  var getLinkTypes = function getLinkTypes() {
238
234
  return __awaiter(void 0, void 0, void 0, function () {
239
- var types, type_1;
235
+ var types, type;
240
236
  return __generator(this, function (_a) {
241
237
  switch (_a.label) {
242
238
  case 0:
@@ -250,15 +246,12 @@ var LinkModal = function LinkModal(props) {
250
246
  types = _a.sent();
251
247
 
252
248
  if (onlySpecificCode) {
253
- type_1 = [];
254
- onlySpecificCode.forEach(function (code) {
255
- type_1.push(types.find(function (item) {
256
- return item.linkTypeCode === code;
257
- }));
249
+ type = types.filter(function (item) {
250
+ return item.linkTypeCode === onlySpecificCode;
258
251
  });
259
252
 
260
- if (type_1.length > 0) {
261
- types = type_1;
253
+ if (type.length > 0) {
254
+ types = type;
262
255
  }
263
256
  }
264
257
 
@@ -366,14 +359,6 @@ var LinkModal = function LinkModal(props) {
366
359
  onChange: function onChange(value) {
367
360
  return setLinkUrl(value);
368
361
  }
369
- }), item.linkTypeCode === 'AffiliateStore' && /*#__PURE__*/_react["default"].createElement(_AffiliateStore["default"], {
370
- onChange: function onChange(value) {
371
- return setLinkUrl(value);
372
- }
373
- }), item.linkTypeCode === 'AffiliatePlatform' && /*#__PURE__*/_react["default"].createElement(_AffiliatePlatform["default"], {
374
- onChange: function onChange(value) {
375
- return setLinkUrl(value);
376
- }
377
362
  }));
378
363
  })), /*#__PURE__*/_react["default"].createElement("div", {
379
364
  className: "footer"
@@ -7,9 +7,9 @@ exports.onAClick = exports.getLinkUrl = exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _coreUtil = require("../../utils/coreUtil");
10
+ var _businessUtil = require("src/components/utils/businessUtil");
11
11
 
12
- var _businessUtil = require("../../utils/businessUtil");
12
+ var _coreUtil = require("src/components/utils/coreUtil");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
@@ -5,18 +5,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.formatData = exports["default"] = void 0;
8
+ exports["default"] = void 0;
9
9
 
10
10
  var _antd = require("antd");
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
14
- var _SortableImageList = _interopRequireDefault(require("./SortableImageList"));
15
-
16
14
  var _commonUtil = require("../../utils/commonUtil");
17
15
 
18
16
  var _businessUtil = require("../../utils/businessUtil");
19
17
 
18
+ var _Iconfont = _interopRequireDefault(require("../Iconfont"));
19
+
20
20
  var _currencyUtil = require("../../utils/currencyUtil");
21
21
 
22
22
  require("./index.less");
@@ -204,26 +204,18 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
204
204
  return r;
205
205
  };
206
206
 
207
- var promType = {
208
- FLASH_SALE: '2',
209
- GROUP_BUY: '4'
210
- };
211
- var proTypeOption = [{
212
- label: 'SKU',
213
- value: 'sku'
214
- }, {
215
- label: 'SPU',
216
- value: 'spu'
217
- }];
218
-
219
- var formatData = function formatData(list, type) {
207
+ var formatData = function formatData(list) {
220
208
  list.map(function (item) {
221
- item.id = type === 'spu' ? item.offerId : item.productId;
209
+ item.preSalesPrice = (0, _currencyUtil.formatCurrencyWithSymbol)(item.salesPrice);
210
+ item.preMarketPrice = (0, _currencyUtil.formatCurrencyWithSymbol)(item.marketPrice);
222
211
  });
223
212
  return list;
224
213
  };
225
214
 
226
- exports.formatData = formatData;
215
+ var promType = {
216
+ FLASH_SALE: '2',
217
+ GROUP_BUY: '4'
218
+ };
227
219
  var Option = _antd.Select.Option;
228
220
  var InputGroup = _antd.Input.Group;
229
221
 
@@ -231,12 +223,14 @@ var ProductModal = function ProductModal(props) {
231
223
  var handleModalSave = props.handleModalSave,
232
224
  closeModal = props.closeModal,
233
225
  visible = props.visible,
234
- _a = props.prodType,
235
- prodType = _a === void 0 ? 'sku' : _a,
236
- _b = props.defaultList,
237
- defaultList = _b === void 0 ? [] : _b,
238
- _c = props.maxSelect,
239
- maxSelect = _c === void 0 ? 20 : _c;
226
+ _a = props.defaultList,
227
+ defaultList = _a === void 0 ? [] : _a,
228
+ _b = props.maxSelect,
229
+ maxSelect = _b === void 0 ? 20 : _b;
230
+
231
+ var _c = (0, _react.useState)(defaultList),
232
+ selectedList = _c[0],
233
+ setSelectedList = _c[1];
240
234
 
241
235
  var _d = (0, _react.useState)([]),
242
236
  catgsList = _d[0],
@@ -298,35 +292,15 @@ var ProductModal = function ProductModal(props) {
298
292
  loading = _t[0],
299
293
  setLoading = _t[1];
300
294
 
301
- var _u = (0, _react.useState)(prodType),
302
- proType = _u[0],
303
- setProType = _u[1];
304
-
305
- var _v = (0, _react.useState)(false),
306
- flag = _v[0],
307
- setFlag = _v[1];
308
-
309
- var _w = (0, _react.useState)(defaultList),
310
- selectedList = _w[0],
311
- setSelectedList = _w[1];
312
-
313
- var _x = (0, _react.useState)(''),
314
- dragId = _x[0],
315
- setDragId = _x[1];
316
-
317
- var _y = (0, _react.useState)({
318
- pageSize: 20,
319
- current: 1,
320
- total: 0
321
- }),
322
- paginationParams = _y[0],
323
- setPaginationParams = _y[1];
295
+ var _u = (0, _react.useState)(defaultList.map(function (v) {
296
+ return v.productId;
297
+ })),
298
+ selectedRowKeys = _u[0],
299
+ setSelectedRowKeys = _u[1];
324
300
 
325
301
  var rowSelection = {
326
- selectedRowKeys: selectedList.map(function (v) {
327
- return v.id;
328
- }),
329
- onSelect: function onSelect(record, selected) {
302
+ selectedRowKeys: selectedRowKeys,
303
+ onSelect: function onSelect(record, selected, selectedRows) {
330
304
  if (selected) {
331
305
  if (selectedList.length === maxSelect) {
332
306
  _antd.message.warning("Max " + maxSelect);
@@ -335,13 +309,17 @@ var ProductModal = function ProductModal(props) {
335
309
  }
336
310
 
337
311
  if (selectedList.length < maxSelect) {
338
- setSelectedList(__spreadArrays(selectedList, [record]));
312
+ setSelectedList(__spreadArrays(selectedList, formatData([record])));
339
313
  }
340
314
  } else {
341
315
  setSelectedList(selectedList.filter(function (v) {
342
- return v.id !== record.id;
316
+ return v.productId !== record.productId;
343
317
  }));
344
318
  }
319
+
320
+ setSelectedRowKeys(selectedRows.map(function (v) {
321
+ return v === null || v === void 0 ? void 0 : v.productId;
322
+ }));
345
323
  },
346
324
  getCheckboxProps: function getCheckboxProps(record) {
347
325
  return {
@@ -350,104 +328,41 @@ var ProductModal = function ProductModal(props) {
350
328
  }
351
329
  };
352
330
 
353
- var moveItem = function moveItem(dragNodeId, hoverNodeId) {
354
- var source = JSON.parse(JSON.stringify(selectedList));
355
- var dragIndex = source.findIndex(function (obj) {
356
- return obj.productId == dragNodeId;
357
- });
358
- var hoverIndex = source.findIndex(function (obj) {
359
- return obj.productId == hoverNodeId;
360
- });
361
- var list = dragSource(source, dragIndex, hoverIndex);
362
- setSelectedList(list);
363
- };
364
-
365
- var onDragStart = function onDragStart(e) {
366
- setDragId(e.currentTarget.dataset.nodeid);
367
- };
368
-
369
- var onDragEnter = function onDragEnter(e) {
370
- var hoverNodeId = e.currentTarget.dataset.nodeid;
371
-
372
- if (dragId === hoverNodeId) {
373
- return;
374
- }
375
-
376
- moveItem(dragId, hoverNodeId);
377
- };
378
-
379
- var onDragEnd = function onDragEnd() {
380
- setDragId('');
331
+ var _v = (0, _react.useState)({
332
+ pageSize: 20,
333
+ current: 1,
334
+ total: 0
335
+ }),
336
+ paginationParams = _v[0],
337
+ setPaginationParams = _v[1];
338
+
339
+ var delSelectedItem = function delSelectedItem(index) {
340
+ console.log(selectedRowKeys, index, 2223);
341
+ var rowKeys = JSON.parse(JSON.stringify(selectedRowKeys));
342
+ rowKeys.splice(index, 1);
343
+ setSelectedRowKeys(rowKeys);
344
+ var rows = JSON.parse(JSON.stringify(selectedList));
345
+ rows.splice(index, 1);
346
+ setSelectedList(rows);
381
347
  }; // 请求商品列表
382
348
 
383
349
 
384
- var queryGoods = function queryGoods() {
350
+ var queryGoods = function queryGoods(data) {
385
351
  return __awaiter(void 0, void 0, void 0, function () {
386
- var _list, total, params, res_1, res;
387
-
352
+ var res;
388
353
  return __generator(this, function (_a) {
389
354
  switch (_a.label) {
390
355
  case 0:
391
- setLoading(true);
392
- setGoodsList([]);
393
- _list = [];
394
- total = 0;
395
- params = {
396
- productName: productName,
397
- storeId: storeId,
398
- cmpTypeId: promotions || '',
399
- minPrice: (0, _currencyUtil.formatBackendCurrency)(minPrice),
400
- maxPrice: (0, _currencyUtil.formatBackendCurrency)(maxPrice),
401
- catgIds: selCatgsList.join(','),
402
- brandIds: selBrandsList.join(','),
403
- labelIds: selLabelData.value || '',
404
- pageSize: paginationParams.pageSize,
405
- pageIndex: paginationParams.current
406
- };
407
- if (!(proType === 'spu')) return [3
408
- /*break*/
409
- , 2];
410
356
  return [4
411
357
  /*yield*/
412
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
413
- offerCode: productCode,
414
- isDefaultCover: 'Y',
415
- onlyQryPublishSku: true,
416
- auditState: 'S',
417
- crmFlag: 'on'
418
- }), 'GET')];
358
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", data, 'GET')];
419
359
 
420
360
  case 1:
421
- res_1 = _a.sent();
422
- _list = formatData((0, _commonUtil.ensure)(function () {
423
- return res_1.list.map(function (m) {
424
- return __assign(__assign({}, m.products[0]), m);
425
- });
426
- }, []), proType);
427
- total = res_1.total;
428
- return [3
429
- /*break*/
430
- , 4];
431
-
432
- case 2:
433
- return [4
434
- /*yield*/
435
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
436
- state: 'A',
437
- productCode: productCode
438
- }), 'GET')];
439
-
440
- case 3:
441
361
  res = _a.sent();
442
- _list = formatData(res.list || []);
443
- total = res.total;
444
- _a.label = 4;
445
-
446
- case 4:
447
362
  setLoading(false);
448
- setGoodsList(_list);
449
- paginationParams.total = total;
450
- setPaginationParams(__assign({}, paginationParams));
363
+ paginationParams.total = res.total;
364
+ setPaginationParams(paginationParams);
365
+ setGoodsList(res.list || []);
451
366
  return [2
452
367
  /*return*/
453
368
  ];
@@ -545,18 +460,6 @@ var ProductModal = function ProductModal(props) {
545
460
  });
546
461
  };
547
462
 
548
- var reset = function reset() {
549
- setSelBrandsList([]);
550
- setSelCatgsList([]);
551
- setSelLabelData([]);
552
- setProductName('');
553
- setStoreId('');
554
- setProductCode('');
555
- setMinPrice('');
556
- setMaxPrice('');
557
- setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
558
- };
559
-
560
463
  (0, _react.useEffect)(function () {
561
464
  queryOfferCatgs();
562
465
  queryBrands();
@@ -568,19 +471,27 @@ var ProductModal = function ProductModal(props) {
568
471
  }, []);
569
472
  (0, _react.useEffect)(function () {
570
473
  setSelectedList(defaultList);
474
+ setSelectedRowKeys(defaultList.map(function (v) {
475
+ return v.productId;
476
+ }));
571
477
 
572
478
  if (props.type === 'groupBuy') {
573
479
  setPromotions(promType.GROUP_BUY);
574
480
  }
575
481
  }, [visible]);
576
- (0, _react.useEffect)(function () {
577
- reset();
578
- paginationParams.current = 1;
579
- setFlag(!flag);
580
- }, [proType]);
581
- (0, _react.useEffect)(function () {
582
- queryGoods();
583
- }, [flag]);
482
+
483
+ var reset = function reset() {
484
+ setSelBrandsList([]);
485
+ setSelCatgsList([]);
486
+ setSelLabelData([]);
487
+ setProductName('');
488
+ setStoreId('');
489
+ setProductCode('');
490
+ setMinPrice('');
491
+ setMaxPrice('');
492
+ setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
493
+ };
494
+
584
495
  var columns = [{
585
496
  title: (0, _locale.i18n)('IMAGE'),
586
497
  dataIndex: 'productImageUrl',
@@ -599,8 +510,8 @@ var ProductModal = function ProductModal(props) {
599
510
  width: 120,
600
511
  ellipsis: true
601
512
  }, {
602
- title: proType === 'spu' ? (0, _locale.i18n)('SPU_CODE') : (0, _locale.i18n)('SKU_CODE'),
603
- dataIndex: proType === 'spu' ? 'offerCode' : 'productCode',
513
+ title: (0, _locale.i18n)('PRODUCT_CODE'),
514
+ dataIndex: 'productCode',
604
515
  width: 120,
605
516
  ellipsis: true
606
517
  }, _defineProperty({
@@ -688,7 +599,7 @@ var ProductModal = function ProductModal(props) {
688
599
  return setStoreId(value);
689
600
  },
690
601
  optionFilterProp: "children",
691
- placeholder: (0, _locale.i18n)('PLEASE_SELECT'),
602
+ placeholder: "Please select",
692
603
  showSearch: true,
693
604
  value: storeId
694
605
  }, storeList && storeList.length > 0 && storeList.map(function (v) {
@@ -701,6 +612,7 @@ var ProductModal = function ProductModal(props) {
701
612
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
702
613
  defaultValue: selLabelData.children || null,
703
614
  onChange: function onChange(v, o) {
615
+ console.log(v, o, 33);
704
616
  setSelLabelData(o);
705
617
  },
706
618
  placeholder: (0, _locale.i18n)('PLEASE_SELECT'),
@@ -747,7 +659,7 @@ var ProductModal = function ProductModal(props) {
747
659
  size: "small",
748
660
  value: productName
749
661
  })), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
750
- label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
662
+ label: "SKU Code"
751
663
  }, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
752
664
  className: "inputStyle",
753
665
  onChange: function onChange(e) {
@@ -781,7 +693,20 @@ var ProductModal = function ProductModal(props) {
781
693
  onClick: function onClick() {
782
694
  setLoading(true);
783
695
  paginationParams.current = 1;
784
- queryGoods();
696
+ queryGoods({
697
+ productName: productName,
698
+ productCode: productCode,
699
+ storeId: storeId,
700
+ cmpTypeId: promotions || '',
701
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minPrice),
702
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maxPrice),
703
+ catgIds: selCatgsList.join(','),
704
+ brandIds: selBrandsList.join(','),
705
+ labelIds: selLabelData.value || '',
706
+ pageSize: paginationParams.pageSize,
707
+ pageIndex: paginationParams.current,
708
+ state: 'A'
709
+ });
785
710
  },
786
711
  size: "small",
787
712
  style: {
@@ -790,17 +715,7 @@ var ProductModal = function ProductModal(props) {
790
715
  type: "primary"
791
716
  }, (0, _locale.i18n)('QUERY'))))), /*#__PURE__*/_react["default"].createElement("div", {
792
717
  className: "rightCot"
793
- }, /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
794
- buttonStyle: "solid",
795
- className: "btn-select-type",
796
- onChange: function onChange(e) {
797
- setProType(e.target.value);
798
- setSelectedList([]);
799
- },
800
- options: proTypeOption,
801
- optionType: "button",
802
- value: proType
803
- }), /*#__PURE__*/_react["default"].createElement(_antd.Table, {
718
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Table, {
804
719
  columns: columns,
805
720
  dataSource: goodsList,
806
721
  loading: loading,
@@ -808,19 +723,47 @@ var ProductModal = function ProductModal(props) {
808
723
  onChange: function onChange(page) {
809
724
  setLoading(true);
810
725
  paginationParams.current = page;
811
- queryGoods();
726
+ setPaginationParams(paginationParams);
727
+ queryGoods({
728
+ productName: productName,
729
+ productCode: productCode,
730
+ cmpTypeId: promotions || '',
731
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minPrice),
732
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maxPrice),
733
+ catgIds: selCatgsList.join(','),
734
+ brandIds: selBrandsList.join(','),
735
+ labelIds: selLabelData.value || '',
736
+ pageSize: paginationParams.pageSize,
737
+ pageIndex: paginationParams.current,
738
+ state: 'A'
739
+ });
812
740
  }
813
741
  }),
814
- rowKey: "id",
742
+ rowKey: "productId",
815
743
  rowSelection: rowSelection,
816
744
  scroll: {
817
- y: 420
745
+ y: 500
818
746
  }
819
747
  }), /*#__PURE__*/_react["default"].createElement("div", {
820
748
  className: "selectedCot"
821
- }, /*#__PURE__*/_react["default"].createElement(_SortableImageList["default"], {
822
- selectedList: selectedList,
823
- setSelectedList: setSelectedList
749
+ }, selectedList.map(function (item, index) {
750
+ return /*#__PURE__*/_react["default"].createElement("div", {
751
+ key: index,
752
+ className: "selectedItem"
753
+ }, /*#__PURE__*/_react["default"].createElement("img", {
754
+ alt: "",
755
+ className: "selectedItemImg " + (item.state !== 'A' ? 'invalid' : ''),
756
+ src: item.productImageUrl,
757
+ title: item.productName
758
+ }), /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
759
+ className: "selectedItemClose",
760
+ color: "#000",
761
+ onClick: function onClick() {
762
+ return delSelectedItem(index);
763
+ },
764
+ size: 12,
765
+ type: "icon-close"
766
+ }));
824
767
  })))), /*#__PURE__*/_react["default"].createElement("div", {
825
768
  className: "footer"
826
769
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -829,7 +772,7 @@ var ProductModal = function ProductModal(props) {
829
772
  className: "totalNum"
830
773
  }, selectedList.length, "/", maxSelect)), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
831
774
  onClick: function onClick() {
832
- handleModalSave && handleModalSave(selectedList, proType);
775
+ handleModalSave && handleModalSave(selectedList);
833
776
  closeModal && closeModal();
834
777
  },
835
778
  style: {
@@ -17,13 +17,7 @@
17
17
  margin-left: 16px;
18
18
  display: flex;
19
19
  flex-direction: column;
20
- justify-content: flex-start;
21
-
22
-
23
- .btn-select-type {
24
- text-align: right;
25
- margin-bottom: 15px;
26
- }
20
+ justify-content: space-between;
27
21
 
28
22
  .prodImg {
29
23
  display: inline-block;