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