Authored by 张帅

封面

... ... @@ -149,6 +149,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
private final static String BLOCK_LINK = "link";
private final static String BLOCK_VIDEO = "video";
private final static String BLOCK_COVER = "coverImage";
private final static String BLOCK_COVER_F = "coverImage_flat";
//记录某一天@用户的推送次数
private final static String ATINBOX_SEND_TIMES_INTEL_IN_DAY = "yh:msg:ATINBOX_SEND_TIMES_INTEL_IN_DAY:";
... ... @@ -209,6 +210,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
article.setArticleTitle(req.getTitle());
article.setFlowType(req.getFlowType());
article.setDispatchChannel(req.getDispatchChannel());
article.setProductLink(req.getProductLink());
try {
grassArticleDao.insertArticleSeletive(article);
logger.info("insert grass article success, uid is {}, ariticle id is {}", article.getAuthorUid(), article.getId());
... ... @@ -341,7 +343,13 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
dataObject.put("width", 1);
dataObject.put("height", 1);
break;
case BLOCK_COVER_F:
String cover = convertImageUrlWithDefault(data);
// JSONObject imageInfo = getImageInfoFromQN(data);
dataObject.put("src", cover);
dataObject.put("width", 1);
dataObject.put("height", 1);
break;
default:
break;
}
... ... @@ -363,7 +371,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
List<GrassArticleBlock> blockList = grassArticleBlockDao.selectByArticleId(articleId);
Map<String, Future<JSONObject>> map = Maps.newConcurrentMap();
for (GrassArticleBlock block : blockList) {
if (!block.getTemplateKey().equals("image") && !block.getTemplateKey().equals("coverImage")) {
if (!block.getTemplateKey().equals("image") && !block.getTemplateKey().equals("coverImage")
&& !block.getTemplateKey().equals(BLOCK_COVER_F)) {
continue;
}
JSONObject object = JSONObject.parseObject(block.getContentData());
... ... @@ -375,7 +384,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
}
List<GrassArticleBlock> needUpdateBlocks = Lists.newArrayList();
for (GrassArticleBlock block : blockList) {
if (!block.getTemplateKey().equals("image") && !block.getTemplateKey().equals("coverImage")) {
if (!block.getTemplateKey().equals("image") && !block.getTemplateKey().equals("coverImage")
&& !block.getTemplateKey().equals(BLOCK_COVER_F)) {
continue;
}
JSONObject object = JSONObject.parseObject(block.getContentData());
... ... @@ -657,6 +667,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
grassArticle.setArticleTitle(req.getTitle());
grassArticle.setDispatchChannel(req.getDispatchChannel());
grassArticle.setFlowType(req.getFlowType());
grassArticle.setProductLink(req.getProductLink());
grassArticleDao.updateByPrimaryKeySelective(grassArticle);
//文章内容
... ... @@ -1236,6 +1247,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
grassArticle.setCopyright(req.getCopyright());
grassArticle.setDispatchChannel(req.getDispatchChannel());
grassArticle.setFlowType(req.getFlowType());
grassArticle.setProductLink(req.getProductLink());
if (type == 3) {
time = Long.valueOf(publishTime) + new Random().nextInt(999);
grassArticle.setIsRecommend(1);
... ... @@ -1412,6 +1424,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
article.setArticleTitle(req.getTitle());
article.setFlowType(req.getFlowType());
article.setDispatchChannel(req.getDispatchChannel());
article.setProductLink(req.getProductLink());
try {
grassArticleDao.insertArticleSeletive(article);
logger.info("insert grass article success, uid is {}, ariticle id is {}", article.getAuthorUid(), article.getId());
... ... @@ -1545,6 +1558,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
//分发渠道,信息流结构
rspBo.setDispatchChannel(grassArticle.getDispatchChannel());
rspBo.setFlowType(grassArticle.getFlowType());
rspBo.setProductLink(grassArticle.getProductLink());
//1)文章内容
List<GrassArticleBlock> grassArticleContentList = grassArticleBlockDao.selectByArticleId(articleId);
List<String> imageList = new ArrayList<>();
... ... @@ -1571,11 +1586,18 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
else if("video".equals(content.getTemplateKey())){
rspBo.setCoverImg(JSON.parseObject(data.getString("data")).getString("coverUrl"));
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.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.setCoverImgFlat(src);
}
}
rspBo.setArticleContent(text);
rspBo.setImgList(imageList);
//2)关联的标签
List<GrassArticleLabel> labelList = grassArticleLabelDao.selectByArticleId(articleId);
if (CollectionUtils.isNotEmpty(labelList)) {
... ... @@ -1716,6 +1738,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
Map<Integer,JSONObject> videoMap = Maps.newHashMap();
//笔记的封面图
Map<Integer,String> coverImageMap = Maps.newHashMap();
Map<Integer,String> coverImage2Map = Maps.newHashMap();
grassArticleContentList.forEach(content -> {
if ("image".equals(content.getTemplateKey())) {
List<String> images = imgMap.get(content.getArticleId());
... ... @@ -1748,6 +1771,12 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?"));
coverImageMap.put(content.getArticleId(), src);
}
if("coverImage_flat".equals(content.getTemplateKey())){
JSONObject data = JSON.parseObject(content.getContentData());
String src = JSON.parseObject(data.getString("data")).getString("src");
src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?"));
coverImageMap.put(content.getArticleId(), src);
}
});
... ... @@ -1791,6 +1820,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
rspBo.setAuthTimeStr(DateUtil.long2DateStr(article.getAuthTime(), DateUtil.DATE_TIME_FORMAT));
rspBo.setAuthStatus(article.getAuthStatus());
rspBo.setSource(article.getArticleType());
rspBo.setProductLink(article.getProductLink());
/* if (article.getArticleType() == ArticleTypeEnum.NORMAL.getValue()) {//文章类型是1 的
if (vitualUids.contains(article.getAuthorUid())) {//属于马甲用户发布的
rspBo.setSource(6);
... ... @@ -1831,19 +1861,18 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
rspBo.setHasPublished(article.getCreateTime() >= System.currentTimeMillis() ? "N" : "Y");
//拼接文章预览的url 类似:http://yoho-community-web.test3.ingress.dev.yohocorp.com/grass/article/1408536?type=preview
rspBo.setPreviewUrl(previewUrl + article.getId() + "?type=preview");
//笔记封面图 长文章
//如果没有单独的给笔记设置封面图,取图片列表的第一张作为封面图
String coverImage = imgMap.get(article.getId()).get(0);
rspBo.setCoverImg(coverImage);
//短视频封面图
if(sort == 4){
rspBo.setCoverImg(videoMap.get(article.getId()) == null ? "" : videoMap.get(article.getId()).getString("coverUrl"));
}
//笔记封面图
else if(sort == 1){
//如果没有单独的给笔记设置封面图,取图片列表的第一张作为封面图
String coverImage = coverImageMap.get(article.getId()) == null ? "" : coverImageMap.get(article.getId());
if(StringUtils.isEmpty(coverImage)){
coverImage = imgMap.get(article.getId()).get(0);
}
rspBo.setCoverImg(coverImage);
}
rspBo.setCoverImgSquare(coverImageMap.get(article.getId()));
rspBo.setCoverImgFlat(coverImage2Map.get(article.getId()));
//短视频url
rspBo.setVideoUrl(videoMap.get(article.getId()) == null ? "" : videoMap.get(article.getId()).getString("videoUrl"));
rspBo.setFileId(videoMap.get(article.getId()) == null ? "" : videoMap.get(article.getId()).getString("fileId"));
... ... @@ -1999,12 +2028,21 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
}
}
//针对笔记的封面新增templateKey coverImage单独处理
if(sort == 1 && StringUtils.isNotEmpty(req.getCoverImage())){
if(StringUtils.isNotEmpty(req.getCoverImage())){
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(articleId);
content.setContentData(getBlock(BLOCK_COVER, req.getCoverImage()));
content.setCreateTime(now);
content.setTemplateKey("coverImage");
content.setTemplateKey(BLOCK_COVER);
content.setOrderBy(0);
contentList.add(content);
}
if(StringUtils.isNotEmpty(req.getCoverImage2())){
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(articleId);
content.setContentData(getBlock(BLOCK_COVER_F, req.getCoverImage2()));
content.setCreateTime(now);
content.setTemplateKey(BLOCK_COVER_F);
content.setOrderBy(0);
contentList.add(content);
}
... ...
... ... @@ -62,14 +62,14 @@
</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="dispatchChannelExt" name="dispatchChannel" 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="dispatchChannelExt" name="dispatchChannel" style="width:600px ">-->
<!--</div>-->
<!--</td>-->
<!--</tr>-->
<tr style="height: 60px">
<td style="width:100%; word-wrap:break-word;" >
... ... @@ -170,14 +170,28 @@
</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="flowTypeExt" name="flowType" style="width:200px ">
<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%;">-->
<!--<div style="float: left;width:700px;" >-->
<!--<label style="font-size: 14px;">选择结构类型</label> <br>-->
<!--<input class="easyui-combobox" id="flowTypeExt" name="flowType" style="width:200px ">-->
<!--</div>-->
<!--</td>-->
<!--</tr>-->
<tr style="height: 60px">
<td>
<label style="font-size: 14px;">关联商品</label> <br>
... ... @@ -195,6 +209,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: 18px; height: 36px;" value="保存到草稿箱"/>
... ... @@ -314,22 +337,22 @@
}
});
$("#dispatchChannelExt").combobox({
valueField : "value",
textField : "text",
required:true,
prompt: "选择分发渠道",
data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
});
/*选择结构类型*/
$("#flowTypeExt").combobox({
valueField : "value",
textField : "text",
required:false,
prompt: "选择结构类型",
data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
});
// $("#dispatchChannelExt").combobox({
// valueField : "value",
// textField : "text",
// required:true,
// prompt: "选择分发渠道",
// data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
// });
//
// /*选择结构类型*/
// $("#flowTypeExt").combobox({
// valueField : "value",
// textField : "text",
// required:false,
// prompt: "选择结构类型",
// data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
// });
$("#articleUid").textbox({
required: true,
... ... @@ -776,6 +799,56 @@
}
});
$("#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!=''){
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,
... ... @@ -854,14 +927,14 @@
$("#title").textbox("setValue",data.articleTitle);
//分发渠道
if(data.dispatchChannel !=null){
$("#dispatchChannelExt").combobox('setValue',data.dispatchChannel);
}
// if(data.dispatchChannel !=null){
// $("#dispatchChannelExt").combobox('setValue',data.dispatchChannel);
// }
//结构类型
if(data.flowType !=null && data.flowType !=-1){
$("#flowTypeExt").combobox('setValue',data.flowType);
}
// if(data.flowType !=null && data.flowType !=-1){
// $("#flowTypeExt").combobox('setValue',data.flowType);
// }
// $("#content").val(data.articleContent);
$("#content").emojioneArea()[0].emojioneArea.setText(data.articleContent);
... ... @@ -885,6 +958,8 @@
//封面图
$("#coverImageUploadExt").imageUpload("setValue",data.coverImg);
$("#coverImage2Upload").imageUpload("setValue",data.coverImgFlat);
$("#product_link").textbox("setValue",data.productLink);
htmlTopic(data.topicName);
... ...
... ... @@ -135,6 +135,33 @@
</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%;">
<label style="font-size: 14px;">选择标签</label> <br>
<input id="labelId" name="labelId" class="easyui-combobox" style="width:600px; "/><br>
... ... @@ -190,6 +217,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="保存到草稿箱"/>
... ... @@ -679,6 +715,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;
}
});
if (data){
... ... @@ -711,6 +851,11 @@
$("#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);
... ...
... ... @@ -73,14 +73,14 @@
</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="dispatchChannel" name="dispatchChannel" 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="dispatchChannel" name="dispatchChannel" style="width:600px ">-->
<!--</div>-->
<!--</td>-->
<!--</tr>-->
<tr style="height: 60px">
<td style="width:100%; word-wrap:break-word;" >
... ... @@ -167,28 +167,41 @@
<tr style="height: 60px">
<td>
<label>封面</label> <br>
<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>
<!--<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>
</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>
<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>
</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 ">-->
<!--</div>-->
<!--</td>-->
<!--</tr>-->
<tr style="height: 60px">
<td>
<label style="font-size: 14px;">关联商品</label> <br>
... ... @@ -208,6 +221,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: 16px; height: 36px;" value="保存到草稿箱"/>
... ... @@ -387,22 +408,22 @@
// }
// });
$("#dispatchChannel").combobox({
valueField : "value",
textField : "text",
required:true,
prompt: "选择分发渠道",
data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
});
// $("#dispatchChannel").combobox({
// valueField : "value",
// textField : "text",
// required:true,
// prompt: "选择分发渠道",
// data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
// });
/*选择信息结构*/
$("#flowType").combobox({
valueField : "value",
textField : "text",
required:false,
prompt: "选择结构类型",
data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
});
// $("#flowType").combobox({
// valueField : "value",
// textField : "text",
// required:false,
// prompt: "选择结构类型",
// data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
// });
$("#articleUid").textbox({
required: true,
... ... @@ -790,6 +811,58 @@
}
});
/*封面图上传*/
$("#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,
... ...
... ... @@ -94,14 +94,14 @@
</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="dispatchChannelExt" name="dispatchChannel" 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="dispatchChannelExt" name="dispatchChannel" style="width:600px ">-->
<!--</div>-->
<!--</td>-->
<!--</tr>-->
<tr style="height: 60px" id = "contentTR">
<td style="width:100% ">
... ... @@ -172,11 +172,20 @@
</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="flowTypeExt" name="flowType" style="width:200px ">-->
<!--</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="flowTypeExt" name="flowType" style="width:200px ">
<label style="font-size: 14px;">跳转链接(商品按钮)</label>
<input class="easyui-textbox" id="product_link" name="productLink" style="width:600px ">
</div>
</td>
</tr>
... ... @@ -357,21 +366,21 @@
}
});
$("#dispatchChannelExt").combobox({
valueField : "value",
textField : "text",
required:true,
prompt: "选择分发渠道",
data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
});
$("#flowTypeExt").combobox({
valueField : "value",
textField : "text",
required:false,
prompt: "选择信息流结构",
data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
});
// $("#dispatchChannelExt").combobox({
// valueField : "value",
// textField : "text",
// required:true,
// prompt: "选择分发渠道",
// data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
// });
//
// $("#flowTypeExt").combobox({
// valueField : "value",
// textField : "text",
// required:false,
// prompt: "选择信息流结构",
// data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
// });
$("#actionUrl").textbox({
required: false,
... ... @@ -483,6 +492,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;
}
});
$("#topicGroupId").combobox({
prompt: "选择话题分组",
required: false,
... ... @@ -895,6 +1008,12 @@
if(data.sort !='' && data.sort == 3){
$("#appurl").attr('checked','true');
}
//封面图
$("#coverImageUpload").imageUpload("setValue",data.coverImg);
$("#coverImage2Upload").imageUpload("setValue",data.coverImgFlat);
$("#product_link").textbox("setValue",data.productLink);
var labelIds = [];
if(data.labelList!=null && data.labelList.length>0){
for (var i=0;i<data.labelList.length;i++){
... ...
... ... @@ -114,14 +114,14 @@
</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="dispatchChannel" name="dispatchChannel" 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="dispatchChannel" name="dispatchChannel" style="width:600px ">-->
<!--</div>-->
<!--</td>-->
<!--</tr>-->
<tr style="height: 60px">
<td style="width:100% ">
... ... @@ -134,7 +134,7 @@
<tr style="height: 60px">
<td>
<span style="color:red">*</span><label>封面</label> <br>
<input id="coverImage" name="articleImages" hidden>
<input id="articleImages" name="articleImages" hidden>
<div id="imageUpload" style="float:left;">
</div>
<div>
... ... @@ -146,6 +146,33 @@
</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>
... ... @@ -194,16 +221,24 @@
</td>
</tr>
<!--选择信息流结构-->
<!--&lt;!&ndash;选择信息流结构&ndash;&gt;-->
<!--<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 ">-->
<!--</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 ">
<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="保存到草稿箱"/>
... ... @@ -314,13 +349,13 @@
{text: "其他", value: "4"}]
});
$("#dispatchChannel").combobox({
valueField : "value",
textField : "text",
required:true,
prompt: "选择分发渠道",
data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
});
// $("#dispatchChannel").combobox({
// valueField : "value",
// textField : "text",
// required:true,
// prompt: "选择分发渠道",
// data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
// });
$("#userBotton").linkbutton({
... ... @@ -395,15 +430,15 @@
onChange: function () {
}
});
/*选择信息结构*/
$("#flowType").combobox({
valueField : "value",
textField : "text",
required:false,
prompt: "选择结构类型",
data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
});
//
// /*选择信息结构*/
// $("#flowType").combobox({
// valueField : "value",
// textField : "text",
// required:false,
// prompt: "选择结构类型",
// data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
// });
$("#subtitle").textbox({
required: false,
... ... @@ -610,7 +645,7 @@
}
imageCount++;
});
$("#coverImage").val(imgs);
$("#articleImages").val(imgs);
if(imageCount < 1){
$.messager.alert("发布失败", "请上传封面图", "error");
... ... @@ -690,7 +725,7 @@
$.messager.alert("发布失败", "请上传封面图", "error");
return false;
}
$("#coverImage").val(imgs);
$("#articleImages").val(imgs);
var labels = '';
$("input[name='labelId']").each(function(j,item){
... ... @@ -727,7 +762,109 @@
}
});
/*封面图上传*/
$("#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;
}
});
// 定时 选择时间
function getTimeDialog(data,id, status){
... ... @@ -787,7 +924,7 @@
}
imageCount++;
});
$("#coverImage").val(imgs);
$("#articleImages").val(imgs);
if(imageCount < 1){
$.messager.alert("发布失败", "请上传封面图", "error");
... ...