Examination_system/Examination_system-1/.svn/pristine/2c/2cee8678ca5fae0d21e0513c4af...

140 lines
4.1 KiB
Plaintext

function getVideo(id){
$.ajax({
url:"../../dataservice?serviceobj=UIvio&action=getAllVideo",
data:{"id":id},
type: "post",
dataType: "json",
success:function(jsonDate){
var obj = JSON.stringify(jsonDate);
obj = JSON.parse(obj);
for(var key in obj) { //第一层循环取到各个list
var List = obj[key];
var str ="";
for(var student in List) { //第二层循环取list中的对象
alert(123);
str+='<div class="col-sm-6 col-md-3 wow fadeInLet">'
+'<div class="team_thumb">'
+'<img src="/EduCationTrain/upload/videos/image/'+List[student].url+'.jpg" onclick="paluVido('+List[student].id+');" class="img-responsive"/> alt="team"'
+'<div class="team_description">'
+'<p>名称:'+List[student].name+'</p>'
+'<p>上传时间:'+List[student].startTime+'</p>'
+'<p>视频类型:'+List[student].type+'</p>'
+'<p>下载次数:'+List[student].dowloadMum+'</p>';
if(List[student].isDownLoad=="1"){
str+='<a href="/EduCationTrain/upload/videos/'+List[student].url+'.'+List[student].fristFormat+'" onclick="downLoadNum('+List[student].id+');">下载</a>';
}else{
str+='<a>不予下载</a>';
}
str+= '</div>'
+'</div>'
+'</div>';
}
$("#videosdiv").html("");
$("#videosdiv").append(str);
if(id==10){
$("#names").text("技术视频");
}
if(id==20){
$("#names").text("安全视频");
}
if(id==30){
$("#names").text("质量视频");
}
if(id==40){
$("#names").text("技能视频");
}
}
},
error:function(){
alert("失败");
}
});
}
function paluVido(id){ //播放
window.open("../UIDeuVideo/playVideo.jsp?id="+id);
}
function download(id){//下载
}
function allvideo(id){
window.location.href="../UIDeuVideo/AllVideo.jsp?id="+id;
}
function downLoadNum(id){//下载次数
$.ajax({
url:"../../dataservice?serviceobj=UIvio&action=downLoadNum&id="+id,
data:{"id":id},
type:"post",
dataType:"json",
success:function(result){
},
error:function(result){
alert("执行失败");
}
});
}
function getAll5Video(id){
$.ajax({
url:"../../dataservice?serviceobj=UIvio&action=getAllVideo",
data:{"id":id},
type: "post",
dataType: "json",
success:function(jsonDate){
alert(456);
var obj = JSON.stringify(jsonDate);
obj = JSON.parse(obj);
for(var key in obj) { //第一层循环取到各个list
var List = obj[key];
var str ="";
for(var student in List) { //第二层循环取list中的对象
str+=' <div class="col-sm-6 col-md-3 wow fadeInLet">'
+' <div class="team_thumb">'
+' <img src="/EduCationTrain/upload/videos/image/'+List[student].url+'.jpg" onclick="paluVido('+List[student].id+');" class="img-responsive"/> alt="team"'
+' <div class="team_description">'
+' <p>名称:'+List[student].name+'</p>'
+' <p>上传时间:'+List[student].startTime+'</p>'
+' <p>视频类型:'+List[student].type+'</p>'
+' <p>下载次数:'+List[student].dowloadMum+'</p>';
if(List[student].isDownLoad=="1"){
str+=' <a href="/EduCationTrain/upload/videos/'+List[student].url+'.'+List[student].fristFormat+'" onclick="downLoadNum('+List[student].id+');">下载</a>';
}else{
str+=' <a>不予下载</a>';
}
str+= ' </div>'
+' </div>'
+' </div>';
}
/*if(id!=0){
str+='<div style="float: right;">'
+'<a onclick="allvideo('+id*10+')">更多>></a>'
+'</div>';
}*/
if("0"==id){ //最新视频
$("#newVideo").html("");
$("#newVideo").append(str);
}
if("1"==id){ //技术视频
$("#technologyVideo").html("");
$("#technologyVideo").append(str);
}
if("2"==id){//安全视频
$("#safetyVideo").html("");
$("#safetyVideo").append(str);
}
if("3"==id){//质量视频
$("#qualityVideo").html("");
$("#qualityVideo").append(str);
}
}
},
error:function(){
alert("失败");
}
});
}