活动增加内容字段

1 个父辈 03e0a2c4
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item" style="display: none"> <div class="layui-form-item">
<label class="layui-form-label">文章内容</label> <label class="layui-form-label">文章内容</label>
<div class="layui-input-block" style="margin-left: 130px;"> <div class="layui-input-block" style="margin-left: 130px;">
<!-- 加载编辑器的容器 --> <!-- 加载编辑器的容器 -->
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<script src="/zzhnc/res/plugins/layui/layui.js" charset="utf-8"></script> <script src="/zzhnc/res/plugins/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/zzhnc/res/js/me.js"></script> <script type="text/javascript" src="/zzhnc/res/js/me.js"></script>
<script> <script>
/*window.onload = function() { window.onload = function() {
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl; UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action) { UE.Editor.prototype.getActionUrl = function(action) {
if(action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') { if(action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
var ue = UE.getEditor('container', { var ue = UE.getEditor('container', {
autoHeight: false autoHeight: false
}); });
}*/ }
layui.use(['form', 'element', 'layer', 'upload'], function() { layui.use(['form', 'element', 'layer', 'upload'], function() {
var form = layui.form, var form = layui.form,
...@@ -116,9 +116,9 @@ ...@@ -116,9 +116,9 @@
console.log(data); console.log(data);
if(data.code == 0) { if(data.code == 0) {
$("[name=title]").val(data.data.title); $("[name=title]").val(data.data.title);
/*UE.getEditor("container").ready(function() { UE.getEditor("container").ready(function() {
UE.getEditor("container").setContent(unescape(data.data.content)); UE.getEditor("container").setContent(unescape(data.data.content));
})*/ })
$("[name=type]").val(data.data.type); $("[name=type]").val(data.data.type);
$("[name=imgurl]").val(data.data.imgurl); $("[name=imgurl]").val(data.data.imgurl);
$(".mainpictrue").attr("src", data.data.imgurl).css("margin-top", "15px"); $(".mainpictrue").attr("src", data.data.imgurl).css("margin-top", "15px");
...@@ -150,18 +150,9 @@ ...@@ -150,18 +150,9 @@
//提交 //提交
form.on('submit(submit)', function(data) { form.on('submit(submit)', function(data) {
var title = $("[name=title]").val(); var title = $("[name=title]").val();
//var content = UE.getEditor('container').getContent(); var content = UE.getEditor('container').getContent();
var imgurl = $("[name=imgurl]").val(); var imgurl = $("[name=imgurl]").val();
var type = $("[name=type]").val(); var type = $("[name=type]").val();
/*if(title == "") {
top.layer.msg("请填写文章标题");
return false;
} else {
if(strlen(title) > 40) {
top.layer.msg("文章标题不超过20个汉字");
return false;
}
}*/
if(strlen(title) > 40) { if(strlen(title) > 40) {
top.layer.msg("文章标题不超过20个汉字"); top.layer.msg("文章标题不超过20个汉字");
return false; return false;
...@@ -174,16 +165,16 @@ ...@@ -174,16 +165,16 @@
top.layer.msg("请上传主图"); top.layer.msg("请上传主图");
return false; return false;
} }
/*if(content == "") { if(content == "") {
top.layer.msg("请输入内容"); top.layer.msg("请输入内容");
return false; return false;
}*/ }
if(id > 0) { if(id > 0) {
//修改项目 //修改项目
$.post("/zzhnc/article/updateArticle", { $.post("/zzhnc/article/updateArticle", {
id: id, id: id,
title: title, title: title,
//content: content, content: content,
type: type, type: type,
imgurl: imgurl imgurl: imgurl
}, function(data) { }, function(data) {
...@@ -198,7 +189,7 @@ ...@@ -198,7 +189,7 @@
//添加项目 //添加项目
$.post("/zzhnc/article/addArticle", { $.post("/zzhnc/article/addArticle", {
title: title, title: title,
//content: content, content: content,
type: type, type: type,
imgurl: imgurl imgurl: imgurl
}, function(data) { }, function(data) {
...@@ -217,7 +208,7 @@ ...@@ -217,7 +208,7 @@
//重置 //重置
$(".resetBtn").on("click", function() { $(".resetBtn").on("click", function() {
$("[name=title]").val(""); $("[name=title]").val("");
//$("[name=content]").val(""); $("[name=content]").val("");
$("[name=type]").val(""); $("[name=type]").val("");
$("[name=imgurl]").val(""); $("[name=imgurl]").val("");
$(".mainpictrue").attr("src", "").css("margin-top", "0"); $(".mainpictrue").attr("src", "").css("margin-top", "0");
......
Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
请先完成此消息的编辑!