<%@page import="com.yeshi.buwan.domain.VideoResource"%>
|
<%@page import="com.yeshi.buwan.domain.VideoUrl"%>
|
<%@page import="com.yeshi.buwan.domain.VideoDetailInfo"%>
|
<%@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" %>
|
<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>首页banner</title>
|
<link rel="stylesheet" href="/BuWan/css/base.css" type="text/css" />
|
<script type="text/javascript" src="/BuWan/js/jquery.min.js"></script>
|
<script type="text/javascript" src="/BuWan/js/jquery.js"></script>
|
<%
|
List<VideoDetailInfo> list = (List<VideoDetailInfo>) request
|
.getAttribute("videoDetailList");
|
List<VideoResource> resourceList = (List<VideoResource>) request
|
.getAttribute("resourceList");
|
String videoId=(String)request.getAttribute("videoId");
|
System.out.println("VideoId:"+videoId);
|
%>
|
|
<script type="text/javascript">
|
//jquery代码段
|
|
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 deleteDetail(detailid,view)
|
{
|
|
if(detailid>0)
|
{
|
if(confirm("确定要删除该剧集吗?")==true)
|
{
|
$.ajax({
|
url : "/BuWan/VideoServlet?type=deleteDetail&id="
|
+ detailid,
|
cache : false,
|
success : function(data) {
|
view.remove();
|
alert("删除成功");
|
}
|
});
|
}
|
}
|
else
|
{
|
alert("没有id删除");
|
view.remove();
|
}
|
}
|
|
$(function() {
|
$(".deleteurl").click(function() {
|
$(this).parent().parent().remove();
|
});
|
|
$(".deletedetail").click(function() {
|
deleteDetail($(this).attr("detailid"),$(this).parent().parent());
|
});
|
|
$("#addDetail").click(function(){
|
var htmlStr="<div class='detail' style='border: solid;border-width: 1px;border-color:gray; width: 500px;margin-top: 20px;'>"+
|
|
"<form action='updateVideoDetail.action?id=0&videoId=<%=videoId%>'><div class='row'>"
|
|
+"<span class='texttitle'>名称:<input type='text' class='text' name='name' > </span> <br />"
|
+"</div><div class='row'><span class='texttitle'>小标题:<input type='text' class='text' name='tag' > </span> <br />"
|
+"</div><div class='row'>"
|
|
+"<span class='texttitle'>简介:<input type='text' class='text' name='introduction'></span> <br />"
|
+"</div><div class='row'>"
|
|
+"<span class='texttitle'>备注:<input type='text' class='text' name='beizhu'> </span> <br />"
|
+"</div><div class='videourl' style='margin-left: 100px;'>"
|
|
+"<input type='button' value='添加链接' class='submit_blue addurl' style='margin-left: 100px;margin-top: 20px;margin-bottom: 20px;'>"
|
|
+"</div><input type='submit' id='updateDetail' value='保存修改' class='submit_blue' style='margin-left: 100px;margin-top: 20px;margin-bottom: 20px;'>"
|
+"<input type='hidden' value='"+<%=videoId%>+"' name='videoId'> <input type='hidden' value='0' name='id'> "
|
|
+"<input type='button' id='deleteDetail' value='删除' detailid='0' class='submit_blue deletedetail' style='margin-left: 100px;margin-top: 20px;margin-bottom: 20px;'>"
|
+"</form>"
|
+"</div>";
|
$("#addDetail").before(htmlStr);
|
$(".deleteurl").unbind();
|
$(".addurl").unbind();
|
$(".deletedetail").unbind();
|
$(".deleteurl").click(function() {
|
$(this).parent().parent().remove();
|
});
|
|
$(".deletedetail").click(function() {
|
deleteDetail($(this).attr("detailid"),$(this).parent().parent());
|
});
|
bindAddUrl();
|
|
});
|
|
|
|
});
|
</script>
|
|
|
<script type="text/javascript">
|
|
function bindAddUrl()
|
{
|
$(".addurl").click(function() {
|
var htmlStr="<div style=\"border-color: #BBBBBB;border-width: 1px;border-style: solid;margin-top: 20px;margin-right: 20px;\">"+
|
"<div class=\"row\">"+"<span class=\"texttitle\">链接:<input type=\"text\" class=\"text\" name=\"urls\" > </span>"+
|
"</div><div class=\"row\"><span class=\"texttitle\">来源:<select name=\"resources\" >";
|
<%for (VideoResource vr : resourceList) {%>
|
htmlStr+="<option value="
|
+ <%=vr.getId()%> + ">" + '<%=vr.getName()%>' + "</option>";
|
<%}%>
|
htmlStr += "</select> </span> <br />";
|
|
htmlStr += "</div><div class=\"row\"><span class=\"texttitle\">是否有效:<input type=\"checkbox\" class=\"text\"";
|
htmlStr+= " checked='checked'";
|
htmlStr+=" name=\"invalids\">";
|
|
htmlStr += "</span> <br /></div><div><input type=\"button\" value=\"删除链接\" class=\"submit_blue deleteurl\" style=\"margin-left: 100px;margin-top: 20px;margin-bottom: 20px;\"></div></div>";
|
$(this).before(htmlStr);
|
|
$(".deleteurl").unbind();
|
$(".deleteurl").click(function() {
|
$(this).parent().parent().remove();
|
});
|
|
});
|
|
//计算高度
|
var main = $(window.parent.document).find("#content");
|
var thisheight = $(document).height() + 30;
|
main.height(thisheight);
|
}
|
|
$(function() {
|
|
bindAddUrl();
|
|
});
|
</script>
|
</head>
|
<!-- 详情页面 -->
|
<body>
|
<div style="margin-left: 200px;padding: 50px;" id="detail">
|
<%
|
for (int i = 0; i < list.size(); i++) {
|
%>
|
|
<div class="detail"
|
style="border: solid;border-width: 1px;border-color:gray; width: 500px;margin-top: 20px;">
|
|
<form action="updateVideoDetail.action">
|
<div class="row">
|
|
<span class="texttitle">名称:<input type="text" class="text"
|
name="name" value="<%=list.get(i).getName()%>"> </span> <br />
|
</div>
|
<div class="row">
|
|
<span class="texttitle">小标题:<input type="text" class="text"
|
name="tag" value="<%=list.get(i).getTag()%>"> </span> <br />
|
</div>
|
<div class="row">
|
|
<span class="texttitle">简介:<input type="text" class="text"
|
name="introduction" value="<%=list.get(i).getIntroduction()%>">
|
</span> <br />
|
</div>
|
<div class="row">
|
|
<span class="texttitle">备注:<input type="text" class="text"
|
name="beizhu" value="<%=list.get(i).getBeizhu()%>"> </span> <br />
|
</div>
|
|
<div class="videourl" style="margin-left: 100px;">
|
<%
|
for (VideoUrl videoUrl : list.get(i).getUrls()) {
|
%>
|
|
<div
|
style="border-color: #BBBBBB;border-width: 1px;border-style: solid;margin-top: 20px;margin-right: 20px;">
|
<div class="row">
|
|
<span class="texttitle">链接:<input type="text" class="text"
|
name="urls" value="<%=videoUrl.getUrl()%>"> </span>
|
</div>
|
|
<div class="row">
|
<span class="texttitle">来源:<select name="resources">
|
<%
|
for (VideoResource vr : resourceList) {
|
if (vr.getId().equalsIgnoreCase(
|
videoUrl.getResource().getId())) {
|
out.print("<option selected='selected' value="
|
+ vr.getId() + ">" + vr.getName()
|
+ "</option>");
|
} else {
|
out.print("<option value=" + vr.getId() + ">"
|
+ vr.getName() + "</option>");
|
}
|
|
}
|
%>
|
</select> </span> <br />
|
|
</div>
|
<div class="row">
|
<span class="texttitle">是否有效:<input type="checkbox"
|
class="text"
|
<%=StringUtil.isNullOrEmpty(videoUrl.getInvalid())
|
|| videoUrl.getInvalid().equalsIgnoreCase("1") ? ""
|
: "checked='checked'"%>
|
name="invalids"> </span> <br />
|
</div>
|
|
<div>
|
<input type="button" value="删除链接" class="submit_blue deleteurl"
|
style="margin-left: 100px;margin-top: 20px;margin-bottom: 20px;">
|
</div>
|
</div>
|
<%
|
}
|
%>
|
<input type="button" value="添加链接" class="submit_blue addurl"
|
style="margin-left: 100px;margin-top: 20px;margin-bottom: 20px;">
|
|
</div>
|
<input type="hidden" name="videoId" value="<%=videoId%>">
|
<input type="hidden" name="id" value="<%=list.get(i).getId()%>">
|
|
<input type="submit" id="updateDetail" value="保存修改"
|
class="submit_blue"
|
style="margin-left: 100px;margin-top: 20px;margin-bottom: 20px;">
|
|
<input type="button" id="deleteDetail" detailid="<%=list.get(i).getId() %>" value="删除"
|
class="submit_blue deletedetail"
|
style="margin-left: 100px;margin-top: 20px;margin-bottom: 20px;">
|
</form>
|
</div>
|
<%
|
}
|
%>
|
|
<input type="button" id="addDetail" value="添加集数" class="submit_blue"
|
style="margin-left: 100px;">
|
</div>
|
|
<script type="text/javascript" src="/BuWan/js/countheight.js">
|
|
</script>
|
</body>
|
</html>
|