@fonixtree/magic-design 1.0.39 → 1.0.40

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.
@@ -225,13 +225,17 @@ var ProductDetailPage = function ProductDetailPage(props) {
225
225
  proType = _j[0],
226
226
  setProType = _j[1];
227
227
 
228
- var _k = (0, _react.useState)({
228
+ var _k = (0, _react.useState)(false),
229
+ flag = _k[0],
230
+ setFlag = _k[1];
231
+
232
+ var _l = (0, _react.useState)({
229
233
  pageSize: 20,
230
234
  current: 1,
231
235
  total: 0
232
236
  }),
233
- paginationParams = _k[0],
234
- setPaginationParams = _k[1];
237
+ paginationParams = _l[0],
238
+ setPaginationParams = _l[1];
235
239
 
236
240
  var columns = [{
237
241
  title: 'Image',
@@ -317,6 +321,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
317
321
  return [4
318
322
  /*yield*/
319
323
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
324
+ state: 'A',
320
325
  productCode: productCode
321
326
  }), 'GET')];
322
327
 
@@ -409,9 +414,13 @@ var ProductDetailPage = function ProductDetailPage(props) {
409
414
  }, []);
410
415
  (0, _react.useEffect)(function () {
411
416
  setLoading(true);
417
+ reset();
412
418
  paginationParams.current = 1;
413
- queryGoods();
419
+ setFlag(!flag);
414
420
  }, [proType]);
421
+ (0, _react.useEffect)(function () {
422
+ queryGoods();
423
+ }, [flag]);
415
424
  var proTypeOption = [{
416
425
  label: 'SKU',
417
426
  value: 'sku'
@@ -303,17 +303,21 @@ var ProductModal = function ProductModal(props) {
303
303
  proType = _u[0],
304
304
  setProType = _u[1];
305
305
 
306
- var _v = (0, _react.useState)(defaultList),
307
- selectedList = _v[0],
308
- setSelectedList = _v[1];
306
+ var _v = (0, _react.useState)(false),
307
+ flag = _v[0],
308
+ setFlag = _v[1];
309
309
 
310
- var _w = (0, _react.useState)({
310
+ var _w = (0, _react.useState)(defaultList),
311
+ selectedList = _w[0],
312
+ setSelectedList = _w[1];
313
+
314
+ var _x = (0, _react.useState)({
311
315
  pageSize: 20,
312
316
  current: 1,
313
317
  total: 0
314
318
  }),
315
- paginationParams = _w[0],
316
- setPaginationParams = _w[1];
319
+ paginationParams = _x[0],
320
+ setPaginationParams = _x[1];
317
321
 
318
322
  var rowSelection = {
319
323
  selectedRowKeys: selectedList.map(function (v) {
@@ -371,8 +375,7 @@ var ProductModal = function ProductModal(props) {
371
375
  brandIds: selBrandsList.join(','),
372
376
  labelIds: selLabelData.value || '',
373
377
  pageSize: paginationParams.pageSize,
374
- pageIndex: paginationParams.current,
375
- state: 'A'
378
+ pageIndex: paginationParams.current
376
379
  };
377
380
  if (!(proType === 'spu')) return [3
378
381
  /*break*/
@@ -403,6 +406,7 @@ var ProductModal = function ProductModal(props) {
403
406
  return [4
404
407
  /*yield*/
405
408
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
409
+ state: 'A',
406
410
  productCode: productCode
407
411
  }), 'GET')];
408
412
 
@@ -514,6 +518,18 @@ var ProductModal = function ProductModal(props) {
514
518
  });
515
519
  };
516
520
 
521
+ var reset = function reset() {
522
+ setSelBrandsList([]);
523
+ setSelCatgsList([]);
524
+ setSelLabelData([]);
525
+ setProductName('');
526
+ setStoreId('');
527
+ setProductCode('');
528
+ setMinPrice('');
529
+ setMaxPrice('');
530
+ setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
531
+ };
532
+
517
533
  (0, _react.useEffect)(function () {
518
534
  queryOfferCatgs();
519
535
  queryBrands();
@@ -531,22 +547,13 @@ var ProductModal = function ProductModal(props) {
531
547
  }
532
548
  }, [visible]);
533
549
  (0, _react.useEffect)(function () {
550
+ reset();
534
551
  paginationParams.current = 1;
535
- queryGoods();
552
+ setFlag(!flag);
536
553
  }, [proType]);
537
-
538
- var reset = function reset() {
539
- setSelBrandsList([]);
540
- setSelCatgsList([]);
541
- setSelLabelData([]);
542
- setProductName('');
543
- setStoreId('');
544
- setProductCode('');
545
- setMinPrice('');
546
- setMaxPrice('');
547
- setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
548
- };
549
-
554
+ (0, _react.useEffect)(function () {
555
+ queryGoods();
556
+ }, [flag]);
550
557
  var columns = [{
551
558
  title: (0, _locale.i18n)('IMAGE'),
552
559
  dataIndex: 'productImageUrl',
@@ -214,7 +214,6 @@ function ProductSource(_a) {
214
214
  url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
215
215
  param = {
216
216
  offers: value,
217
- state: 'A',
218
217
  isDefaultCover: 'Y',
219
218
  onlyQryPublishSku: true,
220
219
  auditState: 'S',
@@ -82,7 +82,7 @@ var newParseUrl = function newParseUrl(urlObj) {
82
82
  // 商品列表
83
83
 
84
84
  case _constants.urlTypeMap.FILTERED_PRODUCT:
85
- link = "/product/list?" + value;
85
+ link = "/product/list/?" + value;
86
86
  params = {
87
87
  action: 'jump',
88
88
  params: {
@@ -251,7 +251,7 @@ var parseUrl = function parseUrl(url) {
251
251
  // 商品列表
252
252
 
253
253
  case _constants.urlType.PROD_FILTER:
254
- link = "/product/list?" + arg1;
254
+ link = "/product/list/?" + arg1;
255
255
  params = {
256
256
  action: 'jump',
257
257
  params: {
@@ -225,13 +225,17 @@ var ProductDetailPage = function ProductDetailPage(props) {
225
225
  proType = _j[0],
226
226
  setProType = _j[1];
227
227
 
228
- var _k = (0, _react.useState)({
228
+ var _k = (0, _react.useState)(false),
229
+ flag = _k[0],
230
+ setFlag = _k[1];
231
+
232
+ var _l = (0, _react.useState)({
229
233
  pageSize: 20,
230
234
  current: 1,
231
235
  total: 0
232
236
  }),
233
- paginationParams = _k[0],
234
- setPaginationParams = _k[1];
237
+ paginationParams = _l[0],
238
+ setPaginationParams = _l[1];
235
239
 
236
240
  var columns = [{
237
241
  title: 'Image',
@@ -317,6 +321,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
317
321
  return [4
318
322
  /*yield*/
319
323
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
324
+ state: 'A',
320
325
  productCode: productCode
321
326
  }), 'GET')];
322
327
 
@@ -409,9 +414,13 @@ var ProductDetailPage = function ProductDetailPage(props) {
409
414
  }, []);
410
415
  (0, _react.useEffect)(function () {
411
416
  setLoading(true);
417
+ reset();
412
418
  paginationParams.current = 1;
413
- queryGoods();
419
+ setFlag(!flag);
414
420
  }, [proType]);
421
+ (0, _react.useEffect)(function () {
422
+ queryGoods();
423
+ }, [flag]);
415
424
  var proTypeOption = [{
416
425
  label: 'SKU',
417
426
  value: 'sku'
@@ -303,17 +303,21 @@ var ProductModal = function ProductModal(props) {
303
303
  proType = _u[0],
304
304
  setProType = _u[1];
305
305
 
306
- var _v = (0, _react.useState)(defaultList),
307
- selectedList = _v[0],
308
- setSelectedList = _v[1];
306
+ var _v = (0, _react.useState)(false),
307
+ flag = _v[0],
308
+ setFlag = _v[1];
309
309
 
310
- var _w = (0, _react.useState)({
310
+ var _w = (0, _react.useState)(defaultList),
311
+ selectedList = _w[0],
312
+ setSelectedList = _w[1];
313
+
314
+ var _x = (0, _react.useState)({
311
315
  pageSize: 20,
312
316
  current: 1,
313
317
  total: 0
314
318
  }),
315
- paginationParams = _w[0],
316
- setPaginationParams = _w[1];
319
+ paginationParams = _x[0],
320
+ setPaginationParams = _x[1];
317
321
 
318
322
  var rowSelection = {
319
323
  selectedRowKeys: selectedList.map(function (v) {
@@ -371,8 +375,7 @@ var ProductModal = function ProductModal(props) {
371
375
  brandIds: selBrandsList.join(','),
372
376
  labelIds: selLabelData.value || '',
373
377
  pageSize: paginationParams.pageSize,
374
- pageIndex: paginationParams.current,
375
- state: 'A'
378
+ pageIndex: paginationParams.current
376
379
  };
377
380
  if (!(proType === 'spu')) return [3
378
381
  /*break*/
@@ -403,6 +406,7 @@ var ProductModal = function ProductModal(props) {
403
406
  return [4
404
407
  /*yield*/
405
408
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
409
+ state: 'A',
406
410
  productCode: productCode
407
411
  }), 'GET')];
408
412
 
@@ -514,6 +518,18 @@ var ProductModal = function ProductModal(props) {
514
518
  });
515
519
  };
516
520
 
521
+ var reset = function reset() {
522
+ setSelBrandsList([]);
523
+ setSelCatgsList([]);
524
+ setSelLabelData([]);
525
+ setProductName('');
526
+ setStoreId('');
527
+ setProductCode('');
528
+ setMinPrice('');
529
+ setMaxPrice('');
530
+ setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
531
+ };
532
+
517
533
  (0, _react.useEffect)(function () {
518
534
  queryOfferCatgs();
519
535
  queryBrands();
@@ -531,22 +547,13 @@ var ProductModal = function ProductModal(props) {
531
547
  }
532
548
  }, [visible]);
533
549
  (0, _react.useEffect)(function () {
550
+ reset();
534
551
  paginationParams.current = 1;
535
- queryGoods();
552
+ setFlag(!flag);
536
553
  }, [proType]);
537
-
538
- var reset = function reset() {
539
- setSelBrandsList([]);
540
- setSelCatgsList([]);
541
- setSelLabelData([]);
542
- setProductName('');
543
- setStoreId('');
544
- setProductCode('');
545
- setMinPrice('');
546
- setMaxPrice('');
547
- setPromotions(props.type === 'groupBuy' ? promType.GROUP_BUY : null);
548
- };
549
-
554
+ (0, _react.useEffect)(function () {
555
+ queryGoods();
556
+ }, [flag]);
550
557
  var columns = [{
551
558
  title: (0, _locale.i18n)('IMAGE'),
552
559
  dataIndex: 'productImageUrl',
@@ -214,7 +214,6 @@ function ProductSource(_a) {
214
214
  url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
215
215
  param = {
216
216
  offers: value,
217
- state: 'A',
218
217
  isDefaultCover: 'Y',
219
218
  onlyQryPublishSku: true,
220
219
  auditState: 'S',
@@ -82,7 +82,7 @@ var newParseUrl = function newParseUrl(urlObj) {
82
82
  // 商品列表
83
83
 
84
84
  case _constants.urlTypeMap.FILTERED_PRODUCT:
85
- link = "/product/list?" + value;
85
+ link = "/product/list/?" + value;
86
86
  params = {
87
87
  action: 'jump',
88
88
  params: {
@@ -251,7 +251,7 @@ var parseUrl = function parseUrl(url) {
251
251
  // 商品列表
252
252
 
253
253
  case _constants.urlType.PROD_FILTER:
254
- link = "/product/list?" + arg1;
254
+ link = "/product/list/?" + arg1;
255
255
  params = {
256
256
  action: 'jump',
257
257
  params: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.39",
4
+ "version": "1.0.40",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",