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