wesmiler 6 lat temu
rodzic
commit
e472592535
1 zmienionych plików z 7 dodań i 15 usunięć
  1. 7 15
      public/static/weixin/js/photo.js

+ 7 - 15
public/static/weixin/js/photo.js

@@ -536,26 +536,18 @@ var app = new Vue({
                         fillColor: '#fff',
                     };*/
                     var rate = 1;
-                    /*if(data.height >2000 || data.width>2000){
+                    if(data.height >2000 || data.width>2000){
                         rate = 0.8;
                     }else if( data.height < 1000 || data.width<1000){
                         rate = 1.5;
-                    }*/
+                    }
 
-                    /*_this.cropParams.cropData = {
+                    _this.cropParams.cropData = {
                         width: data.width * rate,
                         height: data.height * rate,
                         rotate: data.rotate,
                         imageSmoothingQuality: 'high',
                         fillColor: '#fff',
-                    };*/
-
-                    _this.cropParams.cropData = {
-                        width: 600,
-                        height: 800,
-                        rotate: data.rotate,
-                        imageSmoothingQuality: 'high',
-                        fillColor: '#fff',
                     };
 
                     /*var canvas = $image.cropper('getCroppedCanvas',_this.cropParams.cropData);
@@ -666,11 +658,11 @@ var app = new Vue({
                 $("#cropImg").cropper("zoom", rate);
             }
 
-           /* $("#cropImg").cropper(_this.options);
+            $("#cropImg").cropper(_this.options);
             $("#cropImg").cropper('setData', {
                 width: iWidth,
                 height: height
-            });*/
+            });
         },
         // 确定剪切
         cropConfirm: function () {
@@ -693,12 +685,12 @@ var app = new Vue({
                             _this.picList[id] = _this.cropParams;
                             _this.picList[id].url = url;
                             _this.picList[id].preview = url;
-                            _this.picList[id].fileData = _this.dataBlobtoFile(e, e.name);
+                            _this.picList[id].fileData = _this.dataBlobtoFile(blob, blob.name);
                         }else{
                             var data = _this.cropParams;
                             data.url = url;
                             data.preview = url;
-                            data.fileData = _this.dataBlobtoFile(e, e.name);
+                            data.fileData = _this.dataBlobtoFile(blob, blob.name);
                             _this.picList.push(data);
                         }
                         setTimeout(function () {