<%@page import="com.yeshi.buwan.util.Utils"%>
|
<%@page import="com.yeshi.buwan.domain.special.Special"%>
|
<%@page import="com.yeshi.buwan.domain.VideoIntersection"%>
|
<%@page import="com.yeshi.buwan.domain.HomeType"%>
|
<%@page import="com.yeshi.buwan.util.TimeUtil"%>
|
<%@page import="java.util.concurrent.TimeUnit"%>
|
<%@page import="com.yeshi.buwan.web.tag.PageEntity"%>
|
<%@page import="com.yeshi.buwan.util.StringUtil"%>
|
<%@page import="com.yeshi.buwan.domain.VideoInfo"%>
|
<%@page import="com.yeshi.buwan.domain.SystemInfo"%>
|
<%@ page language="java" import="java.util.*"%>
|
<%@ page contentType="text/html; charset=UTF-8"%>
|
<%@ page pageEncoding="UTF-8"%><%@ taglib prefix="page" uri="/pagelib"%>
|
<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>首页banner</title>
|
<link rel="stylesheet" href="/BuWan/css/gongyong.css" type="text/css" />
|
<link rel="stylesheet" href="/BuWan/css/video_list.css" type="text/css" />
|
<LINK rel=stylesheet href="/BuWan/js/jquery-ui-1.11.4/jquery-ui.css" />
|
<script type="text/javascript" src="/BuWan/js/jquery.min.js"></script>
|
<script type="text/javascript" src="/BuWan/js/check.js"></script>
|
<script type="text/javascript" src="/BuWan/js/jquery.js"></script>
|
<script type="text/javascript"
|
src="/BuWan/js/jquery-ui-1.11.4/jquery-ui.js"></script>
|
<script type="text/javascript">
|
function p_del() {
|
var msg = "您真的确定要删除吗?";
|
if (confirm(msg) == true) {
|
return true;
|
} else {
|
return false;
|
}
|
}
|
|
function getNextVideoTypeList(typeId) {
|
$.ajax({
|
url : "/BuWan/VideoTypeServlet?type=getNextVideoTypeList&id="
|
+ typeId,
|
cache : false,
|
success : function(data) {
|
if (data != null && data != "[]") {
|
$(this).parent().nextAll().remove();
|
var printR = "<select class='select'>";
|
printR += "<option value="+typeId+">--请选择--</option>";
|
$.each(eval(data), function(i, item) {
|
printR += "<option value="+item.Id+">" + item.Name
|
+ "</option>";
|
});
|
printR += "</select>";
|
|
$("#vt").append(printR);
|
$(".select").unbind();
|
$(".select").change(function() {
|
$(this).nextAll().remove();
|
$("#videoType").val($(this).val());
|
if ($(this).val() != $(this).prev().val())
|
getNextVideoTypeList($(this).val());
|
});
|
|
}
|
}
|
});
|
}
|
|
function loadVideoType() {
|
//获取顶级元素
|
//getAllParentType
|
$
|
.ajax({
|
url : "/BuWan/VideoTypeServlet?type=getAllParentType&id="
|
+ $("#videoType").val(),
|
cache : false,
|
success : function(data) {
|
if (data != null && data != "[]") {
|
|
$
|
.each(
|
eval(data),
|
function(i, item) {
|
var printR = "<select class='select'>";
|
printR += "<option selected='selected' value='0' >全部</option>";
|
|
$
|
.each(
|
eval(item),
|
function(j,
|
item1) {
|
|
printR += "<option value="+item1.Id+">"
|
+ item1.Name
|
+ "</option>";
|
|
|
});
|
printR += "</select>";
|
$("#vt").append(printR);
|
});
|
|
$(".select").unbind();
|
$(".select").change(function() {
|
$(this).nextAll().remove();
|
$("#videoType").val($(this).val());
|
if ($(this).val() != $(this).prev().val())
|
getNextVideoTypeList($(this).val());
|
});
|
|
}
|
}
|
});
|
}
|
|
//下一步
|
$("#next").click(function() {
|
if ($("#videType").val() < 1) {
|
alert("请选择视频类型");
|
return false;
|
}
|
});
|
|
function changeShow(id) {
|
var u = "/BuWan/VideoServlet?type=changeVideoShow&id=" + id;
|
$.ajax({
|
url : u,
|
cache : false,
|
success : function(data) {
|
alert("修改成功");
|
}
|
});
|
}
|
</script>
|
<!-- 输入框 -->
|
|
<script type="text/javascript">
|
$(function(){
|
var PosX=0;
|
var PosY=0;
|
var chooseDialog = $("#recommendDialog").dialog(
|
{
|
autoOpen : false,
|
position: [PosX, PosY],
|
modal : true,
|
height : 400,
|
width : 800,
|
buttons : {
|
"提交" : function() {
|
var el =$(".hometype");
|
var len = el.length;
|
var url = "";
|
for ( var i = 0; i < len; i++) {
|
if ((el[i].checked == true)) {
|
url += (el[i].value + ",");
|
}
|
}
|
if (url == null || url == undefined || url == '') {
|
alert("尚未选中任何选项!");
|
} else if (confirm('确定执行该操作吗')) {
|
window.location="addHomeVideo.action?videoIds="+$("#videoids").val()+"&homeTypes="+url;
|
}
|
},
|
"取消" : function() {
|
chooseDialog.dialog("close");
|
}
|
}
|
|
});
|
|
chooseDialog.open=function(){
|
|
};
|
|
var intersectionDialog = $("#intersectionDialog").dialog(
|
{
|
autoOpen : false,
|
position: [PosX, PosY],
|
modal : true,
|
height : 600,
|
width : 1000,
|
buttons : {
|
"提交" : function() {
|
var el =$(".intersection");
|
var len = el.length;
|
var url = "";
|
for ( var i = 0; i < len; i++) {
|
if ((el[i].checked == true)) {
|
url += (el[i].value + ",");
|
}
|
}
|
if (url == null || url == undefined || url == '') {
|
alert("尚未选中任何选项!");
|
} else if (confirm('确定执行该操作吗')) {
|
window.location="addSpecialVideo.action?videoIds="+$("#videoids").val()+"&specialIds="+url;
|
}
|
},
|
"取消" : function() {
|
intersectionDialog.dialog("close");
|
}
|
}
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(".addRecommend").click(function(){
|
$("#videoids").val( $(this).attr("videoid"));
|
chooseDialog.dialog("open");
|
});
|
|
$("#addRecommend").click(function(){
|
$("#videoids").val("");
|
var el =$(".movedata");
|
var len = el.length;
|
var url = "";
|
for ( var i = 0; i < len; i++) {
|
if ((el[i].checked == true)) {
|
url += (el[i].value + ",");
|
}
|
}
|
|
if (url == null || url == undefined || url == '') {
|
alert("尚未选中任何选项!");
|
} else
|
{
|
$("#videoids").val(url);
|
chooseDialog.dialog("open");
|
}
|
});
|
|
|
$("#addIntersectionVideo").click(function(){
|
$("#videoids").val("");
|
var el =$(".movedata");
|
var len = el.length;
|
var url = "";
|
for ( var i = 0; i < len; i++) {
|
if ((el[i].checked == true)) {
|
url += (el[i].value + ",");
|
}
|
}
|
|
if (url == null || url == undefined || url == '') {
|
alert("尚未选中任何选项!");
|
} else
|
{
|
$("#videoids").val(url);
|
intersectionDialog.dialog("open");
|
}
|
});
|
|
});
|
function submitForm()
|
{
|
$("#searchform").submit();
|
|
|
}
|
|
|
</script>
|
|
|
|
|
</head>
|
<%
|
List<VideoInfo> list = (List<VideoInfo>) request.getAttribute("videoList");
|
List<HomeType> homeTypeList = (List<HomeType>) request.getAttribute("homeTypeList");
|
List<Special> specialList = (List<Special>) request.getAttribute("specialList");
|
|
PageEntity pageEntity = (PageEntity) request.getAttribute("pageEntity");
|
if (pageEntity == null)//设置默认值
|
{
|
pageEntity = new PageEntity();
|
pageEntity.setPageIndex(1);
|
pageEntity.setPageSize(20);
|
pageEntity.setParams(null);
|
pageEntity.setTotalCount(100);
|
}
|
%>
|
|
<body>
|
<div id="recommendDialog"
|
style="display: none; position: static; margin: auto;">
|
<table>
|
<%
|
int row = homeTypeList.size() % 4 == 0 ? homeTypeList.size() / 4 : homeTypeList.size() / 4 + 1;
|
|
for (int i = 0; i < row; i++) {
|
out.print("<tr>");
|
for (int j = 0; j < 4; j++) {
|
if (i * 4 + j < homeTypeList.size()) {
|
%>
|
<td><input type="checkbox"
|
value=<%=homeTypeList.get(i * 4 + j).getId()%> class="td_ck hometype">
|
<%=homeTypeList.get(i * 4 + j).getName()%></td>
|
<%
|
}
|
}
|
out.print("</tr>");
|
}
|
%>
|
</table>
|
|
</div>
|
|
<div id="intersectionDialog" style="display: none;">
|
<table>
|
<%
|
row = specialList.size() % 3 == 0 ? specialList.size() / 3 : specialList.size() / 3 + 1;
|
|
for (int i = 0; i < row; i++) {
|
out.print("<tr>");
|
for (int j = 0; j < 3; j++) {
|
if (i * 3 + j < specialList.size()) {
|
%>
|
<td><input type="checkbox"
|
value=<%=specialList.get(i * 3 + j).getId()%> class="td_ck intersection">
|
<%=specialList.get(i * 3 + j).getName()%></td>
|
<%
|
}
|
}
|
out.print("</tr>");
|
}
|
%>
|
</table>
|
|
</div>
|
|
|
<div class="div_bj">
|
<input type="hidden" id="videoids" value="">
|
<div class="div_rdtg"></div>
|
|
<div class="qxsc">
|
<div class="qq">
|
<div class="ck">
|
<input type="checkbox"
|
onclick="if(this.checked==true) { checkAll('movedata'); } else { clearAll('movedata'); }"
|
class="td_ck" />
|
</div>
|
<div class="qx">全选</div>
|
<div class="sc_1">
|
<input type="button" value="删除"
|
onclick="controlCheck('deleteListVideo.action?type=deleteCheckVideo&page=1&typeId=2')"
|
class="sc" />
|
</div>
|
</div>
|
|
<div>
|
<form action="videoList.action" id="searchform">
|
<div>
|
<input type="text" class="img_sous" name="key"
|
value="<%=StringUtil.isNullOrEmpty(pageEntity.getParams().get("key"))
|
? ""
|
: pageEntity.getParams().get("key")%>"
|
style="margin: 0;" />
|
</div>
|
<div style="width: 80px; float: left; margin: 0px;">
|
<img src="/BuWan/img/fadajing.png" width="52" height="44"
|
onclick="submitForm()">
|
|
</div>
|
<div>
|
<div id="vt" style="width: 100px; float: left; margin: 0;"></div>
|
<input type="hidden" type="hidden"
|
value="<%=StringUtil.isNullOrEmpty(pageEntity.getParams().get("videoType"))
|
? ""
|
: pageEntity.getParams().get("videoType")%>"
|
id="videoType" name="videoType">
|
</div>
|
<div style="margin-left: 50px;">
|
类型 <select name="contenttype">
|
<option value="0"
|
<%="0".equalsIgnoreCase(pageEntity.getParams().get("contenttype")) ? "selected='selected'" : ""%>>全部</option>
|
<option value="1"
|
<%="1".equalsIgnoreCase(pageEntity.getParams().get("contenttype")) ? "selected='selected'" : ""%>>正片</option>
|
<option value="2"
|
<%="2".equalsIgnoreCase(pageEntity.getParams().get("contenttype")) ? "selected='selected'" : ""%>>花絮/片花</option>
|
</select>
|
</div>
|
</form>
|
</div>
|
<div style="margin-left: 0px;">
|
<div class="bsous">
|
<a href="/BuWan/admin/videos/video_add.jsp"><input
|
type="button" value="添加视频资源 +" class="but_sous" /> </a>
|
</div>
|
</div>
|
|
|
|
</div>
|
|
<div class="div_cont">
|
<div class="div_cont01">
|
<ul>
|
<li class="xz">选择</li>
|
<li>编号</li>
|
<li class="fm">封面</li>
|
<li class="mc">名称</li>
|
<li class="cj">更新时间</li>
|
|
<li class="xs">是否显示</li>
|
<li>操作</li>
|
<li class="sc0">删除</li>
|
|
<li class="cz">修改</li>
|
</ul>
|
</div>
|
<%
|
for (VideoInfo info : list) {
|
%>
|
<div class="div_tab">
|
<table>
|
<tr>
|
<td><input type="checkbox" id="movedata" name="movedata"
|
class="movedata td_ck" value=<%=info.getId()%> class="td_ck" />
|
</td>
|
<td><%=info.getId()%></td>
|
<td><a
|
href="<%=StringUtil.getAbsoluteUrl(request, Utils.getCoverImage(info))%>"
|
target="_blank"> <img
|
src="<%=StringUtil.getAbsoluteUrl(request, info.getPicture())%>"
|
class="img_fm" />
|
</a></td>
|
<td class="dy"><%=info.getName()%></td>
|
<td><%=StringUtil.isNullOrEmpty(info.getCreatetime()+"")
|
? ""
|
: TimeUtil.getGernalTime(Long.parseLong(info.getCreatetime()+""))%></td>
|
|
<td><input type="checkbox" class="td_ck"
|
<%=StringUtil.isNullOrEmpty(info.getShow()) || info.getShow().equalsIgnoreCase("0")
|
? ""
|
: "checked='checked'"%>
|
onclick="changeShow(<%=info.getId()%>)" /></td>
|
<td>
|
<p class="div_p">
|
<a href="#" class="addRecommend" videoid="<%=info.getId()%>">添加推荐</a>
|
</p>
|
</td>
|
<td><a href="deleteVideo.action?id=<%=info.getId()%>"
|
onclick="return p_del()"><img src="/BuWan/img/lajitong.png" />
|
</a></td>
|
|
<td><a href="getVideo.action?id=<%=info.getId()%>"><img
|
src="/BuWan/img/xiugai.png" /> </a></td>
|
</tr>
|
</table>
|
</div>
|
<%
|
}
|
%>
|
|
<div class="div_bot">
|
<div class="ck_k">
|
<input type="checkbox"
|
onclick="if(this.checked==true) { checkAll('movedata'); } else { clearAll('movedata'); }"
|
class="td_ck" />
|
</div>
|
<div class="qx_1">全选</div>
|
|
|
<div class="sc_1_1">
|
<input type="button" value="添加推荐" class="sc" id="addRecommend"
|
style="width: 80px;" />
|
</div>
|
<div class="sc_1_1">
|
<input type="button" value="添加到合集" class="sc"
|
id="addIntersectionVideo" style="width: 80px;" />
|
</div>
|
</div>
|
|
<div class="div_ym">
|
<page:page preimage="/BuWan/img/page_pre.png" url="videoList.action"
|
totalLines="<%=pageEntity.getTotalCount()%>" pagesize="20"
|
nextimage="/BuWan/img/page_next.png"
|
pagebg="/BuWan/img/page_page.png"
|
inputbg="i/BuWan/mg/page_page.png"
|
pageindex="<%=pageEntity.getPageIndex()%>"
|
gobg="/BuWan/img/page_page.img"
|
params="<%=pageEntity.getParams()%>" />
|
</div>
|
</div>
|
|
|
</div>
|
|
|
|
</body>
|
|
|
<script type="text/javascript">
|
$(function(){
|
loadVideoType();
|
});
|
|
</script>
|
|
|
<script type="text/javascript" src="/BuWan/js/countheight.js">
|
|
</script>
|
</html>
|