<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<html>
|
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
|
<title>宣传视频</title>
|
<link rel="stylesheet" href="style.css" type="text/css">
|
</head>
|
|
<body>
|
<div class="main-top">
|
<div><label>视频名称:</label><input type="text" class="gjz" /></div>
|
<input type="button" value="查询" class="cx" />
|
<input type="button" value="清空" class="qk" />
|
</div>
|
<div class="wetland-table" id="wetlandTp">
|
<table cellspacing="0">
|
<thead>
|
<tr>
|
<th width="4%">序号</th>
|
<th width="40%">视频名称</th>
|
<th width="16%">视频大小</th>
|
<th width="20%">上传时间</th>
|
<th width="20%">操作</th>
|
</tr>
|
</thead>
|
<tbody>
|
<!--用于动态加载相关内容-->
|
</tbody>
|
</table>
|
<div class="bottomDiv">
|
<span style="margin-left:10px">共检索到<span id="amongData">0</span>条数据,共有<span id="amongNum">0</span>页。</span>
|
<span class="changePageAll"><span id="firstPage">首页</span><span id="lastPage">上一页</span><span id="currentNum">0</span><span id="nextPage">下一页</span><span id="finalPage">尾页</span></span>
|
</div>
|
</body>
|
<script type="text/javascript" src="js/jquery.min.js"></script>
|
<script src="jcyj/js/dataShow.js"></script>
|
<script type="text/javascript">
|
$(function() {
|
var IP_PATH = getNativePath();
|
//var IP_PATH = window.location.protocol+"//"+window.location.host;
|
var currentPage = 1; //当前页面
|
var among; //数据总数目
|
var totalPage;
|
var search = '';
|
getAjaxInfo(currentPage, search);
|
//获取接口中的数据
|
//点击上一页
|
$("#lastPage").click(function() {
|
if(currentPage == 1) {
|
$(this).css("background", '#E8E8E8')
|
} else {
|
$(this).css("background", '#fff')
|
currentPage--;
|
$("#currentNum").text(currentPage);
|
getAjaxInfo(currentPage, search);
|
}
|
});
|
|
//点击下一页
|
$("#nextPage").click(function() {
|
if(currentPage == totalPage) {
|
$(this).css("background", '#E8E8E8')
|
} else {
|
$(this).css("background", '#fff')
|
currentPage++;
|
$("#currentNum").text(currentPage);
|
getAjaxInfo(currentPage, search);
|
}
|
});
|
//点击查询
|
$(".cx").click(function() {
|
currentPage = 1;
|
search = $(".gjz").val();
|
getAjaxInfo(currentPage, search);
|
});
|
//点击清空
|
$(".qk").click(function() {
|
$(".gjz").val('');
|
search = '';
|
currentPage = 1;
|
getAjaxInfo(currentPage, search);
|
});
|
//点击播放按钮获取视频资源播放视频
|
$(document).on('click', '.play', function() {
|
var id = $(this).attr('id');
|
window.open(IP_PATH+"/common/downloadUploadAttachment.do?id=" + id); //湿地宣教--视频下载接口++++++++++++++++++++++++++++++++++++++++++++++++++++
|
});
|
//点击首页跳转
|
$("#firstPage").click(function(){
|
currentPage = 1,
|
getAjaxInfo(currentPage, search);
|
});
|
//点击尾页跳转
|
$("#finalPage").click(function(){
|
currentPage = totalPage,
|
getAjaxInfo(currentPage, search);
|
});
|
//同步获取视频资源
|
var detailVedio = new Array();
|
function getDetailVedio(id) {
|
$.ajax({
|
type: "post",
|
url: IP_PATH+"/common/listUploadAttachment.do", //湿地宣教--视频大小信息查询接口++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
async: false,
|
data: {
|
"Q_uaTable_S_EQ": 'SYS_VIDEO',
|
"Q_uaTableid_S_EQ": id
|
},
|
dataType: "json",
|
success: function(result) {
|
detailVedio.push(result.data);
|
},
|
error: function() {
|
alert("请求错误!!");
|
}
|
});
|
|
}
|
function getAjaxInfo(currentPage, search) {
|
var num = 10;
|
var start = (currentPage - 1) * num;
|
$.ajax({
|
type: "post",
|
url: IP_PATH+"/video/findVideoFilter.do", //湿地宣教--视频列表详细信息查询接口++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
async: true,
|
data: {
|
"limit": num,
|
"start": start,
|
"Q_videoname_S_LK": search
|
},
|
dataType: "json",
|
success: function(result) {
|
$("tbody").text('');
|
var data = result.data;
|
among = result.total;
|
$("#amongData").text(among);
|
if(among==0){
|
$("tbody").html("<tr><td colspan='5'>暂无数据</td></tr>");
|
return;
|
}
|
if(among % num != 0) {
|
totalPage = parseInt((among / num) + 1);
|
} else {
|
totalPage = among / num;
|
}
|
$("#currentNum").text(currentPage);
|
$("#amongNum").text(totalPage);
|
var a = 1;
|
for(var i = 0; i < data.length; i++) {
|
getDetailVedio(data[i].videoid);
|
var time = data[i].uploadtime;
|
if(time == null || time == '') {
|
time = "未填写";
|
} else {
|
time = time.substring(0, 9);
|
}
|
var inners = "<tr>" +
|
"<td>" + a + "</td>" +
|
"<td>" + data[i].videoname + "</td>" +
|
"<td>" + (parseFloat(detailVedio[i][0].uaFileSize) / 1024).toFixed(2) + "kb</td>" +
|
"<td>" + time + "</td>" +
|
"<td><div class='play' id='" + detailVedio[i][0].uaId + "'></div></td>" +
|
"</tr>";
|
$("tbody").append(inners);
|
a++;
|
}
|
},
|
error: function(e) {
|
alert("请求失败!");
|
$("tbody").html("<tr><td colspan='5'>暂无数据</td></tr>");
|
}
|
|
});
|
}
|
|
});
|
</script>
|
|
</html>
|