<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShopEval.aspx.cs" Inherits="XpShop.Store.ShopEval" %>
<%@ Import Namespace="System.Data"%>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<!--#include file="../inc/encoding.inc"-->
		<title><%=config.SiteTitle%></title>
		<!--#include file="../inc/storehead.inc"-->
		<link rel="stylesheet" href="<%=webSite %>store/style/skin.css" type="text/css"/>
		<link rel="stylesheet" href="<%=webSite %>store/style/shopeval.css" type="text/css"/>
		<script type="text/javascript">
        $(document).ready(function() {
            var index="<%=Request.QueryString["sort"]== null ? 0:Convert.ToInt32(Request.QueryString["sort"]) %>";
            $('#selectSort').get(0).selectedIndex=index;
            
        	$('.vote_y').click(function(){        	
                var src = window.location.href;
                var isLoginOut="<%=CurrentUser==null %>";
                //没有登录
                if(isLoginOut=="True"){
                    window.location.href="<%=webSite %>"+"login.aspx?ReturnUrl="+src;
                }
                else
                {
                    var seid=$(this).attr('seid');
                    var vote="&vote=1,3,"+seid;
                    window.location.href=src+vote;
                }
            });
            
            $('.vote_n').click(function(){        	
                var src = window.location.href;
                var isLoginOut="<%=CurrentUser==null %>";
                //没有登录
                if(isLoginOut=="True"){
                    window.location.href="<%=webSite %>"+"login.aspx?ReturnUrl="+src;
                }
                else
                {
                    var seid=$(this).attr('seid');
                    var vote="&vote=0,3,"+seid;
                    window.location.href=src+vote;
                }
            });
		})
		var url="ShopEval.aspx?sid=<%=Request.QueryString["sid"]%>&sort="
		
        function GoToByID(id,url)
	    {
    	    var objID=document.getElementById(id);location.href=url+objID.value;
    	}
    	
		</script>
		
		
	</head>
	<body>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
	    <div class="xp-w clear">
	        <form id=form1 runat=server>
	        <%-- 店铺头部开始 --%>	
	        <div class="xp-store-nav" style="background:url(<%=webSite %>/upload/Supplier/<%=supplierDetail.Banner%>);">
	            <ul>
	                <li class="out">
	                    <div class="li-div-l"></div>
	                    <div class="li-div-m"><a href="<%=webSite %>store/default.aspx?sid=<%=supplierDetail.SupplierID %>">首页</a></div>
	                    <div class="li-div-r"></div>
	                </li>
	                <li class="out">
	                    <div class="li-div-l"></div>
	                    <div class="li-div-m"><a href="<%=webSite %>store/AboutStore.aspx?sid=<%=supplierDetail.SupplierID %>">商家简介</a></div>
	                    <div class="li-div-r"></div>
	                </li>
	                <li class="on">
	                    <div class="li-div-l"></div>
	                    <div class="li-div-m"><a href="<%=webSite %>store/ShopEval.aspx?sid=<%=supplierDetail.SupplierID %>">商家评价</a></div>
	                    <div class="li-div-r"></div>
	                </li>
	                <li class="out">
	                    <div class="li-div-l"></div>
	                    <div class="li-div-m"><a href="<%=webSite %>store/Contact.aspx?sid=<%=supplierDetail.SupplierID %>">联系方式</a></div>
	                    <div class="li-div-r"></div>
	                </li>
	                <li class="out">
	                    <div class="li-div-l"></div>
	                    <div class="li-div-m"><a href="<%=webSite %>store/StoreAsk.aspx?sid=<%=supplierDetail.SupplierID %>">最新问答</a></div>
	                    <div class="li-div-r"></div>
	                </li>
	                <li class="out">
	                    <div class="li-div-l"></div>
	                    <div class="li-div-m"><a href="<%=webSite %>store/Protect.aspx?sid=<%=supplierDetail.SupplierID %>">服务保障</a></div>
	                    <div class="li-div-r"></div>
	                </li>
	                <li class="out">
	                    <div class="li-div-l"></div>
	                    <div class="li-div-m"><a href="<%=webSite %>store/StoreActivity.aspx?sid=<%=supplierDetail.SupplierID %>">圣诞活动</a></div>
	                    <div class="li-div-r"></div>
	                </li>
	            </ul>
	        </div>
	        <%-- 店铺头部结束 --%>
	        <%--内容开始--%>
	        <div class="xp-shopeval-content">
	        
	            <div class="xp-shopeval-info">
					<div class="shopeval-img" style="float:left; margin-right:10px;">
					    <div class="img"> 
					        <img src="<%=webSite %>/upload/Supplier/<%=supplierDetail.Logo%>" />
					    </div>
					</div>
					<div class="shopeval-info">
					    <div>商家名称：<a href='default.aspx?sid=<%= supplierDetail.SupplierID%>'><%= supplierDetail.Contacter%></a></div>
					    <div>商品数量：<%= supplierDetail.PdtNum%></div>
					    <div>开店时间：<%= supplierDetail.AddTime%></div>
					    <div>所 在 地：<%=supplierDetail.Address %></div>
				    </div>
				 </div>
                 <div class="xp-shopeval-score">
                    <table class="xp-shopeval-score-tab" cellpadding="1">
                        <tr class="top">
                            <td class="title">总体评价</td>
                            <td><div class="shopevalstar<%=string.Format("{0:f0}",supplierDetail.PingFen)%>"></div></td>
                        </tr>
                        <tr>
                            <td class="title">信息可信度</td>
                            <td>
                                <div class="shopevalstar<%=string.Format("{0:f0}",supplierDetail.Pj1)%>"></div>
                                <div class="xp-shopeval-score-tjicon">
                                    <div class="xp-shopeval-score-tjnum">
                                       <div class="top">评价数量（<%=supplierDetail.Reviews%>条）</div>
                                        <div class="text">
                                            <ul>
                                                <li class="clear">
                                                    <div class="divscore">5分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[0]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[0]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">4分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[1]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[1]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">3分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[2]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[2]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">2分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[3]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[3]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">1分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[4]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[4]["itemcount"] %>)</div>
                                                </li>
                                            </ul>
                                        </div>                                   
                                    </div>
                                    <iframe scrolling="no" frameborder="0"></iframe>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="title">价格水平</td>
                            <td>
                                <div class="shopevalstar<%=string.Format("{0:f0}",supplierDetail.Pj2)%>"></div>
                                <div class="xp-shopeval-score-tjicon">
                                    <div class="xp-shopeval-score-tjnum">
                                       <div class="top">评价数量（<%=supplierDetail.Reviews%>条）</div>
                                        <div class="text">
                                            <ul>
                                                <li class="clear">
                                                    <div class="divscore">5分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[5]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[5]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">4分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[6]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[6]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">3分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[7]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[7]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">2分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[8]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[8]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">1分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[9]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[9]["itemcount"] %>)</div>
                                                </li>
                                            </ul>
                                        </div>                                   
                                    </div>
                                    <iframe scrolling="no" frameborder="0"></iframe>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="title">送货速度</td>
                            <td>
                                <div class="shopevalstar<%=string.Format("{0:f0}",supplierDetail.Pj3)%>"></div>
                                <div class="xp-shopeval-score-tjicon">
                                    <div class="xp-shopeval-score-tjnum">
                                       <div class="top">评价数量（<%=supplierDetail.Reviews%>条）</div>
                                        <div class="text">
                                            <ul>
                                                <li class="clear">
                                                    <div class="divscore">5分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[10]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[10]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">4分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[11]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[11]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">3分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[12]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[12]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">2分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[13]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[13]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">1分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[14]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[14]["itemcount"] %>)</div>
                                                </li>
                                            </ul>
                                        </div>                                   
                                    </div>
                                    <iframe scrolling="no" frameborder="0"></iframe>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="title">客户服务</td>
                            <td>
                                <div class="shopevalstar<%=string.Format("{0:f0}",supplierDetail.Pj4)%>"></div>
                                <div class="xp-shopeval-score-tjicon">
                                    <div class="xp-shopeval-score-tjnum">
                                       <div class="top">评价数量（<%=supplierDetail.Reviews%>条）</div>
                                        <div class="text">
                                            <ul>
                                                <li class="clear">
                                                    <div class="divscore">5分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[15]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[15]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">4分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[16]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[16]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">3分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[17]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[17]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">2分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[18]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[18]["itemcount"] %>)</div>
                                                </li>
                                                <li class="clear">
                                                    <div class="divscore">1分</div>
                                                    <div class="divicon1"><div class="divicon2" style='width:<%=dt.Rows[19]["percents"] %>'></div></div>
                                                    <div class="divnum">(<%=dt.Rows[19]["itemcount"] %>)</div>
                                                </li>
                                            </ul>
                                        </div>                                   
                                    </div>
                                    <iframe scrolling="no" frameborder="0"></iframe>
                                </div>    
                            </td>
                        </tr>
                    </table>
                    <script type="text/javascript">
                        $(document).ready(function(){
                            $(".xp-shopeval-score-tjicon").hover(function(){
                                $(this).find('.xp-shopeval-score-tjnum').show();
                                $(this).find('iframe').show();
                            },function(){
                                $(this).find('.xp-shopeval-score-tjnum').hide();
                                $(this).find('iframe').hide();
                            });
                        });
                    </script>
					<div class="shopeval-tip">小贴士：所有发表评价的顾客都在本店购买过商品。</div>
				 </div>
	        
	        
	            <div class="xp-shopeval-title clear">
	                <div style="height:30px; float:left;"><span>所有评价(<%=supplierDetail.Reviews %>条)</span></div>
                    <div style="float:right; margin-right:60px; display:inline;">
						<asp:Label ID="lblTopPage" runat="server"></asp:Label>
					</div>
    				  
				    <div style="float:right; margin-right:60px; display:none">
	                    排序方式：
	                    <asp:DropDownList  ID="ddlSort" runat=server   >
                            <asp:ListItem Value=0>按评价时间 降序</asp:ListItem>
                            <asp:ListItem Value=1>按整体评价 降序</asp:ListItem>
                            <asp:ListItem Value=2>按有用投票数 降序</asp:ListItem>
	                    </asp:DropDownList>
	                </div>

				    <div style="float:right; margin-right:60px;">
	                    <select id="selectSort" onchange="javascript:{GoToByID('selectSort',url);}">
					        <option value="0">按确认收货时间 降序</option>
					        <option value="1">按整体评价 降序</option>
					        <option value="2">按有用投票数 降序</option>
                        </select>
	                </div>             
	            </div>
	            <div class="xp-shopeval-text">          
	            <asp:Repeater ID=rptShopEval runat=server>
	                <ItemTemplate>
	                    <div class="itemcss clear">
	                        <div style="float:left; width:60%;">
	                            <%--评价开始--%>
	                            <div class="plcontent">
	                                <div style="color:#924c4a;">
	                                   顾客：<%#DataBinder.Eval(Container.DataItem, "MemberName")%> <br />
	                                   确认收货：<%#DataBinder.Eval(Container.DataItem, "ReceiveTime")%>
	                                </div>
	                                <div>
	                                    <div class="xp-shopeval-text-title"><%#DataBinder.Eval(Container.DataItem, "Title")%></div>
	                                    <div><%#DataBinder.Eval(Container.DataItem, "Body")%></div>
	                                </div>
	                            </div>
	                            <%--评价结束--%>
	                            <%--回复开始--%>
	                            <div class="xp-shopeval-reply clear">
	                                <div class="shopeval-icon"></div>
	                                <div class="reply">
	                                    <div class="replytitle">商家回复</div>
                                        <asp:repeater id="rptEvalReply" datasource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("relation") %>' runat="server">
	                                    <ItemTemplate>
    	                                    
                                            <div class="askcontent"><%#DataBinder.Eval(Container.DataItem, "[\"Body\"]")%></div>
	                                        <div class="replytime">回复时间：<%#DataBinder.Eval(Container.DataItem, "[\"ReplyTime\"]")%></div>
	                                    </ItemTemplate>
	                                    </asp:Repeater>
                                    
	                                </div>

	                            </div>
	                            <%--回复结束--%>
	                            <div class="clear" style="height:12px; overflow:hidden;"></div>
	                            <div class="xp-shopeval-usefulness">
	                                有<span style=" color:#91433f; font-family:Arial; font-size:15px;"><%#DataBinder.Eval(Container.DataItem,"YesNum")%></span>人认为此评论有用，您认为呢？
	                                <span class="vote_y " seid=<%#DataBinder.Eval(Container.DataItem,"ShopEvalID")%>>有用</span>
	                                <span class="vote_n " seid=<%#DataBinder.Eval(Container.DataItem,"ShopEvalID")%>>没用</span>
	                                <%--<a href="#" class="vote_n " seid=<%#DataBinder.Eval(Container.DataItem,"ShopEvalID")%>>没用</a>--%>
	                            </div>
	                        </div>
	                        <div style="float:right; width:27%; display:inline; margin-right:20px;">
	                            <div style="margin-top:5px;" class="shopevalstar<%#DataBinder.Eval(Container.DataItem, "pingfen", "{0:f0}")%>"></div>
	                            <div class="shopeval-xsxq"></div>
	                            <div class="shopeval-xsxq-score clear">
	                                <table class="shopeval-xsxq-score-tab" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td class="title">信息可信度</td>
                                            <td><div class="store-review-star<%#DataBinder.Eval(Container.DataItem, "Pj1", "{0:f0}")%>"></div></td>
                                        </tr>
                                        <tr>
                                            <td class="title">价格水平</td>
                                            <td><div class="store-review-star<%#DataBinder.Eval(Container.DataItem, "Pj2", "{0:f0}")%>"></div></td>
                                        </tr>
                                        <tr>
                                            <td class="title">送货速度</td>
                                            <td><div class="store-review-star<%#DataBinder.Eval(Container.DataItem, "Pj3", "{0:f0}")%>"></div></td>
                                        </tr>
                                        <tr>
                                            <td class="title">客户服务</td>
                                            <td><div class="store-review-star<%#DataBinder.Eval(Container.DataItem, "Pj4", "{0:f0}")%>"></div></td>
                                        </tr>
                                    </table>
	                            </div>
	                            
	                        </div>
	                    </div>
	                </ItemTemplate>
	            </asp:Repeater>
                <script type="text/javascript">
                    $(document).ready(function(){
                        $(".shopeval-xsxq").toggle(function(){
                            $(this).addClass("shopeval-xsxq-on");
                            $(this).next().show();
                        },function(){
                            $(this).removeClass("shopeval-xsxq-on");
                            $(this).next().hide();
                        });
                    });
                </script>
	            </div>
                <asp:panel id="plPage" visible="true" runat="server">
			    <!-- 翻页开始-->
	                <div class="xp-shopeval-title clear">
                        <div class="fpage" style="float:right; margin-right:60px;">
                            <asp:Label ID="lbPage"  runat="server"></asp:Label>
                        </div>                                
			        </div>
			    <!-- 翻页结束-->
			    </asp:panel>
				</div>
	        <%--内容结束--%>
		    </form>
		</div>	
	    <uc1:Helper id="Helper1" runat="server"></uc1:Helper>
	    <uc1:Footer id="Footer1" runat="server"></uc1:Footer>
	</body>
</html>