<!DOCTYPE html>
|
<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">
|
<title>推荐-栏目内容-视频列表</title>
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
<link href="css/maincontent.css" rel="stylesheet">
|
<style>
|
.search {
|
display: inline;
|
width: auto;
|
}
|
img{
|
width: 120px;
|
height: 120px;
|
}
|
</style>
|
|
</head>
|
|
<body>
|
<nav class="navbar navbar-default navbar-fixed-top">
|
|
</nav>
|
<div id="mainbody">
|
<div id="sidebar">
|
</div>
|
<div id="neirong">
|
|
<div class="erjidh search-div" style="padding: 10px;">
|
<div class="form-group search" role="search">
|
<input type="text" class="form-control search" id="kw" style="width: 200px;" placeholder="搜索">
|
</div>
|
<button type="button" class="btn btn-default search-button">搜索</button>
|
|
<div class="tianjia" class="search">
|
<a href="fenqu.html" class="btn btn-primary" role="button">添加内容 +</a>
|
</div>
|
|
</div>
|
<div class="bottom">
|
<div class="qx">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" class="check-all" value="#">
|
全选</label>
|
</div>
|
</div>
|
<button class="btn btn-warning pl-del" type="button">批量删除</button>
|
<div class="page">
|
<ul class="pagination">
|
<li class="disabled pre">
|
<a href="#">«</a>
|
</li>
|
<li class="active">
|
<a href="#">1</a>
|
</li>
|
<li>
|
<a href="#">2</a>
|
</li>
|
<li>
|
<a href="#" class="next">»</a>
|
</li>
|
</ul>
|
<div class="form-group">
|
<div class="tzan">
|
<button type="button" class="btn btn-primary">跳转</button>
|
</div>
|
<div class="tz">
|
<input class="form-control" type="text" placeholder="页数">
|
</div>
|
</div>
|
</div>
|
|
</div>
|
<div class="zhuti">
|
<div class="zhutisousuo">
|
<table class="table">
|
<thead>
|
<th width="7%">选择</th>
|
<th width="7%">编号</th>
|
<th width="15%">名称</th>
|
<th width="27%">封面</th>
|
<th width="15%">简要介绍</th>
|
<th width="15%">创建时间</th>
|
<th width="7%">删除</th>
|
<th width="7%">编辑</th>
|
</thead>
|
|
<tbody>
|
<tr style="display: none;">
|
<td>
|
<div class="xuanze">
|
<label>
|
<input type="checkbox" class="check-item"
|
value="#">
|
</label>
|
</div>
|
</td>
|
<td>
|
<div class="bianhao homevideoid">623</div>
|
</td>
|
<td>
|
<div class="bianhao name">
|
<a href="#">今日热点</a>
|
</div>
|
</td>
|
|
<td>
|
<div class="bianhao picture">
|
<img style="width: 80%;" />
|
</div>
|
</td>
|
<td style="text-align:center;line-height:105px;" class="tag"></td>
|
<td style="text-align:center;line-height:105px;" class="createtime"></td>
|
<td>
|
<div class="anniu"><img src="image/dustbin.png" class="delete">
|
</div>
|
</td>
|
<td>
|
<div class="anniu">
|
<a key="370" href="javascript:void(0)" class="edit"><img src="image/bianji.png"></a>
|
</div>
|
</td>
|
</tr>
|
</tbody>
|
|
</table>
|
</div>
|
</div>
|
<div class="bottom">
|
<div class="qx">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" class="check-all" value="#">
|
全选</label>
|
</div>
|
</div>
|
<button class="btn btn-warning pl-del" type="button">批量删除</button>
|
<div class="page">
|
<ul class="pagination">
|
<li class="disabled pre">
|
<a href="#">«</a>
|
</li>
|
<li class="active">
|
<a href="#">1</a>
|
</li>
|
<li>
|
<a href="#">2</a>
|
</li>
|
<li>
|
<a href="#" class="next">»</a>
|
</li>
|
</ul>
|
<div class="form-group">
|
<div class="tzan">
|
<button type="button" class="btn btn-primary">跳转</button>
|
</div>
|
<div class="tz">
|
<input class="form-control" type="text" placeholder="页数">
|
</div>
|
</div>
|
</div>
|
|
</div>
|
</div>
|
<script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src="js/page.js"></script>
|
<script src="js/nav.js"></script>
|
<script src="js/common.js"></script>
|
<script src="layer/layer.js"></script>
|
<script>
|
function getQueryString(name) {
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
var r = window.location.search.substr(1).match(reg);
|
if(r != null) return unescape(r[2]);
|
return null;
|
}
|
|
var id = getQueryString("id");
|
|
function getCommonTime(timestamp) {
|
var newDate = new Date();
|
newDate.setTime(timestamp);
|
return newDate.getFullYear() + "-" + (newDate.getMonth() + 1) + "-" + (newDate.getDay() + 1) + " " + newDate.getHours() + ":" + newDate.getMinutes();
|
}
|
|
$(function() {
|
var htmlSrc = "<tr>" + $(".zhuti .table tbody tr").eq(0).html() + "</tr>";
|
|
function getData(page) {
|
var index = layer.load(1, {
|
shade: false
|
})
|
$.post('../new/api/home/gethomevideolist', {
|
"page": page,
|
"id": id,
|
"key": $("#kw").val()
|
}, function(data) {
|
layer.close(index);
|
if(data.code != 0)
|
return;
|
|
fillPage(data.data.pageEntity, function(pageIndex) {
|
getData(pageIndex);
|
});
|
//填充数据
|
|
$(".zhuti .table tbody").empty();
|
for(var i = 0; i < data.data.data.length; i++) {
|
var da = data.data.data[i];
|
$(".zhuti .table tbody").append(htmlSrc);
|
var fk = $(".zhuti .table tbody tr").eq(i);
|
fk.find(".check-item").attr("key", da.id);
|
fk.find(".homevideoid").html(da.id);
|
fk.find(".name").html(da.video.name);
|
var pic = da.picture==null ? da.video.picture:da.picture;
|
fk.find(".picture img").attr("src", pic);
|
fk.find(".tag").html(da.tag);
|
fk.find(".createtime").html(getCommonTime(da.createtime));
|
fk.find(".edit").attr("key", da.id);
|
fk.find(".delete").attr("key", da.id);
|
fk.css("display", "table-row");
|
}
|
|
$(".table .anniu .delete").bind("click", function() {
|
var id = $(this).attr("key");
|
var $deleteElement = $(this);
|
var index = layer.confirm('是否删除该条目?', {
|
btn: ['是', '否'] //按钮
|
}, function() {
|
$.post('../new/api/home/deletehomevideo', {
|
'ids': id
|
}, function(data) {
|
layer.msg(data.msg);
|
layer.close(index);
|
if(data.code == 0) {
|
$deleteElement.parent().parent().parent().remove();
|
}
|
}, 'json');
|
}, function() {
|
|
});
|
|
});
|
|
$(".table .anniu .edit").bind("click", function() {
|
window.location.href = "edit-lmneirong-video.html?id=" + $(this).attr("key");
|
});
|
|
}, 'json');
|
}
|
|
$(".search-div .search-button").click(function() {
|
getData(1);
|
});
|
|
getData(1);
|
|
});
|
</script>
|
|
<script>
|
$(function() {
|
function getCheckedItems() {
|
var ids = "";
|
for(var i = 0; i < $(".check-item").length; i++) {
|
if($(".check-item").eq(i).is(':checked')) {
|
ids += $(".check-item").eq(i).attr("key") + ",";
|
}
|
}
|
if(ids.length > 0)
|
ids = ids.substr(0, ids.length - 1);
|
return ids;
|
}
|
|
$(".pl-del").click(function() {
|
var ids = getCheckedItems();
|
if(ids.length < 1) {
|
layer.msg("请选择栏目");
|
return;
|
}
|
|
$.post('../new/api/home/deletehomevideo', {
|
'ids': ids
|
}, function(data) {
|
layer.msg(data.msg);
|
if(data.code == 0) {
|
|
}
|
}, 'json');
|
|
});
|
|
});
|
</script>
|
</body>
|
|
</html>
|