<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>分区Banner设置</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;
|
}
|
|
#container-video {
|
display: block;
|
}
|
|
#container-web {
|
display: none;
|
}
|
|
#container-special {
|
display: none;
|
}
|
|
#dialog-chooselink {
|
padding: 20px;
|
}
|
|
#dialog-chooselink select {
|
width: 100px;
|
}
|
|
#dialog-chooselink label {
|
display: inline;
|
}
|
|
#dialog-chooselink input[type=text] {
|
display: inline;
|
width: 500px;
|
}
|
|
#dialog-chooselink ul {
|
display: block;
|
list-style: none;
|
}
|
|
#dialog-chooselink ul li {
|
display: inline;
|
list-style: none;
|
width: 33%;
|
float: left;
|
}
|
|
#dialog-chooselink input[type=radio] {
|
width: 20px;
|
height: 20px;
|
}
|
|
#dialog-chooselink .search-result {
|
height: 630px;
|
overflow-y: scroll;
|
}
|
</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="#">分区Banner设置</a>
|
</li>
|
</ol>
|
</div>
|
<form class="form-horizontal">
|
<div class="form-group">
|
<label for="input1" class="changdu1 control-label">图片</label>
|
<div class="col-sm-7">
|
<img id="img" src="#" style="width: 234px; height: 125px;"/>
|
<input type="text" id="input1" class="form-control" value="" />
|
</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="input3" class="changdu1 control-label">简要介绍</label>
|
<div class="col-sm-7">
|
<input type="text" class="form-control" id="desc" placeholder="">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input3" class="changdu1 control-label">视频分类</label>
|
<div class="col-sm-7">
|
<select id="classtype">
|
<option style="display: none;"></option>
|
</select>
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input4" class="changdu1 control-label">视频</label>
|
<div class="col-sm-7">
|
<label id="jump-detail"></label>
|
<input type="hidden" id="linkType" />
|
<input type="hidden" id="linkValue" />
|
<input type="text" readonly="true" id="videoSelect"/>
|
<a href="javascript:void(0)" class="btn btn-info" id="choose-link">选择</a>
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label for="input5" class="changdu1 control-label">备注</label>
|
<div class="col-sm-7">
|
<textarea class="form-control" id="beizhu"></textarea>
|
</div>
|
</div>
|
|
<div class="button0">
|
<div class="button">
|
<button type="button" id="save" class="btn btn-primary save">保存</button>
|
</div>
|
<div class="button">
|
<input type="reset" class="btn btn-default" value="重置" />
|
</div>
|
</div>
|
</form>
|
|
</div>
|
<div id="dialog-chooselink" style="display: none;">
|
<div class="row" style="height: 690px;">
|
<div class="col-lg-3 col-md-3" style="display: inline;">
|
<select class="form-control">
|
<option value="1">视频</option>
|
<option value="2" style="display: none;">网页</option>
|
<option value="3" style="display: none;">合集</option>
|
</select>
|
</div>
|
<div class="col-lg-9 col-md-9" style="display: inline;">
|
<!--视频选择 -->
|
<div id="container-video">
|
<div class="search">
|
<input type="text" class="form-control" placeholder="请输入关键字" style="width: 200px;display: inline;" />
|
<button class="btn btn-info">搜索</button>
|
</div>
|
|
<!-- 搜索结果展示区域-->
|
<div class="search-result">
|
<table class="table">
|
<thead>
|
<th>编号</th>
|
<th>名称</th>
|
<th>封面</th>
|
<th>是否显示</th>
|
<th>选择</th>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
<!--网页填写 -->
|
<div id="container-web">
|
<label>网页链接:</label>
|
<input type="text" class="form-control" />
|
</div>
|
<!--合集选择 -->
|
<div id="container-special">
|
<label>合集列表</label>
|
<ul>
|
<li>
|
<div class="checkbox"><label><input type="checkbox" value="46" > 布丸影视大全Web1</label></div>
|
</li>
|
<li>
|
<div class="checkbox"><label><input type="checkbox" value="46" > 布丸影视大全Web2</label></div>
|
</li>
|
|
</ul>
|
|
</div>
|
</div>
|
|
</div>
|
|
<div style="float: right;">
|
<button class="btn btn-info sure">确定</button>
|
<button class="btn btn-default cancel">取消</button>
|
</div>
|
|
</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(){
|
$.post("api/class/getAllFirstClass", { 'pid': 0 }, function(data) {
|
if(data.code == 0) {
|
var alldata = data.data;
|
var selectType = $("#classtype");
|
for(var edata in alldata) {
|
selectType.append("<option value='" + alldata[edata].id + "'>" + alldata[edata].name + "</option>");
|
}
|
}
|
}, 'json');
|
|
var url = window.location.href;
|
var key = "key";
|
var id = getArgsFromHref(url,key);
|
$.post("api/class/getCategoryRecommendVideo", { 'id': id }, function(data) {
|
if(data.code == 0) {
|
var srcPath = data.crv.picture; //图片路径
|
var orderby = data.crv.orderby; //排序
|
var desc = data.crv.desc; //简介
|
var beizhu = data.crv.beizhu; //备注
|
var videoType = data.crv.videoType.id; //视频类型id
|
var vid = data.crv.videoInfo.id; //视频ID
|
var name = data.crv.videoInfo.name; //视频名称
|
$("#img").attr("src",srcPath);
|
$("#img + input").val(srcPath);
|
$("#orderby").val(orderby);
|
$("#desc").val(desc);
|
$("#beizhu").val(beizhu);
|
$("#videoSelect").val(vid+" "+name);
|
$("#videoSelect").attr("key",vid);
|
$("#classtype > option[value='"+videoType+"']").attr("selected","selected");
|
}
|
}, 'json');
|
|
$("#choose-link").click(function() {
|
index = layer.open({
|
type: 1,
|
title: '链接选择',
|
shadeClose: true,
|
shade: 0.8,
|
area: ['1000px', '800px'],
|
content: $("#dialog-chooselink")
|
});
|
});
|
|
//搜索点击
|
$("#container-video .search button").click(function() {
|
var key = $("#container-video .search input").val();
|
var index = layer.load(0, {
|
'shade': false
|
});
|
$.post('/BuWan/admin/new/api/common/searchvideo', {
|
'key': key
|
}, function(data) {
|
layer.close(index);
|
if(data.code == 0) {
|
$(".search-result table tbody").empty();
|
var html = "";
|
data.data.forEach(function(video) {
|
html += "<tr><td>" + video.id;
|
html += "</td><td>" + video.name + "</td><td><img style='width: 80px;' src=" + video.picture + "> </td><td>" + (video.show == 1 ? '显示' : '不显示') + "</td>";
|
html += "<td><input type='radio' name='choose-video' key=" + video.id + " value='"+video.name+"'></td></tr>";
|
});
|
$(".search-result table tbody").html(html);
|
}
|
|
}, 'json');
|
});
|
|
$("#dialog-chooselink .sure").click(function() {
|
var type = $("#dialog-chooselink select").eq(0).val();
|
var value;
|
if(type == 1) {
|
var videoid = $('#dialog-chooselink .search-result input[name="choose-video"]:checked').attr("key");
|
var name = $('#dialog-chooselink .search-result input[name="choose-video"]:checked').val();
|
console.log(videoid);
|
if(videoid == undefined || videoid == null) {
|
layer.msg("请选择视频");
|
return;
|
}
|
value = videoid;
|
$("#videoSelect").val(videoid+" "+name);
|
$("#videoSelect").attr("key",videoid);
|
}
|
|
$("#linkType").val(type);
|
$("#linkValue").val(value);
|
layer.close(index);
|
|
});
|
|
$("#dialog-chooselink .cancel").click(function() {
|
layer.close(index);
|
});
|
|
$("#save").click(function(){
|
var imgPath = $("#img + input").val(); //图片路径
|
var orderby = $("#orderby").val(); //排序值
|
var desc = $("#desc").val(); //简介
|
var beizhu = $("#beizhu").val(); //备注
|
var vid = $("#videoSelect").attr("key"); //所选视频ID
|
var videoType = $("#classtype > option:selected").val(); //视频类型
|
var reg = new RegExp("^[0-9]*$");
|
if(!reg.test(orderby)){
|
layer.msg("排序值只能为正整数!");
|
return;
|
}
|
$.post('api/class/setCategoryRecommendVideo', {
|
'id': id , "beizhu":beizhu , "desc":desc , "orderby":orderby , "picture":imgPath , "videoid":vid ,"videotype":videoType
|
}, function(data) {
|
if(data == "yes") {
|
layer.alert('保存成功!', {
|
icon: 1,
|
skin: 'layer-ext-seaing'
|
})
|
}
|
}, 'text');
|
});
|
|
$("#input1").bind("focusout",function(){
|
$("#img").attr("src",$(this).val());
|
});
|
|
});
|
|
</script>
|
|
<script>
|
|
function getArgsFromHref(sHref, sArgName){
|
var args = sHref.split("?");
|
var retval = "";
|
|
if(args[0] == sHref) /*参数为空*/
|
{
|
return retval; /*无需做任何处理*/
|
}
|
var str = args[1];
|
args = str.split("&");
|
for(var i = 0; i < args.length; i ++)
|
{
|
str = args[i];
|
var arg = str.split("=");
|
if(arg.length <= 1) continue;
|
if(arg[0] == sArgName) retval = arg[1];
|
}
|
return retval;
|
}
|
</script>
|
|
|
|
</body>
|
|
</html>
|