<html lang="zh-cn">
|
|
<head>
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="referrer" content="never">
|
<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;
|
}
|
|
.video {
|
height: 100px !important;
|
}
|
|
.video .cover-h {
|
height: 100px;
|
max-width: 180px;
|
}
|
|
.video .cover-v {
|
height: 100px;
|
}
|
|
.video tr td {
|
text-align: center;
|
}
|
|
.video .title {
|
background: #1DC7EA;
|
color: #006dcc;
|
border-radius: 5px;
|
height: 100px;
|
padding: 2px 5px;
|
}
|
|
.video .resource {
|
background: #EEEEEE;
|
color: #666666;
|
border-radius: 5px;
|
height: 100px;
|
padding: 2px 5px;
|
}
|
</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-fromtype">
|
<option value="0">自有库</option>
|
<option value="1">全网搜</option>
|
<option value="2">短视频</option>
|
</select>
|
<select name="select" class="form-control search contenttype">
|
<option value="1">正片</option>
|
<option value="2">其他</option>
|
</select>
|
|
<select name="select" class="form-control search resourceIds">
|
<option value="0">全部来源</option>
|
<option value="24">风行2</option>
|
<option value="19">风行</option>
|
<option value="13">爱奇艺</option>
|
<option value="22">爱奇艺2</option>
|
<option value="21">Acfun</option>
|
<option value="25">PPTV</option>
|
<option value="28">韩迷TV</option>
|
</select>
|
|
|
<select name="select" class="form-control search freeType">
|
<option value="">--请选择收费类型--</option>
|
<option value="0">免费</option>
|
<option value="1">会员</option>
|
</select>
|
|
<select name="select" class="form-control search area">
|
<option value="">--请选择区域--</option>
|
<option value="内地">内地</option>
|
<option value="香港">香港</option>
|
<option value="台湾">台湾</option>
|
<option value="美国">美国</option>
|
<option value="泰国">泰国</option>
|
<option value="韩国">韩国</option>
|
<option value="日本">日本</option>
|
</select>
|
|
|
<select name="select" class="form-control search type">
|
<option value="name" selected>片名</option>
|
<option value="actor">主演</option>
|
<option value="director">导演</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="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" v-on:click="deleteItems">批量删除</button>
|
<button class="btn btn-primary pl-addrecommend" type="button" v-on:click="addToRecommends">添加推荐</button>
|
<button class="btn btn-primary pl-addspecial" type="button" v-on:click="addToSpecials">添加到合辑</button>
|
<button class="btn btn-primary pl-addtop" type="button" v-on:click="addToTops">添加到榜首</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" style="display: flex;align-items: center;justify-content: flex-end;">
|
|
<div class="tz" style="margin: 0">
|
<input class="form-control" type="text" placeholder="页数">
|
</div>
|
|
<div class="tzan" style="margin: 0">
|
<button type="button" class="btn btn-primary">跳转</button>
|
</div>
|
|
<div>
|
记录数量:<span class="page-totalcount"></span>
|
</div>
|
|
</div>
|
</div>
|
|
</div>
|
<div class="zhuti">
|
<div class="liebiao">
|
<table class="table">
|
<thead>
|
<th width="6%">选择</th>
|
<th width="12%">横版封面</th>
|
<th width="8%">竖版封面</th>
|
<th width="17%">标题</th>
|
<th width="12%">操作</th>
|
<th width="8%">来源</th>
|
<th width="12%">时间</th>
|
<th width="12%">标签</th>
|
<th width="5%">区域</th>
|
<th width="6%">编号</th>
|
<th width="4%">显示</th>
|
<th width="6%">删除</th>
|
<th width="6%">编辑</th>
|
</thead>
|
<tbody>
|
<tr v-for="(item,index) in videos" class="video">
|
<td width="7%">
|
<div class="xuanze">
|
<label> <input type="checkbox" class="check-item" v-bind:key="item.id" value="#">
|
</label>
|
</div>
|
</td>
|
<td width="12%">
|
<div style="position:relative">
|
<img v-bind:src="item.hpicture" class="cover-h">
|
<img v-if="item.freeType>0" src="image/icon_vip.png" style="position:absolute; right:0;bottom:0; height:20px;">
|
</div>
|
</td>
|
<td width="8%">
|
<img v-bind:src="item.vpicture" class="cover-v">
|
</td>
|
<td width="17%">
|
<div class="title">{{item.name}}</div>
|
</td>
|
<td width="8%">
|
<button class="btn btn-primary pl-addrecommend" type="button" v-on:click="addRecommend(item)" style="height: 100px;width: 160px;">添加推荐</button>
|
</td>
|
<td width="8%">
|
<div class="resource" style="font-size: 12px;">
|
<div v-for="resource in item.resourceList ">{{resource}}</div>
|
</div>
|
</td>
|
<td width="12%">
|
<div style="font-size:12px;">
|
创建:{{item.createTime}}<br> 更新:{{item.updatetime}}
|
</div>
|
</td>
|
<td width="8%" style="font-size:12px;">
|
<div>
|
{{item.tag}}
|
</div>
|
</td>
|
<td width="8%" style="font-size:12px;">
|
<div>
|
{{item.area}}
|
</div>
|
</td>
|
<td width="7%" style="font-size: 12px;">
|
<div class="bianhao videoid ">{{item.id}}</div>
|
</td>
|
<td width="4%">
|
<div class="xuanze">
|
<label> <input type="checkbox" value="#" class="video-show" v-bind:checked="item.show"
|
v-on:click="changeShow($event,item.id)">
|
</label>
|
</div>
|
</td>
|
|
<td width="7%">
|
<div class="anniu">
|
<img src="image/dustbin.png" class="delete" v-on:click="deleteItem(index,item.id)">
|
</div>
|
</td>
|
<td width="7%">
|
<div class="anniu">
|
<a key="370" target="_blank" class="edit" v-bind:href="'edit-lmneirong-video.html?id='+item.id"><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" v-on:click="deleteItems">批量删除</button>
|
<button class="btn btn-primary pl-addrecommend" type="button" v-on:click="addToRecommends">添加推荐</button>
|
<button class="btn btn-primary pl-addspecial" type="button" v-on:click="addToSpecials">添加到合辑</button>
|
<button class="btn btn-primary pl-addtop" type="button" v-on:click="addToTops">添加到榜首</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" style="display: flex;align-items: center;justify-content: flex-end;">
|
|
<div class="tz" style="margin: 0">
|
<input class="form-control" type="text" placeholder="页数">
|
</div>
|
|
<div class="tzan" style="margin: 0">
|
<button type="button" class="btn btn-primary">跳转</button>
|
</div>
|
|
<div>
|
记录数量:<span class="page-totalcount"></span>
|
</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>
|
<th>栏目ID</th>
|
<th>栏目名称</th>
|
<th>选择</th>
|
</thead>
|
<tbody>
|
<tr>
|
<td>12</td>
|
<td>热门推荐</td>
|
<td><input type="checkbox"/></td>
|
<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>
|
</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="dialog-chooselink" style="display: none;">
|
<select name="select" class="form-control addType">
|
|
</select>
|
</div>
|
<script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
|
<script src="js/nav.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src="js/page.js"></script>
|
<script src="js/common.js"></script>
|
<script src="js/vue.min.js"></script>
|
<script src="layer/layer.js"></script>
|
<script>
|
$(function () {
|
|
|
//获取栏目列表
|
$.post('api/home/gethometypelist', {}, function (data) {
|
if (data.code == 0) {
|
var item = $("#hometype table tbody tr").eq(0);
|
$("#hometype table tbody").empty();
|
var homeTypeList = data.data;
|
var rows = homeTypeList.length % 2 == 0 ? homeTypeList.length / 2 : parseInt(homeTypeList.length / 2) + 1;
|
for (var i = 0; i < rows; i++) {
|
$("#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(homeTypeList[i * 2].id);
|
newItem.find("td").eq(1).html(homeTypeList[i * 2].name);
|
newItem.find("td").eq(2).find("input[type='checkbox']").eq(0).val(homeTypeList[i * 2].id);
|
if (homeTypeList.length > i * 2 + 1) {
|
newItem.find("td").eq(3).html(homeTypeList[i * 2 + 1].id);
|
newItem.find("td").eq(4).html(homeTypeList[i * 2 + 1].name);
|
newItem.find("td").eq(5).find("input[type='checkbox']").eq(0).val(homeTypeList[i * 2 + 1].id);
|
} else {
|
newItem.find("td").eq(3).empty();
|
newItem.find("td").eq(4).empty();
|
newItem.find("td").eq(5).empty();
|
}
|
newItem.css("cursor", "pointer");
|
|
//设置颜色
|
if (i % 2 == 0) {
|
newItem.find("td").css("background", "#EEEEEE");
|
}
|
|
newItem.find("td").click(function () {
|
//查询当前tr的本个/下一个checkbox
|
console.log($(this).find("input[type='checkbox']"));
|
if ($(this).find("input[type='checkbox']").length > 0) {
|
if ($(this).find("input[type='checkbox']").is(":checked")) {
|
//取消选中
|
$(this).find("input[type='checkbox']").prop('checked', false);
|
} else {
|
//选中
|
$(this).find("input[type='checkbox']").prop('checked', true);
|
}
|
} else {
|
//查询下一个
|
var $this = $(this);
|
for (var i = 0; i < 3; i++) {
|
var checkb = $this.next().find("input[type='checkbox']");
|
if (checkb.length > 0) {
|
if (checkb.is(":checked")) {
|
//取消选中
|
checkb.prop('checked', false);
|
} else {
|
//选中
|
checkb.prop('checked', true);
|
|
}
|
break;
|
} else {
|
$this = $this.next();
|
}
|
}
|
}
|
return false;
|
});
|
|
newItem.find("input[type='checkbox']").bind("click", function (event) {
|
var $this = $(this);
|
var checked = $this.is(":checked");
|
console.log('checkbox:' + checked)
|
setTimeout(function () {
|
if (checked) {
|
//选中
|
$this.prop('checked', true);
|
console.log("设置选中")
|
} else {
|
//取消选中
|
$this.prop('checked', false);
|
console.log("取消选中")
|
}
|
});
|
|
|
return false;
|
});
|
|
|
}
|
}
|
|
}, 'json');
|
|
//获取专辑列表
|
$.post('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');
|
|
});
|
</script>
|
|
<script>
|
$(function () {
|
var htmlSrc = "<tr>" + $(".zhuti .table tbody tr").eq(0).html() + "</tr>";
|
|
function getCheckedItems() {
|
var ids = "";
|
for (var i = 0; i < $(".check-item").length; i++) {
|
|
if ($(".check-item").eq(i).is(':checked')) {
|
ids += app.videos[i].id + ",";
|
}
|
}
|
if (ids.length > 0)
|
ids = ids.substr(0, ids.length - 1);
|
return ids;
|
}
|
|
|
var app = new Vue({
|
el: "#neirong",
|
data: {
|
videos: []
|
},
|
methods: {
|
addRecommend: function (video) {
|
//直接添加到推荐
|
var key = video.id;
|
$("#hometype .videoids").val(key);
|
//清空显示
|
// $("#hometype").find("input[type=checkbox]").each(function () {
|
// this.checked = false;
|
// });
|
|
$("#hometype").modal("show");
|
|
// 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");
|
// });
|
},
|
|
changeShow: function (event, id) {
|
var el = event.currentTarget;
|
var show = $(el).is(":checked") ? "1" : "0";
|
$.post('api/video/changevideoshow', {
|
'id': id,
|
'show': show
|
}, function (data) {
|
layer.msg(data.msg);
|
layer.close(index);
|
}, 'json');
|
},
|
|
deleteItem: function (index1, id) {
|
alert(index1);
|
var index = layer.confirm('是否删除该条目?', {
|
btn: ['是', '否'] //按钮
|
}, function () {
|
$.post('api/video/deletevideo', {
|
'id': id
|
}, function (data) {
|
layer.msg(data.msg);
|
layer.close(index);
|
if (data.code == 0) {
|
app.videos.splice(index1, 1);
|
}
|
}, 'json');
|
}, function () {
|
|
});
|
},
|
|
getVideoList: function (page) {
|
var index = layer.load(1, {
|
shade: false
|
})
|
var resourceIds = new Array();
|
if ("0" != $(".search-div .resourceIds").val()) {
|
resourceIds.push($(".search-div .resourceIds").val());
|
}
|
$.post('api/video/videolist', {
|
"page": page,
|
"videotype": $(".search-div .videotypes select:last").val(),
|
"fromtype": $(".search-div .select-fromtype").val(),
|
"type": $(".search-div .type").val(),
|
"contenttype": $(".contenttype").val(),
|
"freeType": $(".freeType").val(),
|
"area": $(".area").val(),
|
"key": $("#kw").val(),
|
"resourceIds": JSON.stringify(resourceIds)
|
}, function (data) {
|
layer.close(index);
|
if (data.code != 0)
|
return;
|
|
fillPage(data.data.pageEntity, function (pageIndex) {
|
app.getVideoList(pageIndex);
|
});
|
app.videos = data.data.data;
|
|
|
//填充数据
|
$(".page-totalcount").html(data.data.pageEntity.totalCount);
|
}, 'json');
|
|
},
|
|
|
addToRecommends: function () {
|
var ids = getCheckedItems();
|
if (ids.length < 1)
|
layer.msg("未选择视频");
|
else {
|
$("#hometype .videoids").val(ids);
|
$("#hometype").modal("show");
|
}
|
},
|
|
addToSpecials: function () {
|
var ids = getCheckedItems();
|
if (ids.length < 1)
|
layer.msg("未选择视频");
|
else {
|
$("#special .videoids").val(ids);
|
$("#special").modal("show");
|
}
|
},
|
addToTops: function () {
|
layer.open({
|
type: 1,
|
title: '分类选择',
|
shadeClose: true,
|
btn: ['确定', '取消'],
|
shade: 0.8,
|
area: ['400px', '300px'],
|
yes: function (index) {
|
var ids = getCheckedItems();
|
if (ids.length < 1)
|
layer.msg("未选择视频");
|
var type = $("#dialog-chooselink .addType option:selected").val();
|
addTop(ids, type);
|
layer.close(index);
|
$(".check-item").prop("checked", false);
|
},
|
btn2: function (index) {
|
layer.close(index);
|
},
|
content: $("#dialog-chooselink")
|
});
|
},
|
|
|
deleteItems: function () {
|
var ids = getCheckedItems();
|
if (ids.length < 1) {
|
layer.msg("请选择视频");
|
return;
|
}
|
|
$.post('api/video/deletevideo', {
|
'id': ids
|
}, function (data) {
|
layer.msg(data.msg);
|
if (data.code == 0) {
|
$deleteElement.parent().parent().parent().remove();
|
}
|
}, 'json');
|
|
}
|
|
|
}
|
|
|
});
|
|
|
$(".search-div .search-button").click(function () {
|
app.getVideoList(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 td").length; i++) {
|
if ($("#hometype .table td input[type=checkbox]").eq(i).is(':checked')) {
|
ids += $("#hometype .table 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);
|
|
$.post('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');
|
});
|
|
});
|
|
function addTop(arr, tid) {
|
console.log("选中的视频ID:",arr);
|
$.ajax({
|
type: "post",
|
url: "api/top/addTop",
|
data: {"vids": arr, "tid": tid},
|
traditional: true,
|
dataType: "json",
|
success: function (data) {
|
if (data.code == 0) {
|
layer.alert("添加成功");
|
} else {
|
layer.alert("添加失败");
|
}
|
},
|
error: function () {
|
layer.alert("添加失败");
|
}
|
});
|
}
|
</script>
|
</body>
|
|
</html>
|