提交 8b8f530b 编写于 作者: vino's avatar vino

Merge remote-tracking branch 'origin/dev-circle-nine-20201231' into dev-circle-nine-20201231

......@@ -147,7 +147,7 @@
</div>
<div class="limit-text">
<p>限制大小: 500kb</p>
<p>最小尺寸:160*160</p>
<p>尺寸:112*112</p>
<p>支持jpeg, png格式</p>
</div>
</el-upload>
......@@ -180,7 +180,7 @@
</div>
<div class="limit-text">
<p>限制大小: 500kb</p>
<p>最小尺寸:160*160</p>
<p>宽度:750px</p>
<p>支持jpeg, png格式</p>
</div>
</el-upload>
......@@ -548,11 +548,11 @@
beforeUploadPic1(file) {
this.currentOption.aspectRatio = 1/1;
this.currentOption.cropBoxResizable = true;
this.currentOption.minCropBoxWidth = 160;
this.currentOption.minCropBoxHeight = 160;
this.currentOption.minCropBoxWidth = 112;
this.currentOption.minCropBoxHeight = 112;
let fileLimit = {
width: 160,
height: 160,
width: 112,
height: 112,
size: 0.5,
sizeText: "500K",
key: "listImage",
......@@ -565,11 +565,11 @@
beforeUploadPic2(file) {
this.currentOption.aspectRatio = 1/1;
this.currentOption.cropBoxResizable = true;
this.currentOption.minCropBoxWidth = 160;
this.currentOption.minCropBoxHeight = 160;
this.currentOption.minCropBoxWidth = 750;
// this.currentOption.minCropBoxHeight = 160;
let fileLimit = {
width: 160,
height: 160,
width: 750,
height: 0, //不限制
size: 0.5,
sizeText: "500K",
key: "introImage",
......@@ -600,18 +600,29 @@
vm.slide2.oriUrl = theFile.target.result;
image.onload = function () {
let _this = this;
// if (_this.width != fileLimit.width || _this.height != fileLimit.height) {
if (_this.width < fileLimit.width || _this.height < fileLimit.height) {
if (fileLimit.key == "introImage"){
//表示不限制高度
if (_this.width != fileLimit.width){
vm.$message.error("图片必须是jpegpng格式,同时长宽尺寸和图片大小需符合要求");
return;
}
}
if (fileLimit.key == "listImage"){
if (_this.width != fileLimit.width || _this.height != fileLimit.height) {
vm.$message.error("图片必须是jpegpng格式,同时长宽尺寸和图片大小需符合要求");
return;
}
}
// else if(_this.width > fileLimit.width || _this.height > fileLimit.height){
// vm.showCropper = true;
// vm.currentOption.cvWidth = _this.width;
// vm.currentOption.cvHeight = _this.height;
// return;
// }
else {
// else {
openLoading(vm);
doUpload(vm, file, getFilePath(file, null), "preview4", "progress1", 1).then(function (path) {
closeLoading(vm);
......@@ -629,7 +640,7 @@
};
vm.$message.success("上传成功");
});
}
// }
};
};
return isJPG && isLt2M;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册