Authored by 张帅

社区后台优化

... ... @@ -473,6 +473,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
Integer isRecommend = req.getIsRecommend() == null || req.getIsRecommend() == 8 ? null : req.getIsRecommend();
Integer isTop = req.getIsTop() == null || req.getIsTop() == 8 ? null : req.getIsTop();
Integer sort = req.getSort() == null || req.getSort() == 0 ? null : req.getSort();//文章内容类型:1、笔记 2、长文章 3、H5跳转链接
Integer topicId = req.getTopicId() == null || req.getTopicId() == 0 ? null : req.getTopicId();
List<Integer> authorUids = new ArrayList<>();
String authName = req.getPublisher();
String startTime = req.getStartTimeStr();
... ... @@ -522,13 +523,13 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
int size = req.getSize();
logger.info("start getArticleList: grassArticleDao.getArticleCount ");
int total = grassArticleDao.selectArticleCount(articleId, source, authStatus, authorUids, isRecommend, isTop, startTimeInt, endTimeInt,
recommendSort, auditSort,isExclude, userType, sort, currentTime,req.getMarkFlag(),req.getMarkFindgoods(),req.getDispatchChannel());
recommendSort, auditSort,isExclude, userType, sort, currentTime,req.getMarkFlag(),req.getMarkFindgoods(),req.getDispatchChannel(),topicId);
logger.info("end getArticleList: grassArticleDao.getArticleCount, total is {}", total);
int offset = (page - 1) * size;
logger.info("start getArticleList: grassArticleDao.selectArticleList , offset is {}, limit is {}", offset, size);
List<GrassArticle> articleList = grassArticleDao.selectArticleList(articleId, source, authStatus, authorUids, isRecommend, isTop, startTimeInt, endTimeInt,
offset, size, recommendSort,auditSort, isExclude, userType, sort, currentTime,req.getMarkFlag(),req.getMarkFindgoods(),req.getDispatchChannel());
offset, size, recommendSort,auditSort, isExclude, userType, sort, currentTime,req.getMarkFlag(),req.getMarkFindgoods(),req.getDispatchChannel(), topicId);
logger.info("end getArticleList: grassArticleDao.selectArticleList , offset is {}, limit is {}", offset, size);
rsp.setList(buildArticleDetail(articleList, false));
... ... @@ -1568,6 +1569,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
//1)文章内容
List<GrassArticleBlock> grassArticleContentList = grassArticleBlockDao.selectByArticleId(articleId);
grassArticleContentList = grassArticleContentList.stream().sorted((o1, o2) -> { if(o1.getOrderBy() >= o2.getOrderBy()) return 1;else return -1;}).collect(Collectors.toList());
List<String> imageList = new ArrayList<>();
String text = "";
for (GrassArticleBlock content : grassArticleContentList) {
... ... @@ -1576,7 +1578,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
String src = JSON.parseObject(data.getString("data")).getString("src");
src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?"));
imageList.add(src);
if (grassArticle.getSort() != 1) {
if (rspBo.getCoverImg() == null) {
rspBo.setCoverImg(src);
rspBo.setImgHeight(JSON.parseObject(data.getString("data")).getString("height"));
rspBo.setImgWidth(JSON.parseObject(data.getString("data")).getString("width"));
... ... @@ -1591,14 +1593,20 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
}
else if("video".equals(content.getTemplateKey())){
rspBo.setCoverImg(JSON.parseObject(data.getString("data")).getString("coverUrl"));
rspBo.setImgHeight(JSON.parseObject(data.getString("data")).getString("height"));
rspBo.setImgWidth(JSON.parseObject(data.getString("data")).getString("width"));
rspBo.setVideoUrl(JSON.parseObject(data.getString("data")).getString("videoUrl"));
}else if("coverImage".equals(content.getTemplateKey())){
String src = JSON.parseObject(JSON.parseObject(content.getContentData()).getString("data")).getString("src");
src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?"));
rspBo.setCoverImgSquareHeight(JSON.parseObject(data.getString("data")).getString("height"));
rspBo.setCoverImgSquareWidth(JSON.parseObject(data.getString("data")).getString("width"));
rspBo.setCoverImgSquare(src);
}else if("coverImage_flat".equals(content.getTemplateKey())){
String src = JSON.parseObject(JSON.parseObject(content.getContentData()).getString("data")).getString("src");
src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?"));
rspBo.setCoverImgFlatHeight(JSON.parseObject(data.getString("data")).getString("height"));
rspBo.setCoverImgFlatWidth(JSON.parseObject(data.getString("data")).getString("width"));
rspBo.setCoverImgFlat(src);
}
}
... ...
... ... @@ -41,6 +41,20 @@
<tr style="height: 60px">
<td>
<div style="float: left"> 双列封面图(首图):
</div>
<div style="float: left" id="coverImg"></div>
<div style="float: left"> 单列封面图(小图):
</div>
<div style="float: left" id="coverImgSquare"></div>
<div style="float: left"> 单列封面图(大图):
</div>
<div style="float: left" id="coverImgFlat"></div>
</td>
</tr>
<tr style="height: 60px">
<td>
<div id="articleContent1" style="float: left">
<span>文字内容:</span>
</div>
... ... @@ -175,7 +189,48 @@
$("#sourceStr").html(detailInfo.sourceStr);
$("#contentLength").html(detailInfo.articleContent == null ? 0 : detailInfo.articleContent.length);
$("#articleContent").html(detailInfo.articleContent == null || detailInfo.articleContent.length == 0 ? "空" : detailInfo.articleContent);
if (detailInfo.coverImgSquare != null && detailInfo.coverImgSquare != '') {
var width = detailInfo.coverImgSquareWidth;
var height = detailInfo.coverImgSquareHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
var imgHtml = '<img src="' + detailInfo.coverImgSquare + '" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImgSquare").html(imgHtml);
}
if (detailInfo.coverImgFlat != null && detailInfo.coverImgFlat != '') {
var w = detailInfo.coverImgFlatWidth;
var h = detailInfo.coverImgFlatHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
var imgHtml = '<img src="' + detailInfo.coverImgFlat + '" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImgFlat").html(imgHtml);
}
if(detailInfo.coverImg !=null && detailInfo.coverImg !=''){
var width = detailInfo.imgWidth;
var height = detailInfo.imgHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
imgHtml = '<img src="'+detailInfo.coverImg+'" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImg").html(imgHtml);
}
var imgSize = detailInfo.imgList == null ? 0 : detailInfo.imgList.length;
$("#imgSize").html(imgSize);
... ...
... ... @@ -156,29 +156,24 @@
</tr>
<tr style="height: 60px">
<td>
<label>封面</label> <br>
<div id="coverImageUploadExt" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
<td style="float: left;">
<label>单列封面(小图)(左图右字)</label> <br>
<div id="coverImageUpload" style="float:left;">
</div>
<!--<div>-->
<!--<div style="float:left;">-->
<!--&lt;!&ndash;<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>&ndash;&gt;-->
<!--<span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>-->
<!--</div>-->
<!--</div>-->
</td>
</tr>
<tr style="height: 60px">
<td>
<label>封面(扁图)</label> <br>
<td style="float: left; margin-left: 5%">
<label>单列封面(大图)(上图下字)</label> <br>
<div id="coverImage2Upload" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2.请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</td>
</tr>
... ... @@ -645,6 +640,13 @@
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -727,6 +729,13 @@
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -751,7 +760,7 @@
}
});
$("#coverImageUploadExt").imageUpload({
$("#coverImageUpload").imageUpload({
width: 171,
height: 120,
realInputName: "coverImage",
... ... @@ -765,19 +774,19 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -815,19 +824,19 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -865,19 +874,19 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
var imageCount = 0;
$("input[name='url']").each(function(j,item){
... ... @@ -960,7 +969,7 @@
}
//封面图
$("#coverImageUploadExt").imageUpload("setValue",data.coverImg);
$("#coverImageUpload").imageUpload("setValue",data.coverImg);
$("#coverImage2Upload").imageUpload("setValue",data.coverImgFlat);
$("#product_link").textbox("setValue",data.productLink);
... ... @@ -1071,6 +1080,12 @@
}
});
$("#labelIds").val(labels);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -1167,20 +1182,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == 'png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
//
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == 'png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
var imageCount = 0;
$("input[name='url']").each(function(j,item){
... ...
... ... @@ -104,7 +104,7 @@
<td style="width:100%;">
<span style="color:red">*</span><label style="font-size: 14px;">上传视频</label> <br>
<a href="javascript:void(0);" class="btn btn-default" @click="videoAdd" style="background: #428bca; border-radius: 5px; color:#fff; text-decoration: none; padding: 6px 10px;">选择视频+</a><span style="margin-left: 20px; height: 30px; width: 30px; border-radius: 30px; line-height: 30px; text-align: center; background: #aaa; display: inline-block">{{videoUploaderInfo.progress}}%</span><br>
<span style="color:red"> 请上传比例为16:9横版或9:16竖版视频素材,大小不超过50M,时长不超过180s</span><br>
<span style="color:red"> 请上传比例为16:9横版或9:16竖版视频素材,大小不超过100M,时长不超过10min</span><br>
<input id="videoUrl" type="text" name="videoUrl" :value="videoUploaderInfo.videoUrl" style="padding: 0; border: 1px solid #aaa; width: 545px;height: 30px; line-height: 30px;"><a style="height: 30px; line-height: 30px; border: 1px solid #aaa; color: #000; text-decoration: none; padding: 0px 15px; display: inline-block; border-left: 0px;" href="javascript:(0);" data-clipboard-action="copy" class="copy" data-clipboard-target="#videoUrl">复制</a>
<input type="file" style="display:none;" ref="videoFile" id="videoFile" @change="videoUpload" />
... ... @@ -126,32 +126,6 @@
</td>
</tr>
<tr style="height: 60px">
<td>
<label>封面(方图)</label> <br>
<div id="coverImageUpload" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</div>
</td>
</tr>
<tr style="height: 60px">
<td>
<label>封面(扁图)</label> <br>
<div id="coverImage2Upload" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</div>
</td>
</tr>
<tr style="height: 60px">
<td style="width:100%;">
... ... @@ -700,110 +674,6 @@
}
});
/*封面图上传*/
$("#coverImageUpload").imageUpload({
width: 171,
height: 120,
realInputName: "coverImage",
uploadInputName: "files",
url: serverContextPath + '/fileupload/uploadImgFile',
queryParams: {
bucket: "grassImg"
},
onBeforeSubmit: function () {
debugger;
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
},
filterFileName: function (data) {
debugger;
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误", data.message);
return "";
}
return data.data;
},
onLoadSuccess: function (data) {
$.messager.progress("close");
return false;
}
});
/*封面图上传*/
$("#coverImage2Upload").imageUpload({
width: 171,
height: 120,
realInputName: "coverImage2",
uploadInputName: "files",
url: serverContextPath + '/fileupload/uploadImgFile',
queryParams: {
bucket: "grassImg"
},
onBeforeSubmit: function () {
debugger;
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
},
filterFileName: function (data) {
debugger;
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误", data.message);
return "";
}
return data.data;
},
onLoadSuccess: function (data) {
$.messager.progress("close");
return false;
}
});
if (data){
... ...
... ... @@ -166,29 +166,25 @@
</tr>
<tr style="height: 60px">
<td>
<label>封面(方图)</label> <br>
<td style="float: left;">
<label>单列封面(小图)(左图右字)</label> <br>
<div id="coverImageUpload" style="float:left;">
</div>
<div>
<div style="float:left;">
<!--<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>-->
<span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</div>
<!--<div>-->
<!--<div style="float:left;">-->
<!--&lt;!&ndash;<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>&ndash;&gt;-->
<!--<span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>-->
<!--</div>-->
<!--</div>-->
</td>
</tr>
<tr style="height: 60px">
<td>
<label>封面(扁图)</label> <br>
<td style="float: left; margin-left: 5%">
<label>单列封面(大图)(上图下字)</label> <br>
<div id="coverImage2Upload" style="float:left;">
</div>
<div>
<div style="float:left;">
<!--<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>-->
<span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2.请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</div>
</td>
</tr>
... ... @@ -659,6 +655,12 @@
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -737,6 +739,13 @@
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -774,20 +783,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -826,20 +835,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -877,20 +886,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
var imageCount = 0;
$("input[name='url']").each(function(j,item){
debugger
... ... @@ -1018,6 +1027,13 @@
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -1126,20 +1142,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == 'png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == 'png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
var imageCount = 0;
$("input[name='url']").each(function(j,item){
debugger
... ...
... ... @@ -56,6 +56,19 @@
</td>
</tr>
<tr style="height: 60px">app.grass.simpleProductArticle
<td>
<div style="float: left"> 双列封面图(首图):
</div>
<div style="float: left" id="coverImg"></div>
<div style="float: left"> 单列封面图(小图):
</div>
<div style="float: left" id="coverImgSquare"></div>
<div style="float: left"> 单列封面图(大图):
</div>
<div style="float: left" id="coverImgFlat"></div>
</td>
</tr>
<tr style="height: 60px">
<td>
<div>
... ... @@ -315,7 +328,48 @@
$("#title").html(detailInfo.articleTitle);
$("#contentLength").html(detailInfo.articleContent == null ? 0 : detailInfo.articleContent.length);
$("#articleContent").html(detailInfo.articleContent == null || detailInfo.articleContent.length == 0 ? "文字内容:空<br>" : "文字内容:<br>" + detailInfo.articleContent);
if (detailInfo.coverImgSquare != null && detailInfo.coverImgSquare != '') {
var width = detailInfo.coverImgSquareWidth;
var height = detailInfo.coverImgSquareHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
var imgHtml = '<img src="' + detailInfo.coverImgSquare + '" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImgSquare").html(imgHtml);
}
if (detailInfo.coverImgFlat != null && detailInfo.coverImgFlat != '') {
var w = detailInfo.coverImgFlatWidth;
var h = detailInfo.coverImgFlatHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
var imgHtml = '<img src="' + detailInfo.coverImgFlat + '" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImgFlat").html(imgHtml);
}
if(detailInfo.coverImg !=null && detailInfo.coverImg !=''){
var width = detailInfo.imgWidth;
var height = detailInfo.imgHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
imgHtml = '<img src="'+detailInfo.coverImg+'" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImg").html(imgHtml);
}
var imgSize = detailInfo.imgList == null ? 0 : detailInfo.imgList.length;
$("#imgSize").html(imgSize);
... ...
... ... @@ -44,23 +44,33 @@
</tr>
<tr style="height: 60px">
<td>
<div id="articleBody">
<div id="articleBody">
标题: <span id="articleTitle"></span>
<br>
副标题: <span id="articleSubtitle"></span>
<br>
<div style="float: left"> 封面图:
<div style="float: left"> 双列封面图:
</div>
<br>
<div id="coverImg"></div>
正文:
<div id="articleContent"></div>
<div style="float: left" id="coverImg"></div>
<div style="float: left"> 单列封面图(小图):
</div>
<div style="float: left" id="coverImgSquare"></div>
<div style="float: left"> 单列封面图(大图):
</div>
<div id="coverImgFlat"></div>
</div>
</td>
</tr>
<tr style="height: 60px">
<td>
<div >
正文:
<div id="articleContent"></div>
</div>
</td>
</tr>
</table>
</div>
... ... @@ -245,7 +255,34 @@
}
$("#articleTitle").html(detailInfo.articleTitle);
$("#articleSubtitle").html(detailInfo.articleSubtitle);
if (detailInfo.coverImgSquare != null && detailInfo.coverImgSquare != '') {
var width = detailInfo.coverImgSquareWidth;
var height = detailInfo.coverImgSquareHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
var imgHtml = '<img src="' + detailInfo.coverImgSquare + '" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImgSquare").html(imgHtml);
}
if (detailInfo.coverImgFlat != null && detailInfo.coverImgFlat != '') {
var w = detailInfo.coverImgFlatWidth;
var h = detailInfo.coverImgFlatHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
var imgHtml = '<img src="' + detailInfo.coverImgFlat + '" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImgFlat").html(imgHtml);
}
var imgHtml = '';
if (detailInfo.coverImg != null && detailInfo.coverImg != '') {
var width = detailInfo.imgWidth;
... ...
... ... @@ -94,6 +94,8 @@
</input>
<input class="easyui-combobox" id="markFlag">
</input>
<input class="easyui-combobox" id="topicId">
</input>
<a id="searchBtn" class="btn-info">筛选</a>
<!--<a id="addActivityBtn" class="btn-success">新增</a>-->
<a id="allBtn" class="btn-info">全部 </a>
... ... @@ -127,6 +129,7 @@
$("#authStatus").combobox("setValue","-1");
$("#markFlag").combobox("setValue","");
$("#markType").combobox("setValue","");
$("#topicId").combobox("setValue","");
$("#activityListTable").datagrid("load", {
authStatus: "1"
});
... ... @@ -211,22 +214,6 @@
data:[{text:"全部",value:"-1"},{text:"已屏蔽",value:"4"},{text:"未屏蔽",value:"1",selected:true}]
});
$("#authStatus").combobox({
valueField : "value",
textField : "text",
required:false,
editable:false,
prompt: "请选择屏蔽状态",
data:[{text:"全部",value:"-1"},{text:"已屏蔽",value:"4"},{text:"未屏蔽",value:"1",selected:true}]
});
$("#authStatus").combobox({
valueField : "value",
textField : "text",
required:false,
editable:false,
prompt: "请选择屏蔽状态",
data:[{text:"全部",value:"-1"},{text:"已屏蔽",value:"4"},{text:"未屏蔽",value:"1",selected:true}]
});
$("#sortParam").combobox({
valueField : "value",
textField : "text",
... ... @@ -252,7 +239,21 @@
data:[{text:"全部",value:"-1"},{text:"达人搭配",value:"1"},{text:"发现好货",value:"2"}]
});
$("#topicId").combobox({
valueField: "id",
textField: "topicName",
required: false,
prompt: "请选择话题",
selectOnNavigation : true,
url : serverContextPath + "/grassTopicManage/getGrassTopicList",
loadFilter: function (data) {
var data = defaultLoadFilter(data);
data = data.list;
data.unshift({'id': '0', 'topicName': '全部'});
return data;
}
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action) {
if (action == 'uploadimage' || action == 'uploadfile') {
... ... @@ -269,6 +270,7 @@
var startTime="";
var endTime="";
var markType = $("#markType").combobox('getValue');
var topicId = $("#topicId").combobox('getValue');
var markFlag;
var markFindgoods;
if ($("#startTimeStr").datetimebox('getValue')!='') {
... ... @@ -300,7 +302,8 @@
endTimeStr:endTime,
sort:$("#sortParam").combobox("getValue"),
markFlag:markFlag,
markFindgoods:markFindgoods
markFindgoods:markFindgoods,
topicId:topicId
});
}
});
... ...
... ... @@ -63,8 +63,13 @@
<br>
副标题: <span id="articleSubtitle"></span>
<br>
<div style="float: left"> 封面图:</div><div id="coverImg"></div>
正文:<div id="content"></div>
<div style="float: left"> 双列封面图:</div><div style="float: left" id="coverImg"></div>
<div style="float: left"> 单列封面图(小图):
</div>
<div style="float: left" id="coverImgSquare"></div>
<div style="float: left"> 单列封面图(大图):
</div>
<div id="coverImgFlat"></div>
</div>
... ... @@ -72,6 +77,14 @@
</tr>
<tr style="height: 60px">
<td>
<div >
正文:
<div id="articleContent"></div>
</div>
</td>
</tr>
<tr style="height: 60px">
<td id="goodstd">
<!--<div style="float: left;margin-left: 30px">-->
<!--<a id="publishBtn" class="btn-info" style="display: none">发布</a>-->
... ... @@ -132,6 +145,34 @@
}
$("#articleTitle").html(detailInfo.articleTitle);
$("#articleSubtitle").html(detailInfo.articleSubtitle);
if (detailInfo.coverImgSquare != null && detailInfo.coverImgSquare != '') {
var width = detailInfo.coverImgSquareWidth;
var height = detailInfo.coverImgSquareHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
var imgHtml = '<img src="' + detailInfo.coverImgSquare + '" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImgSquare").html(imgHtml);
}
if (detailInfo.coverImgFlat != null && detailInfo.coverImgFlat != '') {
var w = detailInfo.coverImgFlatWidth;
var h = detailInfo.coverImgFlatHeight;
var w = width;
if(width >240){
w =240;
}
if(width ==1 || height == 1){
w =240;
}
var h = w * height/width;
var imgHtml = '<img src="' + detailInfo.coverImgFlat + '" style="width:'+w+'px;height:'+h+'px;"/>';
$("#coverImgFlat").html(imgHtml);
}
var imgHtml = '';
if(detailInfo.coverImg !=null && detailInfo.coverImg !=''){
... ...
... ... @@ -113,7 +113,7 @@
</tr>
<tr style="height: 60px">
<td>
<span style="color:red">*</span><label>封面</label> <br>
<span style="color:red">*</span><label>双列封面</label> <br>
<input id="coverImage" name="articleImages" hidden>
<div id="imageUpload" style="float:left;">
</div>
... ... @@ -127,28 +127,24 @@
</tr>
<tr style="height: 60px">
<td>
<label>封面(方图)</label> <br>
<td style="float: left;">
<label>单列封面(小图)(左图右字)</label> <br>
<div id="coverImageUpload" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</div>
<!--<div>-->
<!--<div style="float:left;">-->
<!--&lt;!&ndash;<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>&ndash;&gt;-->
<!--<span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>-->
<!--</div>-->
<!--</div>-->
</td>
</tr>
<tr style="height: 60px">
<td>
<label>封面(扁图)</label> <br>
<td style="float: left; margin-left: 5%">
<label>单列封面(大图)(上图下字)</label> <br>
<div id="coverImage2Upload" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2.请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</td>
</tr>
... ... @@ -483,20 +479,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -535,20 +531,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -587,20 +583,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -753,6 +749,12 @@
});
$("#labelIds").val(labels);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -830,6 +832,12 @@
$("#labelIds").val(labels);
var html = '';
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -930,7 +938,12 @@
}
});
$("#labelIds").val(labels);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ...
... ... @@ -133,7 +133,7 @@
</tr>
<tr style="height: 60px">
<td>
<span style="color:red">*</span><label>封面</label> <br>
<span style="color:red">*</span><label>双列封面</label> <br>
<input id="articleImages" name="articleImages" hidden>
<div id="imageUpload" style="float:left;">
</div>
... ... @@ -147,28 +147,24 @@
</tr>
<tr style="height: 60px">
<td>
<label>封面(方图)</label> <br>
<td style="float: left;">
<label>单列封面(小图)(左图右字)</label> <br>
<div id="coverImageUpload" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</div>
<!--<div>-->
<!--<div style="float:left;">-->
<!--&lt;!&ndash;<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>&ndash;&gt;-->
<!--<span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>-->
<!--</div>-->
<!--</div>-->
</td>
</tr>
<tr style="height: 60px">
<td>
<label>封面(扁图)</label> <br>
<td style="float: left; margin-left: 5%">
<label>单列封面(大图)(上图下字)</label> <br>
<div id="coverImage2Upload" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2.请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</td>
</tr>
... ... @@ -497,20 +493,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -663,6 +659,12 @@
});
$("#labelIds").val(labels);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -740,6 +742,12 @@
$("#labelIds").val(labels);
var html = '';
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -777,20 +785,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -829,20 +837,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -942,6 +950,12 @@
});
$("#labelIds").val(labels);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ...
... ... @@ -150,25 +150,24 @@
</tr>
<tr style="height: 60px">
<td>
<label>封面</label> <br>
<td style="float: left;">
<label>单列封面(小图)(左图右字)</label> <br>
<div id="coverImageUpload" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</div>
<!--<div>-->
<!--<div style="float:left;">-->
<!--&lt;!&ndash;<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>&ndash;&gt;-->
<!--<span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>-->
<!--</div>-->
<!--</div>-->
</td>
</tr>
<!--选择信息流结构-->
<tr style="height: 60px">
<td style="width:100%;">
<div style="float: left;width:700px;" >
<span style="color:red">*</span><label style="font-size: 14px;">选择结构类型</label> <br>
<input class="easyui-combobox" id="flowType" name="flowType" style="width:600px ">
<td style="float: left; margin-left: 5%">
<label>单列封面(大图)(上图下字)</label> <br>
<div id="coverImage2Upload" style="float:left;">
</div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2.请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</td>
</tr>
... ... @@ -192,6 +191,15 @@
</div>
</td>
</tr>
<tr style="height: 60px">
<td style="width:100%;">
<div style="float: left;width:700px;" >
<label style="font-size: 14px;">跳转链接(商品按钮)</label>
<input class="easyui-textbox" id="product_link" name="productLink" style="width:600px ">
</div>
</td>
</tr>
<tr>
<td valign="bottom">
<input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/>
... ... @@ -511,6 +519,12 @@
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -607,6 +621,13 @@
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -644,20 +665,72 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
},
filterFileName: function (data) {
debugger;
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误", data.message);
return "";
}
return data.data;
},
onLoadSuccess: function (data) {
$.messager.progress("close");
return false;
}
});
/*封面图上传*/
$("#coverImage2Upload").imageUpload({
width: 171,
height: 120,
realInputName: "coverImage2",
uploadInputName: "files",
url: serverContextPath + '/fileupload/uploadImgFile',
queryParams: {
bucket: "grassImg"
},
onBeforeSubmit: function () {
debugger;
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -695,20 +768,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
var imageCount = 0;
if(imgList !=null){
for (var i=0; i<imgList.length; i++) {
... ... @@ -908,6 +981,13 @@
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -1001,20 +1081,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == 'png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == 'png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
var imageCount = 0;
$("input[name='url']").each(function(j,item){
debugger
... ...
... ... @@ -141,25 +141,24 @@
</tr>
<tr style="height: 60px">
<td>
<label>封面</label> <br>
<div id="coverImageUploadExt" style="float:left;">
</div>
<div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
<td style="float: left;">
<label>单列封面(小图)(左图右字)</label> <br>
<div id="coverImageUpload" style="float:left;">
</div>
<!--<div>-->
<!--<div style="float:left;">-->
<!--&lt;!&ndash;<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>&ndash;&gt;-->
<!--<span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>-->
<!--</div>-->
<!--</div>-->
</td>
</tr>
<!--选择信息流结构-->
<tr style="height: 60px">
<td style="width:100%;">
<div style="float: left;width:700px;" >
<label style="font-size: 14px;">选择结构类型</label> <br>
<input class="easyui-combobox" id="flowType" name="flowType" style="width:200px ">
<td style="float: left; margin-left: 5%">
<label>单列封面(大图)(上图下字)</label> <br>
<div id="coverImage2Upload" style="float:left;">
</div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2.请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</td>
</tr>
... ... @@ -181,6 +180,14 @@
</div>
</td>
</tr>
<tr style="height: 60px">
<td style="width:100%;">
<div style="float: left;width:700px;" >
<label style="font-size: 14px;">跳转链接(商品按钮)</label>
<input class="easyui-textbox" id="product_link" name="productLink" style="width:600px ">
</div>
</td>
</tr>
<tr>
<td valign="bottom">
<input id="draftBotton" class="btn btn-primary" style="font-size: 18px; height: 36px;" value="保存到草稿箱"/>
... ... @@ -587,6 +594,12 @@
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -669,6 +682,12 @@
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -692,7 +711,8 @@
}
});
$("#coverImageUploadExt").imageUpload({
/*封面图上传*/
$("#coverImageUpload").imageUpload({
width: 171,
height: 120,
realInputName: "coverImage",
... ... @@ -706,19 +726,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -742,6 +763,57 @@
}
});
/*封面图上传*/
$("#coverImage2Upload").imageUpload({
width: 171,
height: 120,
realInputName: "coverImage2",
uploadInputName: "files",
url: serverContextPath + '/fileupload/uploadImgFile',
queryParams: {
bucket: "grassImg"
},
onBeforeSubmit: function () {
debugger;
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
},
filterFileName: function (data) {
debugger;
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误", data.message);
return "";
}
return data.data;
},
onLoadSuccess: function (data) {
$.messager.progress("close");
return false;
}
});
$("#imageUpload1").imageUpload({
width: 171,
height: 120,
... ... @@ -756,20 +828,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
var imageCount = 0;
$("input[name='url']").each(function(j,item){
debugger
... ... @@ -827,8 +899,9 @@
}
//封面图
$("#coverImageUploadExt").imageUpload("setValue",data.coverImg);
$("#coverImageUpload").imageUpload("setValue",data.coverImg);
$("#coverImage2Upload").imageUpload("setValue",data.coverImgFlat);
$("#product_link").textbox("setValue",data.productLink);
var context = data.contentText;
if(context == null || context == '' || context == undefined){
... ... @@ -940,6 +1013,12 @@
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -1037,20 +1116,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == 'png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == 'png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
var imageCount = 0;
$("input[name='url']").each(function(j,item){
debugger
... ...
... ... @@ -100,7 +100,7 @@
</tr>
<tr style="height: 60px">
<td>
<span style="color:red">*</span><label>封面</label> <br>
<span style="color:red">*</span><label>双列封面</label> <br>
<input id="coverImage" name="articleImages" hidden>
<div id="imageUpload">
</div>
... ... @@ -111,7 +111,28 @@
</td>
</tr>
<tr style="height: 60px">
<td style="float: left;">
<label>单列封面(小图)(左图右字)</label> <br>
<div id="coverImageUpload" style="float:left;">
</div>
<!--<div>-->
<!--<div style="float:left;">-->
<!--&lt;!&ndash;<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>&ndash;&gt;-->
<!--<span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>-->
<!--</div>-->
<!--</div>-->
</td>
<td style="float: left; margin-left: 5%">
<label>单列封面(大图)(上图下字)</label> <br>
<div id="coverImage2Upload" style="float:left;">
</div>
<div style="float:left;">
<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
<span style=" margin-left: 10px; color: red">2.请上传500K以内的图片,请勿上传像素过高的图片</span>
</div>
</td>
</tr>
<tr style="height: 60px">
... ... @@ -141,16 +162,24 @@
</td>
</tr>
<!--选择信息流结构-->
<!--&lt;!&ndash;选择信息流结构&ndash;&gt;-->
<!--<tr style="height: 60px">-->
<!--<td style="width:100%;">-->
<!--<div style="float: left;width:700px;" >-->
<!--<span style="color:red">*</span><label style="font-size: 14px;">选择结构类型</label> <br>-->
<!--<input class="easyui-combobox" id="flowType" name="flowType" style="width:600px ">-->
<!--</div>-->
<!--</td>-->
<!--</tr>-->
<tr style="height: 60px">
<td style="width:100%;">
<div style="float: left;width:700px;" >
<span style="color:red">*</span><label style="font-size: 14px;">选择结构类型</label> <br>
<input class="easyui-combobox" id="flowType" name="flowType" style="width:600px ">
<label style="font-size: 14px;">跳转链接(商品按钮)</label>
<input class="easyui-textbox" id="product_link" name="productLink" style="width:600px ">
</div>
</td>
</tr>
<tr>
<td valign="bottom">
<input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/>
... ... @@ -350,6 +379,110 @@
}
});
/*封面图上传*/
$("#coverImageUpload").imageUpload({
width: 171,
height: 120,
realInputName: "coverImage",
uploadInputName: "files",
url: serverContextPath + '/fileupload/uploadImgFile',
queryParams: {
bucket: "grassImg"
},
onBeforeSubmit: function () {
debugger;
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
},
filterFileName: function (data) {
debugger;
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误", data.message);
return "";
}
return data.data;
},
onLoadSuccess: function (data) {
$.messager.progress("close");
return false;
}
});
/*封面图上传*/
$("#coverImage2Upload").imageUpload({
width: 171,
height: 120,
realInputName: "coverImage2",
uploadInputName: "files",
url: serverContextPath + '/fileupload/uploadImgFile',
queryParams: {
bucket: "grassImg"
},
onBeforeSubmit: function () {
debugger;
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
},
filterFileName: function (data) {
debugger;
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误", data.message);
return "";
}
return data.data;
},
onLoadSuccess: function (data) {
$.messager.progress("close");
return false;
}
});
$("#imageUpload").imageUpload({
width: 171,
height: 120,
... ... @@ -364,20 +497,20 @@
var oobj = $(this).find("input[type='file']");
var files = oobj[0].files;
for(var i=0; i<files.length;i++){
var obj = files[i];
if(obj!=null && obj!=''){
debugger
if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
if(obj.type.toLowerCase() == 'image/png'){
$.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
return false;
}
}
}
// for(var i=0; i<files.length;i++){
// var obj = files[i];
// if(obj!=null && obj!=''){
// debugger
// if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// if(obj.type.toLowerCase() == 'image/png'){
// $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
// return false;
// }
// }
// }
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
... ... @@ -524,7 +657,12 @@
}
});
$("#labelIds").val(labels);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -593,7 +731,12 @@
});
$("#labelIds").val(labels);
var html = '';
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -688,7 +831,12 @@
}
});
$("#labelIds").val(labels);
var cover1 = $("input[type='hidden'][name='coverImage']").val();
var cover2 = $("input[type='hidden'][name='coverImage2']").val();
if(cover1 && cover2){
$.messager.alert("保存失败", "单列封面只允许上传一张", "error");
return false;
}
return true;
},
success : function(data) {
... ... @@ -752,6 +900,10 @@
$("#topicGroupId").combobox('setValue',data.topicGroupId);
$("#topicId").combobox('setValue',data.topicId);
}
//封面图
$("#coverImageUpload").imageUpload("setValue",data.coverImg);
$("#coverImage2Upload").imageUpload("setValue",data.coverImgFlat);
$("#product_link").textbox("setValue",data.productLink);
htmlTopic(data.topicName);
$("#imageUpload").imageUpload("setValue",data.imgList[0])
... ...
... ... @@ -15,7 +15,7 @@
<body>
<div id="tt" class="easyui-layout" style="height: 600px">
<div id="tt" class="easyui-layout" style="overflow-y: scroll;height: 90%">
<form name="publishArticleForm" id="publishArticleForm" method="post" >
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
... ...
... ... @@ -91,7 +91,7 @@ UE.registerUI('yohoProduct',function(editor,uiName){
title:"yohoProduct",
//指定dialog的外围样式
cssRules:"width:1225px;height:600px;",
cssRules:"width:825px;height:400px;",
//如果给出了buttons就代表dialog有确定和取消
buttons:[
... ...