<%@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_add.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=1",
|
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>
|
<body>
|
<div class="div_bj">
|
<div class="div_ban">视频添加(视频信息填写)</div>
|
<div class="div_rdtg"></div>
|
<form action="addVideo.action">
|
<div>
|
<div>
|
<div class="div_002">
|
<div class="text_tj1">视频名称:</div>
|
<div>
|
<span><input type="text" class="wbk" name="name" id="name" /><input
|
type="button" value="获取网络影片信息" onclick="getVideoInfoFromNet()"
|
class="but_hq" id="search" /> </span>
|
</div>
|
</div>
|
|
<div class="div_004">
|
<div class="text_spf">视频封面:</div>
|
<div>
|
<input name="picture" type="text" id="picture" class="wbk">
|
</div>
|
</div>
|
|
<div class="div_004">
|
<input type="hidden" name="videoType" id="videoType">
|
<div class="text_003">视频类型:</div>
|
<div id="vt"></div>
|
</div>
|
|
<div class="div_002">
|
<div class="text_003">时长:</div>
|
<div>
|
<input type="text" name="duration" id="duration" class="wbk" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<div class="text_003">主要演员:</div>
|
<div>
|
<input type="text" name="mainActor" id="mainactor" class="wbk" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<span class="text_003">排序值:</span>
|
<div>
|
<input type="text" name="orderby" class="wbk" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<span class="text_003">显示标签:</span>
|
<div>
|
<input type="text" name="tag" class="wbk" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<span class="text_003">是否显示:</span>
|
<div>
|
<input type="checkbox" name="show" checked="checkded" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<div class="text_003">上映时间:</div>
|
<div>
|
<span> 年:<input type="text" class="text"
|
style="width:80px; " name="year" id="year" /> 月:<input
|
type="text" class="text" id="month" style="width:80px; "
|
name="month" /> 日:<input type="text" class="text"
|
style="width:80px; " name="day" id="day" /> </span>
|
</div>
|
</div>
|
|
|
<div class="div_002">
|
<div class="text_003">视频评分:</div>
|
<div>
|
<input type="text" class="text_pf01" name="score" id="score" />
|
</div>
|
</div>
|
|
<div class="div_002">
|
<div class="text_003">地区:</div>
|
<div>
|
<input type="text" class="text_pf01" name="area" id="area" />
|
</div>
|
</div>
|
|
|
<div class="div_007">
|
<div class="text_003">简介:</div>
|
<div>
|
<textarea class="text_t5" name="introduction" id="introduction"></textarea>
|
</div>
|
</div>
|
<br />
|
<div class="div_005">
|
<div class="text_003">备注:</div>
|
<div>
|
<textarea class="text_t5" name="beizhu" id="beizhu"></textarea>
|
</div>
|
</div>
|
|
<div class="div_008" style="margin-top: 150px;">
|
<div>
|
<span> <input type="submit" class="sub_3" id="next"
|
value="下一步" /> <input type="reset" class="sub_3" value="取消"
|
style="margin-left: 50px;" /> </span>
|
</div>
|
|
</div>
|
</div>
|
</div>
|
</form>
|
</div>
|
</body>
|
<script type="text/javascript">
|
loadVideoType();
|
</script>
|
<script type="text/javascript" src="/BuWan/js/countheight.js">
|
|
</script>
|
</html>
|