@fonixtree/magic-design 2.0.73 → 2.0.75

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 (61) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/assets/fonts/magic-box-iconfont.css +8 -4
  3. package/es/assets/fonts/magic-box-iconfont.css.bak +8 -4
  4. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  5. package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
  6. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  7. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  8. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  9. package/es/common/LinkModal/BundleCampaign/index.js +2 -2
  10. package/es/common/LinkModal/CouponTable/index.js +1 -1
  11. package/es/common/LinkModal/FilteredProductModal/index.js +14 -88
  12. package/es/common/LinkModal/FilteredProductModal/index.less +0 -6
  13. package/es/common/LinkModal/ProductDetailPage/index.js +52 -32
  14. package/es/common/MagicLink/index.js +2 -2
  15. package/es/common/ProductModal/index.js +50 -43
  16. package/es/common/ProductSource/index.js +19 -20
  17. package/es/common/UrlPicker/AnchorModal/index.js +170 -0
  18. package/es/common/UrlPicker/AnchorModal/index.less +21 -0
  19. package/es/common/UrlPicker/index.js +61 -11
  20. package/es/composite-comp/bol/components/Wallet/mobile/index.js +1 -1
  21. package/es/composite-comp/bol/second-config-panels/WalletSecondConfig/index.js +1 -1
  22. package/es/composite-comp/dito/components/Recommend/mobile/index.js +1 -1
  23. package/es/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  24. package/es/constants/index.js +3 -2
  25. package/es/core/Designer/QuickMenuBar/index.js +1 -1
  26. package/es/locale/en/en.json +1 -0
  27. package/es/locale/es/es.json +1 -0
  28. package/es/locale/id/id.json +1 -0
  29. package/es/utils/businessUtil.js +13 -2
  30. package/es/utils/coreUtil.js +11 -0
  31. package/lib/assets/fonts/.DS_Store +0 -0
  32. package/lib/assets/fonts/magic-box-iconfont.css +8 -4
  33. package/lib/assets/fonts/magic-box-iconfont.css.bak +8 -4
  34. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  35. package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
  36. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  37. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  38. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  39. package/lib/common/LinkModal/BundleCampaign/index.js +2 -2
  40. package/lib/common/LinkModal/CouponTable/index.js +1 -1
  41. package/lib/common/LinkModal/FilteredProductModal/index.js +14 -88
  42. package/lib/common/LinkModal/FilteredProductModal/index.less +0 -6
  43. package/lib/common/LinkModal/ProductDetailPage/index.js +52 -32
  44. package/lib/common/MagicLink/index.js +2 -2
  45. package/lib/common/ProductModal/index.js +50 -43
  46. package/lib/common/ProductSource/index.js +19 -20
  47. package/lib/common/UrlPicker/AnchorModal/index.js +170 -0
  48. package/lib/common/UrlPicker/AnchorModal/index.less +21 -0
  49. package/lib/common/UrlPicker/index.js +61 -11
  50. package/lib/composite-comp/bol/components/Wallet/mobile/index.js +1 -1
  51. package/lib/composite-comp/bol/second-config-panels/WalletSecondConfig/index.js +1 -1
  52. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +1 -1
  53. package/lib/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  54. package/lib/constants/index.js +3 -2
  55. package/lib/core/Designer/QuickMenuBar/index.js +1 -1
  56. package/lib/locale/en/en.json +1 -0
  57. package/lib/locale/es/es.json +1 -0
  58. package/lib/locale/id/id.json +1 -0
  59. package/lib/utils/businessUtil.js +13 -2
  60. package/lib/utils/coreUtil.js +11 -0
  61. package/package.json +1 -1
@@ -179,7 +179,7 @@ var BundleCampaign = function BundleCampaign(props) {
179
179
  campaignName = _b[0],
180
180
  setCampaignName = _b[1];
181
181
 
182
- var _c = (0, _react.useState)(window.magicDesign.storeId ? window.magicDesign.storeId : ''),
182
+ var _c = (0, _react.useState)(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''),
183
183
  storeId = _c[0],
184
184
  setStoreId = _c[1];
185
185
 
@@ -241,7 +241,7 @@ var BundleCampaign = function BundleCampaign(props) {
241
241
 
242
242
  var reset = function reset() {
243
243
  setCampaignName('');
244
- setStoreId(window.magicDesign.storeId ? window.magicDesign.storeId : '');
244
+ setStoreId(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : '');
245
245
  setCmpState('A,B');
246
246
  };
247
247
 
@@ -257,7 +257,7 @@ function CouponTable(props) {
257
257
  state: 'A',
258
258
  couponLocation: 'Promotion',
259
259
  pageTotal: false,
260
- storeId: window.magicDesign.storeId ? window.magicDesign.storeId : ''
260
+ storeId: window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''
261
261
  });
262
262
  return [4
263
263
  /*yield*/
@@ -184,14 +184,6 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
184
184
  }
185
185
  };
186
186
 
187
- var proTypeOption = [{
188
- label: 'SKU',
189
- value: 'sku'
190
- }, {
191
- label: 'SPU',
192
- value: 'spu'
193
- }];
194
-
195
187
  var FilteredProductModal = function FilteredProductModal(props) {
196
188
  var onDataChange = props.onDataChange;
197
189
  var Option = _antd.Select.Option;
@@ -221,7 +213,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
221
213
  labelData = _f[0],
222
214
  setLabelData = _f[1];
223
215
 
224
- var _g = (0, _react.useState)(window.magicDesign.storeId || ''),
216
+ var _g = (0, _react.useState)(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''),
225
217
  storeId = _g[0],
226
218
  setStoreId = _g[1];
227
219
 
@@ -253,17 +245,13 @@ var FilteredProductModal = function FilteredProductModal(props) {
253
245
  loading = _p[0],
254
246
  setLoading = _p[1];
255
247
 
256
- var _q = (0, _react.useState)('sku'),
257
- proType = _q[0],
258
- setProType = _q[1];
259
-
260
- var _r = (0, _react.useState)({
248
+ var _q = (0, _react.useState)({
261
249
  pageSize: 20,
262
250
  current: 1,
263
251
  total: 0
264
252
  }),
265
- paginationParams = _r[0],
266
- setPaginationParams = _r[1];
253
+ paginationParams = _q[0],
254
+ setPaginationParams = _q[1];
267
255
 
268
256
  var onChange = function onChange(value) {
269
257
  settVal(value);
@@ -289,7 +277,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
289
277
  settVal([]);
290
278
  settBrandId([]);
291
279
  settLabelId({});
292
- setStoreId(window.magicDesign.storeId || '');
280
+ setStoreId(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : '');
293
281
  setProductName('');
294
282
  setMinimum('');
295
283
  setMaximum('');
@@ -307,7 +295,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
307
295
  return /*#__PURE__*/_react["default"].createElement("div", {
308
296
  className: "prodImage",
309
297
  style: {
310
- backgroundImage: "url(\"" + (imgUrl || (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent)) + "\")"
298
+ backgroundImage: "url(\"" + (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent) + "\")"
311
299
  }
312
300
  });
313
301
  }
@@ -441,17 +429,11 @@ var FilteredProductModal = function FilteredProductModal(props) {
441
429
 
442
430
  var loadGoods = function loadGoods() {
443
431
  return __awaiter(void 0, void 0, void 0, function () {
444
- var _list, total, params, res, params, res_1, h5UrlStr;
445
-
432
+ var params, res, h5UrlStr;
446
433
  return __generator(this, function (_a) {
447
434
  switch (_a.label) {
448
435
  case 0:
449
436
  setLoading(true);
450
- _list = [];
451
- total = 0;
452
- if (!(proType === 'sku')) return [3
453
- /*break*/
454
- , 2];
455
437
  params = {
456
438
  catgIds: tValue.join(','),
457
439
  brandIds: brandId.map(function (v) {
@@ -473,51 +455,10 @@ var FilteredProductModal = function FilteredProductModal(props) {
473
455
 
474
456
  case 1:
475
457
  res = _a.sent();
476
- _list = res.list || [];
477
- total = res.total;
478
- return [3
479
- /*break*/
480
- , 4];
481
-
482
- case 2:
483
- params = {
484
- catgIds: tValue.join(','),
485
- brandIds: brandId.map(function (v) {
486
- return v.key;
487
- }).join(','),
488
- labelIds: labelId.key,
489
- productName: productName,
490
- storeId: storeId,
491
- minPrice: (0, _currencyUtil.formatBackendCurrency)(minimum),
492
- maxPrice: (0, _currencyUtil.formatBackendCurrency)(maximum),
493
- cmpTypeId: promotions.key || '',
494
- state: 'A',
495
- pageSize: paginationParams.pageSize,
496
- pageIndex: paginationParams.current
497
- };
498
- return [4
499
- /*yield*/
500
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
501
- isDefaultCover: 'Y',
502
- onlyQryPublishSku: true,
503
- auditState: 'S',
504
- crmFlag: 'on'
505
- }), 'GET')];
506
-
507
- case 3:
508
- res_1 = _a.sent();
509
- _list = (0, _commonUtil.ensure)(function () {
510
- return res_1.list.map(function (m) {
511
- return __assign(__assign({}, m.products[0]), m);
512
- });
513
- }, []);
514
- total = res_1.total;
515
- _a.label = 4;
516
-
517
- case 4:
518
- paginationParams.total = total;
519
- setLoading(false);
458
+ setDataSource(res.list || []);
459
+ paginationParams.total = res.total;
520
460
  setPaginationParams(__assign({}, paginationParams));
461
+ setLoading(false);
521
462
  h5UrlStr = JsonToUrl({
522
463
  catgIds: tValue.join(',') || '',
523
464
  brandIds: brandId.map(function (v) {
@@ -529,15 +470,13 @@ var FilteredProductModal = function FilteredProductModal(props) {
529
470
  minPrice: (0, _currencyUtil.formatBackendCurrency)(minimum),
530
471
  maxPrice: (0, _currencyUtil.formatBackendCurrency)(maximum),
531
472
  campaignType: promotions.key || '',
532
- state: 'A',
533
- proType: proType
473
+ state: 'A'
534
474
  });
535
- setDataSource(_list);
536
475
  return [2
537
476
  /*return*/
538
477
  , {
539
478
  url: h5UrlStr,
540
- total: total
479
+ total: res.total
541
480
  }];
542
481
  }
543
482
  });
@@ -553,10 +492,6 @@ var FilteredProductModal = function FilteredProductModal(props) {
553
492
  queryStore();
554
493
  }
555
494
  }, []);
556
- (0, _react.useEffect)(function () {
557
- paginationParams.current = 1;
558
- loadGoods();
559
- }, [proType]);
560
495
  return /*#__PURE__*/_react["default"].createElement("div", {
561
496
  className: "mFilteredProductModal"
562
497
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -727,16 +662,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
727
662
  size: "small"
728
663
  }, (0, _locale.i18n)('CANCEL'))))), /*#__PURE__*/_react["default"].createElement("div", {
729
664
  className: "rightCot"
730
- }, /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
731
- buttonStyle: "solid",
732
- className: "btn-select-type",
733
- onChange: function onChange(e) {
734
- setProType(e.target.value);
735
- },
736
- options: proTypeOption,
737
- optionType: "button",
738
- value: proType
739
- }), /*#__PURE__*/_react["default"].createElement(_antd.Table, {
665
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Table, {
740
666
  columns: columns,
741
667
  dataSource: dataSource,
742
668
  loading: loading,
@@ -747,7 +673,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
747
673
  }
748
674
  }),
749
675
  scroll: {
750
- y: 340
676
+ y: 400
751
677
  }
752
678
  })))));
753
679
  };
@@ -25,12 +25,6 @@
25
25
  width: calc(100% - 240px);
26
26
  margin-left: 16px;
27
27
 
28
- .btn-select-type {
29
- display: block;
30
- text-align: right;
31
- margin-bottom: 10px;
32
- }
33
-
34
28
  .selectedCot {
35
29
  width: 722px;
36
30
  margin-left: 4px;
@@ -17,8 +17,6 @@ var _commonUtil = require("../../../utils/commonUtil");
17
17
 
18
18
  var _businessUtil = require("../../../utils/businessUtil");
19
19
 
20
- var _ProductModal = require("../../ProductModal");
21
-
22
20
  require("./index.less");
23
21
 
24
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); }
@@ -187,7 +185,7 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
187
185
  var Option = _antd.Select.Option;
188
186
 
189
187
  var ProductDetailPage = function ProductDetailPage(props) {
190
- var _onChange = props.onChange;
188
+ var onChange = props.onChange;
191
189
 
192
190
  var _a = (0, _react.useState)([]),
193
191
  productList = _a[0],
@@ -225,13 +223,21 @@ var ProductDetailPage = function ProductDetailPage(props) {
225
223
  proType = _j[0],
226
224
  setProType = _j[1];
227
225
 
228
- var _k = (0, _react.useState)({
226
+ var _k = (0, _react.useState)(false),
227
+ flag = _k[0],
228
+ setFlag = _k[1];
229
+
230
+ var _l = (0, _react.useState)({}),
231
+ selectedPro = _l[0],
232
+ setSelectedPro = _l[1];
233
+
234
+ var _m = (0, _react.useState)({
229
235
  pageSize: 20,
230
236
  current: 1,
231
237
  total: 0
232
238
  }),
233
- paginationParams = _k[0],
234
- setPaginationParams = _k[1];
239
+ paginationParams = _m[0],
240
+ setPaginationParams = _m[1];
235
241
 
236
242
  var columns = [{
237
243
  title: 'Image',
@@ -260,19 +266,21 @@ var ProductDetailPage = function ProductDetailPage(props) {
260
266
  ellipsis: true
261
267
  }];
262
268
  var rowSelection = {
269
+ selectedRowKeys: [(selectedPro === null || selectedPro === void 0 ? void 0 : selectedPro.productId) || ''],
263
270
  onChange: function onChange(selectedRowKeys, selectedRows) {
264
- _onChange({
271
+ var selected = {
265
272
  offerId: selectedRows[0].offerId,
266
273
  productId: selectedRows[0].productId,
267
274
  name: selectedRows[0].productName
268
- });
275
+ };
276
+ setSelectedPro(selected);
269
277
  },
270
278
  type: 'radio'
271
279
  };
272
280
 
273
281
  var queryGoods = function queryGoods() {
274
282
  return __awaiter(void 0, void 0, void 0, function () {
275
- var _list, total, params, res, res_1;
283
+ var _list, total, params, res_1, res;
276
284
 
277
285
  return __generator(this, function (_a) {
278
286
  switch (_a.label) {
@@ -288,24 +296,9 @@ var ProductDetailPage = function ProductDetailPage(props) {
288
296
  pageSize: paginationParams.pageSize,
289
297
  pageIndex: paginationParams.current
290
298
  };
291
- if (!(proType === 'sku')) return [3
299
+ if (!(proType === 'spu')) return [3
292
300
  /*break*/
293
301
  , 2];
294
- return [4
295
- /*yield*/
296
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
297
- productCode: productCode
298
- }), 'GET')];
299
-
300
- case 1:
301
- res = _a.sent();
302
- _list = (0, _ProductModal.formatData)(res.list || []);
303
- total = res.total;
304
- return [3
305
- /*break*/
306
- , 4];
307
-
308
- case 2:
309
302
  return [4
310
303
  /*yield*/
311
304
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
@@ -316,14 +309,30 @@ var ProductDetailPage = function ProductDetailPage(props) {
316
309
  crmFlag: 'on'
317
310
  }), 'GET')];
318
311
 
319
- case 3:
312
+ case 1:
320
313
  res_1 = _a.sent();
321
- _list = (0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
314
+ _list = (0, _commonUtil.ensure)(function () {
322
315
  return res_1.list.map(function (m) {
323
316
  return __assign(__assign({}, m.products[0]), m);
324
317
  });
325
- }, []), proType);
318
+ }, []);
326
319
  total = res_1.total;
320
+ return [3
321
+ /*break*/
322
+ , 4];
323
+
324
+ case 2:
325
+ return [4
326
+ /*yield*/
327
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
328
+ state: 'A',
329
+ productCode: productCode
330
+ }), 'GET')];
331
+
332
+ case 3:
333
+ res = _a.sent();
334
+ _list = res.list || [];
335
+ total = res.total;
327
336
  _a.label = 4;
328
337
 
329
338
  case 4:
@@ -401,14 +410,25 @@ var ProductDetailPage = function ProductDetailPage(props) {
401
410
  };
402
411
 
403
412
  (0, _react.useEffect)(function () {
404
- setLoading(true);
405
- queryGoods();
406
413
  queryBrand();
407
414
 
408
415
  if ((0, _businessUtil.isPlatform)()) {
409
416
  queryStore();
410
417
  }
411
418
  }, []);
419
+ (0, _react.useEffect)(function () {
420
+ onChange(selectedPro);
421
+ }, [selectedPro]);
422
+ (0, _react.useEffect)(function () {
423
+ setLoading(true);
424
+ reset();
425
+ setSelectedPro({});
426
+ paginationParams.current = 1;
427
+ setFlag(!flag);
428
+ }, [proType]);
429
+ (0, _react.useEffect)(function () {
430
+ queryGoods();
431
+ }, [flag]);
412
432
  var proTypeOption = [{
413
433
  label: 'SKU',
414
434
  value: 'sku'
@@ -452,7 +472,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
452
472
  }))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
453
473
  span: 9
454
474
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
455
- label: proType === 'sku' ? 'SKU Code' : 'SPU Code'
475
+ label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
456
476
  }, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
457
477
  onChange: function onChange(e) {
458
478
  return setProductCode(e.target.value);
@@ -527,7 +547,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
527
547
  },
528
548
  showSizeChanger: false
529
549
  }),
530
- rowKey: "id",
550
+ rowKey: "productId",
531
551
  rowSelection: rowSelection,
532
552
  scroll: {
533
553
  y: 300
@@ -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 _businessUtil = require("src/components/utils/businessUtil");
10
+ var _coreUtil = require("../../utils/coreUtil");
11
11
 
12
- var _coreUtil = require("src/components/utils/coreUtil");
12
+ var _businessUtil = require("../../utils/businessUtil");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
@@ -302,17 +302,21 @@ var ProductModal = function ProductModal(props) {
302
302
  proType = _u[0],
303
303
  setProType = _u[1];
304
304
 
305
- var _v = (0, _react.useState)(defaultList),
306
- selectedList = _v[0],
307
- setSelectedList = _v[1];
305
+ var _v = (0, _react.useState)(false),
306
+ flag = _v[0],
307
+ setFlag = _v[1];
308
308
 
309
- var _w = (0, _react.useState)({
309
+ var _w = (0, _react.useState)(defaultList),
310
+ selectedList = _w[0],
311
+ setSelectedList = _w[1];
312
+
313
+ var _x = (0, _react.useState)({
310
314
  pageSize: 20,
311
315
  current: 1,
312
316
  total: 0
313
317
  }),
314
- paginationParams = _w[0],
315
- setPaginationParams = _w[1];
318
+ paginationParams = _x[0],
319
+ setPaginationParams = _x[1];
316
320
 
317
321
  var rowSelection = {
318
322
  selectedRowKeys: selectedList.map(function (v) {
@@ -351,7 +355,7 @@ var ProductModal = function ProductModal(props) {
351
355
 
352
356
  var queryGoods = function queryGoods() {
353
357
  return __awaiter(void 0, void 0, void 0, function () {
354
- var _list, total, params, res, res_1;
358
+ var _list, total, params, res_1, res;
355
359
 
356
360
  return __generator(this, function (_a) {
357
361
  switch (_a.label) {
@@ -370,27 +374,11 @@ var ProductModal = function ProductModal(props) {
370
374
  brandIds: selBrandsList.join(','),
371
375
  labelIds: selLabelData.value || '',
372
376
  pageSize: paginationParams.pageSize,
373
- pageIndex: paginationParams.current,
374
- state: 'A'
377
+ pageIndex: paginationParams.current
375
378
  };
376
- if (!(proType === 'sku')) return [3
379
+ if (!(proType === 'spu')) return [3
377
380
  /*break*/
378
381
  , 2];
379
- return [4
380
- /*yield*/
381
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
382
- productCode: productCode
383
- }), 'GET')];
384
-
385
- case 1:
386
- res = _a.sent();
387
- _list = formatData(res.list || []);
388
- total = res.total;
389
- return [3
390
- /*break*/
391
- , 4];
392
-
393
- case 2:
394
382
  return [4
395
383
  /*yield*/
396
384
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
@@ -401,7 +389,7 @@ var ProductModal = function ProductModal(props) {
401
389
  crmFlag: 'on'
402
390
  }), 'GET')];
403
391
 
404
- case 3:
392
+ case 1:
405
393
  res_1 = _a.sent();
406
394
  _list = formatData((0, _commonUtil.ensure)(function () {
407
395
  return res_1.list.map(function (m) {
@@ -409,6 +397,22 @@ var ProductModal = function ProductModal(props) {
409
397
  });
410
398
  }, []), proType);
411
399
  total = res_1.total;
400
+ return [3
401
+ /*break*/
402
+ , 4];
403
+
404
+ case 2:
405
+ return [4
406
+ /*yield*/
407
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
408
+ state: 'A',
409
+ productCode: productCode
410
+ }), 'GET')];
411
+
412
+ case 3:
413
+ res = _a.sent();
414
+ _list = formatData(res.list || []);
415
+ total = res.total;
412
416
  _a.label = 4;
413
417
 
414
418
  case 4:
@@ -513,6 +517,18 @@ var ProductModal = function ProductModal(props) {
513
517
  });
514
518
  };
515
519
 
520
+ var reset = function reset() {
521
+ setSelBrandsList([]);
522
+ setSelCatgsList([]);
523
+ setSelLabelData([]);
524
+ setProductName('');
525
+ setStoreId('');
526
+ setProductCode('');
527
+ setMinPrice('');
528
+ setMaxPrice('');
529
+ setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
530
+ };
531
+
516
532
  (0, _react.useEffect)(function () {
517
533
  queryOfferCatgs();
518
534
  queryBrands();
@@ -530,22 +546,13 @@ var ProductModal = function ProductModal(props) {
530
546
  }
531
547
  }, [visible]);
532
548
  (0, _react.useEffect)(function () {
549
+ reset();
533
550
  paginationParams.current = 1;
534
- queryGoods();
551
+ setFlag(!flag);
535
552
  }, [proType]);
536
-
537
- var reset = function reset() {
538
- setSelBrandsList([]);
539
- setSelCatgsList([]);
540
- setSelLabelData([]);
541
- setProductName('');
542
- setStoreId('');
543
- setProductCode('');
544
- setMinPrice('');
545
- setMaxPrice('');
546
- setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
547
- };
548
-
553
+ (0, _react.useEffect)(function () {
554
+ queryGoods();
555
+ }, [flag]);
549
556
  var columns = [{
550
557
  title: (0, _locale.i18n)('IMAGE'),
551
558
  dataIndex: 'productImageUrl',
@@ -564,8 +571,8 @@ var ProductModal = function ProductModal(props) {
564
571
  width: 120,
565
572
  ellipsis: true
566
573
  }, {
567
- title: proType === 'sku' ? (0, _locale.i18n)('SKU_CODE') : (0, _locale.i18n)('SPU_CODE'),
568
- dataIndex: proType === 'sku' ? 'productCode' : 'offerCode',
574
+ title: proType === 'spu' ? (0, _locale.i18n)('SPU_CODE') : (0, _locale.i18n)('SKU_CODE'),
575
+ dataIndex: proType === 'spu' ? 'offerCode' : 'productCode',
569
576
  width: 120,
570
577
  ellipsis: true
571
578
  }, _defineProperty({
@@ -712,7 +719,7 @@ var ProductModal = function ProductModal(props) {
712
719
  size: "small",
713
720
  value: productName
714
721
  })), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
715
- label: proType === 'sku' ? 'SKU Code' : 'SPU Code'
722
+ label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
716
723
  }, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
717
724
  className: "inputStyle",
718
725
  onChange: function onChange(e) {
@@ -204,7 +204,7 @@ function ProductSource(_a) {
204
204
 
205
205
  var onSelectProduct = function onSelectProduct() {
206
206
  return __awaiter(_this, void 0, void 0, function () {
207
- var url, param, list, url, param, list, url, param, list_1;
207
+ var url, param, list, url, param, list_1, url, param, list;
208
208
  return __generator(this, function (_a) {
209
209
  switch (_a.label) {
210
210
  case 0:
@@ -232,46 +232,45 @@ function ProductSource(_a) {
232
232
  , 6];
233
233
 
234
234
  case 2:
235
- if (!(prodType === 'sku')) return [3
235
+ if (!(prodType === 'spu')) return [3
236
236
  /*break*/
237
237
  , 4];
238
- url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
238
+ url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
239
239
  param = {
240
- products: value,
241
- state: 'A'
240
+ offers: value,
241
+ isDefaultCover: 'Y',
242
+ onlyQryPublishSku: true,
243
+ auditState: 'S',
244
+ crmFlag: 'on'
242
245
  };
243
246
  return [4
244
247
  /*yield*/
245
248
  , (0, _commonUtil.commonFetch)(url, param, 'GET')];
246
249
 
247
250
  case 3:
248
- list = _a.sent().list;
249
- setSelectedProds((0, _ProductModal.formatData)(list || []));
251
+ list_1 = _a.sent().list;
252
+ setSelectedProds((0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
253
+ return list_1.map(function (m) {
254
+ return __assign(__assign({}, m.products[0]), m);
255
+ });
256
+ }, []), prodType));
250
257
  return [3
251
258
  /*break*/
252
259
  , 6];
253
260
 
254
261
  case 4:
255
- url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
262
+ url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
256
263
  param = {
257
- offers: value,
258
- state: 'A',
259
- isDefaultCover: 'Y',
260
- onlyQryPublishSku: true,
261
- auditState: 'S',
262
- crmFlag: 'on'
264
+ products: value,
265
+ state: 'A'
263
266
  };
264
267
  return [4
265
268
  /*yield*/
266
269
  , (0, _commonUtil.commonFetch)(url, param, 'GET')];
267
270
 
268
271
  case 5:
269
- list_1 = _a.sent().list;
270
- setSelectedProds((0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
271
- return list_1.map(function (m) {
272
- return __assign(__assign({}, m.products[0]), m);
273
- });
274
- }, []), prodType));
272
+ list = _a.sent().list;
273
+ setSelectedProds((0, _ProductModal.formatData)(list || []));
275
274
  _a.label = 6;
276
275
 
277
276
  case 6: