<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">
|
<!--[if lt IE 9]>
|
<script src="js/html5shiv.js"></script>
|
<script src="js/respond.min.js"></script>
|
<![endif]-->
|
</head>
|
|
<body>
|
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
<div class="container-fluid">
|
<!-- Brand and toggle get grouped for better mobile display -->
|
<div class="navbar-header">
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
|
<a class="navbar-brand" href="#"> 视 频 后 台 管 理 系 统 </a>
|
</div>
|
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
<!-- <ul class="nav navbar-nav">
|
<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">布丸视频<span class="caret"></span></a>
|
<ul class="dropdown-menu" role="menu">
|
<li><a href="#">布丸视频</a></li>
|
<li class="divider"></li>
|
<li><a href="#">布丸影视大全</a></li>
|
</ul>
|
</li>
|
</ul>-->
|
|
<ul class="nav navbar-nav navbar-left">
|
<li>
|
<a href="#">数据</a>
|
</li>
|
<li>
|
<a href="tuijian-lanmuneirong.html">推荐</a>
|
</li>
|
<li>
|
<a href="fenqu.html">分区</a>
|
</li>
|
<li class="active">
|
<a href="faxian.html">发现</a>
|
</li>
|
<li>
|
<a href="shezhi.html">设置</a>
|
</li>
|
</ul>
|
<ul class="nav navbar-nav navbar-right">
|
<li class="hover">
|
<a href="#">账户</a>
|
</li>
|
<li>
|
<a href="#">退出登录</a>
|
</li>
|
</ul>
|
</div>
|
<!-- /.navbar-collapse -->
|
</div>
|
<!-- /.container-fluid -->
|
</nav>
|
<div id="mainbody">
|
<div id="sidebar">
|
<dl>
|
<!-- <dt>
|
<div class="tubiao"><span class="glyphicon glyphicon-pencil"></span></div>
|
数据</dt>-->
|
</dl>
|
</div>
|
<div id="neirong">
|
<div class="erjidh">
|
<table class="table">
|
<tbody>
|
<tr>
|
<td class="xiala">
|
<select name="select" class="form-control appclass">
|
<option value="0">全部</option>
|
</select>
|
</td>
|
<td>
|
<form class="form-inline" role="form">
|
<div class="form-group" role="search">
|
<input type="text" class="form-control searchText" style="width:200px;" placeholder="搜索">
|
</div>
|
<button type="button" class="btn btn-default searchBtn">搜索</button>
|
</form>
|
</td>
|
<td>
|
<div class="tianjia">
|
<a href="add-star.html" class="btn btn-primary" role="button">添加内容 +</a>
|
</div>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
<div class="zhuti">
|
<div class="zhutisousuo">
|
<table class="table">
|
<thead>
|
<tr>
|
<th width="7%">选择</th>
|
<th width="7%">编号</th>
|
<th width="15%">明星</th>
|
<th width="21%">头像</th>
|
<th width="21%">APP名称</th>
|
<th width="15%">创建时间</th>
|
<th width="7%">删除</th>
|
<th width="7%">编辑</th>
|
</tr>
|
</thead>
|
</table>
|
</div>
|
<div class="liebiao">
|
<table class="table table-striped">
|
<tbody>
|
<tr style="display: none">
|
<td width="7%">
|
<div class="xuanze">
|
<label>
|
<input type="checkbox" value="#" class="starCheck">
|
</label>
|
</div>
|
</td>
|
<td width="7%" style="text-align:center; line-height:105px;">
|
<div class="code">623</div>
|
</td>
|
<td width="15%" style="text-align:center; line-height:105px;">
|
<div class="starName">本尼迪克特·康伯巴奇</div>
|
</td>
|
<td width="21%">
|
<div class="tupian-banner"><img src="#" height="105"></div>
|
</td>
|
<td width="21%" class="appnametd">
|
<div class="appname" style="display: none;">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" value="#"><div></div>
|
</label>
|
</div>
|
</div>
|
</td>
|
<td width="15%" style="text-align:center; line-height:105px;" class="createtime">2016-09-27 12:20</td>
|
<td width="7%">
|
<div class="anniu" name="del"><img src="image/dustbin.png" data-toggle="modal" data-target="#myModal">
|
<!-- Modal -->
|
</div>
|
</td>
|
<td width="7%">
|
<div class="anniu" name="edit">
|
<a key="370" href="#"><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="checkAll">
|
全选
|
</label>
|
</div>
|
</div>
|
<button class="btn btn-warning batchDel" type="button ">批量删除</button>
|
<div class="page ">
|
<ul class="pagination ">
|
<li class="disabled pre ">
|
<a href="#">«</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 " id="customPage " placeholder="页数 ">
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script src="js/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>
|
|
var trHTML;
|
var appHTML;
|
$(function(){
|
var $tbody = $(".liebiao> .table > tbody");
|
trHTML= $tbody.html();
|
appHTML = $tbody.find(".appnametd").html();
|
setAppClass(); getHotStar(1);
|
$(".checkAll").bind("click",function(){
|
if(this.checked) {
|
$(".xuanze > label >input ").prop('checked', true)
|
}
|
else { $(".xuanze > label >input ").prop('checked', false)
|
}
|
});
|
$(".searchBtn").bind("click",function(){
|
getHotStar(1);
|
});
|
|
$(".batchDel").bind("click",function(){
|
var arr="";
|
var selectAll = $(".starCheck").each(function(){
|
var cur = $(this);
|
var ck= cur.context.checked;
|
if (ck) {
|
var val = cur.attr("key");
|
arr += val + ",";
|
}
|
if(arr==""){
|
layer.msg("请先选择数据!");
|
return;
|
}
|
layer.confirm('是否批量删除?', {
|
btn: ['否','是']
|
}, function(index){
|
layer.close(index);
|
return false;
|
}, function(){
|
deleteHotStar(arr);
|
$(".checkAll").prop("checked",false);
|
});
|
});
|
});
|
});
|
</script>
|
|
<script>
|
function getHotStar(pageIndex) {
|
var key = $(".searchText").val();
|
var sysid = $(".appclass option:checked").val();
|
$.post("api/hotstar/hotStarList", { "pageIndex": pageIndex, "key": key, "detailsystem": sysid }, function(data) {
|
if(data.code == 0) {
|
setData(pageIndex, data);
|
fillPage(data.pageEntity, function(page) {
|
getHotStar(page);
|
});
|
}
|
}, 'json');
|
}
|
|
function setData(pageIndex, data) {
|
|
pageIndex = pageIndex - 1;
|
var $tbody = $(".liebiao > .table > tbody");
|
$(".liebiao tbody").empty();
|
var pageSize = data.pageEntity.pageSize;
|
var totalCount = data.pageEntity.totalCount;
|
var len = (pageSize < totalCount - (pageIndex * pageSize)) ? pageSize : totalCount - (pageIndex * pageSize);
|
len = (pageIndex * pageSize) + len;
|
var ii = pageIndex * pageSize;
|
for(var mm = 0; ii < len && ii < totalCount; ii++, mm++) {
|
var id = data.hotStarAdminList[mm].superHotStar.hotStar.id;
|
var name = data.hotStarAdminList[mm].superHotStar.hotStar.name;
|
var imgPath = data.hotStarAdminList[mm].superHotStar.hotStar.portrait;
|
var createtime = data.hotStarAdminList[mm].superHotStar.hotStar.createtime;
|
var detailSystemList = data.hotStarAdminList[mm].detailSystemList;
|
$tbody.append(trHTML);
|
$tbody.find("tr").eq(mm).css("display", "table-row");
|
var $curCheck = $tbody.find(".xuanze label input").eq(mm);
|
$curCheck.attr("key", id);
|
var $curCode = $tbody.find(".code").eq(mm);
|
$curCode.text(id);
|
var $curName = $tbody.find(".starName").eq(mm);
|
$curName.text(name);
|
$tbody.find(".tupian-banner > img").eq(mm).attr("src", imgPath);
|
var mydate = new Date(parseInt(createtime)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
|
$tbody.find(".createtime").eq(mm).text(mydate);
|
$tbody.find("tr").eq(mm).find(".anniu").attr("key", id);
|
$tbody.find("tr").eq(mm).find("div[name='edit'] > a").attr("href", 'edit-star.html?key=' + id);
|
//app分类处理
|
for(var nn = 0; nn < detailSystemList.length; nn++) {
|
var detailSystem = detailSystemList[nn].detailSystem;
|
var selected = detailSystemList[nn].selected;
|
var $curttr = $tbody.find("tr").eq(mm);
|
var blank = " " + detailSystem.appName;
|
$curttr.find(".appnametd").append(appHTML);
|
$curttr.find(".appnametd > .appname").eq(nn).css("display", "table-row");
|
$curttr.find(".appnametd .appname input").eq(nn).attr("key", detailSystem.id);
|
$curttr.find(".appnametd .appname input").eq(nn).attr("value", id);
|
$curttr.find(".appnametd .appname input").eq(nn).attr("checked", selected);
|
$curttr.find(".appnametd .appname label > div").eq(nn).append(blank);
|
}
|
}
|
|
$tbody.find("tr").find(".appnametd .appname input").bind("click", function() {
|
var id = $(this).val();
|
var sysid = $(this).attr("key");
|
var ck = $(this).context.checked;
|
var type = ck ? "add" : "delete";
|
$.post("api/hotstar/setStarDetailSystem", { "type": type, "detailSystem": sysid, "id": id }, function() {
|
if(ck) {
|
if(data = "yes")
|
layer.msg("添加成功");
|
else
|
layer.msg("添加失败");
|
} else {
|
if(data = "yes")
|
layer.msg("删除成功");
|
else
|
layer.msg("删除失败");
|
}
|
}, "text")
|
});
|
|
$("div[name='del']").bind("click", function() {
|
var $obj = $(this);
|
layer.confirm('您确定要删除?', {
|
btn: ['否', '是'] //按钮
|
}, function(index) {
|
layer.close(index);
|
return false;
|
}, function() {
|
var id = $obj.attr("key");
|
deleteHotStar(id);
|
});
|
});
|
}
|
|
function deleteHotStar(ids){
|
$.post("api/hotstar/deleteHotStarList", {"ids":ids}, function(data) {
|
if(data=="yes") {
|
layer.msg("删除成功!");
|
getHotStar(1);
|
}
|
}, 'text');
|
}
|
|
function setAppClass() {
|
$.post("api/common/detailsystemlist", {}, function(data) {
|
if(data.code == 0) {
|
var alldata = data.data;
|
var allSystems = $(".appclass").eq(0);
|
var optionHtml = allSystems.html();
|
for(var index in alldata) {
|
allSystems.append(optionHtml);
|
var edata = alldata[index];
|
var curOption = allSystems.find("option").eq(parseInt(index) + parseInt(1));
|
curOption.attr("value", "" + edata.id + "");
|
curOption.text("" + edata.name + "");
|
}
|
}
|
}, 'json');
|
}
|
</script>
|
</body>
|
|
</html>
|