@fonixtree/magic-design 1.0.37 → 1.0.39
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/FilteredProductModal/index.js +12 -86
- package/es/common/LinkModal/FilteredProductModal/index.less +0 -6
- package/es/common/LinkModal/ProductDetailPage/index.js +24 -21
- package/es/common/ProductModal/index.js +21 -21
- package/es/common/ProductSource/index.js +20 -20
- package/lib/common/LinkModal/FilteredProductModal/index.js +12 -86
- package/lib/common/LinkModal/FilteredProductModal/index.less +0 -6
- package/lib/common/LinkModal/ProductDetailPage/index.js +24 -21
- package/lib/common/ProductModal/index.js +21 -21
- package/lib/common/ProductSource/index.js +20 -20
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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)(
|
|
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 =
|
|
266
|
-
setPaginationParams =
|
|
253
|
+
paginationParams = _q[0],
|
|
254
|
+
setPaginationParams = _q[1];
|
|
267
255
|
|
|
268
256
|
var onChange = function onChange(value) {
|
|
269
257
|
settVal(value);
|
|
@@ -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(\"" + (
|
|
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
|
|
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
|
-
|
|
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.
|
|
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:
|
|
676
|
+
y: 400
|
|
751
677
|
}
|
|
752
678
|
})))));
|
|
753
679
|
};
|
|
@@ -272,7 +272,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
272
272
|
|
|
273
273
|
var queryGoods = function queryGoods() {
|
|
274
274
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
275
|
-
var _list, total, params,
|
|
275
|
+
var _list, total, params, res_1, res;
|
|
276
276
|
|
|
277
277
|
return __generator(this, function (_a) {
|
|
278
278
|
switch (_a.label) {
|
|
@@ -288,24 +288,9 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
288
288
|
pageSize: paginationParams.pageSize,
|
|
289
289
|
pageIndex: paginationParams.current
|
|
290
290
|
};
|
|
291
|
-
if (!(proType === '
|
|
291
|
+
if (!(proType === 'spu')) return [3
|
|
292
292
|
/*break*/
|
|
293
293
|
, 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
294
|
return [4
|
|
310
295
|
/*yield*/
|
|
311
296
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -316,7 +301,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
316
301
|
crmFlag: 'on'
|
|
317
302
|
}), 'GET')];
|
|
318
303
|
|
|
319
|
-
case
|
|
304
|
+
case 1:
|
|
320
305
|
res_1 = _a.sent();
|
|
321
306
|
_list = (0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
322
307
|
return res_1.list.map(function (m) {
|
|
@@ -324,6 +309,21 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
324
309
|
});
|
|
325
310
|
}, []), proType);
|
|
326
311
|
total = res_1.total;
|
|
312
|
+
return [3
|
|
313
|
+
/*break*/
|
|
314
|
+
, 4];
|
|
315
|
+
|
|
316
|
+
case 2:
|
|
317
|
+
return [4
|
|
318
|
+
/*yield*/
|
|
319
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
320
|
+
productCode: productCode
|
|
321
|
+
}), 'GET')];
|
|
322
|
+
|
|
323
|
+
case 3:
|
|
324
|
+
res = _a.sent();
|
|
325
|
+
_list = (0, _ProductModal.formatData)(res.list || []);
|
|
326
|
+
total = res.total;
|
|
327
327
|
_a.label = 4;
|
|
328
328
|
|
|
329
329
|
case 4:
|
|
@@ -401,14 +401,17 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
401
401
|
};
|
|
402
402
|
|
|
403
403
|
(0, _react.useEffect)(function () {
|
|
404
|
-
setLoading(true);
|
|
405
|
-
queryGoods();
|
|
406
404
|
queryBrand();
|
|
407
405
|
|
|
408
406
|
if ((0, _businessUtil.isPlatform)()) {
|
|
409
407
|
queryStore();
|
|
410
408
|
}
|
|
411
409
|
}, []);
|
|
410
|
+
(0, _react.useEffect)(function () {
|
|
411
|
+
setLoading(true);
|
|
412
|
+
paginationParams.current = 1;
|
|
413
|
+
queryGoods();
|
|
414
|
+
}, [proType]);
|
|
412
415
|
var proTypeOption = [{
|
|
413
416
|
label: 'SKU',
|
|
414
417
|
value: 'sku'
|
|
@@ -452,7 +455,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
452
455
|
}))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
453
456
|
span: 9
|
|
454
457
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
455
|
-
label: proType === '
|
|
458
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
456
459
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
457
460
|
onChange: function onChange(e) {
|
|
458
461
|
return setProductCode(e.target.value);
|
|
@@ -352,7 +352,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
352
352
|
|
|
353
353
|
var queryGoods = function queryGoods() {
|
|
354
354
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
355
|
-
var _list, total, params,
|
|
355
|
+
var _list, total, params, res_1, res;
|
|
356
356
|
|
|
357
357
|
return __generator(this, function (_a) {
|
|
358
358
|
switch (_a.label) {
|
|
@@ -374,24 +374,9 @@ var ProductModal = function ProductModal(props) {
|
|
|
374
374
|
pageIndex: paginationParams.current,
|
|
375
375
|
state: 'A'
|
|
376
376
|
};
|
|
377
|
-
if (!(proType === '
|
|
377
|
+
if (!(proType === 'spu')) return [3
|
|
378
378
|
/*break*/
|
|
379
379
|
, 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
380
|
return [4
|
|
396
381
|
/*yield*/
|
|
397
382
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -402,7 +387,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
402
387
|
crmFlag: 'on'
|
|
403
388
|
}), 'GET')];
|
|
404
389
|
|
|
405
|
-
case
|
|
390
|
+
case 1:
|
|
406
391
|
res_1 = _a.sent();
|
|
407
392
|
_list = formatData((0, _commonUtil.ensure)(function () {
|
|
408
393
|
return res_1.list.map(function (m) {
|
|
@@ -410,6 +395,21 @@ var ProductModal = function ProductModal(props) {
|
|
|
410
395
|
});
|
|
411
396
|
}, []), proType);
|
|
412
397
|
total = res_1.total;
|
|
398
|
+
return [3
|
|
399
|
+
/*break*/
|
|
400
|
+
, 4];
|
|
401
|
+
|
|
402
|
+
case 2:
|
|
403
|
+
return [4
|
|
404
|
+
/*yield*/
|
|
405
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
406
|
+
productCode: productCode
|
|
407
|
+
}), 'GET')];
|
|
408
|
+
|
|
409
|
+
case 3:
|
|
410
|
+
res = _a.sent();
|
|
411
|
+
_list = formatData(res.list || []);
|
|
412
|
+
total = res.total;
|
|
413
413
|
_a.label = 4;
|
|
414
414
|
|
|
415
415
|
case 4:
|
|
@@ -565,8 +565,8 @@ var ProductModal = function ProductModal(props) {
|
|
|
565
565
|
width: 120,
|
|
566
566
|
ellipsis: true
|
|
567
567
|
}, {
|
|
568
|
-
title: proType === '
|
|
569
|
-
dataIndex: proType === '
|
|
568
|
+
title: proType === 'spu' ? (0, _locale.i18n)('SPU_CODE') : (0, _locale.i18n)('SKU_CODE'),
|
|
569
|
+
dataIndex: proType === 'spu' ? 'offerCode' : 'productCode',
|
|
570
570
|
width: 120,
|
|
571
571
|
ellipsis: true
|
|
572
572
|
}, _defineProperty({
|
|
@@ -713,7 +713,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
713
713
|
size: "small",
|
|
714
714
|
value: productName
|
|
715
715
|
})), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
716
|
-
label: proType === '
|
|
716
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
717
717
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
718
718
|
className: "inputStyle",
|
|
719
719
|
onChange: function onChange(e) {
|
|
@@ -201,33 +201,16 @@ 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 + "/products";
|
|
215
|
-
param = {
|
|
216
|
-
products: value,
|
|
217
|
-
state: 'A'
|
|
218
|
-
};
|
|
219
|
-
return [4
|
|
220
|
-
/*yield*/
|
|
221
|
-
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
222
|
-
|
|
223
|
-
case 1:
|
|
224
|
-
list = _a.sent().list;
|
|
225
|
-
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
226
|
-
return [3
|
|
227
|
-
/*break*/
|
|
228
|
-
, 4];
|
|
229
|
-
|
|
230
|
-
case 2:
|
|
231
214
|
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
|
|
232
215
|
param = {
|
|
233
216
|
offers: value,
|
|
@@ -241,13 +224,30 @@ function ProductSource(_a) {
|
|
|
241
224
|
/*yield*/
|
|
242
225
|
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
243
226
|
|
|
244
|
-
case
|
|
227
|
+
case 1:
|
|
245
228
|
list_1 = _a.sent().list;
|
|
246
229
|
setSelectedProds((0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
247
230
|
return list_1.map(function (m) {
|
|
248
231
|
return __assign(__assign({}, m.products[0]), m);
|
|
249
232
|
});
|
|
250
233
|
}, []), prodType));
|
|
234
|
+
return [3
|
|
235
|
+
/*break*/
|
|
236
|
+
, 4];
|
|
237
|
+
|
|
238
|
+
case 2:
|
|
239
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
|
|
240
|
+
param = {
|
|
241
|
+
products: value,
|
|
242
|
+
state: 'A'
|
|
243
|
+
};
|
|
244
|
+
return [4
|
|
245
|
+
/*yield*/
|
|
246
|
+
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
247
|
+
|
|
248
|
+
case 3:
|
|
249
|
+
list = _a.sent().list;
|
|
250
|
+
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
251
251
|
_a.label = 4;
|
|
252
252
|
|
|
253
253
|
case 4:
|
|
@@ -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;
|
|
@@ -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)(
|
|
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 =
|
|
266
|
-
setPaginationParams =
|
|
253
|
+
paginationParams = _q[0],
|
|
254
|
+
setPaginationParams = _q[1];
|
|
267
255
|
|
|
268
256
|
var onChange = function onChange(value) {
|
|
269
257
|
settVal(value);
|
|
@@ -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(\"" + (
|
|
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
|
|
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
|
-
|
|
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.
|
|
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:
|
|
676
|
+
y: 400
|
|
751
677
|
}
|
|
752
678
|
})))));
|
|
753
679
|
};
|
|
@@ -272,7 +272,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
272
272
|
|
|
273
273
|
var queryGoods = function queryGoods() {
|
|
274
274
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
275
|
-
var _list, total, params,
|
|
275
|
+
var _list, total, params, res_1, res;
|
|
276
276
|
|
|
277
277
|
return __generator(this, function (_a) {
|
|
278
278
|
switch (_a.label) {
|
|
@@ -288,24 +288,9 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
288
288
|
pageSize: paginationParams.pageSize,
|
|
289
289
|
pageIndex: paginationParams.current
|
|
290
290
|
};
|
|
291
|
-
if (!(proType === '
|
|
291
|
+
if (!(proType === 'spu')) return [3
|
|
292
292
|
/*break*/
|
|
293
293
|
, 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
294
|
return [4
|
|
310
295
|
/*yield*/
|
|
311
296
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -316,7 +301,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
316
301
|
crmFlag: 'on'
|
|
317
302
|
}), 'GET')];
|
|
318
303
|
|
|
319
|
-
case
|
|
304
|
+
case 1:
|
|
320
305
|
res_1 = _a.sent();
|
|
321
306
|
_list = (0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
322
307
|
return res_1.list.map(function (m) {
|
|
@@ -324,6 +309,21 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
324
309
|
});
|
|
325
310
|
}, []), proType);
|
|
326
311
|
total = res_1.total;
|
|
312
|
+
return [3
|
|
313
|
+
/*break*/
|
|
314
|
+
, 4];
|
|
315
|
+
|
|
316
|
+
case 2:
|
|
317
|
+
return [4
|
|
318
|
+
/*yield*/
|
|
319
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
320
|
+
productCode: productCode
|
|
321
|
+
}), 'GET')];
|
|
322
|
+
|
|
323
|
+
case 3:
|
|
324
|
+
res = _a.sent();
|
|
325
|
+
_list = (0, _ProductModal.formatData)(res.list || []);
|
|
326
|
+
total = res.total;
|
|
327
327
|
_a.label = 4;
|
|
328
328
|
|
|
329
329
|
case 4:
|
|
@@ -401,14 +401,17 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
401
401
|
};
|
|
402
402
|
|
|
403
403
|
(0, _react.useEffect)(function () {
|
|
404
|
-
setLoading(true);
|
|
405
|
-
queryGoods();
|
|
406
404
|
queryBrand();
|
|
407
405
|
|
|
408
406
|
if ((0, _businessUtil.isPlatform)()) {
|
|
409
407
|
queryStore();
|
|
410
408
|
}
|
|
411
409
|
}, []);
|
|
410
|
+
(0, _react.useEffect)(function () {
|
|
411
|
+
setLoading(true);
|
|
412
|
+
paginationParams.current = 1;
|
|
413
|
+
queryGoods();
|
|
414
|
+
}, [proType]);
|
|
412
415
|
var proTypeOption = [{
|
|
413
416
|
label: 'SKU',
|
|
414
417
|
value: 'sku'
|
|
@@ -452,7 +455,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
452
455
|
}))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
453
456
|
span: 9
|
|
454
457
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
455
|
-
label: proType === '
|
|
458
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
456
459
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
457
460
|
onChange: function onChange(e) {
|
|
458
461
|
return setProductCode(e.target.value);
|
|
@@ -352,7 +352,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
352
352
|
|
|
353
353
|
var queryGoods = function queryGoods() {
|
|
354
354
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
355
|
-
var _list, total, params,
|
|
355
|
+
var _list, total, params, res_1, res;
|
|
356
356
|
|
|
357
357
|
return __generator(this, function (_a) {
|
|
358
358
|
switch (_a.label) {
|
|
@@ -374,24 +374,9 @@ var ProductModal = function ProductModal(props) {
|
|
|
374
374
|
pageIndex: paginationParams.current,
|
|
375
375
|
state: 'A'
|
|
376
376
|
};
|
|
377
|
-
if (!(proType === '
|
|
377
|
+
if (!(proType === 'spu')) return [3
|
|
378
378
|
/*break*/
|
|
379
379
|
, 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
380
|
return [4
|
|
396
381
|
/*yield*/
|
|
397
382
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -402,7 +387,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
402
387
|
crmFlag: 'on'
|
|
403
388
|
}), 'GET')];
|
|
404
389
|
|
|
405
|
-
case
|
|
390
|
+
case 1:
|
|
406
391
|
res_1 = _a.sent();
|
|
407
392
|
_list = formatData((0, _commonUtil.ensure)(function () {
|
|
408
393
|
return res_1.list.map(function (m) {
|
|
@@ -410,6 +395,21 @@ var ProductModal = function ProductModal(props) {
|
|
|
410
395
|
});
|
|
411
396
|
}, []), proType);
|
|
412
397
|
total = res_1.total;
|
|
398
|
+
return [3
|
|
399
|
+
/*break*/
|
|
400
|
+
, 4];
|
|
401
|
+
|
|
402
|
+
case 2:
|
|
403
|
+
return [4
|
|
404
|
+
/*yield*/
|
|
405
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
406
|
+
productCode: productCode
|
|
407
|
+
}), 'GET')];
|
|
408
|
+
|
|
409
|
+
case 3:
|
|
410
|
+
res = _a.sent();
|
|
411
|
+
_list = formatData(res.list || []);
|
|
412
|
+
total = res.total;
|
|
413
413
|
_a.label = 4;
|
|
414
414
|
|
|
415
415
|
case 4:
|
|
@@ -565,8 +565,8 @@ var ProductModal = function ProductModal(props) {
|
|
|
565
565
|
width: 120,
|
|
566
566
|
ellipsis: true
|
|
567
567
|
}, {
|
|
568
|
-
title: proType === '
|
|
569
|
-
dataIndex: proType === '
|
|
568
|
+
title: proType === 'spu' ? (0, _locale.i18n)('SPU_CODE') : (0, _locale.i18n)('SKU_CODE'),
|
|
569
|
+
dataIndex: proType === 'spu' ? 'offerCode' : 'productCode',
|
|
570
570
|
width: 120,
|
|
571
571
|
ellipsis: true
|
|
572
572
|
}, _defineProperty({
|
|
@@ -713,7 +713,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
713
713
|
size: "small",
|
|
714
714
|
value: productName
|
|
715
715
|
})), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
716
|
-
label: proType === '
|
|
716
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
717
717
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
718
718
|
className: "inputStyle",
|
|
719
719
|
onChange: function onChange(e) {
|
|
@@ -201,33 +201,16 @@ 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 + "/products";
|
|
215
|
-
param = {
|
|
216
|
-
products: value,
|
|
217
|
-
state: 'A'
|
|
218
|
-
};
|
|
219
|
-
return [4
|
|
220
|
-
/*yield*/
|
|
221
|
-
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
222
|
-
|
|
223
|
-
case 1:
|
|
224
|
-
list = _a.sent().list;
|
|
225
|
-
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
226
|
-
return [3
|
|
227
|
-
/*break*/
|
|
228
|
-
, 4];
|
|
229
|
-
|
|
230
|
-
case 2:
|
|
231
214
|
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
|
|
232
215
|
param = {
|
|
233
216
|
offers: value,
|
|
@@ -241,13 +224,30 @@ function ProductSource(_a) {
|
|
|
241
224
|
/*yield*/
|
|
242
225
|
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
243
226
|
|
|
244
|
-
case
|
|
227
|
+
case 1:
|
|
245
228
|
list_1 = _a.sent().list;
|
|
246
229
|
setSelectedProds((0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
247
230
|
return list_1.map(function (m) {
|
|
248
231
|
return __assign(__assign({}, m.products[0]), m);
|
|
249
232
|
});
|
|
250
233
|
}, []), prodType));
|
|
234
|
+
return [3
|
|
235
|
+
/*break*/
|
|
236
|
+
, 4];
|
|
237
|
+
|
|
238
|
+
case 2:
|
|
239
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
|
|
240
|
+
param = {
|
|
241
|
+
products: value,
|
|
242
|
+
state: 'A'
|
|
243
|
+
};
|
|
244
|
+
return [4
|
|
245
|
+
/*yield*/
|
|
246
|
+
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
247
|
+
|
|
248
|
+
case 3:
|
|
249
|
+
list = _a.sent().list;
|
|
250
|
+
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
251
251
|
_a.label = 4;
|
|
252
252
|
|
|
253
253
|
case 4:
|