@fonixtree/magic-design 2.0.73 → 2.0.74
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/es/composite-comp/bol/components/Wallet/mobile/index.js +1 -1
- package/es/composite-comp/bol/second-config-panels/WalletSecondConfig/index.js +1 -1
- package/es/constants/index.js +1 -1
- 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/lib/composite-comp/bol/components/Wallet/mobile/index.js +1 -1
- package/lib/composite-comp/bol/second-config-panels/WalletSecondConfig/index.js +1 -1
- package/lib/constants/index.js +1 -1
- 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);
|
|
@@ -351,7 +351,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
351
351
|
|
|
352
352
|
var queryGoods = function queryGoods() {
|
|
353
353
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
354
|
-
var _list, total, params,
|
|
354
|
+
var _list, total, params, res_1, res;
|
|
355
355
|
|
|
356
356
|
return __generator(this, function (_a) {
|
|
357
357
|
switch (_a.label) {
|
|
@@ -373,24 +373,9 @@ var ProductModal = function ProductModal(props) {
|
|
|
373
373
|
pageIndex: paginationParams.current,
|
|
374
374
|
state: 'A'
|
|
375
375
|
};
|
|
376
|
-
if (!(proType === '
|
|
376
|
+
if (!(proType === 'spu')) return [3
|
|
377
377
|
/*break*/
|
|
378
378
|
, 2];
|
|
379
|
-
return [4
|
|
380
|
-
/*yield*/
|
|
381
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
382
|
-
productCode: productCode
|
|
383
|
-
}), 'GET')];
|
|
384
|
-
|
|
385
|
-
case 1:
|
|
386
|
-
res = _a.sent();
|
|
387
|
-
_list = formatData(res.list || []);
|
|
388
|
-
total = res.total;
|
|
389
|
-
return [3
|
|
390
|
-
/*break*/
|
|
391
|
-
, 4];
|
|
392
|
-
|
|
393
|
-
case 2:
|
|
394
379
|
return [4
|
|
395
380
|
/*yield*/
|
|
396
381
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -401,7 +386,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
401
386
|
crmFlag: 'on'
|
|
402
387
|
}), 'GET')];
|
|
403
388
|
|
|
404
|
-
case
|
|
389
|
+
case 1:
|
|
405
390
|
res_1 = _a.sent();
|
|
406
391
|
_list = formatData((0, _commonUtil.ensure)(function () {
|
|
407
392
|
return res_1.list.map(function (m) {
|
|
@@ -409,6 +394,21 @@ var ProductModal = function ProductModal(props) {
|
|
|
409
394
|
});
|
|
410
395
|
}, []), proType);
|
|
411
396
|
total = res_1.total;
|
|
397
|
+
return [3
|
|
398
|
+
/*break*/
|
|
399
|
+
, 4];
|
|
400
|
+
|
|
401
|
+
case 2:
|
|
402
|
+
return [4
|
|
403
|
+
/*yield*/
|
|
404
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
405
|
+
productCode: productCode
|
|
406
|
+
}), 'GET')];
|
|
407
|
+
|
|
408
|
+
case 3:
|
|
409
|
+
res = _a.sent();
|
|
410
|
+
_list = formatData(res.list || []);
|
|
411
|
+
total = res.total;
|
|
412
412
|
_a.label = 4;
|
|
413
413
|
|
|
414
414
|
case 4:
|
|
@@ -564,8 +564,8 @@ var ProductModal = function ProductModal(props) {
|
|
|
564
564
|
width: 120,
|
|
565
565
|
ellipsis: true
|
|
566
566
|
}, {
|
|
567
|
-
title: proType === '
|
|
568
|
-
dataIndex: proType === '
|
|
567
|
+
title: proType === 'spu' ? (0, _locale.i18n)('SPU_CODE') : (0, _locale.i18n)('SKU_CODE'),
|
|
568
|
+
dataIndex: proType === 'spu' ? 'offerCode' : 'productCode',
|
|
569
569
|
width: 120,
|
|
570
570
|
ellipsis: true
|
|
571
571
|
}, _defineProperty({
|
|
@@ -712,7 +712,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
712
712
|
size: "small",
|
|
713
713
|
value: productName
|
|
714
714
|
})), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
715
|
-
label: proType === '
|
|
715
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
716
716
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
717
717
|
className: "inputStyle",
|
|
718
718
|
onChange: function onChange(e) {
|
|
@@ -204,7 +204,7 @@ function ProductSource(_a) {
|
|
|
204
204
|
|
|
205
205
|
var onSelectProduct = function onSelectProduct() {
|
|
206
206
|
return __awaiter(_this, void 0, void 0, function () {
|
|
207
|
-
var url, param, list, url, param,
|
|
207
|
+
var url, param, list, url, param, list_1, url, param, list;
|
|
208
208
|
return __generator(this, function (_a) {
|
|
209
209
|
switch (_a.label) {
|
|
210
210
|
case 0:
|
|
@@ -232,26 +232,9 @@ function ProductSource(_a) {
|
|
|
232
232
|
, 6];
|
|
233
233
|
|
|
234
234
|
case 2:
|
|
235
|
-
if (!(prodType === '
|
|
235
|
+
if (!(prodType === 'spu')) return [3
|
|
236
236
|
/*break*/
|
|
237
237
|
, 4];
|
|
238
|
-
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
|
|
239
|
-
param = {
|
|
240
|
-
products: value,
|
|
241
|
-
state: 'A'
|
|
242
|
-
};
|
|
243
|
-
return [4
|
|
244
|
-
/*yield*/
|
|
245
|
-
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
246
|
-
|
|
247
|
-
case 3:
|
|
248
|
-
list = _a.sent().list;
|
|
249
|
-
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
250
|
-
return [3
|
|
251
|
-
/*break*/
|
|
252
|
-
, 6];
|
|
253
|
-
|
|
254
|
-
case 4:
|
|
255
238
|
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
|
|
256
239
|
param = {
|
|
257
240
|
offers: value,
|
|
@@ -265,13 +248,30 @@ function ProductSource(_a) {
|
|
|
265
248
|
/*yield*/
|
|
266
249
|
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
267
250
|
|
|
268
|
-
case
|
|
251
|
+
case 3:
|
|
269
252
|
list_1 = _a.sent().list;
|
|
270
253
|
setSelectedProds((0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
271
254
|
return list_1.map(function (m) {
|
|
272
255
|
return __assign(__assign({}, m.products[0]), m);
|
|
273
256
|
});
|
|
274
257
|
}, []), prodType));
|
|
258
|
+
return [3
|
|
259
|
+
/*break*/
|
|
260
|
+
, 6];
|
|
261
|
+
|
|
262
|
+
case 4:
|
|
263
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
|
|
264
|
+
param = {
|
|
265
|
+
products: value,
|
|
266
|
+
state: 'A'
|
|
267
|
+
};
|
|
268
|
+
return [4
|
|
269
|
+
/*yield*/
|
|
270
|
+
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
271
|
+
|
|
272
|
+
case 5:
|
|
273
|
+
list = _a.sent().list;
|
|
274
|
+
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
275
275
|
_a.label = 6;
|
|
276
276
|
|
|
277
277
|
case 6:
|
|
@@ -290,7 +290,7 @@ function (_super) {
|
|
|
290
290
|
show: true
|
|
291
291
|
}, _b[_constants.walletType.CENDUIT] = {
|
|
292
292
|
amount: userPoint === null ? '****' : userPoint,
|
|
293
|
-
btnText: userPoint ? '
|
|
293
|
+
btnText: userPoint ? 'CenDuit Mall' : '',
|
|
294
294
|
show: true
|
|
295
295
|
}, _b)
|
|
296
296
|
}, function () {
|
|
@@ -136,7 +136,7 @@ function (_super) {
|
|
|
136
136
|
value: _constants.walletType.B2B
|
|
137
137
|
}, (0, _locale.i18n)('B2B PayLater')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
138
138
|
value: _constants.walletType.CENDUIT
|
|
139
|
-
}, (0, _locale.i18n)('
|
|
139
|
+
}, (0, _locale.i18n)('CenDuit')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
140
140
|
value: _constants.walletType.BNPL
|
|
141
141
|
}, (0, _locale.i18n)('BNPL')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
142
142
|
value: _constants.walletType.CREDIT
|
package/es/constants/index.js
CHANGED
|
@@ -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);
|
|
@@ -351,7 +351,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
351
351
|
|
|
352
352
|
var queryGoods = function queryGoods() {
|
|
353
353
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
354
|
-
var _list, total, params,
|
|
354
|
+
var _list, total, params, res_1, res;
|
|
355
355
|
|
|
356
356
|
return __generator(this, function (_a) {
|
|
357
357
|
switch (_a.label) {
|
|
@@ -373,24 +373,9 @@ var ProductModal = function ProductModal(props) {
|
|
|
373
373
|
pageIndex: paginationParams.current,
|
|
374
374
|
state: 'A'
|
|
375
375
|
};
|
|
376
|
-
if (!(proType === '
|
|
376
|
+
if (!(proType === 'spu')) return [3
|
|
377
377
|
/*break*/
|
|
378
378
|
, 2];
|
|
379
|
-
return [4
|
|
380
|
-
/*yield*/
|
|
381
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
382
|
-
productCode: productCode
|
|
383
|
-
}), 'GET')];
|
|
384
|
-
|
|
385
|
-
case 1:
|
|
386
|
-
res = _a.sent();
|
|
387
|
-
_list = formatData(res.list || []);
|
|
388
|
-
total = res.total;
|
|
389
|
-
return [3
|
|
390
|
-
/*break*/
|
|
391
|
-
, 4];
|
|
392
|
-
|
|
393
|
-
case 2:
|
|
394
379
|
return [4
|
|
395
380
|
/*yield*/
|
|
396
381
|
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
|
|
@@ -401,7 +386,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
401
386
|
crmFlag: 'on'
|
|
402
387
|
}), 'GET')];
|
|
403
388
|
|
|
404
|
-
case
|
|
389
|
+
case 1:
|
|
405
390
|
res_1 = _a.sent();
|
|
406
391
|
_list = formatData((0, _commonUtil.ensure)(function () {
|
|
407
392
|
return res_1.list.map(function (m) {
|
|
@@ -409,6 +394,21 @@ var ProductModal = function ProductModal(props) {
|
|
|
409
394
|
});
|
|
410
395
|
}, []), proType);
|
|
411
396
|
total = res_1.total;
|
|
397
|
+
return [3
|
|
398
|
+
/*break*/
|
|
399
|
+
, 4];
|
|
400
|
+
|
|
401
|
+
case 2:
|
|
402
|
+
return [4
|
|
403
|
+
/*yield*/
|
|
404
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
|
|
405
|
+
productCode: productCode
|
|
406
|
+
}), 'GET')];
|
|
407
|
+
|
|
408
|
+
case 3:
|
|
409
|
+
res = _a.sent();
|
|
410
|
+
_list = formatData(res.list || []);
|
|
411
|
+
total = res.total;
|
|
412
412
|
_a.label = 4;
|
|
413
413
|
|
|
414
414
|
case 4:
|
|
@@ -564,8 +564,8 @@ var ProductModal = function ProductModal(props) {
|
|
|
564
564
|
width: 120,
|
|
565
565
|
ellipsis: true
|
|
566
566
|
}, {
|
|
567
|
-
title: proType === '
|
|
568
|
-
dataIndex: proType === '
|
|
567
|
+
title: proType === 'spu' ? (0, _locale.i18n)('SPU_CODE') : (0, _locale.i18n)('SKU_CODE'),
|
|
568
|
+
dataIndex: proType === 'spu' ? 'offerCode' : 'productCode',
|
|
569
569
|
width: 120,
|
|
570
570
|
ellipsis: true
|
|
571
571
|
}, _defineProperty({
|
|
@@ -712,7 +712,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
712
712
|
size: "small",
|
|
713
713
|
value: productName
|
|
714
714
|
})), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
|
|
715
|
-
label: proType === '
|
|
715
|
+
label: proType === 'spu' ? 'SPU Code' : 'SKU Code'
|
|
716
716
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
717
717
|
className: "inputStyle",
|
|
718
718
|
onChange: function onChange(e) {
|
|
@@ -204,7 +204,7 @@ function ProductSource(_a) {
|
|
|
204
204
|
|
|
205
205
|
var onSelectProduct = function onSelectProduct() {
|
|
206
206
|
return __awaiter(_this, void 0, void 0, function () {
|
|
207
|
-
var url, param, list, url, param,
|
|
207
|
+
var url, param, list, url, param, list_1, url, param, list;
|
|
208
208
|
return __generator(this, function (_a) {
|
|
209
209
|
switch (_a.label) {
|
|
210
210
|
case 0:
|
|
@@ -232,26 +232,9 @@ function ProductSource(_a) {
|
|
|
232
232
|
, 6];
|
|
233
233
|
|
|
234
234
|
case 2:
|
|
235
|
-
if (!(prodType === '
|
|
235
|
+
if (!(prodType === 'spu')) return [3
|
|
236
236
|
/*break*/
|
|
237
237
|
, 4];
|
|
238
|
-
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
|
|
239
|
-
param = {
|
|
240
|
-
products: value,
|
|
241
|
-
state: 'A'
|
|
242
|
-
};
|
|
243
|
-
return [4
|
|
244
|
-
/*yield*/
|
|
245
|
-
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
246
|
-
|
|
247
|
-
case 3:
|
|
248
|
-
list = _a.sent().list;
|
|
249
|
-
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
250
|
-
return [3
|
|
251
|
-
/*break*/
|
|
252
|
-
, 6];
|
|
253
|
-
|
|
254
|
-
case 4:
|
|
255
238
|
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
|
|
256
239
|
param = {
|
|
257
240
|
offers: value,
|
|
@@ -265,13 +248,30 @@ function ProductSource(_a) {
|
|
|
265
248
|
/*yield*/
|
|
266
249
|
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
267
250
|
|
|
268
|
-
case
|
|
251
|
+
case 3:
|
|
269
252
|
list_1 = _a.sent().list;
|
|
270
253
|
setSelectedProds((0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
271
254
|
return list_1.map(function (m) {
|
|
272
255
|
return __assign(__assign({}, m.products[0]), m);
|
|
273
256
|
});
|
|
274
257
|
}, []), prodType));
|
|
258
|
+
return [3
|
|
259
|
+
/*break*/
|
|
260
|
+
, 6];
|
|
261
|
+
|
|
262
|
+
case 4:
|
|
263
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
|
|
264
|
+
param = {
|
|
265
|
+
products: value,
|
|
266
|
+
state: 'A'
|
|
267
|
+
};
|
|
268
|
+
return [4
|
|
269
|
+
/*yield*/
|
|
270
|
+
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
271
|
+
|
|
272
|
+
case 5:
|
|
273
|
+
list = _a.sent().list;
|
|
274
|
+
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
275
275
|
_a.label = 6;
|
|
276
276
|
|
|
277
277
|
case 6:
|
|
@@ -290,7 +290,7 @@ function (_super) {
|
|
|
290
290
|
show: true
|
|
291
291
|
}, _b[_constants.walletType.CENDUIT] = {
|
|
292
292
|
amount: userPoint === null ? '****' : userPoint,
|
|
293
|
-
btnText: userPoint ? '
|
|
293
|
+
btnText: userPoint ? 'CenDuit Mall' : '',
|
|
294
294
|
show: true
|
|
295
295
|
}, _b)
|
|
296
296
|
}, function () {
|
|
@@ -136,7 +136,7 @@ function (_super) {
|
|
|
136
136
|
value: _constants.walletType.B2B
|
|
137
137
|
}, (0, _locale.i18n)('B2B PayLater')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
138
138
|
value: _constants.walletType.CENDUIT
|
|
139
|
-
}, (0, _locale.i18n)('
|
|
139
|
+
}, (0, _locale.i18n)('CenDuit')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
140
140
|
value: _constants.walletType.BNPL
|
|
141
141
|
}, (0, _locale.i18n)('BNPL')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
142
142
|
value: _constants.walletType.CREDIT
|
package/lib/constants/index.js
CHANGED