js,jsp

<!-- 文件名:vod_VideoInfo_Action.jsp -->
<!-- 版  权:Copyright 2005-2007 Huawei Tech. Co. Ltd. All Rights Reserved. -->
<!-- 描  述:EPG首页 -->
<!-- 修改人: 汪光文 -->
<!-- 修改时间:2009-6-8 -->
<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.huawei.iptvmw.epg.bean.MetaData"%>
<%@page import="com.huawei.iptvmw.epg.bean.info.ChannelInfoRecord"%>
<%@page import="com.huawei.iptvmw.epg.bean.info.TypeInfoRecord"%>
<%@ page import="com.huawei.iptvmw.epg.bean.ServiceHelp" %>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.HashSet"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>

<%@include file="config/config_VOD.jsp" %>        
<%@include file="vod_VideoInfo_Data.jsp" %>

<html  xmlns:v>
  <head>
    <title>VODPage page</title>
<style>
body
{
 background-color: #69c0db;
 font-size:12;
}
v/:*{behavior:url(#default#VML)}
</style>
<script type="text/javascript">

var pageCount = 10; //每页显示的最多集数
var pageStart = 0; //默认第一页显示的开始位置
var tpListCols = 5;    //每行显示电视剧的数量
var startPage = pageStart/pageCount;  //当前页的起点位置
var tpListLength = 0 ;    //显示的总数
if(null != subVodIdList)
{
 tpListLength =  subVodIdList.length;
}
var totalPage = Math.ceil(tpListLength/pageCount); //一共显示的页数
var presentNum = 0;    //当前页实际显示数量
var tpListRows = Math.ceil(presentNum/tpListCols);   //实际的行数
var LastRowActual = presentNum%tpListCols;    //最后一行实际的列数
var url="";    //播放地址
var index=-1;  //电视剧集数下标

function init()
{
 
 showDetailInfo();
 showFuncLink();
 if(1 == isSitcom)
 {
  showSitCome(1);
  getDirectionImg();
  document.getElementById("funcLink").style.display = 'none';
  document.getElementById("ccc").style.display='block';
 }else
 {
  document.getElementById("funcLink").style.display = 'block';
  document.getElementById("ccc").style.display='none';
 }
 if(flag>=0)
 {
  showBGDiv();
  if(flag==0)
  {
   shareFavorite("收藏成功!");
  }else if(flag==1)
  {
   showDialogue("收藏失败!");
  }else if(flag==2)
  {
   shareFavorite("已经收藏!");
  }else if(flag==3)
  {
   showDialogue("共享成功!");
  }else if(flag==4)
  {
   showDialogue("共享失败!");
  }
 }
 }
function clickSitcom(index)
{
 document.getElementById('page').style.display = "none";
 document.getElementById("sitcom").style.display='none';
 document.getElementById("funcLink").style.display='block';
 document.getElementById("ccc").style.display='none';
 showDetailInfo(index);
}
function showDetailInfo(index)
{
 var str="<img src='"+posterPath+"' style='position:absolute;top:0px;left:20px;width:140px;height:110px' οnclick='' title='"+vodNameInfo+"'>";
 str+="<table style='position:absolute;top:0px;left:170px;font-size:14;'>";
 if(index==undefined)
 {
  str+="<tr><td>影视 : "+vodNameInfo+"</td></tr>";
 }else
 {
  str+="<tr><td>影视 : "+vodNameInfo+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;第"+(index+1)+"集</td></tr>";
 }
 str +="<tr><td>价格 : "+vodPrice+"</td></tr>";
 str += "<tr><td>付费后24小时观看</td></tr>";
 str += "<tr><td>类型 : "+vodType+"</td></tr>";
 str += "<tr><td><label style='width:100px;overflow:hidden;text-overflow:ellipsis;word-break:keep-all;white-space:nowrap;' title='"+actor+"'>主演 : "+actor+"</label></td></tr>";
 str += "<tr><td>时长 : "+elapseTime+"分钟</td></tr></table>"; 
 str+="<table style='position:absolute;top:140px;left:40px;font-size:14;'><tr><td>剧情介绍 : </td></tr>";
 str+="<tr><td style='overflow:hidden;text-overflow:ellipsis; word-break:break-all;white-space:nowrap;font-size:12px;font-weight:10px;'>"+introduce+"</td></tr></table>";
 document.getElementById("detail").innerHTML = str;
}
function showFuncLink()
{
 var str="";
 str+="<table width='210px' height='20px'><tr>";
 str += "<td><img style='height:20px;width:49px;cursor:hand;' src='"+vodPic[8]+"' οnclick=playFilm()></td>";
 str += "<td><img style='height:20px;width:49px;cursor:hand;' src='"+vodPic[9]+"' οnclick='playSeg()'></td>";
 str += "<td><img style='height:20px;width:49px;cursor:hand;' src='"+vodPic[10]+"' οnclick='addFavorite(0)'></td>";
 str += "<td><img style='height:20px;width:49px;cursor:hand;' src='images/category/bt_iptvStow.png' οnclick='showaddAppraise()'></td>";
 str += "<td ><img style='height:20px;width:75px;cursor:hand;' src='"+bt_FriRec+"' οnclick='showFriRec()'></td>";
 if(0==isSitcom)
 {
     //不是电视剧时
  str += "<td><img style='height:20px;width:49px;cursor:hand;' src='"+ bt_back+"' οnclick='goBack()'></td>";
 }else
 {
     //电视剧时
  str += "<td><img style='height:20px;width:49px;cursor:hand;' src='"+ bt_back+"' οnclick='back()'></td>";
 }
 str += "</tr></table>";
 document.getElementById("funcLink").innerHTML = str;
 correctPNG();
}

// 好评 和 差评vodId
function addAppraise()
{
 var rad = document.getElementsByName("good");
 
 var ifgood = 0;
 
 for(var i=0; i<rad.length; i++)
 {
    if(rad[i].checked)
    {
  ifgood = rad[i].value;
    }
 }
 var count = 1;
 doexTest(ifgood,count);
 closeDialogue();
}    

 

var xmlHttp; //声明XMLHttpRequest对象
 
//实例化该对象
function createXMLHttpRequest()
{
   if(window.ActiveXObject)
   {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
   }
   else
   if(window.XMLHttpRequest)
   {
    xmlHttp = new XMLHttpRequest();
   }
}
    
//向服务器端发送请求
function doexTest(ifgood,count)
{
    createXMLHttpRequest();
    var url = "addAppraise.jsp?vodId="+vodId+"&ifgood="+ifgood+"&count="+count;
    xmlHttp.open("post",url,true);
    xmlHttp.onreadystatechange = new Function("callback()");
    xmlHttp.send(null);
}
     
//接受返回值
function callback()

    if(xmlHttp.readyState == 4)
    {
         if(xmlHttp.status == 200)
         {
     var mes = xmlHttp.ResponseText;
  var result = mes.split(" ");
  if(result[result.length-1] == 0 || "0".equals(result[result.length-1]) )
  {
   showDialogue("评论成功!");
  }
  else
  {
   showDialogue("评论失败!");
  }
     
         }
    }
}
     
function showaddAppraise()
{
 var str="";
 str+="<v:RoundRect style='width:250px;height:100px;'  strokecolor='#1A6B92' strokeweight='2px'>";
 str+="<v:TextBox><table style='width:100%;height:100%;text-align:justify;font-size:12;margin:5;letter-spacing:1;'>";
 str+="<tr><td align=center><strong>";
 str+="<input type='radio' name='good' checked value='0' /><img style='cursor:hand;' src=images/category/add_08.gif οnclick='addAppraise()' title='好评加一个'> 好评 &nbsp;&nbsp;";
 str+="&nbsp;&nbsp;<input type='radio' value='1' name='good'/><img style='cursor:hand;' src=images/category/add_11.gif  οnclick='addAppraise()' title='差评加一个'> 差评";
 str+="</strong></td></tr>";
 str+="<tr><td align='right'><img id='imgConfirm' src='"+bt_confirm+"' style='cursor:hand' οnclick='addAppraise()'></td></tr>";
 str+="</table></v:TextBox></v:RoundRect>";
 document.getElementById('prompt').innerHTML=str;
 document.getElementById('prompt').style.display='block';
 document.getElementById('imgConfirm').focus();
}


function goBack()
{
 if(""!=picPath&&"null"!=picPath)
 {
  window.parent.document.location.href = returnPage;
 }else
 {
  window.document.location.href = returnPage;
 }
}
function back()
{
 document.getElementById('funcLink').style.display = "none";
 document.getElementById('sitcom').style.display = "block";
 document.getElementById('page').style.display = "block";
 document.getElementById('ccc').style.display = "block";
}
function showFriRec()
{
 document.location.href = "sh_FriRecGive_Action2.jsp?vodId="+vodId+"&contentType="+contentType;
}
     
function playSeg()
{
 if(null == segMediaUrl || ""==segMediaUrl)
 {
  showDialogue("暂无片花!");
  showBGDiv();
 }else
 {
  url=segMediaUrl;
  confirm(true);
 }
}

function playFilm()
{
 if(index <0)
 {
  url=mediaUrl;
  if(vodPrice == 0.0)
  {
   confirm(true);
  }else
  {
   showConfirm();
   showBGDiv();
  }
 }else
 {
  url = subVodCodeMap.subMediUrl[index];
  if(vodPrice == 0.0)
  {
   confirm(true);
  }else
  {
   showConfirm();
   showBGDiv();
  }
 }
}

function showSitCome(index)
{
 startPage = index-1;
 pageStart = startPage*pageCount;
 presentNum = tpListLength - pageStart;
 if(presentNum > pageCount)
 {
  presentNum = pageCount;
 }
 var k = presentNum%tpListCols;  //余数即如果不够显示剩下的数目,tpListCols是每行的个数,
 var n = Math.ceil(presentNum/tpListCols); //行数
 var list ="分集点播 :";
 list +="<table width='320px' height='23px'>";
 for(var i=0 ; i<n; i++)
 {
  list += "<tr>";
  for(var j=0;j<tpListCols;j++)
  {
   var m = i*tpListCols+j;
   if(k!=0&&i==n-1&&j>=k)
   {
    list+="<td></td>";
   }else
   {
    list += "<td onclick = 'index="+(m+pageStart)+";clickSitcom("+(m+pageStart)+");' style='cursor:hand;font-size:12px' width='61px' height='23px' align='center' background="+vodPic[23]+">";
    list += "第"+(m+pageStart+1)+"集";
    list += "</td>";
   }
  }
  list+="</tr>";
 }
 list+="</table>";
 document.getElementById("sitcom").innerHTML = list;
}

//以下代码实现分页
//获取上一页,下一页 图标.
function getDirectionImg()
{
 if(totalPage >1)
 {
  document.getElementById("direction1").innerHTML = "<table><tr><td><img src='images/search/bt_firstPage.png' οnclick='prePage()' style='cursor:hand;width:20px;height:20px'></td><td  style='cursor:hand;height:10px;width:40px;font-size:12px' οnclick='prePage()'>上一页</td></tr></table>";
  document.getElementById("direction2").innerHTML = "<table><tr><td  style='cursor:hand;height:10px;width:40px;font-size:12px' οnclick='nextPage()'>下一页</td><td><img src='images/search/bt_endPage.png' οnclick='nextPage()' style='cursor:hand;width:20px;height:20px'></td></tr></table>";
  document.getElementById("direction1").style.display = "none";
  document.getElementById("direction2").style.display = "block";
 }
}

function prePage()
{
 startPage--;
 if(startPage<totalPage-1)
 {
  document.getElementById("direction2").style.display = "block";
 }
 if(startPage<=0)
 {
  startPage=0;
  document.getElementById("direction1").style.display = "none";
 }
 showSitCome(startPage+1);
}
function nextPage()
{
 startPage++;
 if(startPage>0)
 {
  document.getElementById("direction1").style.display = "block";
 }
 if(startPage >= totalPage-1)
 {
    startPage = totalPage-1;
    document.getElementById("direction2").style.display = "none";
 }
 showSitCome(startPage+1);
}

function addFavorite(state)
{
 document.location.href="vod_ProgrameView.jsp?vodId="+vodId+"&picPath="+picPath+"&state="+state;
}
    
function showConfirm()
{
 var str="";
 str+="<v:RoundRect style='width:320;height:120px;'  strokecolor='#1A6B92' strokeweight='2px'>";
 str+="<v:TextBox><table style='text-align:justify;font-size: 12;margin:5; letter-spacing: 1;'>";
 str+="<tr><td colspan='2'><strong> 收费提示</strong></td></tr>";
 str+="<tr><td colspan='2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您选择了付费观看";
 if(index<0)
 {
  str+="电影《"+vodNameInfo+"》";
 }else
 {
  str+="电视剧《"+vodNameInfo+"》第"+(index+1)+"集";
 }
 str+=",价格为"+vodPrice+"元。费用将计入您本月的点播账单。</td></tr>";
 str+="<tr><td><img id='imgConfirm' src='"+bt_confirm+"' style='cursor:hand' οnclick='confirm(true)'></td><td align='right'><img id='imgCancel' src='"+bt_cancel+"' style='cursor:hand' οnclick='closeDialogue()'></td></tr>";
 str+="</table></v:TextBox></v:RoundRect>";
 document.getElementById('prompt').innerHTML=str;
 document.getElementById('prompt').style.display='block';
 document.getElementById('imgConfirm').focus();
}

function shareFavorite(dialogue)
{
 var str="";
 str+="<v:RoundRect style='width:200px;height:80px;'  strokecolor='#1A6B92' strokeweight='2px'>";
 str+="<v:TextBox><table style='text-align:justify;font-size:12;margin:5;letter-spacing:1;'>";
 str+="<tr><td colspan='2'><strong>&nbsp;&nbsp;&nbsp;&nbsp;"+dialogue+"是否共享?</strong></td></tr>";
 str+="<tr><td><img id='imgConfirm' src='"+bt_confirm+"' style='cursor:hand' οnclick='confirm(false)'></td>";
 str+="<td align='right'><img id='imgCancel' src='"+bt_cancel+"' style='cursor:hand' οnclick='closeDialogue()'></td></tr>";
 str+="</table></v:TextBox></v:RoundRect>";
 document.getElementById('prompt').innerHTML=str;
 document.getElementById('prompt').style.display='block';
 document.getElementById('imgConfirm').focus();
}
function showDialogue(dialogue)
{
 var str="";
 str+="<v:RoundRect style='width:200px;height:80px;'  strokecolor='#1A6B92' strokeweight='2px'>";
 str+="<v:TextBox><table style='width:100%;height:100%;text-align:justify;font-size:12;margin:5;letter-spacing:1;'>";
 str+="<tr><td><strong>";
 str+=dialogue;
 str+="</strong></td></tr>";
 str+="<tr><td align='right'><img id='imgConfirm' src='"+bt_confirm+"' style='cursor:hand' οnclick='closeDialogue()'></td></tr>";
 str+="</table></v:TextBox></v:RoundRect>";
 document.getElementById('prompt').innerHTML=str;
 document.getElementById('prompt').style.display='block';
 document.getElementById('imgConfirm').focus();
}
//显示大div盖住其他层
function showBGDiv()
{
 var bgObj=document.createElement("div");
 bgObj.setAttribute('id','bgDiv');
 bgObj.style.position="absolute";
 bgObj.style.top="0";
 bgObj.style.left="0";
 bgObj.style.background="#fff";
 bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=1,opacity=3,finishOpacity=75)";
 bgObj.style.width="110%";
 bgObj.style.height="100%";
 bgObj.style.zIndex = "100";
 document.body.appendChild(bgObj);
}

function confirm(flag)
{
 document.getElementById('prompt').style.display='none';
 var bgObj=document.getElementById('bgDiv');
 if(null!=bgObj)
 {
  document.body.removeChild(bgObj);
 }
 if(flag)
 {
  top.mediaPlay.document.location.href= "mediaPlay.jsp?mediaUrl="+url+"&vodId="+vodId;
 }else
 {
  addFavorite(1) 
 }
}

function closeDialogue()
{
 document.getElementById('prompt').style.display='none';
 var bgObj=document.getElementById('bgDiv');
 if(null!=bgObj)
 {
  document.body.removeChild(bgObj);
 } 
}

//过滤图片毛边
function correctPNG()
{
 for(var i=0; i<document.images.length; i++)
 {
  var img = document.images[i];
  var imgName = img.src.toUpperCase();
  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
  {
   var imgID = (img.id) ? " id='" + img.id + "' " : "";
   var imgClass = (img.className) ? " class='" + img.className + "' " : "";
   var imgTitle = (img.title) ? " title='" + img.title + "' " : "title='" + img.alt + "' ";
   if(img.getAttributeNode("onClick").value!=null)
   var imgEvent =" οnclick='"+img.getAttributeNode("onClick").value+"'";
   var imgStyle = " display:inline-block;" + img.style.cssText;
   if (img.align == "left") imgStyle = "float:left;" + imgStyle;
   if (img.align == "right") imgStyle = "float:right;" + imgStyle;
   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
   var strNewHTML = "<span " + imgID + imgClass + imgTitle + imgEvent
   + " style=/"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
   + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
   + "(src=/'" + img.src + "/', sizingMethod='scale');/"></span>";
   img.outerHTML = strNewHTML;
   i = i-1;
  }
 }
}
</script>
</head>
<body onLoad="init();" >
<div id="title" style="position:absolute; left:20px; top:10px;font-size:14px;font-weight: bolder;">
点播节目信息
</div>
<div id='detail' style='position: absolute;top:35px;left:0px;'></div>
<div id='sitcom' style='position: absolute;top:280px;left:30px;'></div>
<div id='funcLink' style='position: absolute;top:330px;left:30px;'></div>
<div id='page' style='position: absolute; bottom: 40px;left:30px;'>
 <div id="direction1" style="position: absolute; left:40px;width:70;"></div>
 <div id="direction2" style="position: absolute; left:140px;width:70;"></div>
 <div id='ccc' style="position:absolute;top:5;left:250px;width:70;cursor:hand;" οnclick='goBack()'>返回</div>
</div>
<div id='prompt' style="position:absolute;top:150px;left:50px;border-color: blue;z-index: 101;display:none;"></div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值