<%@ Page Language="C#" MasterPageFile="../Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<Mvcmode.E_pingviewlist>" %>
<%@ Import Namespace="Mvcmode"%>
<%@ Import Namespace="Mvcbll"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
<title><%=ViewData["Title"]%></title>
<meta name="Keywords" content="<%=ViewData["Keywords"] %>">
<meta name="Description" content="<%=ViewData["Description"] %>">
<link href="<%=ViewData["webd"]%>Content/themes/red/css/reset.css" rel="stylesheet" type="text/css">
<link href="<%=ViewData["webd"]%>Content/themes/red/css/all.css" rel="stylesheet" type="text/css">
<link href="<%=ViewData["webd"]%>Content/themes/red/css/comment.css" rel="stylesheet" type="text/css">
<!--[if lt IE 9]> 
<script src="<%=ViewData["webd"]%>Comja/html5.js"></script> 
<![endif]-->
<script type="text/javascript" src="<%=ViewData["webd"]%>Comja/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="<%=ViewData["webd"]%>Comja/pub.js"></script>
<script type="text/javascript" src="<%=ViewData["webd"]%>Comja/common.js" async></script>
<script type="text/javascript" src="<%=ViewData["webd"]%>Comja/addreply.js" async></script>
<%if (1 == 0)
  { %>
<link href="../../../Content/themes/red/css/reset.css" rel="stylesheet" type="text/css">
<link href="../../../Content/themes/red/css/all.css" rel="stylesheet" type="text/css">
<link href="../../../Content/themes/red/css/comment.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../../../Comja/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../../Comja/pub.js"></script>
<script type="text/javascript" src="../../../Comja/common.js" async></script>
<script type="text/javascript" src="../../../Comja/addreply.js" async></script>
<%} %>
<script type="text/javascript">
    $(document).ready(function() {

    });
    var replyurl="<%=ViewData["webd"]%>comment/addreplysave";
     function onclickreply()
    {
	    if ($("#resign1").val() == "") {
                alert('署名不能为空！');
                return false;
            }
            if ($("#recontent1").val() == "") {
                alert('回复内容不能为空！');
                return false;
            }
            if ($("#recontent1").val().length <1) {
                alert('回复内容太少！');
                return false;
            }
            replysave(replyurl);
    }
    function UpGood(pingid,plgood) {
        var urlget="<%=ViewData["webd"]%>jquery/plgood?tl=" + Math.random();
        $.ajax({
            type: "GET",
            url: urlget,
            dataType: "html",
            data: { "id": "" + pingid + "" }, /*传输的参数*/
            success: function (html) {
               alert("谢谢你的参与!");
               plgood=plgood+1;
               $("#plgood_"+pingid).attr("href","javascript:;");
               $("#plgood_"+pingid+" span").html(plgood);
            }, error: function (html) {             
            }
        });
    }
	function closewin()
	{
        var pingid=$("#re_pingid").val();
		if ($("#hui_"+pingid).hasClass("frpl"))
            $("#hui_"+pingid).removeClass("frpl");
		if ($("#opt_"+pingid).hasClass("optbottom"))
			$("#opt_"+pingid).removeClass("optbottom");
         /*huan ran rehtml*/
        $("#re_pingid").val("0");
        var rehtml= $('#recon_'+pingid).html();
        $('#rehtml').html(rehtml);
		$('#recon_'+pingid).html("");
        $("#hui_"+pingid).attr("href","javascript:Huifu("+pingid+");");
        rehtml="";
	}
    
    function Huifu(pingid) {     
        // move rehtml
        var rehtml=$('#rehtml').html();	
        if (rehtml.length>10)
        { 
            $('#rehtml').html("");       
            $('#recon_'+pingid).html(rehtml);
		
            $("#re_pingid").val(pingid);
		    if (!$("#hui_"+pingid).hasClass("frpl"))
                $("#hui_"+pingid).addClass("frpl");
            $("#hui_"+pingid).attr("href","javascript:;");
		    if (!$("#opt_"+pingid).hasClass("optbottom"))
			    $("#opt_"+pingid).addClass("optbottom");   
        }     
	    rehtml="";
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%
ViewData["adsrc"] = Fun.Webdirectory + "Content/themes/red/images/53bk.jpg";
ViewData["adtype"] = "0";
ViewData["ishome"] = "1";
%>
<div class="w982">
<%Html.RenderPartial("~/themes/red/userinc/Topsub.ascx");%>
<div class="main  clearfix ">
<h2 class="plh2">评论：<%=ViewData["linktitle"]%></h2>
<div class="pagecomment clearfix">
<div class="pltitle">
   <a href="#comto" class="wantpl"><span>我要评论</span></a>  
   <div class="blue">（已有<span class="num"><%=ViewData["total"]%></span>条评论）</div>
   <div class="more"><%=ViewData["pagemsg"]%></div>
</div>
<div class="newt">最新评论</div>
<div class="box">       
    <%
      if (Model.E_pingTotal > 0)
        {
           foreach (var item in Model.E_pingItems)
            { %>
            <dl>
              <dt><cite><strong><%=item.Plsign %></strong></cite><span><%=item.Addtime%></span></dt>
              <dd>
                <div class="ctxt">
                  <%Response.Write(Fun.Textout(item.Pldetail));
                    Mvcbll.E_pingbll pl = new Mvcbll.E_pingbll();
                    pl.showreply(item.E_pingLists);
               /*
                    Response.Write("<div class=\"replyshow\">");
                    Response.Write("<div class=\"re_title\"><cite><strong>" + item2.Plsign + "回复</strong></cite><span>" + item2.Addtime + "</span></div>");
                    Response.Write("<div class=\"re_con\">" + item2.Pldetail + "</div>");
                    Response.Write("</div>");    */                    
                    %>
                 </div>
                <div class="opt" id="opt_<%=item.Id%>">
                  <div class="optbar"><a href="javascript:Huifu(<%=item.Id%>);" id="hui_<%=item.Id%>">回复</a><a style="cursor:pointer;" href="javascript:UpGood(<%=item.Id%>,<%=item.Plgood%>);" id="plgood_<%=item.Id%>">顶[<span><%=item.Plgood%></span>]</a></div>
                </div>     
                <div id="recon_<%=item.Id%>"><span></span></div>          
                <%--这里显示回复内容--%>
              </dd>
            </dl>
         <%}
       }
       else
       {
           Response.Write("<div class=\"nocom\">暂时无评论!</div>");
       }%>     

</div>

<div class="plbottom">
  <div class="more"><%=ViewData["pagemsg"]%></div>
</div>

<div class="addforlist">
<%Html.RenderAction("AddCommentforlist", "Comment", new { qiid = ViewData["qiid"], editionid = ViewData["editionid"], newsid = ViewData["newsid"] }); %>
</div>

</div>

<div class="clear"><span></span></div>
</div><!--main结束-->   

<div class="rehtml" id="rehtml">
    <div class="plreply clearfix" style="position:relative" id="plreply1">
        <div class="close"><img id="reclose" onclick="closewin();" src="<%=ViewData["webd"]%>Content/themes/red/images/close.gif" width="14" height="14" alt="关闭" /></div>
        <div class="resign" >署名：<input  type="text" value="" name="resign1" id="resign1"  /></div>        
        <div class="recontent">
        <textarea name="recontent1" id="recontent1" cols="45" rows="6"></textarea>
        <input type="hidden" name="re_qiid" value="<%=ViewData["qiid"]%>" />
        <input type="hidden" name="re_editionid" value="<%=ViewData["editionid"]%>" />
        <input type="hidden" name="re_newsid" value="<%=ViewData["newsid"]%>" />
        <input type="hidden" name="re_pingid" id="re_pingid" value="0" />
        </div>
        <div class="resubmit"><a href="javascript:;" onclick="onclickreply();"  id="replysubmit" class="fabu">马上发表</a></div> 
   </div>
</div><!--main-->
</div>
<%Html.RenderPartial("~/themes/red/userinc/Foot.ascx");%>
</asp:Content>