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

Commit 2e29584a authored by wangyifan's avatar wangyifan

admin-设置新版banner 提示、大小限制

parent 2822d4ba
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
type = 3; type = 3;
$("#tags").show(); $("#tags").show();
$("#activeTags").hide(); $("#activeTags").hide();
$("#tall").html('新版顶部BANNER(bannerType=3)'); $("#tall").html('(最多允许添加10张图,宽度为764像素,高度为192像素,宽高比4:1)');
} else { } else {
type = 1; type = 1;
$("#tags").show(); $("#tags").show();
...@@ -562,12 +562,12 @@ ...@@ -562,12 +562,12 @@
autoReplace: true, autoReplace: true,
minImageWidth: '764', minImageWidth: '764',
maxImageWidth: '764', maxImageWidth: '764',
minImageHeight: '1018', minImageHeight: type == 3 ? '192' : '1018',
maxImageHeight: '1018', maxImageHeight: type == 3 ? '192' : '1018',
previewSettings: { previewSettings: {
image: { image: {
width: '764px', width: '764px',
height: '1018px' height: type == 3 ? '192px' : '1018px'
} }
}, },
dropZoneTitle: "请上传文件", dropZoneTitle: "请上传文件",
...@@ -583,6 +583,9 @@ ...@@ -583,6 +583,9 @@
console.log($("#testImg").height(),$("#testImg").width()) console.log($("#testImg").height(),$("#testImg").width())
if ($("#testImg").height() != 1018) return layer.msg('图片规格不符合要求'); if ($("#testImg").height() != 1018) return layer.msg('图片规格不符合要求');
if ($("#testImg").width() != 764) return layer.msg('图片规格不符合要求'); if ($("#testImg").width() != 764) return layer.msg('图片规格不符合要求');
} else if (type == 3) {
if ($("#testImg").width() != 764) return layer.msg('图片规格不符合要求,需764×192');
if ($("#testImg").height() != 192) return layer.msg('图片规格不符合要求,需764×192');
} else { } else {
if ($("#testImg").width() != 382) return layer.msg('图片规格不符合要求'); if ($("#testImg").width() != 382) return layer.msg('图片规格不符合要求');
} }
......
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