Authored by 张帅

Merge branch 'dev-grass-20200317' into test6.9.24

# Conflicts:
#	web/src/main/webapp/html/grass/article/editArticle.html
#	web/src/main/webapp/html/grass/article/publishArticle.html
#	web/src/main/webapp/html/grass/longArticle/edit.html
#	web/src/main/webapp/html/grass/longArticle/publish.html
@@ -155,6 +155,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -155,6 +155,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
155 private final static String BLOCK_LINK = "link"; 155 private final static String BLOCK_LINK = "link";
156 private final static String BLOCK_VIDEO = "video"; 156 private final static String BLOCK_VIDEO = "video";
157 private final static String BLOCK_COVER = "coverImage"; 157 private final static String BLOCK_COVER = "coverImage";
  158 + private final static String BLOCK_COVER_F = "coverImage_flat";
158 159
159 //记录某一天@用户的推送次数 160 //记录某一天@用户的推送次数
160 private final static String ATINBOX_SEND_TIMES_INTEL_IN_DAY = "yh:msg:ATINBOX_SEND_TIMES_INTEL_IN_DAY:"; 161 private final static String ATINBOX_SEND_TIMES_INTEL_IN_DAY = "yh:msg:ATINBOX_SEND_TIMES_INTEL_IN_DAY:";
@@ -215,6 +216,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -215,6 +216,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
215 article.setArticleTitle(req.getTitle()); 216 article.setArticleTitle(req.getTitle());
216 article.setFlowType(req.getFlowType()); 217 article.setFlowType(req.getFlowType());
217 article.setDispatchChannel(req.getDispatchChannel()); 218 article.setDispatchChannel(req.getDispatchChannel());
  219 + article.setProductLink(req.getProductLink());
218 try { 220 try {
219 grassArticleDao.insertArticleSeletive(article); 221 grassArticleDao.insertArticleSeletive(article);
220 logger.info("insert grass article success, uid is {}, ariticle id is {}", article.getAuthorUid(), article.getId()); 222 logger.info("insert grass article success, uid is {}, ariticle id is {}", article.getAuthorUid(), article.getId());
@@ -347,7 +349,13 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -347,7 +349,13 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
347 dataObject.put("width", 1); 349 dataObject.put("width", 1);
348 dataObject.put("height", 1); 350 dataObject.put("height", 1);
349 break; 351 break;
350 - 352 + case BLOCK_COVER_F:
  353 + String cover = convertImageUrlWithDefault(data);
  354 +// JSONObject imageInfo = getImageInfoFromQN(data);
  355 + dataObject.put("src", cover);
  356 + dataObject.put("width", 1);
  357 + dataObject.put("height", 1);
  358 + break;
351 default: 359 default:
352 break; 360 break;
353 } 361 }
@@ -369,7 +377,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -369,7 +377,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
369 List<GrassArticleBlock> blockList = grassArticleBlockDao.selectByArticleId(articleId); 377 List<GrassArticleBlock> blockList = grassArticleBlockDao.selectByArticleId(articleId);
370 Map<String, Future<JSONObject>> map = Maps.newConcurrentMap(); 378 Map<String, Future<JSONObject>> map = Maps.newConcurrentMap();
371 for (GrassArticleBlock block : blockList) { 379 for (GrassArticleBlock block : blockList) {
372 - if (!block.getTemplateKey().equals("image") && !block.getTemplateKey().equals("coverImage")) { 380 + if (!block.getTemplateKey().equals("image") && !block.getTemplateKey().equals("coverImage")
  381 + && !block.getTemplateKey().equals(BLOCK_COVER_F)) {
373 continue; 382 continue;
374 } 383 }
375 JSONObject object = JSONObject.parseObject(block.getContentData()); 384 JSONObject object = JSONObject.parseObject(block.getContentData());
@@ -381,7 +390,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -381,7 +390,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
381 } 390 }
382 List<GrassArticleBlock> needUpdateBlocks = Lists.newArrayList(); 391 List<GrassArticleBlock> needUpdateBlocks = Lists.newArrayList();
383 for (GrassArticleBlock block : blockList) { 392 for (GrassArticleBlock block : blockList) {
384 - if (!block.getTemplateKey().equals("image") && !block.getTemplateKey().equals("coverImage")) { 393 + if (!block.getTemplateKey().equals("image") && !block.getTemplateKey().equals("coverImage")
  394 + && !block.getTemplateKey().equals(BLOCK_COVER_F)) {
385 continue; 395 continue;
386 } 396 }
387 JSONObject object = JSONObject.parseObject(block.getContentData()); 397 JSONObject object = JSONObject.parseObject(block.getContentData());
@@ -663,6 +673,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -663,6 +673,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
663 grassArticle.setArticleTitle(req.getTitle()); 673 grassArticle.setArticleTitle(req.getTitle());
664 grassArticle.setDispatchChannel(req.getDispatchChannel()); 674 grassArticle.setDispatchChannel(req.getDispatchChannel());
665 grassArticle.setFlowType(req.getFlowType()); 675 grassArticle.setFlowType(req.getFlowType());
  676 + grassArticle.setProductLink(req.getProductLink());
666 grassArticleDao.updateByPrimaryKeySelective(grassArticle); 677 grassArticleDao.updateByPrimaryKeySelective(grassArticle);
667 678
668 //文章内容 679 //文章内容
@@ -1242,6 +1253,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -1242,6 +1253,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
1242 grassArticle.setCopyright(req.getCopyright()); 1253 grassArticle.setCopyright(req.getCopyright());
1243 grassArticle.setDispatchChannel(req.getDispatchChannel()); 1254 grassArticle.setDispatchChannel(req.getDispatchChannel());
1244 grassArticle.setFlowType(req.getFlowType()); 1255 grassArticle.setFlowType(req.getFlowType());
  1256 + grassArticle.setProductLink(req.getProductLink());
1245 if (type == 3) { 1257 if (type == 3) {
1246 time = Long.valueOf(publishTime) + new Random().nextInt(999); 1258 time = Long.valueOf(publishTime) + new Random().nextInt(999);
1247 grassArticle.setIsRecommend(1); 1259 grassArticle.setIsRecommend(1);
@@ -1418,6 +1430,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -1418,6 +1430,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
1418 article.setArticleTitle(req.getTitle()); 1430 article.setArticleTitle(req.getTitle());
1419 article.setFlowType(req.getFlowType()); 1431 article.setFlowType(req.getFlowType());
1420 article.setDispatchChannel(req.getDispatchChannel()); 1432 article.setDispatchChannel(req.getDispatchChannel());
  1433 + article.setProductLink(req.getProductLink());
1421 try { 1434 try {
1422 grassArticleDao.insertArticleSeletive(article); 1435 grassArticleDao.insertArticleSeletive(article);
1423 logger.info("insert grass article success, uid is {}, ariticle id is {}", article.getAuthorUid(), article.getId()); 1436 logger.info("insert grass article success, uid is {}, ariticle id is {}", article.getAuthorUid(), article.getId());
@@ -1551,6 +1564,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -1551,6 +1564,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
1551 //分发渠道,信息流结构 1564 //分发渠道,信息流结构
1552 rspBo.setDispatchChannel(grassArticle.getDispatchChannel()); 1565 rspBo.setDispatchChannel(grassArticle.getDispatchChannel());
1553 rspBo.setFlowType(grassArticle.getFlowType()); 1566 rspBo.setFlowType(grassArticle.getFlowType());
  1567 + rspBo.setProductLink(grassArticle.getProductLink());
  1568 +
1554 //1)文章内容 1569 //1)文章内容
1555 List<GrassArticleBlock> grassArticleContentList = grassArticleBlockDao.selectByArticleId(articleId); 1570 List<GrassArticleBlock> grassArticleContentList = grassArticleBlockDao.selectByArticleId(articleId);
1556 List<String> imageList = new ArrayList<>(); 1571 List<String> imageList = new ArrayList<>();
@@ -1577,11 +1592,18 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -1577,11 +1592,18 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
1577 else if("video".equals(content.getTemplateKey())){ 1592 else if("video".equals(content.getTemplateKey())){
1578 rspBo.setCoverImg(JSON.parseObject(data.getString("data")).getString("coverUrl")); 1593 rspBo.setCoverImg(JSON.parseObject(data.getString("data")).getString("coverUrl"));
1579 rspBo.setVideoUrl(JSON.parseObject(data.getString("data")).getString("videoUrl")); 1594 rspBo.setVideoUrl(JSON.parseObject(data.getString("data")).getString("videoUrl"));
  1595 + }else if("coverImage".equals(content.getTemplateKey())){
  1596 + String src = JSON.parseObject(JSON.parseObject(content.getContentData()).getString("data")).getString("src");
  1597 + src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?"));
  1598 + rspBo.setCoverImgSquare(src);
  1599 + }else if("coverImage_flat".equals(content.getTemplateKey())){
  1600 + String src = JSON.parseObject(JSON.parseObject(content.getContentData()).getString("data")).getString("src");
  1601 + src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?"));
  1602 + rspBo.setCoverImgFlat(src);
1580 } 1603 }
1581 } 1604 }
1582 rspBo.setArticleContent(text); 1605 rspBo.setArticleContent(text);
1583 rspBo.setImgList(imageList); 1606 rspBo.setImgList(imageList);
1584 -  
1585 //2)关联的标签 1607 //2)关联的标签
1586 List<GrassArticleLabel> labelList = grassArticleLabelDao.selectByArticleId(articleId); 1608 List<GrassArticleLabel> labelList = grassArticleLabelDao.selectByArticleId(articleId);
1587 if (CollectionUtils.isNotEmpty(labelList)) { 1609 if (CollectionUtils.isNotEmpty(labelList)) {
@@ -1724,6 +1746,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -1724,6 +1746,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
1724 Map<Integer,JSONObject> videoMap = Maps.newHashMap(); 1746 Map<Integer,JSONObject> videoMap = Maps.newHashMap();
1725 //笔记的封面图 1747 //笔记的封面图
1726 Map<Integer,String> coverImageMap = Maps.newHashMap(); 1748 Map<Integer,String> coverImageMap = Maps.newHashMap();
  1749 + Map<Integer,String> coverImage2Map = Maps.newHashMap();
1727 grassArticleContentList.forEach(content -> { 1750 grassArticleContentList.forEach(content -> {
1728 if ("image".equals(content.getTemplateKey())) { 1751 if ("image".equals(content.getTemplateKey())) {
1729 List<String> images = imgMap.get(content.getArticleId()); 1752 List<String> images = imgMap.get(content.getArticleId());
@@ -1756,6 +1779,12 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -1756,6 +1779,12 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
1756 src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?")); 1779 src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?"));
1757 coverImageMap.put(content.getArticleId(), src); 1780 coverImageMap.put(content.getArticleId(), src);
1758 } 1781 }
  1782 + if("coverImage_flat".equals(content.getTemplateKey())){
  1783 + JSONObject data = JSON.parseObject(content.getContentData());
  1784 + String src = JSON.parseObject(data.getString("data")).getString("src");
  1785 + src = StringUtils.isEmpty(src) ? "" : src.substring(0, src.indexOf("?"));
  1786 + coverImageMap.put(content.getArticleId(), src);
  1787 + }
1759 1788
1760 }); 1789 });
1761 1790
@@ -1799,6 +1828,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -1799,6 +1828,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
1799 rspBo.setAuthTimeStr(DateUtil.long2DateStr(article.getAuthTime(), DateUtil.DATE_TIME_FORMAT)); 1828 rspBo.setAuthTimeStr(DateUtil.long2DateStr(article.getAuthTime(), DateUtil.DATE_TIME_FORMAT));
1800 rspBo.setAuthStatus(article.getAuthStatus()); 1829 rspBo.setAuthStatus(article.getAuthStatus());
1801 rspBo.setSource(article.getArticleType()); 1830 rspBo.setSource(article.getArticleType());
  1831 + rspBo.setProductLink(article.getProductLink());
1802 /* if (article.getArticleType() == ArticleTypeEnum.NORMAL.getValue()) {//文章类型是1 的 1832 /* if (article.getArticleType() == ArticleTypeEnum.NORMAL.getValue()) {//文章类型是1 的
1803 if (vitualUids.contains(article.getAuthorUid())) {//属于马甲用户发布的 1833 if (vitualUids.contains(article.getAuthorUid())) {//属于马甲用户发布的
1804 rspBo.setSource(6); 1834 rspBo.setSource(6);
@@ -1840,19 +1870,18 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -1840,19 +1870,18 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
1840 rspBo.setHasPublished(article.getCreateTime() >= System.currentTimeMillis() ? "N" : "Y"); 1870 rspBo.setHasPublished(article.getCreateTime() >= System.currentTimeMillis() ? "N" : "Y");
1841 //拼接文章预览的url 类似:http://yoho-community-web.test3.ingress.dev.yohocorp.com/grass/article/1408536?type=preview 1871 //拼接文章预览的url 类似:http://yoho-community-web.test3.ingress.dev.yohocorp.com/grass/article/1408536?type=preview
1842 rspBo.setPreviewUrl(previewUrl + article.getId() + "?type=preview"); 1872 rspBo.setPreviewUrl(previewUrl + article.getId() + "?type=preview");
  1873 +
  1874 + //笔记封面图 长文章
  1875 + //如果没有单独的给笔记设置封面图,取图片列表的第一张作为封面图
  1876 + String coverImage = imgMap.get(article.getId()).get(0);
  1877 + rspBo.setCoverImg(coverImage);
  1878 +
1843 //短视频封面图 1879 //短视频封面图
1844 if(sort == 4){ 1880 if(sort == 4){
1845 rspBo.setCoverImg(videoMap.get(article.getId()) == null ? "" : videoMap.get(article.getId()).getString("coverUrl")); 1881 rspBo.setCoverImg(videoMap.get(article.getId()) == null ? "" : videoMap.get(article.getId()).getString("coverUrl"));
1846 } 1882 }
1847 - //笔记封面图  
1848 - else if(sort == 1){  
1849 - //如果没有单独的给笔记设置封面图,取图片列表的第一张作为封面图  
1850 - String coverImage = coverImageMap.get(article.getId()) == null ? "" : coverImageMap.get(article.getId());  
1851 - if(StringUtils.isEmpty(coverImage)){  
1852 - coverImage = imgMap.get(article.getId()).get(0);  
1853 - }  
1854 - rspBo.setCoverImg(coverImage);  
1855 - } 1883 + rspBo.setCoverImgSquare(coverImageMap.get(article.getId()));
  1884 + rspBo.setCoverImgFlat(coverImage2Map.get(article.getId()));
1856 //短视频url 1885 //短视频url
1857 rspBo.setVideoUrl(videoMap.get(article.getId()) == null ? "" : videoMap.get(article.getId()).getString("videoUrl")); 1886 rspBo.setVideoUrl(videoMap.get(article.getId()) == null ? "" : videoMap.get(article.getId()).getString("videoUrl"));
1858 rspBo.setFileId(videoMap.get(article.getId()) == null ? "" : videoMap.get(article.getId()).getString("fileId")); 1887 rspBo.setFileId(videoMap.get(article.getId()) == null ? "" : videoMap.get(article.getId()).getString("fileId"));
@@ -2035,12 +2064,21 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -2035,12 +2064,21 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
2035 } 2064 }
2036 } 2065 }
2037 //针对笔记的封面新增templateKey coverImage单独处理 2066 //针对笔记的封面新增templateKey coverImage单独处理
2038 - if(sort == 1 && StringUtils.isNotEmpty(req.getCoverImage())){ 2067 + if(StringUtils.isNotEmpty(req.getCoverImage())){
2039 GrassArticleBlock content = new GrassArticleBlock(); 2068 GrassArticleBlock content = new GrassArticleBlock();
2040 content.setArticleId(articleId); 2069 content.setArticleId(articleId);
2041 content.setContentData(getBlock(BLOCK_COVER, req.getCoverImage())); 2070 content.setContentData(getBlock(BLOCK_COVER, req.getCoverImage()));
2042 content.setCreateTime(now); 2071 content.setCreateTime(now);
2043 - content.setTemplateKey("coverImage"); 2072 + content.setTemplateKey(BLOCK_COVER);
  2073 + content.setOrderBy(0);
  2074 + contentList.add(content);
  2075 + }
  2076 + if(StringUtils.isNotEmpty(req.getCoverImage2())){
  2077 + GrassArticleBlock content = new GrassArticleBlock();
  2078 + content.setArticleId(articleId);
  2079 + content.setContentData(getBlock(BLOCK_COVER_F, req.getCoverImage2()));
  2080 + content.setCreateTime(now);
  2081 + content.setTemplateKey(BLOCK_COVER_F);
2044 content.setOrderBy(0); 2082 content.setOrderBy(0);
2045 contentList.add(content); 2083 contentList.add(content);
2046 } 2084 }
@@ -62,6 +62,14 @@ @@ -62,6 +62,14 @@
62 </td> 62 </td>
63 </tr> 63 </tr>
64 64
  65 + <!--<tr style="height: 60px">-->
  66 + <!--<td style="width:100%;">-->
  67 + <!--<div style="float: left;width:700px;" >-->
  68 + <!--<span style="color:red">*</span><label style="font-size: 14px;">选择分发渠道</label> <br>-->
  69 + <!--<input class="easyui-combobox" id="dispatchChannelExt" name="dispatchChannel" style="width:600px ">-->
  70 + <!--</div>-->
  71 + <!--</td>-->
  72 + <!--</tr>-->
65 73
66 <tr style="height: 60px"> 74 <tr style="height: 60px">
67 <td style="width:100%; word-wrap:break-word;" > 75 <td style="width:100%; word-wrap:break-word;" >
@@ -162,14 +170,28 @@ @@ -162,14 +170,28 @@
162 </tr> 170 </tr>
163 171
164 <tr style="height: 60px"> 172 <tr style="height: 60px">
165 - <td style="width:100%;">  
166 - <div style="float: left;width:700px;" >  
167 - <label style="font-size: 14px;">选择结构类型</label> <br>  
168 - <input class="easyui-combobox" id="flowTypeExt" name="flowType" style="width:200px "> 173 + <td>
  174 + <label>封面(扁图)</label> <br>
  175 + <div id="coverImage2Upload" style="float:left;">
  176 + </div>
  177 + <div>
  178 + <div style="float:left;">
  179 + <span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
  180 + <span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
  181 + </div>
169 </div> 182 </div>
170 </td> 183 </td>
171 </tr> 184 </tr>
172 185
  186 + <!--<tr style="height: 60px">-->
  187 + <!--<td style="width:100%;">-->
  188 + <!--<div style="float: left;width:700px;" >-->
  189 + <!--<label style="font-size: 14px;">选择结构类型</label> <br>-->
  190 + <!--<input class="easyui-combobox" id="flowTypeExt" name="flowType" style="width:200px ">-->
  191 + <!--</div>-->
  192 + <!--</td>-->
  193 + <!--</tr>-->
  194 +
173 <tr style="height: 60px"> 195 <tr style="height: 60px">
174 <td> 196 <td>
175 <label style="font-size: 14px;">关联商品</label> <br> 197 <label style="font-size: 14px;">关联商品</label> <br>
@@ -187,6 +209,15 @@ @@ -187,6 +209,15 @@
187 </div> 209 </div>
188 </td> 210 </td>
189 </tr> 211 </tr>
  212 + <tr style="height: 60px">
  213 + <td style="width:100%;">
  214 + <div style="float: left;width:700px;" >
  215 + <label style="font-size: 14px;">跳转链接(商品按钮)</label>
  216 + <input class="easyui-textbox" id="product_link" name="productLink" style="width:600px ">
  217 + </div>
  218 + </td>
  219 + </tr>
  220 +
190 <tr> 221 <tr>
191 <td valign="bottom"> 222 <td valign="bottom">
192 <input id="draftBotton" class="btn btn-primary" style="font-size: 18px; height: 36px;" value="保存到草稿箱"/> 223 <input id="draftBotton" class="btn btn-primary" style="font-size: 18px; height: 36px;" value="保存到草稿箱"/>
@@ -307,14 +338,23 @@ @@ -307,14 +338,23 @@
307 }); 338 });
308 339
309 340
310 - /*选择结构类型*/  
311 - $("#flowTypeExt").combobox({  
312 - valueField : "value",  
313 - textField : "text",  
314 - required:false,  
315 - prompt: "选择结构类型",  
316 - data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]  
317 - }); 341 +
  342 + // $("#dispatchChannelExt").combobox({
  343 + // valueField : "value",
  344 + // textField : "text",
  345 + // required:true,
  346 + // prompt: "选择分发渠道",
  347 + // data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
  348 + // });
  349 + //
  350 + // /*选择结构类型*/
  351 + // $("#flowTypeExt").combobox({
  352 + // valueField : "value",
  353 + // textField : "text",
  354 + // required:false,
  355 + // prompt: "选择结构类型",
  356 + // data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
  357 + // });
318 358
319 $("#articleUid").textbox({ 359 $("#articleUid").textbox({
320 required: true, 360 required: true,
@@ -761,6 +801,56 @@ @@ -761,6 +801,56 @@
761 } 801 }
762 }); 802 });
763 803
  804 + $("#coverImage2Upload").imageUpload({
  805 + width: 171,
  806 + height: 120,
  807 + realInputName: "coverImage2",
  808 + uploadInputName: "files",
  809 + url: serverContextPath + '/fileupload/uploadImgFile',
  810 + queryParams: {
  811 + bucket: "grassImg"
  812 + },
  813 + onBeforeSubmit: function () {
  814 + debugger;
  815 + var oobj = $(this).find("input[type='file']");
  816 + var files = oobj[0].files;
  817 +
  818 + for(var i=0; i<files.length;i++){
  819 + var obj = files[i];
  820 + if(obj!=null && obj!=''){
  821 + if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
  822 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  823 + return false;
  824 + }
  825 + if(obj.type.toLowerCase() == 'image/png'){
  826 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  827 + return false;
  828 + }
  829 + }
  830 + }
  831 + $.messager.progress({
  832 + title: "正在执行",
  833 + msg: "正在执行,请稍后...",
  834 + interval: 500,
  835 + text: ""
  836 + });
  837 + },
  838 + filterFileName: function (data) {
  839 + debugger;
  840 + if (!data || data.code != 200) {
  841 + $.messager.progress("close");
  842 + $.messager.alert("错误", data.message);
  843 + return "";
  844 + }
  845 + return data.data;
  846 + },
  847 + onLoadSuccess: function (data) {
  848 + $.messager.progress("close");
  849 +
  850 + return false;
  851 + }
  852 + });
  853 +
764 $("#imageUpload1").imageUpload({ 854 $("#imageUpload1").imageUpload({
765 width: 171, 855 width: 171,
766 height: 120, 856 height: 120,
@@ -839,11 +929,15 @@ @@ -839,11 +929,15 @@
839 $("#title").textbox("setValue",data.articleTitle); 929 $("#title").textbox("setValue",data.articleTitle);
840 930
841 931
  932 + //分发渠道
  933 + // if(data.dispatchChannel !=null){
  934 + // $("#dispatchChannelExt").combobox('setValue',data.dispatchChannel);
  935 + // }
842 936
843 //结构类型 937 //结构类型
844 - if(data.flowType !=null && data.flowType !=-1){  
845 - $("#flowTypeExt").combobox('setValue',data.flowType);  
846 - } 938 + // if(data.flowType !=null && data.flowType !=-1){
  939 + // $("#flowTypeExt").combobox('setValue',data.flowType);
  940 + // }
847 941
848 // $("#content").val(data.articleContent); 942 // $("#content").val(data.articleContent);
849 $("#content").emojioneArea()[0].emojioneArea.setText(data.articleContent); 943 $("#content").emojioneArea()[0].emojioneArea.setText(data.articleContent);
@@ -867,6 +961,8 @@ @@ -867,6 +961,8 @@
867 961
868 //封面图 962 //封面图
869 $("#coverImageUploadExt").imageUpload("setValue",data.coverImg); 963 $("#coverImageUploadExt").imageUpload("setValue",data.coverImg);
  964 + $("#coverImage2Upload").imageUpload("setValue",data.coverImgFlat);
  965 + $("#product_link").textbox("setValue",data.productLink);
870 966
871 htmlTopic(data.topicName); 967 htmlTopic(data.topicName);
872 968
@@ -127,6 +127,33 @@ @@ -127,6 +127,33 @@
127 </tr> 127 </tr>
128 128
129 <tr style="height: 60px"> 129 <tr style="height: 60px">
  130 + <td>
  131 + <label>封面(方图)</label> <br>
  132 + <div id="coverImageUpload" style="float:left;">
  133 + </div>
  134 + <div>
  135 + <div style="float:left;">
  136 + <span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
  137 + <span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
  138 + </div>
  139 + </div>
  140 + </td>
  141 + </tr>
  142 + <tr style="height: 60px">
  143 + <td>
  144 + <label>封面(扁图)</label> <br>
  145 + <div id="coverImage2Upload" style="float:left;">
  146 + </div>
  147 + <div>
  148 + <div style="float:left;">
  149 + <span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
  150 + <span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
  151 + </div>
  152 + </div>
  153 + </td>
  154 + </tr>
  155 +
  156 + <tr style="height: 60px">
130 <td style="width:100%;"> 157 <td style="width:100%;">
131 <label style="font-size: 14px;">选择标签</label> <br> 158 <label style="font-size: 14px;">选择标签</label> <br>
132 <input id="labelId" name="labelId" class="easyui-combobox" style="width:600px; "/><br> 159 <input id="labelId" name="labelId" class="easyui-combobox" style="width:600px; "/><br>
@@ -182,6 +209,15 @@ @@ -182,6 +209,15 @@
182 </div> 209 </div>
183 </td> 210 </td>
184 </tr> 211 </tr>
  212 +
  213 + <tr style="height: 60px">
  214 + <td style="width:100%;">
  215 + <div style="float: left;width:700px;" >
  216 + <label style="font-size: 14px;">跳转链接(商品按钮)</label>
  217 + <input class="easyui-textbox" id="product_link" name="productLink" style="width:600px ">
  218 + </div>
  219 + </td>
  220 + </tr>
185 <tr> 221 <tr>
186 <td valign="bottom"> 222 <td valign="bottom">
187 <input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/> 223 <input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/>
@@ -664,6 +700,110 @@ @@ -664,6 +700,110 @@
664 } 700 }
665 }); 701 });
666 702
  703 + /*封面图上传*/
  704 + $("#coverImageUpload").imageUpload({
  705 + width: 171,
  706 + height: 120,
  707 + realInputName: "coverImage",
  708 + uploadInputName: "files",
  709 + url: serverContextPath + '/fileupload/uploadImgFile',
  710 + queryParams: {
  711 + bucket: "grassImg"
  712 + },
  713 + onBeforeSubmit: function () {
  714 + debugger;
  715 + var oobj = $(this).find("input[type='file']");
  716 + var files = oobj[0].files;
  717 +
  718 + for(var i=0; i<files.length;i++){
  719 + var obj = files[i];
  720 + if(obj!=null && obj!=''){
  721 + debugger
  722 + if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
  723 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  724 + return false;
  725 + }
  726 + if(obj.type.toLowerCase() == 'image/png'){
  727 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  728 + return false;
  729 + }
  730 + }
  731 + }
  732 + $.messager.progress({
  733 + title: "正在执行",
  734 + msg: "正在执行,请稍后...",
  735 + interval: 500,
  736 + text: ""
  737 + });
  738 + },
  739 + filterFileName: function (data) {
  740 + debugger;
  741 + if (!data || data.code != 200) {
  742 + $.messager.progress("close");
  743 + $.messager.alert("错误", data.message);
  744 + return "";
  745 + }
  746 + return data.data;
  747 + },
  748 + onLoadSuccess: function (data) {
  749 + $.messager.progress("close");
  750 +
  751 + return false;
  752 + }
  753 + });
  754 +
  755 + /*封面图上传*/
  756 + $("#coverImage2Upload").imageUpload({
  757 + width: 171,
  758 + height: 120,
  759 + realInputName: "coverImage2",
  760 + uploadInputName: "files",
  761 + url: serverContextPath + '/fileupload/uploadImgFile',
  762 + queryParams: {
  763 + bucket: "grassImg"
  764 + },
  765 + onBeforeSubmit: function () {
  766 + debugger;
  767 + var oobj = $(this).find("input[type='file']");
  768 + var files = oobj[0].files;
  769 +
  770 + for(var i=0; i<files.length;i++){
  771 + var obj = files[i];
  772 + if(obj!=null && obj!=''){
  773 + debugger
  774 + if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
  775 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  776 + return false;
  777 + }
  778 + if(obj.type.toLowerCase() == 'image/png'){
  779 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  780 + return false;
  781 + }
  782 + }
  783 + }
  784 + $.messager.progress({
  785 + title: "正在执行",
  786 + msg: "正在执行,请稍后...",
  787 + interval: 500,
  788 + text: ""
  789 + });
  790 + },
  791 + filterFileName: function (data) {
  792 + debugger;
  793 + if (!data || data.code != 200) {
  794 + $.messager.progress("close");
  795 + $.messager.alert("错误", data.message);
  796 + return "";
  797 + }
  798 + return data.data;
  799 + },
  800 + onLoadSuccess: function (data) {
  801 + $.messager.progress("close");
  802 +
  803 + return false;
  804 + }
  805 + });
  806 +
667 807
668 if (data){ 808 if (data){
669 809
@@ -693,6 +833,11 @@ @@ -693,6 +833,11 @@
693 $("#topicGroupId").combobox('setValue',data.topicGroupId); 833 $("#topicGroupId").combobox('setValue',data.topicGroupId);
694 $("#topicId").combobox('setValue',data.topicId); 834 $("#topicId").combobox('setValue',data.topicId);
695 } 835 }
  836 + //封面图
  837 + $("#coverImageUpload").imageUpload("setValue",data.coverImg);
  838 + $("#coverImage2Upload").imageUpload("setValue",data.coverImgFlat);
  839 + $("#product_link").textbox("setValue",data.productLink);
  840 +
696 841
697 htmlTopic(data.topicName); 842 htmlTopic(data.topicName);
698 843
@@ -73,6 +73,15 @@ @@ -73,6 +73,15 @@
73 </td> 73 </td>
74 </tr> 74 </tr>
75 75
  76 + <!--<tr style="height: 60px">-->
  77 + <!--<td style="width:100%;">-->
  78 + <!--<div style="float: left;width:700px;" >-->
  79 + <!--<span style="color:red">*</span><label style="font-size: 14px;">选择分发渠道</label> <br>-->
  80 + <!--<input class="easyui-combobox" id="dispatchChannel" name="dispatchChannel" style="width:600px ">-->
  81 + <!--</div>-->
  82 + <!--</td>-->
  83 + <!--</tr>-->
  84 +
76 <tr style="height: 60px"> 85 <tr style="height: 60px">
77 <td style="width:100%; word-wrap:break-word;" > 86 <td style="width:100%; word-wrap:break-word;" >
78 <label style="font-size: 14px;">标题</label> <br> 87 <label style="font-size: 14px;">标题</label> <br>
@@ -158,28 +167,41 @@ @@ -158,28 +167,41 @@
158 167
159 <tr style="height: 60px"> 168 <tr style="height: 60px">
160 <td> 169 <td>
161 - <label>封面</label> <br> 170 + <label>封面(方图)</label> <br>
162 <div id="coverImageUpload" style="float:left;"> 171 <div id="coverImageUpload" style="float:left;">
163 </div> 172 </div>
164 <div> 173 <div>
165 <div style="float:left;"> 174 <div style="float:left;">
166 - <span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>  
167 - <span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span> 175 + <!--<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>-->
  176 + <span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>
168 </div> 177 </div>
169 </div> 178 </div>
170 </td> 179 </td>
171 </tr> 180 </tr>
172 -  
173 - <!--选择信息流结构-->  
174 <tr style="height: 60px"> 181 <tr style="height: 60px">
175 - <td style="width:100%;">  
176 - <div style="float: left;width:700px;" >  
177 - <label style="font-size: 14px;">选择结构类型</label> <br>  
178 - <input class="easyui-combobox" id="flowType" name="flowType" style="width:200px "> 182 + <td>
  183 + <label>封面(扁图)</label> <br>
  184 + <div id="coverImage2Upload" style="float:left;">
  185 + </div>
  186 + <div>
  187 + <div style="float:left;">
  188 + <!--<span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>-->
  189 + <span style=" margin-left: 10px; color: red">请上传500K以内的图片,请勿上传像素过高的图片</span>
  190 + </div>
179 </div> 191 </div>
180 </td> 192 </td>
181 </tr> 193 </tr>
182 194
  195 + <!--选择信息流结构-->
  196 + <!--<tr style="height: 60px">-->
  197 + <!--<td style="width:100%;">-->
  198 + <!--<div style="float: left;width:700px;" >-->
  199 + <!--<label style="font-size: 14px;">选择结构类型</label> <br>-->
  200 + <!--<input class="easyui-combobox" id="flowType" name="flowType" style="width:200px ">-->
  201 + <!--</div>-->
  202 + <!--</td>-->
  203 + <!--</tr>-->
  204 +
183 <tr style="height: 60px"> 205 <tr style="height: 60px">
184 <td> 206 <td>
185 <label style="font-size: 14px;">关联商品</label> <br> 207 <label style="font-size: 14px;">关联商品</label> <br>
@@ -199,6 +221,14 @@ @@ -199,6 +221,14 @@
199 </div> 221 </div>
200 </td> 222 </td>
201 </tr> 223 </tr>
  224 + <tr style="height: 60px">
  225 + <td style="width:100%;">
  226 + <div style="float: left;width:700px;" >
  227 + <label style="font-size: 14px;">跳转链接(商品按钮)</label>
  228 + <input class="easyui-textbox" id="product_link" name="productLink" style="width:600px ">
  229 + </div>
  230 + </td>
  231 + </tr>
202 <tr> 232 <tr>
203 <td valign="bottom"> 233 <td valign="bottom">
204 <input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/> 234 <input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/>
@@ -378,14 +408,22 @@ @@ -378,14 +408,22 @@
378 // } 408 // }
379 // }); 409 // });
380 410
  411 + // $("#dispatchChannel").combobox({
  412 + // valueField : "value",
  413 + // textField : "text",
  414 + // required:true,
  415 + // prompt: "选择分发渠道",
  416 + // data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
  417 + // });
  418 +
381 /*选择信息结构*/ 419 /*选择信息结构*/
382 - $("#flowType").combobox({  
383 - valueField : "value",  
384 - textField : "text",  
385 - required:false,  
386 - prompt: "选择结构类型",  
387 - data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]  
388 - }); 420 + // $("#flowType").combobox({
  421 + // valueField : "value",
  422 + // textField : "text",
  423 + // required:false,
  424 + // prompt: "选择结构类型",
  425 + // data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
  426 + // });
389 427
390 $("#articleUid").textbox({ 428 $("#articleUid").textbox({
391 required: true, 429 required: true,
@@ -773,6 +811,58 @@ @@ -773,6 +811,58 @@
773 } 811 }
774 }); 812 });
775 813
  814 + /*封面图上传*/
  815 + $("#coverImage2Upload").imageUpload({
  816 + width: 171,
  817 + height: 120,
  818 + realInputName: "coverImage2",
  819 + uploadInputName: "files",
  820 + url: serverContextPath + '/fileupload/uploadImgFile',
  821 + queryParams: {
  822 + bucket: "grassImg"
  823 + },
  824 + onBeforeSubmit: function () {
  825 + debugger;
  826 + var oobj = $(this).find("input[type='file']");
  827 + var files = oobj[0].files;
  828 +
  829 + for(var i=0; i<files.length;i++){
  830 + var obj = files[i];
  831 + if(obj!=null && obj!=''){
  832 + debugger
  833 + if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
  834 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  835 + return false;
  836 + }
  837 + if(obj.type.toLowerCase() == 'image/png'){
  838 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  839 + return false;
  840 + }
  841 + }
  842 + }
  843 + $.messager.progress({
  844 + title: "正在执行",
  845 + msg: "正在执行,请稍后...",
  846 + interval: 500,
  847 + text: ""
  848 + });
  849 + },
  850 + filterFileName: function (data) {
  851 + debugger;
  852 + if (!data || data.code != 200) {
  853 + $.messager.progress("close");
  854 + $.messager.alert("错误", data.message);
  855 + return "";
  856 + }
  857 + return data.data;
  858 + },
  859 + onLoadSuccess: function (data) {
  860 + $.messager.progress("close");
  861 +
  862 + return false;
  863 + }
  864 + });
  865 +
776 $("#imageUpload1").imageUpload({ 866 $("#imageUpload1").imageUpload({
777 width: 171, 867 width: 171,
778 height: 120, 868 height: 120,
@@ -94,6 +94,15 @@ @@ -94,6 +94,15 @@
94 </td> 94 </td>
95 </tr> 95 </tr>
96 96
  97 + <!--<tr style="height: 60px">-->
  98 + <!--<td style="width:100%;">-->
  99 + <!--<div style="float: left;width:700px;" >-->
  100 + <!--<span style="color:red">*</span><label style="font-size: 14px;">选择分发渠道</label> <br>-->
  101 + <!--<input class="easyui-combobox" id="dispatchChannelExt" name="dispatchChannel" style="width:600px ">-->
  102 + <!--</div>-->
  103 + <!--</td>-->
  104 + <!--</tr>-->
  105 +
97 <tr style="height: 60px" id = "contentTR"> 106 <tr style="height: 60px" id = "contentTR">
98 <td style="width:100% "> 107 <td style="width:100% ">
99 <label style="font-size: 14px;">正文内容</label> <br> 108 <label style="font-size: 14px;">正文内容</label> <br>
@@ -163,11 +172,20 @@ @@ -163,11 +172,20 @@
163 </tr> 172 </tr>
164 173
165 <!--选择信息流结构--> 174 <!--选择信息流结构-->
  175 + <!--<tr style="height: 60px">-->
  176 + <!--<td style="width:100%;">-->
  177 + <!--<div style="float: left;width:700px;" >-->
  178 + <!--<label style="font-size: 14px;">选择信息流结构</label> <br>-->
  179 + <!--<input class="easyui-combobox" id="flowTypeExt" name="flowType" style="width:200px ">-->
  180 + <!--</div>-->
  181 + <!--</td>-->
  182 + <!--</tr>-->
  183 +
166 <tr style="height: 60px"> 184 <tr style="height: 60px">
167 <td style="width:100%;"> 185 <td style="width:100%;">
168 <div style="float: left;width:700px;" > 186 <div style="float: left;width:700px;" >
169 - <label style="font-size: 14px;">选择信息流结构</label> <br>  
170 - <input class="easyui-combobox" id="flowTypeExt" name="flowType" style="width:200px "> 187 + <label style="font-size: 14px;">跳转链接(商品按钮)</label>
  188 + <input class="easyui-textbox" id="product_link" name="productLink" style="width:600px ">
171 </div> 189 </div>
172 </td> 190 </td>
173 </tr> 191 </tr>
@@ -348,13 +366,22 @@ @@ -348,13 +366,22 @@
348 } 366 }
349 }); 367 });
350 368
351 - $("#flowTypeExt").combobox({  
352 - valueField : "value",  
353 - textField : "text",  
354 - required:false,  
355 - prompt: "选择信息流结构",  
356 - data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]  
357 - }); 369 +
  370 + // $("#dispatchChannelExt").combobox({
  371 + // valueField : "value",
  372 + // textField : "text",
  373 + // required:true,
  374 + // prompt: "选择分发渠道",
  375 + // data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
  376 + // });
  377 + //
  378 + // $("#flowTypeExt").combobox({
  379 + // valueField : "value",
  380 + // textField : "text",
  381 + // required:false,
  382 + // prompt: "选择信息流结构",
  383 + // data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
  384 + // });
358 385
359 $("#actionUrl").textbox({ 386 $("#actionUrl").textbox({
360 required: false, 387 required: false,
@@ -466,6 +493,110 @@ @@ -466,6 +493,110 @@
466 } 493 }
467 }); 494 });
468 495
  496 + /*封面图上传*/
  497 + $("#coverImageUpload").imageUpload({
  498 + width: 171,
  499 + height: 120,
  500 + realInputName: "coverImage",
  501 + uploadInputName: "files",
  502 + url: serverContextPath + '/fileupload/uploadImgFile',
  503 + queryParams: {
  504 + bucket: "grassImg"
  505 + },
  506 + onBeforeSubmit: function () {
  507 + debugger;
  508 + var oobj = $(this).find("input[type='file']");
  509 + var files = oobj[0].files;
  510 +
  511 + for(var i=0; i<files.length;i++){
  512 + var obj = files[i];
  513 + if(obj!=null && obj!=''){
  514 + debugger
  515 + if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
  516 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  517 + return false;
  518 + }
  519 + if(obj.type.toLowerCase() == 'image/png'){
  520 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  521 + return false;
  522 + }
  523 + }
  524 + }
  525 + $.messager.progress({
  526 + title: "正在执行",
  527 + msg: "正在执行,请稍后...",
  528 + interval: 500,
  529 + text: ""
  530 + });
  531 + },
  532 + filterFileName: function (data) {
  533 + debugger;
  534 + if (!data || data.code != 200) {
  535 + $.messager.progress("close");
  536 + $.messager.alert("错误", data.message);
  537 + return "";
  538 + }
  539 + return data.data;
  540 + },
  541 + onLoadSuccess: function (data) {
  542 + $.messager.progress("close");
  543 +
  544 + return false;
  545 + }
  546 + });
  547 +
  548 + /*封面图上传*/
  549 + $("#coverImage2Upload").imageUpload({
  550 + width: 171,
  551 + height: 120,
  552 + realInputName: "coverImage2",
  553 + uploadInputName: "files",
  554 + url: serverContextPath + '/fileupload/uploadImgFile',
  555 + queryParams: {
  556 + bucket: "grassImg"
  557 + },
  558 + onBeforeSubmit: function () {
  559 + debugger;
  560 + var oobj = $(this).find("input[type='file']");
  561 + var files = oobj[0].files;
  562 +
  563 + for(var i=0; i<files.length;i++){
  564 + var obj = files[i];
  565 + if(obj!=null && obj!=''){
  566 + debugger
  567 + if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
  568 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  569 + return false;
  570 + }
  571 + if(obj.type.toLowerCase() == 'image/png'){
  572 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  573 + return false;
  574 + }
  575 + }
  576 + }
  577 + $.messager.progress({
  578 + title: "正在执行",
  579 + msg: "正在执行,请稍后...",
  580 + interval: 500,
  581 + text: ""
  582 + });
  583 + },
  584 + filterFileName: function (data) {
  585 + debugger;
  586 + if (!data || data.code != 200) {
  587 + $.messager.progress("close");
  588 + $.messager.alert("错误", data.message);
  589 + return "";
  590 + }
  591 + return data.data;
  592 + },
  593 + onLoadSuccess: function (data) {
  594 + $.messager.progress("close");
  595 +
  596 + return false;
  597 + }
  598 + });
  599 +
469 $("#topicGroupId").combobox({ 600 $("#topicGroupId").combobox({
470 prompt: "选择话题分组", 601 prompt: "选择话题分组",
471 required: false, 602 required: false,
@@ -874,6 +1005,12 @@ @@ -874,6 +1005,12 @@
874 if(data.sort !='' && data.sort == 3){ 1005 if(data.sort !='' && data.sort == 3){
875 $("#appurl").attr('checked','true'); 1006 $("#appurl").attr('checked','true');
876 } 1007 }
  1008 +
  1009 + //封面图
  1010 + $("#coverImageUpload").imageUpload("setValue",data.coverImg);
  1011 + $("#coverImage2Upload").imageUpload("setValue",data.coverImgFlat);
  1012 + $("#product_link").textbox("setValue",data.productLink);
  1013 +
877 var labelIds = []; 1014 var labelIds = [];
878 if(data.labelList!=null && data.labelList.length>0){ 1015 if(data.labelList!=null && data.labelList.length>0){
879 for (var i=0;i<data.labelList.length;i++){ 1016 for (var i=0;i<data.labelList.length;i++){
@@ -114,6 +114,15 @@ @@ -114,6 +114,15 @@
114 </td> 114 </td>
115 </tr> 115 </tr>
116 116
  117 + <!--<tr style="height: 60px">-->
  118 + <!--<td style="width:100%;">-->
  119 + <!--<div style="float: left;width:700px;" >-->
  120 + <!--<span style="color:red">*</span><label style="font-size: 14px;">选择分发渠道</label> <br>-->
  121 + <!--<input class="easyui-combobox" id="dispatchChannel" name="dispatchChannel" style="width:600px ">-->
  122 + <!--</div>-->
  123 + <!--</td>-->
  124 + <!--</tr>-->
  125 +
117 <tr style="height: 60px"> 126 <tr style="height: 60px">
118 <td style="width:100% "> 127 <td style="width:100% ">
119 <label style="font-size: 14px;">正文内容</label> <br> 128 <label style="font-size: 14px;">正文内容</label> <br>
@@ -125,7 +134,7 @@ @@ -125,7 +134,7 @@
125 <tr style="height: 60px"> 134 <tr style="height: 60px">
126 <td> 135 <td>
127 <span style="color:red">*</span><label>封面</label> <br> 136 <span style="color:red">*</span><label>封面</label> <br>
128 - <input id="coverImage" name="articleImages" hidden> 137 + <input id="articleImages" name="articleImages" hidden>
129 <div id="imageUpload" style="float:left;"> 138 <div id="imageUpload" style="float:left;">
130 </div> 139 </div>
131 <div> 140 <div>
@@ -137,6 +146,33 @@ @@ -137,6 +146,33 @@
137 </td> 146 </td>
138 </tr> 147 </tr>
139 148
  149 + <tr style="height: 60px">
  150 + <td>
  151 + <label>封面(方图)</label> <br>
  152 + <div id="coverImageUpload" style="float:left;">
  153 + </div>
  154 + <div>
  155 + <div style="float:left;">
  156 + <span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
  157 + <span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
  158 + </div>
  159 + </div>
  160 + </td>
  161 + </tr>
  162 + <tr style="height: 60px">
  163 + <td>
  164 + <label>封面(扁图)</label> <br>
  165 + <div id="coverImage2Upload" style="float:left;">
  166 + </div>
  167 + <div>
  168 + <div style="float:left;">
  169 + <span style=" margin-left: 10px; color: red">1. 请上传 3:4/4:3/1:1 的图片,优质清晰的封面有利于推荐</span></br>
  170 + <span style=" margin-left: 10px; color: red">2. 请上传500K以内的图片,请勿上传像素过高的图片</span>
  171 + </div>
  172 + </div>
  173 + </td>
  174 + </tr>
  175 +
140 176
141 <tr style="height: 60px"> 177 <tr style="height: 60px">
142 <td> 178 <td>
@@ -185,16 +221,24 @@ @@ -185,16 +221,24 @@
185 </td> 221 </td>
186 </tr> 222 </tr>
187 223
188 - <!--选择信息流结构--> 224 + <!--&lt;!&ndash;选择信息流结构&ndash;&gt;-->
  225 + <!--<tr style="height: 60px">-->
  226 + <!--<td style="width:100%;">-->
  227 + <!--<div style="float: left;width:700px;" >-->
  228 + <!--<label style="font-size: 14px;">选择结构类型</label> <br>-->
  229 + <!--<input class="easyui-combobox" id="flowType" name="flowType" style="width:200px ">-->
  230 + <!--</div>-->
  231 + <!--</td>-->
  232 + <!--</tr>-->
  233 +
189 <tr style="height: 60px"> 234 <tr style="height: 60px">
190 <td style="width:100%;"> 235 <td style="width:100%;">
191 <div style="float: left;width:700px;" > 236 <div style="float: left;width:700px;" >
192 - <label style="font-size: 14px;">选择结构类型</label> <br>  
193 - <input class="easyui-combobox" id="flowType" name="flowType" style="width:200px "> 237 + <label style="font-size: 14px;">跳转链接(商品按钮)</label>
  238 + <input class="easyui-textbox" id="product_link" name="productLink" style="width:600px ">
194 </div> 239 </div>
195 </td> 240 </td>
196 </tr> 241 </tr>
197 -  
198 <tr> 242 <tr>
199 <td valign="bottom"> 243 <td valign="bottom">
200 <input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/> 244 <input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/>
@@ -305,6 +349,14 @@ @@ -305,6 +349,14 @@
305 {text: "其他", value: "4"}] 349 {text: "其他", value: "4"}]
306 }); 350 });
307 351
  352 + // $("#dispatchChannel").combobox({
  353 + // valueField : "value",
  354 + // textField : "text",
  355 + // required:true,
  356 + // prompt: "选择分发渠道",
  357 + // data:[{text:"全部",value:"-1"},{text:"社区",value:"1"},{text:"导购",value:"2"}]
  358 + // });
  359 +
308 360
309 $("#userBotton").linkbutton({ 361 $("#userBotton").linkbutton({
310 iconCls : "icon-search", 362 iconCls : "icon-search",
@@ -378,15 +430,15 @@ @@ -378,15 +430,15 @@
378 onChange: function () { 430 onChange: function () {
379 } 431 }
380 }); 432 });
381 -  
382 - /*选择信息结构*/  
383 - $("#flowType").combobox({  
384 - valueField : "value",  
385 - textField : "text",  
386 - required:false,  
387 - prompt: "选择结构类型",  
388 - data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]  
389 - }); 433 + //
  434 + // /*选择信息结构*/
  435 + // $("#flowType").combobox({
  436 + // valueField : "value",
  437 + // textField : "text",
  438 + // required:false,
  439 + // prompt: "选择结构类型",
  440 + // data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
  441 + // });
390 442
391 $("#subtitle").textbox({ 443 $("#subtitle").textbox({
392 required: false, 444 required: false,
@@ -593,7 +645,7 @@ @@ -593,7 +645,7 @@
593 } 645 }
594 imageCount++; 646 imageCount++;
595 }); 647 });
596 - $("#coverImage").val(imgs); 648 + $("#articleImages").val(imgs);
597 649
598 if(imageCount < 1){ 650 if(imageCount < 1){
599 $.messager.alert("发布失败", "请上传封面图", "error"); 651 $.messager.alert("发布失败", "请上传封面图", "error");
@@ -673,7 +725,7 @@ @@ -673,7 +725,7 @@
673 $.messager.alert("发布失败", "请上传封面图", "error"); 725 $.messager.alert("发布失败", "请上传封面图", "error");
674 return false; 726 return false;
675 } 727 }
676 - $("#coverImage").val(imgs); 728 + $("#articleImages").val(imgs);
677 729
678 var labels = ''; 730 var labels = '';
679 $("input[name='labelId']").each(function(j,item){ 731 $("input[name='labelId']").each(function(j,item){
@@ -710,7 +762,109 @@ @@ -710,7 +762,109 @@
710 } 762 }
711 }); 763 });
712 764
  765 + /*封面图上传*/
  766 + $("#coverImageUpload").imageUpload({
  767 + width: 171,
  768 + height: 120,
  769 + realInputName: "coverImage",
  770 + uploadInputName: "files",
  771 + url: serverContextPath + '/fileupload/uploadImgFile',
  772 + queryParams: {
  773 + bucket: "grassImg"
  774 + },
  775 + onBeforeSubmit: function () {
  776 + debugger;
  777 + var oobj = $(this).find("input[type='file']");
  778 + var files = oobj[0].files;
  779 +
  780 + for(var i=0; i<files.length;i++){
  781 + var obj = files[i];
  782 + if(obj!=null && obj!=''){
  783 + debugger
  784 + if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
  785 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  786 + return false;
  787 + }
  788 + if(obj.type.toLowerCase() == 'image/png'){
  789 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  790 + return false;
  791 + }
  792 + }
  793 + }
  794 + $.messager.progress({
  795 + title: "正在执行",
  796 + msg: "正在执行,请稍后...",
  797 + interval: 500,
  798 + text: ""
  799 + });
  800 + },
  801 + filterFileName: function (data) {
  802 + debugger;
  803 + if (!data || data.code != 200) {
  804 + $.messager.progress("close");
  805 + $.messager.alert("错误", data.message);
  806 + return "";
  807 + }
  808 + return data.data;
  809 + },
  810 + onLoadSuccess: function (data) {
  811 + $.messager.progress("close");
  812 +
  813 + return false;
  814 + }
  815 + });
  816 +
  817 + /*封面图上传*/
  818 + $("#coverImage2Upload").imageUpload({
  819 + width: 171,
  820 + height: 120,
  821 + realInputName: "coverImage2",
  822 + uploadInputName: "files",
  823 + url: serverContextPath + '/fileupload/uploadImgFile',
  824 + queryParams: {
  825 + bucket: "grassImg"
  826 + },
  827 + onBeforeSubmit: function () {
  828 + debugger;
  829 + var oobj = $(this).find("input[type='file']");
  830 + var files = oobj[0].files;
713 831
  832 + for(var i=0; i<files.length;i++){
  833 + var obj = files[i];
  834 + if(obj!=null && obj!=''){
  835 + debugger
  836 + if(obj.name.substring(obj.name.lastIndexOf(".")).toLowerCase() == '.png'){
  837 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  838 + return false;
  839 + }
  840 + if(obj.type.toLowerCase() == 'image/png'){
  841 + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;});
  842 + return false;
  843 + }
  844 + }
  845 + }
  846 + $.messager.progress({
  847 + title: "正在执行",
  848 + msg: "正在执行,请稍后...",
  849 + interval: 500,
  850 + text: ""
  851 + });
  852 + },
  853 + filterFileName: function (data) {
  854 + debugger;
  855 + if (!data || data.code != 200) {
  856 + $.messager.progress("close");
  857 + $.messager.alert("错误", data.message);
  858 + return "";
  859 + }
  860 + return data.data;
  861 + },
  862 + onLoadSuccess: function (data) {
  863 + $.messager.progress("close");
  864 +
  865 + return false;
  866 + }
  867 + });
714 868
715 // 定时 选择时间 869 // 定时 选择时间
716 function getTimeDialog(data,id, status){ 870 function getTimeDialog(data,id, status){
@@ -770,7 +924,7 @@ @@ -770,7 +924,7 @@
770 } 924 }
771 imageCount++; 925 imageCount++;
772 }); 926 });
773 - $("#coverImage").val(imgs); 927 + $("#articleImages").val(imgs);
774 928
775 if(imageCount < 1){ 929 if(imageCount < 1){
776 $.messager.alert("发布失败", "请上传封面图", "error"); 930 $.messager.alert("发布失败", "请上传封面图", "error");