记得上下班打卡 | git大法好,push需谨慎

Commit ffd6f2bb authored by dongchun's avatar dongchun

修改banner图片大小问题

parent 7e340d2c
......@@ -110,7 +110,7 @@
<div class="home_page">
<div class="left_content">
<div class="left_title">
<img id="testImg" src="" style="display: none;" alt="">
</div>
<div class="function_btn">
<div class="hot_title">
......@@ -134,7 +134,7 @@
</div>
<div id="tags" class="tags">
<button type="button" class="btn btn-warning" style="margin-right: 12px;" onclick="addItem(0)">添加banner</button>
<span id="tall">(最多允许添加10张图,建议宽度750像素)</span>
<span id="tall">(最多允许添加10张图,宽度为764像素,高度为1018像素)</span>
</div>
</div>
<div id="bannerList" class="banner_list">
......@@ -557,12 +557,21 @@
dropZoneTitle: "请上传文件",
maxFileCount: 1
}).on("filebatchselected", function (event, files) { //默认上传
console.log(files,$(this))
$(this).fileinput("upload");
})
.on("fileuploaded", function (event, data) { //上传回调事件
let showPicture = 'https://img.zhengzai.tv/' + data.response.data.ossPath;
$("#viewImg"+num+"").attr('src', showPicture)
$("#testImg").attr('src', showPicture);
setTimeout(()=>{
if (type == 1) {
console.log($("#testImg").height(),$("#testImg").width())
if ($("#testImg").height() != 1018) return layer.msg('图片规格不符合要求');
if ($("#testImg").width() != 764) return layer.msg('图片规格不符合要求');
} else {
if ($("#testImg").width() != 382) return layer.msg('图片规格不符合要求');
}
$("#viewImg"+num+"").attr('src', showPicture)
}, 500)
})
}
function promiseMethods(url,type,data,contentType) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment