@fonixtree/magic-design 1.0.38 → 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.
- package/es/common/LinkModal/ProductDetailPage/index.js +36 -24
- package/es/common/ProductModal/index.js +50 -43
- package/es/common/ProductSource/index.js +19 -20
- package/es/utils/businessUtil.js +2 -2
- package/lib/common/LinkModal/ProductDetailPage/index.js +36 -24
- package/lib/common/ProductModal/index.js +50 -43
- package/lib/common/ProductSource/index.js +19 -20
- package/lib/utils/businessUtil.js +2 -2
- package/package.json +1 -1
|
@@ -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 =
|
|
234
|
-
setPaginationParams =
|
|
237
|
+
paginationParams = _l[0],
|
|
238
|
+
setPaginationParams = _l[1];
|
|
235
239
|
|
|
236
240
|
var columns = [{
|
|
237
241
|
title: 'Image',
|
|
@@ -272,7 +276,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
272
276
|
|
|
273
277
|
var queryGoods = function queryGoods() {
|
|
274
278
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
275
|
-
var _list, total, params,
|
|
279
|
+
var _list, total, params, res_1, res;
|
|
276
280
|
|
|
277
281
|
return __generator(this, function (_a) {
|
|
278
282
|
switch (_a.label) {
|
|
@@ -288,24 +292,9 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
288
292
|
pageSize: paginationParams.pageSize,
|
|
289
293
|
pageIndex: paginationParams.current
|
|
290
294
|
};
|
|
291
|
-
if (!(proType === '
|
|
295
|
+
if (!(proType === 'spu')) return [3
|
|
292
296
|
/*break*/
|
|
293
297
|
, 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
298
|
return [4
|
|
310
299
|
/*yield*/
|
|
311
300
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -316,7 +305,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
316
305
|
crmFlag: 'on'
|
|
317
306
|
}), 'GET')];
|
|
318
307
|
|
|
319
|
-
case
|
|
308
|
+
case 1:
|
|
320
309
|
res_1 = _a.sent();
|
|
321
310
|
_list = (0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
322
311
|
return res_1.list.map(function (m) {
|
|
@@ -324,6 +313,22 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
324
313
|
});
|
|
325
314
|
}, []), proType);
|
|
326
315
|
total = res_1.total;
|
|
316
|
+
return [3
|
|
317
|
+
/*break*/
|
|
318
|
+
, 4];
|
|
319
|
+
|
|
320
|
+
case 2:
|
|
321
|
+
return [4
|
|
322
|
+
/*yield*/
|
|
323
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
324
|
+
state: 'A',
|
|
325
|
+
productCode: productCode
|
|
326
|
+
}), 'GET')];
|
|
327
|
+
|
|
328
|
+
case 3:
|
|
329
|
+
res = _a.sent();
|
|
330
|
+
_list = (0, _ProductModal.formatData)(res.list || []);
|
|
331
|
+
total = res.total;
|
|
327
332
|
_a.label = 4;
|
|
328
333
|
|
|
329
334
|
case 4:
|
|
@@ -401,14 +406,21 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
401
406
|
};
|
|
402
407
|
|
|
403
408
|
(0, _react.useEffect)(function () {
|
|
404
|
-
setLoading(true);
|
|
405
|
-
queryGoods();
|
|
406
409
|
queryBrand();
|
|
407
410
|
|
|
408
411
|
if ((0, _businessUtil.isPlatform)()) {
|
|
409
412
|
queryStore();
|
|
410
413
|
}
|
|
411
414
|
}, []);
|
|
415
|
+
(0, _react.useEffect)(function () {
|
|
416
|
+
setLoading(true);
|
|
417
|
+
reset();
|
|
418
|
+
paginationParams.current = 1;
|
|
419
|
+
setFlag(!flag);
|
|
420
|
+
}, [proType]);
|
|
421
|
+
(0, _react.useEffect)(function () {
|
|
422
|
+
queryGoods();
|
|
423
|
+
}, [flag]);
|
|
412
424
|
var proTypeOption = [{
|
|
413
425
|
label: 'SKU',
|
|
414
426
|
value: 'sku'
|
|
@@ -452,7 +464,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
452
464
|
}))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
453
465
|
span: 9
|
|
454
466
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
455
|
-
label: proType === '
|
|
467
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
456
468
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
457
469
|
onChange: function onChange(e) {
|
|
458
470
|
return setProductCode(e.target.value);
|
|
@@ -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)(
|
|
307
|
-
|
|
308
|
-
|
|
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 =
|
|
316
|
-
setPaginationParams =
|
|
319
|
+
paginationParams = _x[0],
|
|
320
|
+
setPaginationParams = _x[1];
|
|
317
321
|
|
|
318
322
|
var rowSelection = {
|
|
319
323
|
selectedRowKeys: selectedList.map(function (v) {
|
|
@@ -352,7 +356,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
352
356
|
|
|
353
357
|
var queryGoods = function queryGoods() {
|
|
354
358
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
355
|
-
var _list, total, params,
|
|
359
|
+
var _list, total, params, res_1, res;
|
|
356
360
|
|
|
357
361
|
return __generator(this, function (_a) {
|
|
358
362
|
switch (_a.label) {
|
|
@@ -371,27 +375,11 @@ 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
|
-
if (!(proType === '
|
|
380
|
+
if (!(proType === 'spu')) return [3
|
|
378
381
|
/*break*/
|
|
379
382
|
, 2];
|
|
380
|
-
return [4
|
|
381
|
-
/*yield*/
|
|
382
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
383
|
-
productCode: productCode
|
|
384
|
-
}), 'GET')];
|
|
385
|
-
|
|
386
|
-
case 1:
|
|
387
|
-
res = _a.sent();
|
|
388
|
-
_list = formatData(res.list || []);
|
|
389
|
-
total = res.total;
|
|
390
|
-
return [3
|
|
391
|
-
/*break*/
|
|
392
|
-
, 4];
|
|
393
|
-
|
|
394
|
-
case 2:
|
|
395
383
|
return [4
|
|
396
384
|
/*yield*/
|
|
397
385
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -402,7 +390,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
402
390
|
crmFlag: 'on'
|
|
403
391
|
}), 'GET')];
|
|
404
392
|
|
|
405
|
-
case
|
|
393
|
+
case 1:
|
|
406
394
|
res_1 = _a.sent();
|
|
407
395
|
_list = formatData((0, _commonUtil.ensure)(function () {
|
|
408
396
|
return res_1.list.map(function (m) {
|
|
@@ -410,6 +398,22 @@ var ProductModal = function ProductModal(props) {
|
|
|
410
398
|
});
|
|
411
399
|
}, []), proType);
|
|
412
400
|
total = res_1.total;
|
|
401
|
+
return [3
|
|
402
|
+
/*break*/
|
|
403
|
+
, 4];
|
|
404
|
+
|
|
405
|
+
case 2:
|
|
406
|
+
return [4
|
|
407
|
+
/*yield*/
|
|
408
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
409
|
+
state: 'A',
|
|
410
|
+
productCode: productCode
|
|
411
|
+
}), 'GET')];
|
|
412
|
+
|
|
413
|
+
case 3:
|
|
414
|
+
res = _a.sent();
|
|
415
|
+
_list = formatData(res.list || []);
|
|
416
|
+
total = res.total;
|
|
413
417
|
_a.label = 4;
|
|
414
418
|
|
|
415
419
|
case 4:
|
|
@@ -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
|
-
|
|
552
|
+
setFlag(!flag);
|
|
536
553
|
}, [proType]);
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
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',
|
|
@@ -565,8 +572,8 @@ var ProductModal = function ProductModal(props) {
|
|
|
565
572
|
width: 120,
|
|
566
573
|
ellipsis: true
|
|
567
574
|
}, {
|
|
568
|
-
title: proType === '
|
|
569
|
-
dataIndex: proType === '
|
|
575
|
+
title: proType === 'spu' ? (0, _locale.i18n)('SPU_CODE') : (0, _locale.i18n)('SKU_CODE'),
|
|
576
|
+
dataIndex: proType === 'spu' ? 'offerCode' : 'productCode',
|
|
570
577
|
width: 120,
|
|
571
578
|
ellipsis: true
|
|
572
579
|
}, _defineProperty({
|
|
@@ -713,7 +720,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
713
720
|
size: "small",
|
|
714
721
|
value: productName
|
|
715
722
|
})), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
716
|
-
label: proType === '
|
|
723
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
717
724
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
718
725
|
className: "inputStyle",
|
|
719
726
|
onChange: function onChange(e) {
|
|
@@ -201,53 +201,52 @@ function ProductSource(_a) {
|
|
|
201
201
|
|
|
202
202
|
var onSelectProduct = function onSelectProduct() {
|
|
203
203
|
return __awaiter(_this, void 0, void 0, function () {
|
|
204
|
-
var url, param,
|
|
204
|
+
var url, param, list_1, url, param, list;
|
|
205
205
|
return __generator(this, function (_a) {
|
|
206
206
|
switch (_a.label) {
|
|
207
207
|
case 0:
|
|
208
208
|
if (!(value && value.length > 0)) return [3
|
|
209
209
|
/*break*/
|
|
210
210
|
, 5];
|
|
211
|
-
if (!(prodType === '
|
|
211
|
+
if (!(prodType === 'spu')) return [3
|
|
212
212
|
/*break*/
|
|
213
213
|
, 2];
|
|
214
|
-
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/
|
|
214
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
|
|
215
215
|
param = {
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
offers: value,
|
|
217
|
+
isDefaultCover: 'Y',
|
|
218
|
+
onlyQryPublishSku: true,
|
|
219
|
+
auditState: 'S',
|
|
220
|
+
crmFlag: 'on'
|
|
218
221
|
};
|
|
219
222
|
return [4
|
|
220
223
|
/*yield*/
|
|
221
224
|
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
222
225
|
|
|
223
226
|
case 1:
|
|
224
|
-
|
|
225
|
-
setSelectedProds((0, _ProductModal.formatData)(
|
|
227
|
+
list_1 = _a.sent().list;
|
|
228
|
+
setSelectedProds((0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
229
|
+
return list_1.map(function (m) {
|
|
230
|
+
return __assign(__assign({}, m.products[0]), m);
|
|
231
|
+
});
|
|
232
|
+
}, []), prodType));
|
|
226
233
|
return [3
|
|
227
234
|
/*break*/
|
|
228
235
|
, 4];
|
|
229
236
|
|
|
230
237
|
case 2:
|
|
231
|
-
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/
|
|
238
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
|
|
232
239
|
param = {
|
|
233
|
-
|
|
234
|
-
state: 'A'
|
|
235
|
-
isDefaultCover: 'Y',
|
|
236
|
-
onlyQryPublishSku: true,
|
|
237
|
-
auditState: 'S',
|
|
238
|
-
crmFlag: 'on'
|
|
240
|
+
products: value,
|
|
241
|
+
state: 'A'
|
|
239
242
|
};
|
|
240
243
|
return [4
|
|
241
244
|
/*yield*/
|
|
242
245
|
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
243
246
|
|
|
244
247
|
case 3:
|
|
245
|
-
|
|
246
|
-
setSelectedProds((0, _ProductModal.formatData)(
|
|
247
|
-
return list_1.map(function (m) {
|
|
248
|
-
return __assign(__assign({}, m.products[0]), m);
|
|
249
|
-
});
|
|
250
|
-
}, []), prodType));
|
|
248
|
+
list = _a.sent().list;
|
|
249
|
+
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
251
250
|
_a.label = 4;
|
|
252
251
|
|
|
253
252
|
case 4:
|
package/es/utils/businessUtil.js
CHANGED
|
@@ -82,7 +82,7 @@ var newParseUrl = function newParseUrl(urlObj) {
|
|
|
82
82
|
// 商品列表
|
|
83
83
|
|
|
84
84
|
case _constants.urlTypeMap.FILTERED_PRODUCT:
|
|
85
|
-
link = "/product/list
|
|
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
|
|
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 =
|
|
234
|
-
setPaginationParams =
|
|
237
|
+
paginationParams = _l[0],
|
|
238
|
+
setPaginationParams = _l[1];
|
|
235
239
|
|
|
236
240
|
var columns = [{
|
|
237
241
|
title: 'Image',
|
|
@@ -272,7 +276,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
272
276
|
|
|
273
277
|
var queryGoods = function queryGoods() {
|
|
274
278
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
275
|
-
var _list, total, params,
|
|
279
|
+
var _list, total, params, res_1, res;
|
|
276
280
|
|
|
277
281
|
return __generator(this, function (_a) {
|
|
278
282
|
switch (_a.label) {
|
|
@@ -288,24 +292,9 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
288
292
|
pageSize: paginationParams.pageSize,
|
|
289
293
|
pageIndex: paginationParams.current
|
|
290
294
|
};
|
|
291
|
-
if (!(proType === '
|
|
295
|
+
if (!(proType === 'spu')) return [3
|
|
292
296
|
/*break*/
|
|
293
297
|
, 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
298
|
return [4
|
|
310
299
|
/*yield*/
|
|
311
300
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -316,7 +305,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
316
305
|
crmFlag: 'on'
|
|
317
306
|
}), 'GET')];
|
|
318
307
|
|
|
319
|
-
case
|
|
308
|
+
case 1:
|
|
320
309
|
res_1 = _a.sent();
|
|
321
310
|
_list = (0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
322
311
|
return res_1.list.map(function (m) {
|
|
@@ -324,6 +313,22 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
324
313
|
});
|
|
325
314
|
}, []), proType);
|
|
326
315
|
total = res_1.total;
|
|
316
|
+
return [3
|
|
317
|
+
/*break*/
|
|
318
|
+
, 4];
|
|
319
|
+
|
|
320
|
+
case 2:
|
|
321
|
+
return [4
|
|
322
|
+
/*yield*/
|
|
323
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
324
|
+
state: 'A',
|
|
325
|
+
productCode: productCode
|
|
326
|
+
}), 'GET')];
|
|
327
|
+
|
|
328
|
+
case 3:
|
|
329
|
+
res = _a.sent();
|
|
330
|
+
_list = (0, _ProductModal.formatData)(res.list || []);
|
|
331
|
+
total = res.total;
|
|
327
332
|
_a.label = 4;
|
|
328
333
|
|
|
329
334
|
case 4:
|
|
@@ -401,14 +406,21 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
401
406
|
};
|
|
402
407
|
|
|
403
408
|
(0, _react.useEffect)(function () {
|
|
404
|
-
setLoading(true);
|
|
405
|
-
queryGoods();
|
|
406
409
|
queryBrand();
|
|
407
410
|
|
|
408
411
|
if ((0, _businessUtil.isPlatform)()) {
|
|
409
412
|
queryStore();
|
|
410
413
|
}
|
|
411
414
|
}, []);
|
|
415
|
+
(0, _react.useEffect)(function () {
|
|
416
|
+
setLoading(true);
|
|
417
|
+
reset();
|
|
418
|
+
paginationParams.current = 1;
|
|
419
|
+
setFlag(!flag);
|
|
420
|
+
}, [proType]);
|
|
421
|
+
(0, _react.useEffect)(function () {
|
|
422
|
+
queryGoods();
|
|
423
|
+
}, [flag]);
|
|
412
424
|
var proTypeOption = [{
|
|
413
425
|
label: 'SKU',
|
|
414
426
|
value: 'sku'
|
|
@@ -452,7 +464,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
452
464
|
}))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
453
465
|
span: 9
|
|
454
466
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
455
|
-
label: proType === '
|
|
467
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
456
468
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
457
469
|
onChange: function onChange(e) {
|
|
458
470
|
return setProductCode(e.target.value);
|
|
@@ -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)(
|
|
307
|
-
|
|
308
|
-
|
|
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 =
|
|
316
|
-
setPaginationParams =
|
|
319
|
+
paginationParams = _x[0],
|
|
320
|
+
setPaginationParams = _x[1];
|
|
317
321
|
|
|
318
322
|
var rowSelection = {
|
|
319
323
|
selectedRowKeys: selectedList.map(function (v) {
|
|
@@ -352,7 +356,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
352
356
|
|
|
353
357
|
var queryGoods = function queryGoods() {
|
|
354
358
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
355
|
-
var _list, total, params,
|
|
359
|
+
var _list, total, params, res_1, res;
|
|
356
360
|
|
|
357
361
|
return __generator(this, function (_a) {
|
|
358
362
|
switch (_a.label) {
|
|
@@ -371,27 +375,11 @@ 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
|
-
if (!(proType === '
|
|
380
|
+
if (!(proType === 'spu')) return [3
|
|
378
381
|
/*break*/
|
|
379
382
|
, 2];
|
|
380
|
-
return [4
|
|
381
|
-
/*yield*/
|
|
382
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
383
|
-
productCode: productCode
|
|
384
|
-
}), 'GET')];
|
|
385
|
-
|
|
386
|
-
case 1:
|
|
387
|
-
res = _a.sent();
|
|
388
|
-
_list = formatData(res.list || []);
|
|
389
|
-
total = res.total;
|
|
390
|
-
return [3
|
|
391
|
-
/*break*/
|
|
392
|
-
, 4];
|
|
393
|
-
|
|
394
|
-
case 2:
|
|
395
383
|
return [4
|
|
396
384
|
/*yield*/
|
|
397
385
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -402,7 +390,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
402
390
|
crmFlag: 'on'
|
|
403
391
|
}), 'GET')];
|
|
404
392
|
|
|
405
|
-
case
|
|
393
|
+
case 1:
|
|
406
394
|
res_1 = _a.sent();
|
|
407
395
|
_list = formatData((0, _commonUtil.ensure)(function () {
|
|
408
396
|
return res_1.list.map(function (m) {
|
|
@@ -410,6 +398,22 @@ var ProductModal = function ProductModal(props) {
|
|
|
410
398
|
});
|
|
411
399
|
}, []), proType);
|
|
412
400
|
total = res_1.total;
|
|
401
|
+
return [3
|
|
402
|
+
/*break*/
|
|
403
|
+
, 4];
|
|
404
|
+
|
|
405
|
+
case 2:
|
|
406
|
+
return [4
|
|
407
|
+
/*yield*/
|
|
408
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
409
|
+
state: 'A',
|
|
410
|
+
productCode: productCode
|
|
411
|
+
}), 'GET')];
|
|
412
|
+
|
|
413
|
+
case 3:
|
|
414
|
+
res = _a.sent();
|
|
415
|
+
_list = formatData(res.list || []);
|
|
416
|
+
total = res.total;
|
|
413
417
|
_a.label = 4;
|
|
414
418
|
|
|
415
419
|
case 4:
|
|
@@ -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
|
-
|
|
552
|
+
setFlag(!flag);
|
|
536
553
|
}, [proType]);
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
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',
|
|
@@ -565,8 +572,8 @@ var ProductModal = function ProductModal(props) {
|
|
|
565
572
|
width: 120,
|
|
566
573
|
ellipsis: true
|
|
567
574
|
}, {
|
|
568
|
-
title: proType === '
|
|
569
|
-
dataIndex: proType === '
|
|
575
|
+
title: proType === 'spu' ? (0, _locale.i18n)('SPU_CODE') : (0, _locale.i18n)('SKU_CODE'),
|
|
576
|
+
dataIndex: proType === 'spu' ? 'offerCode' : 'productCode',
|
|
570
577
|
width: 120,
|
|
571
578
|
ellipsis: true
|
|
572
579
|
}, _defineProperty({
|
|
@@ -713,7 +720,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
713
720
|
size: "small",
|
|
714
721
|
value: productName
|
|
715
722
|
})), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
716
|
-
label: proType === '
|
|
723
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
717
724
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
718
725
|
className: "inputStyle",
|
|
719
726
|
onChange: function onChange(e) {
|
|
@@ -201,53 +201,52 @@ function ProductSource(_a) {
|
|
|
201
201
|
|
|
202
202
|
var onSelectProduct = function onSelectProduct() {
|
|
203
203
|
return __awaiter(_this, void 0, void 0, function () {
|
|
204
|
-
var url, param,
|
|
204
|
+
var url, param, list_1, url, param, list;
|
|
205
205
|
return __generator(this, function (_a) {
|
|
206
206
|
switch (_a.label) {
|
|
207
207
|
case 0:
|
|
208
208
|
if (!(value && value.length > 0)) return [3
|
|
209
209
|
/*break*/
|
|
210
210
|
, 5];
|
|
211
|
-
if (!(prodType === '
|
|
211
|
+
if (!(prodType === 'spu')) return [3
|
|
212
212
|
/*break*/
|
|
213
213
|
, 2];
|
|
214
|
-
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/
|
|
214
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
|
|
215
215
|
param = {
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
offers: value,
|
|
217
|
+
isDefaultCover: 'Y',
|
|
218
|
+
onlyQryPublishSku: true,
|
|
219
|
+
auditState: 'S',
|
|
220
|
+
crmFlag: 'on'
|
|
218
221
|
};
|
|
219
222
|
return [4
|
|
220
223
|
/*yield*/
|
|
221
224
|
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
222
225
|
|
|
223
226
|
case 1:
|
|
224
|
-
|
|
225
|
-
setSelectedProds((0, _ProductModal.formatData)(
|
|
227
|
+
list_1 = _a.sent().list;
|
|
228
|
+
setSelectedProds((0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
229
|
+
return list_1.map(function (m) {
|
|
230
|
+
return __assign(__assign({}, m.products[0]), m);
|
|
231
|
+
});
|
|
232
|
+
}, []), prodType));
|
|
226
233
|
return [3
|
|
227
234
|
/*break*/
|
|
228
235
|
, 4];
|
|
229
236
|
|
|
230
237
|
case 2:
|
|
231
|
-
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/
|
|
238
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
|
|
232
239
|
param = {
|
|
233
|
-
|
|
234
|
-
state: 'A'
|
|
235
|
-
isDefaultCover: 'Y',
|
|
236
|
-
onlyQryPublishSku: true,
|
|
237
|
-
auditState: 'S',
|
|
238
|
-
crmFlag: 'on'
|
|
240
|
+
products: value,
|
|
241
|
+
state: 'A'
|
|
239
242
|
};
|
|
240
243
|
return [4
|
|
241
244
|
/*yield*/
|
|
242
245
|
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
243
246
|
|
|
244
247
|
case 3:
|
|
245
|
-
|
|
246
|
-
setSelectedProds((0, _ProductModal.formatData)(
|
|
247
|
-
return list_1.map(function (m) {
|
|
248
|
-
return __assign(__assign({}, m.products[0]), m);
|
|
249
|
-
});
|
|
250
|
-
}, []), prodType));
|
|
248
|
+
list = _a.sent().list;
|
|
249
|
+
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
251
250
|
_a.label = 4;
|
|
252
251
|
|
|
253
252
|
case 4:
|
|
@@ -82,7 +82,7 @@ var newParseUrl = function newParseUrl(urlObj) {
|
|
|
82
82
|
// 商品列表
|
|
83
83
|
|
|
84
84
|
case _constants.urlTypeMap.FILTERED_PRODUCT:
|
|
85
|
-
link = "/product/list
|
|
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
|
|
254
|
+
link = "/product/list/?" + arg1;
|
|
255
255
|
params = {
|
|
256
256
|
action: 'jump',
|
|
257
257
|
params: {
|