<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;
|
}
|
|
#hometype input[type=checkbox] {
|
height: 20px;
|
width: 20px;
|
}
|
|
#hometype ul li {
|
line-height: 30px;
|
}
|
|
#hometype ul li span {
|
height: 30px;
|
vertical-align: middle;
|
margin-left: 5px;
|
}
|
|
#hometype table td {
|
padding: 5px;
|
}
|
|
#special input[type=checkbox] {
|
height: 20px;
|
width: 20px;
|
}
|
|
#special ul li {
|
line-height: 30px;
|
}
|
|
#special ul li span {
|
height: 30px;
|
vertical-align: middle;
|
margin-left: 5px;
|
}
|
|
#special table td {
|
padding: 5px;
|
}
|
|
#hometype-sure {
|
padding: 20px;
|
display: none;
|
}
|
|
#hometype-sure span {
|
width: 100px;
|
text-align: right;
|
}
|
|
#hometype-sure input[type=text] {
|
width: 360px;
|
display: inline;
|
}
|
|
#hometype-sure div {
|
margin-bottom: 20px;
|
}
|
</style>
|
</head>
|
|
<body>
|
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
</nav>
|
<div id="mainbody">
|
<div id="sidebar">
|
<dl>
|
</dl>
|
</div>
|
<div id="neirong">
|
<div class="erjidh search-div" style="padding: 10px;">
|
|
<div class="search videotypes">
|
<select name="select" class="form-control roottype search">
|
|
</select>
|
|
</div>
|
|
<select name="select" class="form-control search select-detailsystem">
|
|
</select>
|
<select name="select" class="form-control search contenttype">
|
<option value="1">正片</option>
|
<option value="2">其他</option>
|
</select>
|
<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="add-fqmovie.html" class="btn btn-primary" role="button">添加内容 +</a>
|
</div>
|
</div>
|
<div class="zhuti">
|
<div class="liebiao">
|
<table class="table">
|
<thead>
|
<th width="7%">选择</th>
|
<th width="7%">编号</th>
|
<th width="24%">封面</th>
|
<th width="17%">名称</th>
|
<th width="15%">更新时间</th>
|
<th width="8%">是否显示</th>
|
<th width="8%">操作</th>
|
<th width="7%">删除</th>
|
<th width="7%">编辑</th>
|
</thead>
|
<tbody>
|
<tr style="display: none;">
|
<td width="7%">
|
<div class="xuanze">
|
<label> <input type="checkbox" class="check-item"
|
value="#">
|
</label>
|
</div>
|
</td>
|
<td width="7%">
|
<div class="bianhao videoid">623</div>
|
</td>
|
<td width="24%">
|
<div class="tupian-banner">
|
<img alt src="" class="video-img" style="width: 240px;">
|
</div>
|
</td>
|
<td width="17%">
|
<div class="bianhao video-name"></div>
|
</td>
|
<td width="15%" style="text-align: center; line-height: 105px;" class="video-updatetime">2016-09-27</td>
|
<td width="8%">
|
<div class="xuanze">
|
<label> <input type="checkbox" value="#" class="video-show">
|
</label>
|
</div>
|
</td>
|
<td width="8%">
|
<div class="bianhao addrecommend">
|
<a href="javascript:void(0)">添加推荐</a>
|
</div>
|
</td>
|
<td width="7%">
|
<div class="anniu">
|
<img src="image/dustbin.png" class="delete">
|
|
</div>
|
</td>
|
<td width="7%">
|
<div class="anniu">
|
<a key="370" class="edit" onclick="p_del()"><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>
|
<button class="btn btn-primary pl-addrecommend" type="button">添加推荐</button>
|
<button class="btn btn-primary pl-addspecial" type="button">添加到合辑</button>
|
<button class="btn btn-primary pl-addFind">添加到发现</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>
|
</div>
|
|
<!--栏目选择 -->
|
<div class="modal fade" id="hometype" tabindex="-1" role="dialog" aria-hidden="true">
|
<input type="hidden" class="videoids" />
|
<input type="hidden" class="desc" />
|
<input type="hidden" class="picture" />
|
<div class="modal-dialog">
|
<div class="modal-content">
|
<div class="modal-header">
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<h4 class="modal-title" id="myModalLabel">栏目选择</h4>
|
</div>
|
<div class="modal-body">
|
<div class="row">
|
<div class="col-lg-4">
|
<label>子系统选择</label>
|
<ul class="col-lg-12 detailsystem">
|
<li><input type="checkbox" /> <span>布丸影视大全</span> </li>
|
<li><input type="checkbox" /> <span>布丸视频</span></li>
|
<li><input type="checkbox" /> <span>布丸影视大全IOS</span></li>
|
</ul>
|
</div>
|
<div class="col-lg-8">
|
<table class="table">
|
<thead>
|
<th>栏目ID</th>
|
<th>栏目名称</th>
|
<th>选择</th>
|
</thead>
|
<tbody>
|
<tr>
|
<td>12</td>
|
<td>热门推荐</td>
|
<td><input type="checkbox" /> </td>
|
</tr>
|
<tr>
|
<td>12</td>
|
<td>热门推荐</td>
|
<td><input type="checkbox" /> </td>
|
</tr>
|
<tr>
|
<td>12</td>
|
<td>热门推荐</td>
|
<td><input type="checkbox" /> </td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
</div>
|
<div class="modal-footer">
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
<button type="button" class="btn btn-primary">提交更改</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<!-- 专辑选择 -->
|
<div class="modal fade" id="special" tabindex="-1" role="dialog" aria-hidden="true">
|
<input type="hidden" class="videoids" />
|
<div class="modal-dialog">
|
<div class="modal-content">
|
<div class="modal-header">
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<h4 class="modal-title" id="myModalLabel">专题选择</h4>
|
</div>
|
<div class="modal-body">
|
<div class="row">
|
<div class="col-lg-4">
|
<label>子系统选择</label>
|
<ul class="col-lg-12 detailsystem">
|
<li><input type="checkbox" /> <span>布丸影视大全</span> </li>
|
<li><input type="checkbox" /> <span>布丸视频</span></li>
|
<li><input type="checkbox" /> <span>布丸影视大全IOS</span></li>
|
</ul>
|
</div>
|
<div class="col-lg-8">
|
<table class="table">
|
<thead>
|
<th>专题ID</th>
|
<th>专题名称</th>
|
<th>选择</th>
|
</thead>
|
<tbody>
|
<tr>
|
<td>12</td>
|
<td>热门推荐</td>
|
<td><input type="checkbox" /> </td>
|
</tr>
|
<tr>
|
<td>12</td>
|
<td>热门推荐</td>
|
<td><input type="checkbox" /> </td>
|
</tr>
|
<tr>
|
<td>12</td>
|
<td>热门推荐</td>
|
<td><input type="checkbox" /> </td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
</div>
|
<div class="modal-footer">
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
<button type="button" class="btn btn-primary">提交更改</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<!-- 栏目视频确认 -->
|
<div id="hometype-sure">
|
<div class="row">
|
<span class="col-lg-4">封面图片:</span><input type="text" class="form-control col-lg-8 picture" placeholder="如不更改可不填写" />
|
</div>
|
<div class="row">
|
<span class="col-lg-4"> 简介:</span><input type="text" class="form-control col-lg-8 desc" placeholder="如不更改可不填写" />
|
</div>
|
|
<div class="row" style="text-align: center;">
|
<input type="button" class="btn btn-default" value="确定" />
|
</div>
|
|
</div>
|
<!--
|
添加到发现
|
-->
|
<div id="addfindWin" style="display: none;">
|
<div style="align-content: center;"></div>
|
<div class="row" style="margin-left: 10px;">
|
<span style="float: left;">选择分类</span>
|
<select class="col-lg-5 xzFind">
|
</select>
|
</div>
|
<div class="row" style="margin-top: 170px;margin-left: 230px;">
|
<button class="btn btn-info sure">确定</button>
|
<button class="btn btn-default cancel">取消</button>
|
</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() {
|
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/video/deletevideo', {
|
'id': ids
|
}, function(data) {
|
layer.msg(data.msg);
|
if(data.code == 0) {
|
$deleteElement.parent().parent().parent().remove();
|
}
|
}, 'json');
|
|
});
|
|
$(".pl-addrecommend").click(function() {
|
var ids = getCheckedItems();
|
if(ids.length < 1)
|
layer.msg("未选择视频");
|
else {
|
$("#hometype .videoids").val(ids);
|
$("#hometype").modal("show");
|
}
|
|
});
|
|
$(".pl-addspecial").click(function() {
|
var ids = getCheckedItems();
|
if(ids.length < 1)
|
layer.msg("未选择视频");
|
else {
|
$("#special .videoids").val(ids);
|
$("#special").modal("show");
|
}
|
});
|
|
$.post("api/find/getAllFindClass",{},function(data){
|
if(data.code==0){
|
var list = data.data;
|
for (var i=0;i < list.length;i++) {
|
var findClass = list[i];
|
var name = findClass.name;
|
var cid = findClass.id;
|
$(".xzFind").append("<option key='"+cid+"'>"+name+"</option>")
|
}
|
}
|
},'json')
|
|
$(".pl-addFind").click(function(){
|
var ids = getCheckedItems();
|
if(ids.length < 1)
|
layer.msg("未选择视频");
|
else {
|
layindex = layer.open({
|
type: 1,
|
title: '添加',
|
shadeClose: true,
|
shade: 0.8,
|
area: ['400px', '300px'],
|
content: $("#addfindWin")
|
});
|
}
|
});
|
|
$("#addfindWin .cancel").click(function(){
|
layer.close(layindex);
|
})
|
|
$("#addfindWin .sure").click(function(){
|
var fcid = $(".xzFind :checked").attr("key");
|
var ids = getCheckedItems();
|
$(".xuanze .check-item").prop("checked",false);
|
$.post("api/find/batchAddFindVideo",{"fcid":fcid,"ids":ids},function(data){
|
if(data.code==0){
|
layer.msg("添加成功");
|
}else{
|
layer.msg("添加失败");
|
}
|
},'json')
|
layer.close(layindex);
|
})
|
|
//获取栏目列表
|
$.post('../new/api/home/gethometypelist', {}, function(data) {
|
if(data.code == 0) {
|
var item = $("#hometype table tbody tr").eq(0);
|
$("#hometype table tbody").empty();
|
data.data.forEach(function(hometype) {
|
$("#hometype table tbody").append("<tr>" + item.html() + "</tr>");
|
var newItem = $("#hometype table tbody tr").eq($("#hometype table tbody tr").length - 1);
|
newItem.find("td").eq(0).html(hometype.id);
|
newItem.find("td").eq(1).html(hometype.name);
|
newItem.find("td").eq(2).find("input[type='checkbox']").eq(0).val(hometype.id);
|
});
|
}
|
|
}, 'json');
|
|
//获取专辑列表
|
$.post('../new/api/special/getspeciallist', {}, function(data) {
|
if(data.code == 0) {
|
var item = $("#special table tbody tr").eq(0);
|
$("#special table tbody").empty();
|
data.data.forEach(function(special) {
|
$("#special table tbody").append("<tr>" + item.html() + "</tr>");
|
var newItem = $("#special table tbody tr").eq($("#special table tbody tr").length - 1);
|
newItem.find("td").eq(0).html(special.id);
|
newItem.find("td").eq(1).html(special.name);
|
newItem.find("td").eq(2).find("input[type='checkbox']").eq(0).val(special.id);
|
});
|
}
|
}, 'json');
|
|
//获取系统列表
|
$.post('../new/api/common/detailsystemlist', {}, function(data) {
|
if(data.code == 0) {
|
$(".select-detailsystem").empty();
|
$(".select-detailsystem").append("<option value='0'>全部</option>");
|
|
$(".detailsystem").empty();
|
data.data.forEach(function(detailsystem) {
|
var html = "";
|
html += "<option value=" + detailsystem.id + ">";
|
html += detailsystem.name;
|
html += "</option>";
|
$(".select-detailsystem").append(html);
|
|
html = "<li><input type='checkbox' value=" + detailsystem.id + ">";
|
html += "<span>" + detailsystem.name;
|
html += "</span> </li>";
|
$(".detailsystem").append(html);
|
});
|
}
|
|
}, 'json');
|
});
|
</script>
|
|
<script>
|
$(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/video/videolist', {
|
"page": page,
|
"videotype": $(".search-div .videotypes select:last").val(),
|
"detailsystem": $(".search-div .select-detailsystem").val(),
|
"contenttype": $(".contenttype").val(),
|
"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(".videoid").html(da.id);
|
fk.find(".video-name").html(da.name);
|
fk.find(".video-img").attr("src", da.picture);
|
fk.find(".video-updatetime").html(da.updatetime);
|
if(da.show == 1)
|
fk.find(".video-show").attr("checked", true);
|
else
|
fk.find(".video-show").attr("checked", false);
|
fk.find(".video-show").attr("key", da.id);
|
fk.find(".addrecommend a").attr("key", da.id);
|
fk.find(".edit").attr("key", da.id);
|
fk.find(".delete").attr("key", da.id);
|
fk.css("display", "table-row");
|
}
|
|
$(".table .addrecommend a").bind("click", function() {
|
var index = layer.open({
|
type: 1,
|
skin: 'layui-layer-demo', //样式类名
|
closeBtn: 0, //不显示关闭按钮
|
anim: 2,
|
area: ['500px', '250px'],
|
shadeClose: true, //开启遮罩关闭
|
content: $("#hometype-sure")
|
});
|
var key = $(this).attr("key");
|
$("#hometype-sure input[type=button]").click(function() {
|
$("#hometype .picture").val($("#hometype-sure .picture").val());
|
$("#hometype .desc").val($("#hometype-sure .desc").val());
|
$("#hometype .videoids").val(key);
|
layer.close(index);
|
$("#hometype").modal("show");
|
});
|
|
});
|
|
$(".table .video-show").bind("click", function() {
|
var show = $(this).is(":checked") ? "1" : "0";
|
var key = $(this).attr("key");
|
$.post('../new/api/video/changevideoshow', {
|
'id': key,
|
'show': show
|
}, function(data) {
|
layer.msg(data.msg);
|
layer.close(index);
|
if(data.code == 0) {
|
$deleteElement.parent().parent().parent().remove();
|
}
|
}, 'json');
|
|
});
|
|
$(".table .anniu .delete").bind("click", function() {
|
var id = $(this).attr("key");
|
var $deleteElement = $(this);
|
var index = layer.confirm('是否删除该条目?', {
|
btn: ['是', '否'] //按钮
|
}, function() {
|
$.post('../new/api/video/deletevideo', {
|
'id': 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() {
|
|
});
|
|
}, 'json');
|
}
|
|
$(".search-div .search-button").click(function() {
|
getData(1);
|
});
|
|
$("#special .modal-footer button:last").click(function() {
|
var ids = "";
|
for(var i = 0; i < $("#special .table tr").length; i++) {
|
if($("#special .table tr td input[type=checkbox]").eq(i).is(':checked')) {
|
ids += $("#special .table tr td input[type=checkbox]").eq(i).val() + ",";
|
}
|
}
|
if(ids.length > 0)
|
ids = ids.substr(0, ids.length - 1);
|
|
$.post('api/special/addspecialvideo', {
|
'specialid': ids,
|
'videos': $("#special .videoids").val()
|
}, function(data) {
|
if(data.code == 0)
|
layer.msg(data.msg);
|
}, 'json');
|
});
|
|
$("#hometype .modal-footer button:last").click(function() {
|
var ids = "";
|
for(var i = 0; i < $("#hometype .table tr").length; i++) {
|
if($("#hometype .table tr td input[type=checkbox]").eq(i).is(':checked')) {
|
ids += $("#hometype .table tr td input[type=checkbox]").eq(i).val() + ",";
|
}
|
}
|
if(ids.length < 1) {
|
layer.msg("请选择推荐类型");
|
return;
|
}
|
|
if(ids.length > 0)
|
ids = ids.substr(0, ids.length - 1);
|
alert(ids);
|
|
$.post('../new/api/home/addhomevideos', {
|
'videoids': $("#hometype .videoids").val(),
|
'types': ids,
|
'tag': $("#hometype .desc").val(),
|
'picture': $("#hometype .picture").val()
|
}, function(data) {
|
if(data.code == 0)
|
layer.msg(data.msg);
|
}, 'json');
|
});
|
|
});
|
</script>
|
</body>
|
|
</html>
|