{include file="public:header"/}
<link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="/resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
<link href="/resource/css/common.css?v=201903260001" rel="stylesheet">
<script type="text/javascript" src="/resource/js/lib/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/resource/js/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="/resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
<link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
<link href="/static/css/snailfish.css" rel="stylesheet">
<script type="text/javascript" src="/static/js/global.js?v=1000"></script>
</head>
<style>
.demo-pic {
border: palegreen solid;
width: 900px;
}
</style>
<body layadmin-themealias="default">
<div class="layui-fluid">
<div class="layui-card">
<div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">设置</span>
</div>
<div class="layui-card-body" style="padding:15px;">
<form action="" method="post" class="layui-form" lay-filter="component-layui-form-item"
enctype="multipart/form-data">
<!-- input框 -->
<div class="layui-form-item">
<label class="layui-form-label">标题</label>
<div class="layui-input-block">
<input type="text" id='welcome_title' name="data[welcome_title]" class="form-control"
value="{$list.welcome_title}">
</div>
</div>
<!-- 富文本 -->
<div class="layui-form-item">
<label class="layui-form-label">内容</label>
<div class="layui-input-block">
<textarea class="editor1" id="content" name="data[content]" title="">
{$list.content}
</textarea>
</div>
</div>
<!-- 单选radio -->
<div class="layui-form-item">
<label class="layui-form-label" style="width: 100px;">性别</label>
<div class="layui-input-block">
<input type='radio' name='gender' title="女性" value=0 {if condition="$list.gender eq 0"}checked{/if} />
<input type='radio' name='gender' title="男性" value=1 {if condition="$list.gender eq 1"}checked{/if} />
<input type='radio' name='gender' title="保密" value=2 {if condition="$list.gender eq 2"}checked{/if} />
</div>
</div>
<!-- 图片上传 -->
<div class="layui-form-item">
<label class="layui-form-label must">图片</label>
<div class="layui-input-block gimgs">
<div class="input-group ">
<input type="text" name="data[intro_img]" id="intro_img" value="{$list.intro_img}"
class="form-control" autocomplete="off">
<span class="input-group-btn">
<button class="btn btn-primary" type="button"
onclick="GetUploadify(1,'','video','call_back');">选择图片</button>
</span>
</div>
<div class="input-group " style="margin-top:.5em;">
<img id="intro_img2" src="{$list.intro_img}"
onerror="this.src='/static/images/nopic.png'; this.title='图片未找到.'"
class="img-responsive img-thumbnail" width="150">
<em class="close" style="position:absolute; top: 0px; right: -14px;" title="删除这张图片"
onclick="deleteImage(this)">×</em>
</div>
<span class="layui-form-mid layui-word-aux image-block">长方形png图标,最佳尺寸:400*730</span>
</div>
</div>
<script>
// 上传商品图片成功回调函数
function call_back(fileurl_tmp) {
console.log(fileurl_tmp);
$("#intro_img").val(fileurl_tmp);
$("#intro_img2").attr('src', fileurl_tmp);
}
//删除图片
function deleteImage() {
layer.msg('不支持删除,重新选择图片进行替换即可', {
time: 1000
});
}
</script>
<div class="layui-form-item">
<label class="layui-form-label"> </label>
<div class="layui-input-block">
<input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
</div>
</div>
</form>
</div>
</div>
</div>
<script src="/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: '/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use('index');
</script>
<script type="text/javascript">
var editor1;
$(function () {
//具体参数配置在 editor_config.js 中
var options = {
zIndex: 999,
initialFrameWidth: "100%", //初化宽度
initialFrameHeight: 400, //初化高度
focus: false, //初始化时,是否让编辑器获得焦点true或false
maximumWords: 99999, removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
pasteplain: false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
autoHeightEnabled: true,
autotypeset: {
mergeEmptyline: true, //合并空行
removeClass: true, //去掉冗余的class
removeEmptyline: false, //去掉空行
textAlign: "left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版
imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版
pasteFilter: false, //根据规则过滤没事粘贴进来的内容
clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号
clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体
removeEmptyNode: false, //去掉空节点
//可以去掉的标签
removeTagNames: { "font": 1 },
indent: false, // 行首缩进
indentValue: '0em' //行首缩进的大小
}
};
editor1 = new UE.ui.Editor(options);
editor1.render("content");
});
</script>
<script>
//由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
var layer = layui.layer;
var $;
var cur_open_div;
layui.use(['jquery', 'layer', 'form'], function () {
$ = layui.$;
var form = layui.form;
//监听提交
form.on('submit(formDemo)', function (data) {
$.ajax({
url: data.form.action,
type: data.form.method,
data: data.field,
dataType: 'json',
success: function (info) {
if (info.status == 1) {
layer.msg(info.msg, {
time: 1000,
end: function () {
location.href = location.href;
}
});
} else {
layer.msg(info.msg, {
icon: 2,
time: 2000
});
}
}
});
return false;
});
})
</script>
</body>
07-21
403
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-24
312
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-23
438
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-14
4606
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-23
4189
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)