@fonixtree/magic-design 2.0.71 → 2.0.73
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/AffiliateProductModal/index.js +1 -1
- package/es/common/AffiliateProductModal/index.less +1 -1
- package/es/common/Button/index.less +0 -1
- package/es/common/LinkModal/FilteredProductModal/index.js +154 -104
- package/es/common/LinkModal/FilteredProductModal/index.less +7 -0
- package/es/common/LinkModal/ProductDetailPage/index.js +92 -57
- package/es/common/LinkModal/ProductDetailPage/index.less +6 -1
- package/es/common/ProductModal/index.js +124 -87
- package/es/common/ProductModal/index.less +7 -1
- package/es/common/ProductSource/index.js +82 -21
- package/es/composite-comp/dito/components/HeadNavigation/defaultJSON.js +22 -17
- package/es/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +26 -23
- package/es/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +25 -27
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
- package/es/constants/index.js +12 -3
- package/es/core/Designer/QuickMenuBar/index.js +9 -1
- package/es/core/Designer/index.js +11 -1
- package/es/locale/en/en.json +4 -1
- package/es/locale/es/es.json +4 -1
- package/es/locale/id/id.json +4 -1
- package/es/utils/commonUtil.js +14 -6
- package/lib/common/AffiliateProductModal/index.js +1 -1
- package/lib/common/AffiliateProductModal/index.less +1 -1
- package/lib/common/Button/index.less +0 -1
- package/lib/common/LinkModal/FilteredProductModal/index.js +154 -104
- package/lib/common/LinkModal/FilteredProductModal/index.less +7 -0
- package/lib/common/LinkModal/ProductDetailPage/index.js +92 -57
- package/lib/common/LinkModal/ProductDetailPage/index.less +6 -1
- package/lib/common/ProductModal/index.js +124 -87
- package/lib/common/ProductModal/index.less +7 -1
- package/lib/common/ProductSource/index.js +82 -21
- package/lib/composite-comp/dito/components/HeadNavigation/defaultJSON.js +22 -17
- package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +26 -23
- package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +25 -27
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
- package/lib/constants/index.js +12 -3
- package/lib/core/Designer/QuickMenuBar/index.js +9 -1
- package/lib/core/Designer/index.js +11 -1
- package/lib/locale/en/en.json +4 -1
- package/lib/locale/es/es.json +4 -1
- package/lib/locale/id/id.json +4 -1
- package/lib/utils/commonUtil.js +14 -6
- package/package.json +1 -1
|
@@ -431,7 +431,7 @@ var AffiliateProductModal = function AffiliateProductModal(props) {
|
|
|
431
431
|
title: (0, _locale.i18n)('PRODUCT_SELECT'),
|
|
432
432
|
visible: visible,
|
|
433
433
|
width: "1200px",
|
|
434
|
-
wrapClassName: "
|
|
434
|
+
wrapClassName: "affiliateModalCot"
|
|
435
435
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
436
436
|
className: "proModalWrap"
|
|
437
437
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -184,6 +184,14 @@ 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
|
+
|
|
187
195
|
var FilteredProductModal = function FilteredProductModal(props) {
|
|
188
196
|
var onDataChange = props.onDataChange;
|
|
189
197
|
var Option = _antd.Select.Option;
|
|
@@ -213,41 +221,41 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
213
221
|
labelData = _f[0],
|
|
214
222
|
setLabelData = _f[1];
|
|
215
223
|
|
|
216
|
-
var _g = (0, _react.useState)(''),
|
|
217
|
-
|
|
218
|
-
|
|
224
|
+
var _g = (0, _react.useState)(window.magicDesign.storeId || ''),
|
|
225
|
+
storeId = _g[0],
|
|
226
|
+
setStoreId = _g[1];
|
|
219
227
|
|
|
220
|
-
var _h = (0, _react.useState)(
|
|
221
|
-
|
|
222
|
-
|
|
228
|
+
var _h = (0, _react.useState)([]),
|
|
229
|
+
storeList = _h[0],
|
|
230
|
+
setStoreList = _h[1];
|
|
223
231
|
|
|
224
|
-
var _j = (0, _react.useState)(
|
|
225
|
-
|
|
226
|
-
|
|
232
|
+
var _j = (0, _react.useState)(''),
|
|
233
|
+
productName = _j[0],
|
|
234
|
+
setProductName = _j[1];
|
|
227
235
|
|
|
228
236
|
var _k = (0, _react.useState)(''),
|
|
229
|
-
|
|
230
|
-
|
|
237
|
+
minimum = _k[0],
|
|
238
|
+
setMinimum = _k[1];
|
|
231
239
|
|
|
232
240
|
var _l = (0, _react.useState)(''),
|
|
233
|
-
|
|
234
|
-
|
|
241
|
+
maximum = _l[0],
|
|
242
|
+
setMaximum = _l[1];
|
|
235
243
|
|
|
236
|
-
var _m = (0, _react.useState)(
|
|
237
|
-
|
|
238
|
-
|
|
244
|
+
var _m = (0, _react.useState)([]),
|
|
245
|
+
dataSource = _m[0],
|
|
246
|
+
setDataSource = _m[1];
|
|
239
247
|
|
|
240
|
-
var _o = (0, _react.useState)(
|
|
241
|
-
|
|
242
|
-
|
|
248
|
+
var _o = (0, _react.useState)({}),
|
|
249
|
+
promotions = _o[0],
|
|
250
|
+
setPromotions = _o[1];
|
|
243
251
|
|
|
244
|
-
var _p = (0, _react.useState)(
|
|
245
|
-
|
|
246
|
-
|
|
252
|
+
var _p = (0, _react.useState)(false),
|
|
253
|
+
loading = _p[0],
|
|
254
|
+
setLoading = _p[1];
|
|
247
255
|
|
|
248
|
-
var _q = (0, _react.useState)(
|
|
249
|
-
|
|
250
|
-
|
|
256
|
+
var _q = (0, _react.useState)('sku'),
|
|
257
|
+
proType = _q[0],
|
|
258
|
+
setProType = _q[1];
|
|
251
259
|
|
|
252
260
|
var _r = (0, _react.useState)({
|
|
253
261
|
pageSize: 20,
|
|
@@ -282,7 +290,6 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
282
290
|
settBrandId([]);
|
|
283
291
|
settLabelId({});
|
|
284
292
|
setStoreId(window.magicDesign.storeId || '');
|
|
285
|
-
setStoreName('');
|
|
286
293
|
setProductName('');
|
|
287
294
|
setMinimum('');
|
|
288
295
|
setMaximum('');
|
|
@@ -293,14 +300,14 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
293
300
|
|
|
294
301
|
var columns = [{
|
|
295
302
|
title: 'Image',
|
|
296
|
-
dataIndex: '
|
|
303
|
+
dataIndex: 'productImageUrl',
|
|
297
304
|
key: 'imgUrl',
|
|
298
305
|
width: 100,
|
|
299
306
|
render: function render(imgUrl, record) {
|
|
300
307
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
301
308
|
className: "prodImage",
|
|
302
309
|
style: {
|
|
303
|
-
backgroundImage: "url(\"" + (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent) + "\")"
|
|
310
|
+
backgroundImage: "url(\"" + (imgUrl || (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent)) + "\")"
|
|
304
311
|
}
|
|
305
312
|
});
|
|
306
313
|
}
|
|
@@ -309,13 +316,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
309
316
|
dataIndex: 'offerName',
|
|
310
317
|
key: 'offerName',
|
|
311
318
|
ellipsis: true
|
|
312
|
-
},
|
|
313
|
-
// title: 'SKU',
|
|
314
|
-
// dataIndex: 'attrValues',
|
|
315
|
-
// key: 'attrValues',
|
|
316
|
-
// ellipsis: true,
|
|
317
|
-
// },
|
|
318
|
-
{
|
|
319
|
+
}, {
|
|
319
320
|
title: 'Price',
|
|
320
321
|
dataIndex: 'salesPrice',
|
|
321
322
|
key: 'salesPrice',
|
|
@@ -439,72 +440,106 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
439
440
|
};
|
|
440
441
|
|
|
441
442
|
var loadGoods = function loadGoods() {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
443
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
444
|
+
var _list, total, params, res, params, res_1, h5UrlStr;
|
|
445
|
+
|
|
446
|
+
return __generator(this, function (_a) {
|
|
447
|
+
switch (_a.label) {
|
|
448
|
+
case 0:
|
|
449
|
+
setLoading(true);
|
|
450
|
+
_list = [];
|
|
451
|
+
total = 0;
|
|
452
|
+
if (!(proType === 'sku')) return [3
|
|
453
|
+
/*break*/
|
|
454
|
+
, 2];
|
|
455
|
+
params = {
|
|
456
|
+
catgIds: tValue.join(','),
|
|
457
|
+
brandIds: brandId.map(function (v) {
|
|
458
|
+
return v.key;
|
|
459
|
+
}).join(','),
|
|
460
|
+
labelIds: labelId.key,
|
|
461
|
+
q: productName,
|
|
462
|
+
storeId: storeId,
|
|
463
|
+
startPrice: (0, _currencyUtil.formatBackendCurrency)(minimum),
|
|
464
|
+
endPrice: (0, _currencyUtil.formatBackendCurrency)(maximum),
|
|
465
|
+
campaignType: promotions.key || '',
|
|
466
|
+
state: 'A',
|
|
467
|
+
pageSize: paginationParams.pageSize,
|
|
468
|
+
pageIndex: paginationParams.current
|
|
469
|
+
};
|
|
470
|
+
return [4
|
|
471
|
+
/*yield*/
|
|
472
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
|
|
473
|
+
|
|
474
|
+
case 1:
|
|
475
|
+
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);
|
|
520
|
+
setPaginationParams(__assign({}, paginationParams));
|
|
521
|
+
h5UrlStr = JsonToUrl({
|
|
522
|
+
catgIds: tValue.join(',') || '',
|
|
523
|
+
brandIds: brandId.map(function (v) {
|
|
524
|
+
return v.key;
|
|
525
|
+
}).join(',') || '',
|
|
526
|
+
labelIds: labelId.key || '',
|
|
527
|
+
q: productName || '',
|
|
528
|
+
storeId: storeId || '',
|
|
529
|
+
minPrice: (0, _currencyUtil.formatBackendCurrency)(minimum),
|
|
530
|
+
maxPrice: (0, _currencyUtil.formatBackendCurrency)(maximum),
|
|
531
|
+
campaignType: promotions.key || '',
|
|
532
|
+
state: 'A',
|
|
533
|
+
proType: proType
|
|
534
|
+
});
|
|
535
|
+
setDataSource(_list);
|
|
536
|
+
return [2
|
|
537
|
+
/*return*/
|
|
538
|
+
, {
|
|
539
|
+
url: h5UrlStr,
|
|
540
|
+
total: total
|
|
541
|
+
}];
|
|
542
|
+
}
|
|
508
543
|
});
|
|
509
544
|
});
|
|
510
545
|
};
|
|
@@ -518,6 +553,10 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
518
553
|
queryStore();
|
|
519
554
|
}
|
|
520
555
|
}, []);
|
|
556
|
+
(0, _react.useEffect)(function () {
|
|
557
|
+
paginationParams.current = 1;
|
|
558
|
+
loadGoods();
|
|
559
|
+
}, [proType]);
|
|
521
560
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
522
561
|
className: "mFilteredProductModal"
|
|
523
562
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -664,13 +703,15 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
664
703
|
onClick: function onClick() {
|
|
665
704
|
paginationParams.current = 1;
|
|
666
705
|
loadGoods().then(function (res) {
|
|
706
|
+
console.log('res', res);
|
|
707
|
+
|
|
667
708
|
if (res.total !== 0) {
|
|
668
709
|
onDataChange({
|
|
669
710
|
value: res.url,
|
|
670
711
|
name: res.url
|
|
671
712
|
}, res.total);
|
|
672
713
|
} else {
|
|
673
|
-
onDataChange('', res.total);
|
|
714
|
+
onDataChange('', res.total);
|
|
674
715
|
}
|
|
675
716
|
});
|
|
676
717
|
},
|
|
@@ -686,7 +727,16 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
686
727
|
size: "small"
|
|
687
728
|
}, (0, _locale.i18n)('CANCEL'))))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
688
729
|
className: "rightCot"
|
|
689
|
-
}, /*#__PURE__*/_react["default"].createElement(_antd.
|
|
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, {
|
|
690
740
|
columns: columns,
|
|
691
741
|
dataSource: dataSource,
|
|
692
742
|
loading: loading,
|
|
@@ -697,7 +747,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
697
747
|
}
|
|
698
748
|
}),
|
|
699
749
|
scroll: {
|
|
700
|
-
y:
|
|
750
|
+
y: 340
|
|
701
751
|
}
|
|
702
752
|
})))));
|
|
703
753
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.mFilteredProductModal {
|
|
2
2
|
height: 550px;
|
|
3
|
+
|
|
3
4
|
.proModalWrap {
|
|
4
5
|
.info {
|
|
5
6
|
background: #ecf1fd;
|
|
@@ -24,6 +25,12 @@
|
|
|
24
25
|
width: calc(100% - 240px);
|
|
25
26
|
margin-left: 16px;
|
|
26
27
|
|
|
28
|
+
.btn-select-type {
|
|
29
|
+
display: block;
|
|
30
|
+
text-align: right;
|
|
31
|
+
margin-bottom: 10px;
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
.selectedCot {
|
|
28
35
|
width: 722px;
|
|
29
36
|
margin-left: 4px;
|
|
@@ -17,6 +17,8 @@ var _commonUtil = require("../../../utils/commonUtil");
|
|
|
17
17
|
|
|
18
18
|
var _businessUtil = require("../../../utils/businessUtil");
|
|
19
19
|
|
|
20
|
+
var _ProductModal = require("../../ProductModal");
|
|
21
|
+
|
|
20
22
|
require("./index.less");
|
|
21
23
|
|
|
22
24
|
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); }
|
|
@@ -182,19 +184,6 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
|
182
184
|
}
|
|
183
185
|
};
|
|
184
186
|
|
|
185
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
186
|
-
var t = {};
|
|
187
|
-
|
|
188
|
-
for (var p in s) {
|
|
189
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
193
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
194
|
-
}
|
|
195
|
-
return t;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
187
|
var Option = _antd.Select.Option;
|
|
199
188
|
|
|
200
189
|
var ProductDetailPage = function ProductDetailPage(props) {
|
|
@@ -232,12 +221,17 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
232
221
|
loading = _h[0],
|
|
233
222
|
setLoading = _h[1];
|
|
234
223
|
|
|
235
|
-
var _j = (0, _react.useState)(
|
|
224
|
+
var _j = (0, _react.useState)('sku'),
|
|
225
|
+
proType = _j[0],
|
|
226
|
+
setProType = _j[1];
|
|
227
|
+
|
|
228
|
+
var _k = (0, _react.useState)({
|
|
236
229
|
pageSize: 20,
|
|
237
|
-
|
|
230
|
+
current: 1,
|
|
231
|
+
total: 0
|
|
238
232
|
}),
|
|
239
|
-
paginationParams =
|
|
240
|
-
setPaginationParams =
|
|
233
|
+
paginationParams = _k[0],
|
|
234
|
+
setPaginationParams = _k[1];
|
|
241
235
|
|
|
242
236
|
var columns = [{
|
|
243
237
|
title: 'Image',
|
|
@@ -276,22 +270,68 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
276
270
|
type: 'radio'
|
|
277
271
|
};
|
|
278
272
|
|
|
279
|
-
var queryGoods = function queryGoods(
|
|
273
|
+
var queryGoods = function queryGoods() {
|
|
280
274
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
281
|
-
var res;
|
|
275
|
+
var _list, total, params, res, res_1;
|
|
276
|
+
|
|
282
277
|
return __generator(this, function (_a) {
|
|
283
278
|
switch (_a.label) {
|
|
284
279
|
case 0:
|
|
280
|
+
_list = [];
|
|
281
|
+
total = 0;
|
|
282
|
+
params = {
|
|
283
|
+
productName: productName,
|
|
284
|
+
brandIds: brandId.map(function (v) {
|
|
285
|
+
return v.key;
|
|
286
|
+
}).join(',') || '',
|
|
287
|
+
storeId: storeId,
|
|
288
|
+
pageSize: paginationParams.pageSize,
|
|
289
|
+
pageIndex: paginationParams.current
|
|
290
|
+
};
|
|
291
|
+
if (!(proType === 'sku')) return [3
|
|
292
|
+
/*break*/
|
|
293
|
+
, 2];
|
|
285
294
|
return [4
|
|
286
295
|
/*yield*/
|
|
287
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", params,
|
|
296
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
297
|
+
productCode: productCode
|
|
298
|
+
}), 'GET')];
|
|
288
299
|
|
|
289
300
|
case 1:
|
|
290
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
|
+
return [4
|
|
310
|
+
/*yield*/
|
|
311
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
312
|
+
offerCode: productCode,
|
|
313
|
+
isDefaultCover: 'Y',
|
|
314
|
+
onlyQryPublishSku: true,
|
|
315
|
+
auditState: 'S',
|
|
316
|
+
crmFlag: 'on'
|
|
317
|
+
}), 'GET')];
|
|
318
|
+
|
|
319
|
+
case 3:
|
|
320
|
+
res_1 = _a.sent();
|
|
321
|
+
_list = (0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
322
|
+
return res_1.list.map(function (m) {
|
|
323
|
+
return __assign(__assign({}, m.products[0]), m);
|
|
324
|
+
});
|
|
325
|
+
}, []), proType);
|
|
326
|
+
total = res_1.total;
|
|
327
|
+
_a.label = 4;
|
|
328
|
+
|
|
329
|
+
case 4:
|
|
330
|
+
setProductList(_list);
|
|
291
331
|
setLoading(false);
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
332
|
+
window.MProductList = _list;
|
|
333
|
+
paginationParams.total = total;
|
|
334
|
+
setPaginationParams(__assign({}, paginationParams));
|
|
295
335
|
return [2
|
|
296
336
|
/*return*/
|
|
297
337
|
];
|
|
@@ -362,17 +402,20 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
362
402
|
|
|
363
403
|
(0, _react.useEffect)(function () {
|
|
364
404
|
setLoading(true);
|
|
365
|
-
|
|
366
|
-
var total = paginationParams.total,
|
|
367
|
-
params = __rest(paginationParams, ["total"]);
|
|
368
|
-
|
|
369
|
-
queryGoods(params);
|
|
405
|
+
queryGoods();
|
|
370
406
|
queryBrand();
|
|
371
407
|
|
|
372
408
|
if ((0, _businessUtil.isPlatform)()) {
|
|
373
409
|
queryStore();
|
|
374
410
|
}
|
|
375
411
|
}, []);
|
|
412
|
+
var proTypeOption = [{
|
|
413
|
+
label: 'SKU',
|
|
414
|
+
value: 'sku'
|
|
415
|
+
}, {
|
|
416
|
+
label: 'SPU',
|
|
417
|
+
value: 'spu'
|
|
418
|
+
}];
|
|
376
419
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
377
420
|
className: "productDetailPage"
|
|
378
421
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Form, {
|
|
@@ -382,6 +425,20 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
382
425
|
layout: "horizontal"
|
|
383
426
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Row, {
|
|
384
427
|
gutter: 24
|
|
428
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
429
|
+
offset: 20,
|
|
430
|
+
span: 4
|
|
431
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
|
|
432
|
+
buttonStyle: "solid",
|
|
433
|
+
className: "btn-select-type",
|
|
434
|
+
onChange: function onChange(e) {
|
|
435
|
+
setProType(e.target.value);
|
|
436
|
+
},
|
|
437
|
+
options: proTypeOption,
|
|
438
|
+
optionType: "button",
|
|
439
|
+
value: proType
|
|
440
|
+
}))), /*#__PURE__*/_react["default"].createElement(_antd.Row, {
|
|
441
|
+
gutter: 24
|
|
385
442
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
386
443
|
span: 9
|
|
387
444
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
@@ -395,7 +452,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
395
452
|
}))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
|
|
396
453
|
span: 9
|
|
397
454
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
398
|
-
label:
|
|
455
|
+
label: proType === 'sku' ? 'SKU Code' : 'SPU Code'
|
|
399
456
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
400
457
|
onChange: function onChange(e) {
|
|
401
458
|
return setProductCode(e.target.value);
|
|
@@ -444,19 +501,8 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
444
501
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
|
|
445
502
|
onClick: function onClick() {
|
|
446
503
|
setLoading(true);
|
|
447
|
-
paginationParams.
|
|
448
|
-
|
|
449
|
-
var total = paginationParams.total,
|
|
450
|
-
params = __rest(paginationParams, ["total"]);
|
|
451
|
-
|
|
452
|
-
queryGoods(__assign({
|
|
453
|
-
productName: productName,
|
|
454
|
-
productCode: productCode,
|
|
455
|
-
brandIds: brandId.map(function (v) {
|
|
456
|
-
return v.key;
|
|
457
|
-
}).join(',') || '',
|
|
458
|
-
storeId: storeId
|
|
459
|
-
}, params));
|
|
504
|
+
paginationParams.current = 1;
|
|
505
|
+
queryGoods();
|
|
460
506
|
},
|
|
461
507
|
size: "small",
|
|
462
508
|
style: {
|
|
@@ -476,26 +522,15 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
476
522
|
pagination: __assign(__assign({}, paginationParams), {
|
|
477
523
|
onChange: function onChange(page) {
|
|
478
524
|
setLoading(true);
|
|
479
|
-
paginationParams.
|
|
480
|
-
|
|
481
|
-
var total = paginationParams.total,
|
|
482
|
-
params = __rest(paginationParams, ["total"]);
|
|
483
|
-
|
|
484
|
-
queryGoods(__assign({
|
|
485
|
-
productName: productName,
|
|
486
|
-
productCode: productCode,
|
|
487
|
-
brandIds: brandId.map(function (v) {
|
|
488
|
-
return v.key;
|
|
489
|
-
}).join(',') || '',
|
|
490
|
-
storeId: storeId
|
|
491
|
-
}, params));
|
|
525
|
+
paginationParams.current = page;
|
|
526
|
+
queryGoods();
|
|
492
527
|
},
|
|
493
528
|
showSizeChanger: false
|
|
494
529
|
}),
|
|
495
|
-
rowKey: "
|
|
530
|
+
rowKey: "id",
|
|
496
531
|
rowSelection: rowSelection,
|
|
497
532
|
scroll: {
|
|
498
|
-
y:
|
|
533
|
+
y: 300
|
|
499
534
|
}
|
|
500
535
|
}));
|
|
501
536
|
};
|