|
@@ -511,11 +511,6 @@ var app = new Vue({
|
|
|
maxCanvasWeight: cropWidth,
|
|
maxCanvasWeight: cropWidth,
|
|
|
minCanvasHeight: iHeight,*/
|
|
minCanvasHeight: iHeight,*/
|
|
|
viewMode: 1,
|
|
viewMode: 1,
|
|
|
- ready: function(data){
|
|
|
|
|
- // _this.cropParams.data = data;
|
|
|
|
|
- // $image.cropper('setCropBoxData',{width: iWidth, height: iHeight});
|
|
|
|
|
- consoel.log(data);
|
|
|
|
|
- },
|
|
|
|
|
crop: function (data) {
|
|
crop: function (data) {
|
|
|
_this.cropParams.data = data;
|
|
_this.cropParams.data = data;
|
|
|
/* if(data.width<800){
|
|
/* if(data.width<800){
|
|
@@ -532,6 +527,12 @@ var app = new Vue({
|
|
|
imageSmoothingQuality: 'high',
|
|
imageSmoothingQuality: 'high',
|
|
|
fillColor: '#fff',
|
|
fillColor: '#fff',
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ var canvas = $image.cropper('getCroppedCanvas',_this.cropParams.cropData);
|
|
|
|
|
+ var url = canvas.toBlob(function (e) {
|
|
|
|
|
+ alert(44)
|
|
|
|
|
+ alert(JSON.stringify(e))
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -611,7 +612,7 @@ var app = new Vue({
|
|
|
image.src = _this.cropParams.url;
|
|
image.src = _this.cropParams.url;
|
|
|
var width = image.width;
|
|
var width = image.width;
|
|
|
var height = image.height;*/
|
|
var height = image.height;*/
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if(data.height<data.width){
|
|
if(data.height<data.width){
|
|
|
$("#cropImg").cropper("rotate", 90);
|
|
$("#cropImg").cropper("rotate", 90);
|
|
|
}
|
|
}
|
|
@@ -632,7 +633,7 @@ var app = new Vue({
|
|
|
$("#cropImg").cropper("zoom", rate);
|
|
$("#cropImg").cropper("zoom", rate);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $("#cropImg").cropper('setCropBoxData',{width: iWidth, height: iHeight,top: 0});
|
|
|
|
|
|
|
+ $("#cropImg").cropper('setCropBoxData',{width: iWidth, height: iHeight});
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
// 确定剪切
|
|
// 确定剪切
|