<%@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/gongyong.css" type="text/css" />
|
<link rel="stylesheet" href="/BuWan/css/video.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>
|
<script type="text/javascript">
|
//jquery代码段
|
|
function getVideoInfoFromNet() {
|
//搜索的名称
|
var name = document.getElementById("name").value;
|
var search = document.getElementById("search");
|
search.value = "正在搜索...";
|
|
$.ajax({
|
url : "/BuWan/VideoServlet?type=getVideoInfoFromDouBan&name="
|
+ encodeURI(encodeURI(name)),
|
cache : false,
|
success : function(data) {
|
// $(this).addClass("done");
|
search.value = "网络获取影片信息";
|
var jsonData = eval(data);
|
$.each(jsonData, function(index, objVal) { //遍历对象数组,index是数组的索引号,objVal是遍历的一个对象。
|
//val["属性"]可取到对应的属性值。
|
var r = confirm("视频名称:" + objVal["Name"] + "--\n是否添加信息?")
|
if (r == true) {
|
$("#name").val(objVal["Name"]);
|
$("#introduction").val(objVal["Introduction"]);
|
$("#mainactor").val(objVal["MainActor"]);
|
$("#beizhu").val(objVal["Beizhu"]);
|
$("#year").val(objVal["Year"]);
|
$("#month").val(objVal["Month"]);
|
$("#day").val(objVal["Day"]);
|
$("#img").attr("src", objVal["Picture"]);
|
$("#picture").val(objVal["Picture"]);
|
$("#duration").val(objVal["Duration"]);
|
$("#area").val(objVal["Area"]);
|
}
|
});
|
|
}
|
});
|
}
|
|
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'>";
|
|
$
|
.each(
|
eval(item),
|
function(j,
|
item1) {
|
if (item1.Selected == 0) {
|
printR += "<option value="+item1.Id+">"
|
+ item1.Name
|
+ "</option>";
|
} else {
|
printR += "<option selected='selected' 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;
|
}
|
});
|
</script>
|
|
|
</head>
|
<%
|
VideoInfo videoInfo = (VideoInfo) request.getAttribute("videoInfo");
|
%>
|
|
|
|
<body>
|
<div class="div_bj">
|
<div class="div_ban">视频添加(视频信息填写)</div>
|
<div class="div_rdtg"></div>
|
<form action="updateVideo.action">
|
<input type="hidden" name="id" value="<%=videoInfo.getId()%>">
|
<div>
|
<div class="div_cont">
|
<div class="div_002">
|
<div class="text_tj1">视频名称:</div>
|
<div>
|
<span><input type="text" class="wbk" name="name" id="name"
|
value="<%=videoInfo.getName()%>" /><input type="button"
|
id="search" onclick="getVideoInfoFromNet()" value="获取网络影片信息"
|
class="but_hq" /> </span>
|
</div>
|
</div>
|
|
<div class="div_002" style="height:140px;">
|
<div class="text_spf">视频封面:</div>
|
<div>
|
<img id="img"
|
src="<%=StringUtil.getAbsoluteUrl(request, videoInfo.getName())%>"
|
class="img_spf" /><input name="picture" id="picture"
|
type="text" class="text" value="<%=videoInfo.getPicture()%>"
|
style="margin-bottom: 20px;">
|
</div>
|
</div>
|
|
<div class="div_002">
|
<div class="text_003">时长:</div>
|
<div>
|
<input type="text" name="duration" id="duration" class="wbk"
|
value="<%=videoInfo.getDuration()%>" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<div class="text_003">播放次数:</div>
|
<div>
|
<input type="text" name="duration" id="duration" class="wbk"
|
value="<%=videoInfo.getWatchCount()%>" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<div class="text_003">主要演员:</div>
|
<div>
|
<input type="text" name="mainActor" class="wbk" id="mainactor"
|
value="<%=videoInfo.getMainActor()%>" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<span class="text_003">排序值:</span>
|
<div>
|
<input type="text" name="orderby" class="wbk"
|
value="<%=videoInfo.getOrderby()%>" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<span class="text_003">显示标签:</span>
|
<div>
|
<input type="text" name="tag" class="wbk"
|
value="<%=videoInfo.getTag()%>" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<span class="text_003">是否显示:</span>
|
<div>
|
<input type="checkbox" name="show"
|
<%=videoInfo.getShow() != null
|
&& videoInfo.getShow().equalsIgnoreCase("1")
|
? "checked='checkded'"
|
: ""%> />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<div class="text_003">上映时间:</div>
|
<div>
|
<span> 年:<input type="text" class="wbk"
|
value="<%=videoInfo.getYear()%>" style="width:80px; "
|
name="year" id="year" /> 月:<input type="text" class="wbk"
|
id="month" value="<%=videoInfo.getMonth()%>"
|
style="width:80px; " name="month" /> 日:<input type="text"
|
class="wbk" value="<%=videoInfo.getDay()%>" style="width:80px; "
|
name="day" id="day" /> </span>
|
</div>
|
</div>
|
|
|
<div class="div_002">
|
<div class="text_003">视频评分:</div>
|
<div>
|
<input type="text" class="wbk" name="score" id="score"
|
value="<%=videoInfo.getScore()%>" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<div class="text_003">地区:</div>
|
<div>
|
<input type="text" class="wbk" name="area" id="area"
|
value="<%=videoInfo.getArea()%>" />
|
</div>
|
</div>
|
|
|
<div class="div_002" style="height:80px;">
|
<div class="text_001">简介:</div>
|
<div>
|
<div class="bs-docs-example">
|
<textarea rows="5" cols="50" name="beizhu"></textarea>
|
</div>
|
</div>
|
</div>
|
<br />
|
<div class="div_002" style="height:80px;">
|
<div class="text_001">备注:</div>
|
<div>
|
<div class="bs-docs-example">
|
<textarea rows="5" cols="50" name="beizhu"></textarea>
|
</div>
|
</div>
|
</div>
|
<br />
|
<div class="div_002" style="margin-bottom: 50px;">
|
<div>
|
<span> <input type="submit" class="submit_blue" id="next"
|
value="确定" /> <input type="submit" class="submit_blue"
|
value="取消" style="margin-left: 50px;" /> </span>
|
</div>
|
|
</div>
|
</div>
|
</div>
|
</form>
|
|
<script type="text/javascript">
|
loadVideoType();
|
</script>
|
|
|
<script type="text/javascript" src="/BuWan/js/countheight.js">
|
|
</script>
|
</div>
|
</body>
|
</html>
|