@fonixtree/magic-design 1.0.41 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/common/LinkModal/ProductDetailPage/index.js +20 -12
- package/es/composite-comp/common/components/ProductItem/index.js +19 -21
- package/lib/common/LinkModal/ProductDetailPage/index.js +20 -12
- package/lib/composite-comp/common/components/ProductItem/index.js +19 -21
- package/package.json +1 -1
- package/es/assets/fonts/.DS_Store +0 -0
- package/lib/assets/fonts/.DS_Store +0 -0
|
@@ -17,8 +17,6 @@ var _commonUtil = require("../../../utils/commonUtil");
|
|
|
17
17
|
|
|
18
18
|
var _businessUtil = require("../../../utils/businessUtil");
|
|
19
19
|
|
|
20
|
-
var _ProductModal = require("../../ProductModal");
|
|
21
|
-
|
|
22
20
|
require("./index.less");
|
|
23
21
|
|
|
24
22
|
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); }
|
|
@@ -187,7 +185,7 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
|
187
185
|
var Option = _antd.Select.Option;
|
|
188
186
|
|
|
189
187
|
var ProductDetailPage = function ProductDetailPage(props) {
|
|
190
|
-
var
|
|
188
|
+
var onChange = props.onChange;
|
|
191
189
|
|
|
192
190
|
var _a = (0, _react.useState)([]),
|
|
193
191
|
productList = _a[0],
|
|
@@ -229,13 +227,17 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
229
227
|
flag = _k[0],
|
|
230
228
|
setFlag = _k[1];
|
|
231
229
|
|
|
232
|
-
var _l = (0, _react.useState)({
|
|
230
|
+
var _l = (0, _react.useState)({}),
|
|
231
|
+
selectedPro = _l[0],
|
|
232
|
+
setSelectedPro = _l[1];
|
|
233
|
+
|
|
234
|
+
var _m = (0, _react.useState)({
|
|
233
235
|
pageSize: 20,
|
|
234
236
|
current: 1,
|
|
235
237
|
total: 0
|
|
236
238
|
}),
|
|
237
|
-
paginationParams =
|
|
238
|
-
setPaginationParams =
|
|
239
|
+
paginationParams = _m[0],
|
|
240
|
+
setPaginationParams = _m[1];
|
|
239
241
|
|
|
240
242
|
var columns = [{
|
|
241
243
|
title: 'Image',
|
|
@@ -264,12 +266,14 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
264
266
|
ellipsis: true
|
|
265
267
|
}];
|
|
266
268
|
var rowSelection = {
|
|
269
|
+
selectedRowKeys: [(selectedPro === null || selectedPro === void 0 ? void 0 : selectedPro.productId) || ''],
|
|
267
270
|
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
268
|
-
|
|
271
|
+
var selected = {
|
|
269
272
|
offerId: selectedRows[0].offerId,
|
|
270
273
|
productId: selectedRows[0].productId,
|
|
271
274
|
name: selectedRows[0].productName
|
|
272
|
-
}
|
|
275
|
+
};
|
|
276
|
+
setSelectedPro(selected);
|
|
273
277
|
},
|
|
274
278
|
type: 'radio'
|
|
275
279
|
};
|
|
@@ -307,11 +311,11 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
307
311
|
|
|
308
312
|
case 1:
|
|
309
313
|
res_1 = _a.sent();
|
|
310
|
-
_list = (0,
|
|
314
|
+
_list = (0, _commonUtil.ensure)(function () {
|
|
311
315
|
return res_1.list.map(function (m) {
|
|
312
316
|
return __assign(__assign({}, m.products[0]), m);
|
|
313
317
|
});
|
|
314
|
-
}, [])
|
|
318
|
+
}, []);
|
|
315
319
|
total = res_1.total;
|
|
316
320
|
return [3
|
|
317
321
|
/*break*/
|
|
@@ -327,7 +331,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
327
331
|
|
|
328
332
|
case 3:
|
|
329
333
|
res = _a.sent();
|
|
330
|
-
_list =
|
|
334
|
+
_list = res.list || [];
|
|
331
335
|
total = res.total;
|
|
332
336
|
_a.label = 4;
|
|
333
337
|
|
|
@@ -412,9 +416,13 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
412
416
|
queryStore();
|
|
413
417
|
}
|
|
414
418
|
}, []);
|
|
419
|
+
(0, _react.useEffect)(function () {
|
|
420
|
+
onChange(selectedPro);
|
|
421
|
+
}, [selectedPro]);
|
|
415
422
|
(0, _react.useEffect)(function () {
|
|
416
423
|
setLoading(true);
|
|
417
424
|
reset();
|
|
425
|
+
setSelectedPro({});
|
|
418
426
|
paginationParams.current = 1;
|
|
419
427
|
setFlag(!flag);
|
|
420
428
|
}, [proType]);
|
|
@@ -539,7 +547,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
539
547
|
},
|
|
540
548
|
showSizeChanger: false
|
|
541
549
|
}),
|
|
542
|
-
rowKey: "
|
|
550
|
+
rowKey: "productId",
|
|
543
551
|
rowSelection: rowSelection,
|
|
544
552
|
scroll: {
|
|
545
553
|
y: 300
|
|
@@ -19,8 +19,6 @@ var _ImageLabel = _interopRequireDefault(require("../ImageLabel"));
|
|
|
19
19
|
|
|
20
20
|
var _components = require("../../../../meta-comp/components");
|
|
21
21
|
|
|
22
|
-
var _businessUtil = require("../../../../utils/businessUtil");
|
|
23
|
-
|
|
24
22
|
require("./index.less");
|
|
25
23
|
|
|
26
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -95,26 +93,26 @@ function (_super) {
|
|
|
95
93
|
}
|
|
96
94
|
|
|
97
95
|
ProductItem.prototype.render = function () {
|
|
98
|
-
var _a, _b, _c;
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
data =
|
|
102
|
-
panelProps =
|
|
103
|
-
onItemClick =
|
|
104
|
-
showProName =
|
|
105
|
-
showProgress =
|
|
106
|
-
fixHeight =
|
|
107
|
-
layout =
|
|
108
|
-
imgHeight =
|
|
109
|
-
imgWidth =
|
|
110
|
-
unknownPrice =
|
|
111
|
-
rest = __rest(
|
|
112
|
-
|
|
113
|
-
|
|
96
|
+
var _a, _b, _c, _d;
|
|
97
|
+
|
|
98
|
+
var _e = this.props,
|
|
99
|
+
data = _e.data,
|
|
100
|
+
panelProps = _e.panelProps,
|
|
101
|
+
onItemClick = _e.onItemClick,
|
|
102
|
+
showProName = _e.showProName,
|
|
103
|
+
showProgress = _e.showProgress,
|
|
104
|
+
fixHeight = _e.fixHeight,
|
|
105
|
+
layout = _e.layout,
|
|
106
|
+
imgHeight = _e.imgHeight,
|
|
107
|
+
imgWidth = _e.imgWidth,
|
|
108
|
+
unknownPrice = _e.unknownPrice,
|
|
109
|
+
rest = __rest(_e, ["data", "panelProps", "onItemClick", "showProName", "showProgress", "fixHeight", "layout", "imgHeight", "imgWidth", "unknownPrice"]); // const promotions = getPromotionList(data);
|
|
110
|
+
|
|
111
|
+
|
|
114
112
|
var price = (0, _currencyUtil.formatCurrency)(data.salesPrice);
|
|
115
113
|
/** 当是拼团时 显示价格 */
|
|
116
114
|
|
|
117
|
-
if (data.sppType
|
|
115
|
+
if (data.sppType) {
|
|
118
116
|
price = data.specialPrice !== null ? (0, _currencyUtil.formatCurrency)(data.specialPrice) : (0, _currencyUtil.formatCurrency)(data.salesPrice);
|
|
119
117
|
}
|
|
120
118
|
|
|
@@ -176,9 +174,9 @@ function (_super) {
|
|
|
176
174
|
small: true
|
|
177
175
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
178
176
|
className: "content-wrap"
|
|
179
|
-
}, panelProps.label.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
177
|
+
}, panelProps.label.open && ((_d = data === null || data === void 0 ? void 0 : data.cmpBuygetnLabels) === null || _d === void 0 ? void 0 : _d.length) > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
180
178
|
className: "promotions-wrap"
|
|
181
|
-
},
|
|
179
|
+
}, data.cmpBuygetnLabels.map(function (promot, index) {
|
|
182
180
|
return /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
183
181
|
key: index,
|
|
184
182
|
className: "promotion-item",
|
|
@@ -17,8 +17,6 @@ var _commonUtil = require("../../../utils/commonUtil");
|
|
|
17
17
|
|
|
18
18
|
var _businessUtil = require("../../../utils/businessUtil");
|
|
19
19
|
|
|
20
|
-
var _ProductModal = require("../../ProductModal");
|
|
21
|
-
|
|
22
20
|
require("./index.less");
|
|
23
21
|
|
|
24
22
|
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); }
|
|
@@ -187,7 +185,7 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
|
187
185
|
var Option = _antd.Select.Option;
|
|
188
186
|
|
|
189
187
|
var ProductDetailPage = function ProductDetailPage(props) {
|
|
190
|
-
var
|
|
188
|
+
var onChange = props.onChange;
|
|
191
189
|
|
|
192
190
|
var _a = (0, _react.useState)([]),
|
|
193
191
|
productList = _a[0],
|
|
@@ -229,13 +227,17 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
229
227
|
flag = _k[0],
|
|
230
228
|
setFlag = _k[1];
|
|
231
229
|
|
|
232
|
-
var _l = (0, _react.useState)({
|
|
230
|
+
var _l = (0, _react.useState)({}),
|
|
231
|
+
selectedPro = _l[0],
|
|
232
|
+
setSelectedPro = _l[1];
|
|
233
|
+
|
|
234
|
+
var _m = (0, _react.useState)({
|
|
233
235
|
pageSize: 20,
|
|
234
236
|
current: 1,
|
|
235
237
|
total: 0
|
|
236
238
|
}),
|
|
237
|
-
paginationParams =
|
|
238
|
-
setPaginationParams =
|
|
239
|
+
paginationParams = _m[0],
|
|
240
|
+
setPaginationParams = _m[1];
|
|
239
241
|
|
|
240
242
|
var columns = [{
|
|
241
243
|
title: 'Image',
|
|
@@ -264,12 +266,14 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
264
266
|
ellipsis: true
|
|
265
267
|
}];
|
|
266
268
|
var rowSelection = {
|
|
269
|
+
selectedRowKeys: [(selectedPro === null || selectedPro === void 0 ? void 0 : selectedPro.productId) || ''],
|
|
267
270
|
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
268
|
-
|
|
271
|
+
var selected = {
|
|
269
272
|
offerId: selectedRows[0].offerId,
|
|
270
273
|
productId: selectedRows[0].productId,
|
|
271
274
|
name: selectedRows[0].productName
|
|
272
|
-
}
|
|
275
|
+
};
|
|
276
|
+
setSelectedPro(selected);
|
|
273
277
|
},
|
|
274
278
|
type: 'radio'
|
|
275
279
|
};
|
|
@@ -307,11 +311,11 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
307
311
|
|
|
308
312
|
case 1:
|
|
309
313
|
res_1 = _a.sent();
|
|
310
|
-
_list = (0,
|
|
314
|
+
_list = (0, _commonUtil.ensure)(function () {
|
|
311
315
|
return res_1.list.map(function (m) {
|
|
312
316
|
return __assign(__assign({}, m.products[0]), m);
|
|
313
317
|
});
|
|
314
|
-
}, [])
|
|
318
|
+
}, []);
|
|
315
319
|
total = res_1.total;
|
|
316
320
|
return [3
|
|
317
321
|
/*break*/
|
|
@@ -327,7 +331,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
327
331
|
|
|
328
332
|
case 3:
|
|
329
333
|
res = _a.sent();
|
|
330
|
-
_list =
|
|
334
|
+
_list = res.list || [];
|
|
331
335
|
total = res.total;
|
|
332
336
|
_a.label = 4;
|
|
333
337
|
|
|
@@ -412,9 +416,13 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
412
416
|
queryStore();
|
|
413
417
|
}
|
|
414
418
|
}, []);
|
|
419
|
+
(0, _react.useEffect)(function () {
|
|
420
|
+
onChange(selectedPro);
|
|
421
|
+
}, [selectedPro]);
|
|
415
422
|
(0, _react.useEffect)(function () {
|
|
416
423
|
setLoading(true);
|
|
417
424
|
reset();
|
|
425
|
+
setSelectedPro({});
|
|
418
426
|
paginationParams.current = 1;
|
|
419
427
|
setFlag(!flag);
|
|
420
428
|
}, [proType]);
|
|
@@ -539,7 +547,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
539
547
|
},
|
|
540
548
|
showSizeChanger: false
|
|
541
549
|
}),
|
|
542
|
-
rowKey: "
|
|
550
|
+
rowKey: "productId",
|
|
543
551
|
rowSelection: rowSelection,
|
|
544
552
|
scroll: {
|
|
545
553
|
y: 300
|
|
@@ -19,8 +19,6 @@ var _ImageLabel = _interopRequireDefault(require("../ImageLabel"));
|
|
|
19
19
|
|
|
20
20
|
var _components = require("../../../../meta-comp/components");
|
|
21
21
|
|
|
22
|
-
var _businessUtil = require("../../../../utils/businessUtil");
|
|
23
|
-
|
|
24
22
|
require("./index.less");
|
|
25
23
|
|
|
26
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -95,26 +93,26 @@ function (_super) {
|
|
|
95
93
|
}
|
|
96
94
|
|
|
97
95
|
ProductItem.prototype.render = function () {
|
|
98
|
-
var _a, _b, _c;
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
data =
|
|
102
|
-
panelProps =
|
|
103
|
-
onItemClick =
|
|
104
|
-
showProName =
|
|
105
|
-
showProgress =
|
|
106
|
-
fixHeight =
|
|
107
|
-
layout =
|
|
108
|
-
imgHeight =
|
|
109
|
-
imgWidth =
|
|
110
|
-
unknownPrice =
|
|
111
|
-
rest = __rest(
|
|
112
|
-
|
|
113
|
-
|
|
96
|
+
var _a, _b, _c, _d;
|
|
97
|
+
|
|
98
|
+
var _e = this.props,
|
|
99
|
+
data = _e.data,
|
|
100
|
+
panelProps = _e.panelProps,
|
|
101
|
+
onItemClick = _e.onItemClick,
|
|
102
|
+
showProName = _e.showProName,
|
|
103
|
+
showProgress = _e.showProgress,
|
|
104
|
+
fixHeight = _e.fixHeight,
|
|
105
|
+
layout = _e.layout,
|
|
106
|
+
imgHeight = _e.imgHeight,
|
|
107
|
+
imgWidth = _e.imgWidth,
|
|
108
|
+
unknownPrice = _e.unknownPrice,
|
|
109
|
+
rest = __rest(_e, ["data", "panelProps", "onItemClick", "showProName", "showProgress", "fixHeight", "layout", "imgHeight", "imgWidth", "unknownPrice"]); // const promotions = getPromotionList(data);
|
|
110
|
+
|
|
111
|
+
|
|
114
112
|
var price = (0, _currencyUtil.formatCurrency)(data.salesPrice);
|
|
115
113
|
/** 当是拼团时 显示价格 */
|
|
116
114
|
|
|
117
|
-
if (data.sppType
|
|
115
|
+
if (data.sppType) {
|
|
118
116
|
price = data.specialPrice !== null ? (0, _currencyUtil.formatCurrency)(data.specialPrice) : (0, _currencyUtil.formatCurrency)(data.salesPrice);
|
|
119
117
|
}
|
|
120
118
|
|
|
@@ -176,9 +174,9 @@ function (_super) {
|
|
|
176
174
|
small: true
|
|
177
175
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
178
176
|
className: "content-wrap"
|
|
179
|
-
}, panelProps.label.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
177
|
+
}, panelProps.label.open && ((_d = data === null || data === void 0 ? void 0 : data.cmpBuygetnLabels) === null || _d === void 0 ? void 0 : _d.length) > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
180
178
|
className: "promotions-wrap"
|
|
181
|
-
},
|
|
179
|
+
}, data.cmpBuygetnLabels.map(function (promot, index) {
|
|
182
180
|
return /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
183
181
|
key: index,
|
|
184
182
|
className: "promotion-item",
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|