@fonixtree/magic-design 1.0.62 → 1.0.65

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.
@@ -255,7 +255,10 @@ function (_super) {
255
255
 
256
256
  _this.state = {
257
257
  messageNum: '',
258
- userInfo: currentUser
258
+ userInfo: currentUser,
259
+ loading: false,
260
+ selectedImgFile: {},
261
+ editImgModalVisible: false
259
262
  };
260
263
 
261
264
  _this.getNum = function (v) {
@@ -385,7 +388,9 @@ function (_super) {
385
388
  return {
386
389
  userInfo: __assign(__assign({}, preState.userInfo), {
387
390
  photo: params.photo
388
- })
391
+ }),
392
+ loading: false,
393
+ editImgModalVisible: false
389
394
  };
390
395
  });
391
396
  return [2
@@ -397,6 +402,12 @@ function (_super) {
397
402
  };
398
403
 
399
404
  _this.onUploadImg = function (formData) {
405
+ if (_this.state.loading) return;
406
+
407
+ _this.setState({
408
+ loading: true
409
+ });
410
+
400
411
  fetch('/designer/v1/h5/image', {
401
412
  method: 'POST',
402
413
  body: formData
@@ -415,10 +426,6 @@ function (_super) {
415
426
  return;
416
427
  }
417
428
 
418
- _this.setState({
419
- editImgModalVisible: false
420
- });
421
-
422
429
  _this.modifyPhoto({
423
430
  photo: responseData.fileUrl
424
431
  });
@@ -428,6 +435,10 @@ function (_super) {
428
435
  message: err === null || err === void 0 ? void 0 : err.data,
429
436
  duration: 5000
430
437
  });
438
+
439
+ _this.setState({
440
+ loading: false
441
+ });
431
442
  });
432
443
  };
433
444
 
@@ -548,10 +559,7 @@ function (_super) {
548
559
  };
549
560
 
550
561
  PersonalInfoMobile.defaultProps = {
551
- data: {
552
- selectedImgFile: {},
553
- editImgModalVisible: false
554
- }
562
+ data: {}
555
563
  };
556
564
  return PersonalInfoMobile;
557
565
  }(_react["default"].Component);
@@ -255,7 +255,10 @@ function (_super) {
255
255
 
256
256
  _this.state = {
257
257
  messageNum: '',
258
- userInfo: currentUser
258
+ userInfo: currentUser,
259
+ loading: false,
260
+ selectedImgFile: {},
261
+ editImgModalVisible: false
259
262
  };
260
263
 
261
264
  _this.getNum = function (v) {
@@ -385,7 +388,9 @@ function (_super) {
385
388
  return {
386
389
  userInfo: __assign(__assign({}, preState.userInfo), {
387
390
  photo: params.photo
388
- })
391
+ }),
392
+ loading: false,
393
+ editImgModalVisible: false
389
394
  };
390
395
  });
391
396
  return [2
@@ -397,6 +402,12 @@ function (_super) {
397
402
  };
398
403
 
399
404
  _this.onUploadImg = function (formData) {
405
+ if (_this.state.loading) return;
406
+
407
+ _this.setState({
408
+ loading: true
409
+ });
410
+
400
411
  fetch('/designer/v1/h5/image', {
401
412
  method: 'POST',
402
413
  body: formData
@@ -415,10 +426,6 @@ function (_super) {
415
426
  return;
416
427
  }
417
428
 
418
- _this.setState({
419
- editImgModalVisible: false
420
- });
421
-
422
429
  _this.modifyPhoto({
423
430
  photo: responseData.fileUrl
424
431
  });
@@ -428,6 +435,10 @@ function (_super) {
428
435
  message: err === null || err === void 0 ? void 0 : err.data,
429
436
  duration: 5000
430
437
  });
438
+
439
+ _this.setState({
440
+ loading: false
441
+ });
431
442
  });
432
443
  };
433
444
 
@@ -548,10 +559,7 @@ function (_super) {
548
559
  };
549
560
 
550
561
  PersonalInfoMobile.defaultProps = {
551
- data: {
552
- selectedImgFile: {},
553
- editImgModalVisible: false
554
- }
562
+ data: {}
555
563
  };
556
564
  return PersonalInfoMobile;
557
565
  }(_react["default"].Component);
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.62",
4
+ "version": "1.0.65",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",