Authored by chenly5

爬虫笔记支持自定义封面

... ... @@ -603,15 +603,6 @@
return false;
}
/*//封面图
var coverUrl = '';
$("input[name='coverImage']").each(function(j,item){
coverUrl = item.value;
});
debugger;
$("#coverImage").val(coverUrl);*/
var labels = '';
$("input[name='labelId']").each(function(j,item){
... ... @@ -893,7 +884,6 @@
}
//封面图
debugger;
$("#coverImageUploadExt").imageUpload("setValue",data.coverImg);
htmlTopic(data.topicName);
... ...
... ... @@ -194,6 +194,16 @@
</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>
<td valign="bottom">
<input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/>
... ... @@ -386,6 +396,15 @@
}
});
/*选择信息结构*/
$("#flowType").combobox({
valueField : "value",
textField : "text",
required:false,
prompt: "选择结构类型",
data:[{text:"",value:""},{text:"长图",value:"1"},{text:"方图",value:"2"}]
});
$("#subtitle").textbox({
required: false,
missingMessage: "请输入120字以内的副标题",
... ...
... ... @@ -158,6 +158,20 @@
</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 style="width:100%;">
... ... @@ -632,6 +646,58 @@
}
});
/*封面图上传*/
$("#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;
}
});
$("#imageUpload1").imageUpload({
width: 171,
height: 120,
... ...
... ... @@ -149,6 +149,20 @@
</td>
</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>
</div>
</td>
</tr>
<!--选择信息流结构-->
<tr style="height: 60px">
<td style="width:100%;">
... ... @@ -695,6 +709,56 @@
}
});
$("#coverImageUploadExt").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!=''){
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,
... ... @@ -784,6 +848,9 @@
$("#flowType").combobox('setValue',data.flowType);
}
//封面图
$("#coverImageUploadExt").imageUpload("setValue",data.coverImg);
var context = data.contentText;
if(context == null || context == '' || context == undefined){
... ...