<html lang="zh-cn">
|
|
<head>
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="referrer" content="never">
|
<title>添加栏目</title>
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
<link href="css/maincontent.css" rel="stylesheet">
|
<link href="css/tablestyle.css" rel="stylesheet">
|
<style>
|
.form-group {
|
margin-bottom: 30px;
|
}
|
|
.checkbox input[type=checkbox] {
|
top: 6px;
|
}
|
</style>
|
</head>
|
|
<body>
|
<nav class="navbar navbar-default navbar-fixed-top">
|
</nav>
|
<div id="mainbody">
|
<div id="sidebar">
|
<dl>
|
</dl>
|
</div>
|
<div id="neirong">
|
<div class="erjidh">
|
<ol class="breadcrumb">
|
<li>
|
<a href="tuijian-lanmuneirong.html">栏目内容</a>
|
</li>
|
<li class="active">添加内容</li>
|
</ol>
|
</div>
|
<form class="form-horizontal" role="form">
|
<div class="form-group">
|
<label for="input1" class="changdu1 control-label">名称</label>
|
<div class="col-sm-7">
|
<input type="text" class="form-control" id="name" placeholder="必须填写">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input1" class="changdu1 control-label">图标</label>
|
<div class="col-sm-7">
|
<img style="width: 50px;" class="icon-img"/>
|
<input type="text" class="form-control" id="icon" placeholder="必须填写">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input2" class="changdu1 control-label">权重</label>
|
<div class="col-sm-7">
|
<input type="text" class="form-control" id="orderby" placeholder="必须填写">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input2" class="changdu1 control-label">顶部标签</label>
|
<div class="col-sm-7">
|
<select id="classtype" class="form-control" style="max-width: 150px;"></select>
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input2" class="changdu1 control-label">换一批显示位置</label>
|
<div class="col-sm-7">
|
<select id="refreshPosition" class="form-control" style="max-width: 150px;">
|
<option value="0">不显示</option>
|
<option value="1">右上角</option>
|
<option value="2">正下方</option>
|
</select>
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input2" class="changdu1 control-label">是否显示更多</label>
|
<div class="col-sm-7">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" id="hasMore" value="#">
|
</label>
|
</div>
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input2" class="changdu1 control-label">是否有banner</label>
|
<div class="col-sm-7">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" id="bigPicture" value="#">
|
</label>
|
</div>
|
</div>
|
</div>
|
|
<div class="form-group" id="moreTagContainer" style="display: none;">
|
<label for="input2" class="changdu1 control-label">更多显示名称</label>
|
<div class="col-sm-7">
|
<div class="checkbox">
|
<label>
|
<input type="text" class="form-control" id="moreTag" placeholder="">
|
</label>
|
</div>
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input3" class="changdu1 control-label">显示列数</label>
|
<div class="col-sm-7">
|
<input type="text" class="form-control" id="column" placeholder="必须填写">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input4" class="changdu1 control-label">显示个数</label>
|
<div class="col-sm-7">
|
<input type="text" class="form-control" id="number" placeholder="必须填写">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input5" class="changdu1 control-label">Android跳转到的类</label>
|
<div class="col-sm-7">
|
<input type="text" class="form-control" id="activity" placeholder="">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input6" class="changdu1 control-label">IOS跳转到的类</label>
|
<div class="col-sm-7">
|
<input type="text" class="form-control" id="ioscontrol" placeholder="">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input7" class="changdu1 control-label">跳转参数</label>
|
<div class="col-sm-7">
|
<textarea class="form-control" rows="7" id="params"></textarea>
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input7" class="changdu1 control-label">媒体</label>
|
<div class="col-sm-7 detailsystem">
|
|
</div>
|
</div>
|
<div class="button0">
|
<div class="button">
|
<button type="button" class="btn btn-primary save">保存</button>
|
</div>
|
<div class="button">
|
<input type="reset" class="btn btn-default" value="重置"/>
|
</div>
|
</div>
|
</form>
|
|
</div>
|
</div>
|
|
<script src="js/jquery-1.9.1.min.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src="js/nav.js"></script>
|
<script src="js/common.js"></script>
|
<script src="layer/layer.js"></script>
|
<script>
|
$(function () {
|
|
|
$("#hasMore").change(function () {
|
if ($("#hasMore").is(":checked")) {
|
$("#moreTagContainer").css("display", "block");
|
} else {
|
$("#moreTagContainer").css("display", "none");
|
}
|
|
});
|
|
$.post('api/homerecommend/getSpcialList', {
|
"page": 1
|
}, function (data) {
|
if (data.code == 0) {
|
var datas = data.data.data;
|
$("#classtype").empty();
|
for (var i = 0; i < datas.length; i++) {
|
var html = "<option";
|
html += " value=" + datas[i].special.dataKey + " >";
|
html += datas[i].special.name;
|
html += "</option>";
|
$("#classtype").append(html);
|
}
|
|
}
|
|
}, "json");
|
|
|
$.post('api/common/detailsystemlist', function (data) {
|
if (data.code == 0) {
|
var dsStr = "";
|
data.data.forEach(function (ds) {
|
dsStr += "<div class='checkbox '><label>";
|
dsStr += "<input type='checkbox' value=" + ds.id + ">";
|
dsStr += " " + ds.name;
|
dsStr += "</label></div>";
|
});
|
$(".detailsystem").html(dsStr);
|
}
|
}, 'json');
|
|
$(".save").click(function () {
|
|
var $detailsystems = $(".detailsystem input[type=checkbox]");
|
var dess = "";
|
for (var i = 0; i < $detailsystems.length; i++) {
|
if ($detailsystems.eq(i).is(":checked")) {
|
dess += $detailsystems.eq(i).val() + ",";
|
}
|
}
|
if (dess.length > 0)
|
dess = dess.substr(0, dess.length - 1);
|
|
var index = layer.load(0, {
|
'shade': false
|
});
|
$.post('api/home/addhometype', {
|
'name': $("#name").val(),
|
'orderby': $("#orderby").val(),
|
'activity': $("#activity").val(),
|
'params': $("#params").val(),
|
'iosControl': $("#ioscontrol").val(),
|
'columns': $("#column").val(),
|
'number': $("#number").val(),
|
'hasMore': $("#hasMore").is(":checked") ? true : false,
|
'bigPicture': $("#bigPicture").is(":checked") ? true : false,
|
'moreTag': $("#moreTag").val(),
|
'refreshPosition': $("#refreshPosition").val(),
|
'icon': $("#icon").val(),
|
'detailsystemids': dess,
|
'specialDataKey': $("#classtype").val()
|
}, function (data) {
|
layer.close(index);
|
layer.msg(data.msg);
|
doResponse(data, function () {
|
|
});
|
}, 'json');
|
|
});
|
|
});
|
</script>
|
</body>
|
|
</html>
|