wesmiler преди 6 години
родител
ревизия
a580e62417
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      public/static/weixin/js/photo.js

+ 3 - 3
public/static/weixin/js/photo.js

@@ -646,13 +646,11 @@ var app = new Vue({
                 var id = _this.cropParams.id;
                 $image = $("#cropImg");
                 console.log(_this.cropParams)
+                console.log(JSON.stringify(_this.cropParams))
                 // var canvas = $image.cropper('getCroppedCanvas');
                 var canvas = $image.cropper('getCroppedCanvas',_this.cropParams.cropData);
                 var url = canvas.toBlob(function (e) {
-                    $.closePopup();
                     console.log(e);  //生成Blob的图片格式
-                    alert(JSON.stringify(e))
-                    alert(JSON.stringify(canvas))
                     if (e != null) {
                         var timestamp = Date.parse(new Date());
                         e.name = timestamp + ".png";
@@ -672,6 +670,7 @@ var app = new Vue({
 
                         console.log(_this.picList)
                         setTimeout(function () {
+                            $.closePopup();
                             $.hideLoading();
                             _this.cropParams = {};
                             $("#cropImg").cropper('destroy');
@@ -679,6 +678,7 @@ var app = new Vue({
                             $("#cropImg").remove();
                         }, 200);
                     }else{
+                        $.closePopup();
                         _this.cropParams = {};
                         $.hideLoading();
                         $.showLoading('图片处理失败,请重新上传');