wesmiler пре 6 година
родитељ
комит
ed489ff020
1 измењених фајлова са 6 додато и 10 уклоњено
  1. 6 10
      public/static/weixin/js/photo.js

+ 6 - 10
public/static/weixin/js/photo.js

@@ -471,7 +471,7 @@ var app = new Vue({
             // $("#cropImg").remove();
             $(".crop-img").html('<img id="cropImg" src="" alt="" off="">');
             var iWidth = $("body").outerWidth();
-            var iHeight = $("body").outerHeight()-130;
+            var iHeight = $("body").height()-130;
             if(id>=0){
                 $("#cropImg").attr('src', _this.cropParams.old_url);
             }else{
@@ -528,8 +528,8 @@ var app = new Vue({
                         fillColor: '#fff',
                     };*/
                     _this.cropParams.cropData = {
-                        width: data.width*10,
-                        height: data.height*10,
+                        width: iWidth*10,
+                        height: iHeight*10,
                         rotate: data.rotate,
                         // imageSmoothingQuality: 'high',
                         fillColor: '#fff',
@@ -628,11 +628,10 @@ var app = new Vue({
             }
             var cwidth = $(".cropper-canvas").outerWidth();
 
-            console.log(data);
             // var cheight = $(".cropper-canvas").outerHeight();
             var size = data.height<data.width? data.height: data.width;
             var iWidth = $("body").outerWidth();
-            var iHeight = $("body").outerHeight()-130;
+            var iHeight = $("body").height()-130;
             /*var iWidth = $(".cropper-canvas").outerWidth();
             var iHeight = $(".cropper-canvas").outerHeight();*/
             if(size<iWidth){
@@ -656,13 +655,11 @@ var app = new Vue({
                 $.showLoading('图片处理中...');
                 var id = _this.cropParams.id;
                 $image = $("#cropImg");
-                alert(685456545);
-                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) {
-                    console.log(e);  //生成Blob的图片格式
+                    console.log(e||event);  //生成Blob的图片格式
                     if (e != null) {
                         var timestamp = Date.parse(new Date());
                         e.name = timestamp + ".png";
@@ -680,7 +677,6 @@ var app = new Vue({
                             _this.picList.push(data);
                         }
 
-                        console.log(_this.picList)
                         setTimeout(function () {
                             $.closePopup();
                             $.hideLoading();