handleImagesUrlBefore:function(file){
var _this = this;
return new Promise(function(resolve, reject) {
var reader = new FileReader();
reader.onload = function(event) {
var image = new Image();
image.onload = function () {
var width = this.width;
var height = this.height;
if (width>695 || width < 685){
_this.$alert('图片尺寸必须在685~695之间!', '提示', {confirmButtonText: '确定'});
reject();
}
if (height >695||height< 685) {
_this.$alert('图片尺寸必须在685~695之间!', '提示', {confirmButtonText: '确定'});
reject();
}
resolve();
};
image.src = event.target.result;
}
reader.readAsDataURL(file);
});
var _this = this;
return new Promise(function(resolve, reject) {
var reader = new FileReader();
reader.onload = function(event) {
var image = new Image();
image.onload = function () {
var width = this.width;
var height = this.height;
if (width>695 || width < 685){
_this.$alert('图片尺寸必须在685~695之间!', '提示', {confirmButtonText: '确定'});
reject();
}
if (height >695||height< 685) {
_this.$alert('图片尺寸必须在685~695之间!', '提示', {confirmButtonText: '确定'});
reject();
}
resolve();
};
image.src = event.target.result;
}
reader.readAsDataURL(file);
});
}