@fonixtree/magic-design 1.0.3 → 1.0.5

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.
Binary file
@@ -201,6 +201,12 @@ function (_super) {
201
201
  return _this;
202
202
  }
203
203
 
204
+ ImagePicker.prototype.componentDidMount = function () {
205
+ this.setState({
206
+ inputVal: this.props.value
207
+ });
208
+ };
209
+
204
210
  ImagePicker.prototype.componentWillReceiveProps = function (nextProps) {
205
211
  if (nextProps.value != this.props.value) {
206
212
  this.setState({
@@ -177,21 +177,18 @@ function CatgTable(props) {
177
177
 
178
178
  var queryCategory = function queryCategory() {
179
179
  return __awaiter(_this, void 0, void 0, function () {
180
- var res, tree;
180
+ var res;
181
181
  return __generator(this, function (_a) {
182
182
  switch (_a.label) {
183
183
  case 0:
184
184
  setLoading(true);
185
185
  return [4
186
186
  /*yield*/
187
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/contract/offercatgs", {}, 'GET')];
187
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offercatgs/list", {}, 'GET')];
188
188
 
189
189
  case 1:
190
190
  res = _a.sent();
191
- tree = (0, _businessUtil.listToTree)(res);
192
- console.log('res', res);
193
- console.log('tree', tree);
194
- setCatgList(tree);
191
+ setCatgList((0, _businessUtil.listToTree)(res));
195
192
  setLoading(false);
196
193
  return [2
197
194
  /*return*/
@@ -346,7 +346,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
346
346
  case 0:
347
347
  return [4
348
348
  /*yield*/
349
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/contract/offercatgs", {}, 'GET')];
349
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offercatgs/list", {}, 'GET')];
350
350
 
351
351
  case 1:
352
352
  res = _a.sent();
@@ -368,7 +368,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
368
368
  case 0:
369
369
  return [4
370
370
  /*yield*/
371
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands", {}, 'GET')];
371
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands/list", {}, 'GET')];
372
372
 
373
373
  case 1:
374
374
  res = _a.sent();
@@ -309,7 +309,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
309
309
  case 0:
310
310
  return [4
311
311
  /*yield*/
312
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands")];
312
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands/list", {}, 'GET')];
313
313
 
314
314
  case 1:
315
315
  res = _a.sent();
@@ -275,7 +275,7 @@ function (_super) {
275
275
  ];
276
276
  return [4
277
277
  /*yield*/
278
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands")];
278
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands/list", {}, 'GET')];
279
279
 
280
280
  case 3:
281
281
  res = _a.sent();
@@ -0,0 +1,4 @@
1
+ .m-button-config {
2
+ padding: 0 12px;
3
+ background-color: #F5F6F7;
4
+ }
@@ -459,7 +459,7 @@ var getColorRgba = function getColorRgba(sHex, alpha) {
459
459
  exports.getColorRgba = getColorRgba;
460
460
 
461
461
  function asyncDataURLtoImage(dataUrl) {
462
- return new Promise(function (resolve, reject) {
462
+ return new Promise(function (resolve) {
463
463
  var img = new Image();
464
464
 
465
465
  img.onload = function () {
@@ -467,7 +467,8 @@ function asyncDataURLtoImage(dataUrl) {
467
467
  };
468
468
 
469
469
  img.onerror = function () {
470
- reject(new Error('img error'));
470
+ console.error(dataUrl + ' img error');
471
+ resolve({});
471
472
  };
472
473
 
473
474
  img.src = dataUrl;
Binary file
@@ -201,6 +201,12 @@ function (_super) {
201
201
  return _this;
202
202
  }
203
203
 
204
+ ImagePicker.prototype.componentDidMount = function () {
205
+ this.setState({
206
+ inputVal: this.props.value
207
+ });
208
+ };
209
+
204
210
  ImagePicker.prototype.componentWillReceiveProps = function (nextProps) {
205
211
  if (nextProps.value != this.props.value) {
206
212
  this.setState({
@@ -177,21 +177,18 @@ function CatgTable(props) {
177
177
 
178
178
  var queryCategory = function queryCategory() {
179
179
  return __awaiter(_this, void 0, void 0, function () {
180
- var res, tree;
180
+ var res;
181
181
  return __generator(this, function (_a) {
182
182
  switch (_a.label) {
183
183
  case 0:
184
184
  setLoading(true);
185
185
  return [4
186
186
  /*yield*/
187
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/contract/offercatgs", {}, 'GET')];
187
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offercatgs/list", {}, 'GET')];
188
188
 
189
189
  case 1:
190
190
  res = _a.sent();
191
- tree = (0, _businessUtil.listToTree)(res);
192
- console.log('res', res);
193
- console.log('tree', tree);
194
- setCatgList(tree);
191
+ setCatgList((0, _businessUtil.listToTree)(res));
195
192
  setLoading(false);
196
193
  return [2
197
194
  /*return*/
@@ -346,7 +346,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
346
346
  case 0:
347
347
  return [4
348
348
  /*yield*/
349
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/contract/offercatgs", {}, 'GET')];
349
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offercatgs/list", {}, 'GET')];
350
350
 
351
351
  case 1:
352
352
  res = _a.sent();
@@ -368,7 +368,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
368
368
  case 0:
369
369
  return [4
370
370
  /*yield*/
371
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands", {}, 'GET')];
371
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands/list", {}, 'GET')];
372
372
 
373
373
  case 1:
374
374
  res = _a.sent();
@@ -309,7 +309,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
309
309
  case 0:
310
310
  return [4
311
311
  /*yield*/
312
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands")];
312
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands/list", {}, 'GET')];
313
313
 
314
314
  case 1:
315
315
  res = _a.sent();
@@ -275,7 +275,7 @@ function (_super) {
275
275
  ];
276
276
  return [4
277
277
  /*yield*/
278
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands")];
278
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands/list", {}, 'GET')];
279
279
 
280
280
  case 3:
281
281
  res = _a.sent();
@@ -0,0 +1,4 @@
1
+ .m-button-config {
2
+ padding: 0 12px;
3
+ background-color: #F5F6F7;
4
+ }
@@ -459,7 +459,7 @@ var getColorRgba = function getColorRgba(sHex, alpha) {
459
459
  exports.getColorRgba = getColorRgba;
460
460
 
461
461
  function asyncDataURLtoImage(dataUrl) {
462
- return new Promise(function (resolve, reject) {
462
+ return new Promise(function (resolve) {
463
463
  var img = new Image();
464
464
 
465
465
  img.onload = function () {
@@ -467,7 +467,8 @@ function asyncDataURLtoImage(dataUrl) {
467
467
  };
468
468
 
469
469
  img.onerror = function () {
470
- reject(new Error('img error'));
470
+ console.error(dataUrl + ' img error');
471
+ resolve({});
471
472
  };
472
473
 
473
474
  img.src = dataUrl;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.3",
4
+ "version": "1.0.5",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",