<%@ Page language="c#" Codebehind="List.aspx.cs" AutoEventWireup="false" Inherits="XpShop.WebUI.List" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LoginForm" Src="Modules/LoginForm.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SmallCart" Src="Modules/SmallCart.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNav" Src="Modules/LeftNav.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UserNewlyViewProducts" Src="Modules/UserNewlyViewProducts.ascx" %>
<%@ Register TagPrefix="uc1" TagName="TopSaleProduct" Src="Modules/CatTopSalePdts.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Link" Src="Modules/Link.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><%=categoryname=="" ? "商品列表" : categoryname%>|<%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>inc/getParmByUrl.js" type="text/javascript"></script>
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/inc/custom_list.js" type="text/javascript"></script>
		<script type="text/javascript">
			var baseUrl = "/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>list.aspx?";
            var compareUrl="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Compare.aspx";
            var prePage="<%=GetResourceString("PreviousPage")%>";
			var nextPage="<%=GetResourceString("NextPage")%>";
			var cID = "<%=Request.QueryString["CatID"] == null ? "" : Request.QueryString["CatID"] %>";
			var extend = '<%=config.html %>';
        </script>
		<style>
		#navbar ul li.list{background:url("/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/images/navbar_on.jpg") no-repeat;}
        #navbar ul li.list a:link,#navbar ul li.list a:visited,#navbar ul li.list a:hover{color:#ffffff; font-weight:bold; text-decoration:none;}
		</style>
	</HEAD>
	<body>
		<div id="container">
			<uc1:Header id="Header1" runat="server"></uc1:Header>
			<!--位置导航开始-->
			<div class="path"><%=GetCurrentPosition()%></div>
			<!--位置导航结束-->
			<div id="content">
				<div id="content_left_side">
					<uc1:LeftNav id="LeftNav" runat="server"></uc1:LeftNav>
					<uc1:TopSaleProduct id="TopSaleProduct1" runat="server"></uc1:TopSaleProduct>
					<uc1:UserNewlyViewProducts id="UserNewlyViewProducts" runat="server"></uc1:UserNewlyViewProducts>
					<asp:Literal id="ltrAD" runat="server"></asp:Literal>	
				</div>
				<div id="content_middle_side">
					
				    <!--子类列表开始-->
				    <%--<%if(this.Request.QueryString["BrandID"] == null){ %>
					<div class="mframe">
						<div class="tl"><%=GetResourceString("SubCategoryList")%></div>
						<div class="tr"></div>
						<div class="tm"></div>
						<div class="ml"></div>
						<div class="mr"></div>
						<div class="mm">
					        <%BindSubCatList();%>
					        <asp:DataList id="dlSubCatList" CellPadding="3" CellSpacing="0" RepeatLayout="Table" RepeatDirection="Horizontal"
							    RepeatColumns="5" CssClass="tdbg" Style="MARGIN-LEFT:30px" runat="server">
							    <ItemStyle Width="100px" />
							    <ItemTemplate>
								    <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>List.aspx?CatID=<%# DataBinder.Eval(Container.DataItem,"CategoryID")%><%}else{%>categories/Category_<%# DataBinder.Eval(Container.DataItem,"CategoryID") %>.<%=config.html%><%}%>'>
									    <%#DataBinder.Eval(Container.DataItem,"Name")%>
								    </a>
							    </ItemTemplate>
						    </asp:DataList>
						</div>
					    <div class="bl"></div>
					    <div class="br"></div>
					    <div class="bm"></div>
					</div>
					<%} %>--%>
					<!--子类列表结束-->
					<div class="list_ad">
			            <%if(category.HeadAd != "" && category.HeadAd != null){%>
			                <%=category.HeadAd%>
                        <%}else{ %>
                            <%=XpShop.WebUI.WebUtils.GetAD(46)%> 
                        <%} %>
			        </div>
					<!--商品列表开始-->
					<div class="list_frame">
						<div class="tl"></div>
						<div class="tr"></div>
						<div class="tm">
						    <div class="list_style">
								<ul>
									<li class="display_mode">
										<span><%=GetResourceString("DisplayMode")%></span>
										<% if(Request.QueryString["display"] == "hlist") {%>
										<a title="<%=GetResourceString("HList")%>" href='<%=getUrl(2,"hlist")%>' class="hlist_selected" ><%=GetResourceString("HList")%></a>
										<%}else{%>
										<a title="<%=GetResourceString("HList")%>" href='<%=getUrl(2,"hlist")%>' class="hlist" ><%=GetResourceString("HList")%></a>
										<%}%>
										<% if(Request.QueryString["display"] == "wlist" || Request.QueryString["display"] == null) {%>
										<a title="<%=GetResourceString("WList")%>" href='<%=getUrl(2,"wlist")%>'  class="wlist_selected" ><%=GetResourceString("WList")%></a>
										<%}else{%>
										<a title="<%=GetResourceString("WList")%>" href='<%=getUrl(2,"wlist")%>'  class="wlist" ><%=GetResourceString("WList")%></a>
										<%}%>
										<% if(Request.QueryString["display"] == "piclist") {%>
										<a title="<%=GetResourceString("PList")%>" href='<%=getUrl(2,"piclist")%>'  class="piclist_selected" ><%=GetResourceString("PList")%></a>
										<%}else{%>
										<a title="<%=GetResourceString("PList")%>" href='<%=getUrl(2,"piclist")%>'  class="piclist" ><%=GetResourceString("PList")%></a>
										<%}%>
									</li>
									<li class="sort_mode">
										<span><%=GetResourceString("SortMode")%></span>
                                        <div class="sort-mode-content">
                                            <select id="ddlSort">
                                                <option value="1"><%=GetResourceString("DefaultSort")%></option>
                                                <option value="2"><%=GetResourceString("DateSort")%></option>
                                                <option value="5"><%=GetResourceString("DateUp")%></option>
                                                <option value="3"><%=GetResourceString("PriceUp")%></option>
                                                <option value="4"><%=GetResourceString("PriceDown")%></option>
                                                <option value="6"><%=GetResourceString("SalesDown")%></option>
                                                <option value="7"><%=GetResourceString("SalesUp")%></option>
                                            </select>
                                        </div>
									</li>
									<li class="page_change">
										<span><%=GetResourceString("DoPage")%></span>
                                        <span class="prepage"></span>
										<span class="nextpage"></span>
									</li>
								</ul>
							</div>
						</div>
						<div class="ml"></div>
						<div class="mr"></div>
						<div class="mm">
						    <div class="plist">
								<% if(Request.QueryString["display"] == "hlist") {%>
								<div class="pro_hlist">
									<%BindProductList("dlProducts1",6);%>
									<asp:DataList id="dlProducts1" CellPadding="3" CellSpacing="0" GridLines="None" RepeatColumns="1"
										RepeatDirection="Horizontal" RepeatLayout="Table" Visible="true" Width="100%" runat="server">
										<ItemTemplate>													
											<table cellpadding="3" cellspacing="0" width="100%">
												<tr>
                                                    <td width="20%">
                                                        <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' target="_blank">
                                                            <img width="167" height="252" src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%=config.Path%>upload/<%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>">
                                                        </a>
													</td>
													<td width="60%" align="left" valign="top">
													    <table cellpadding="3" cellspacing="0" border="0">
														    <tr>
															    <td>
															        <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' target=_blank><font color="#d6201c"><b><%#DataBinder.Eval(Container.DataItem,"Name")%></b></font></a>
														        </td>
														    </tr>
														    <tr>
															    <td><a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' target=_blank><%#DataBinder.Eval(Container.DataItem,"ShortDesc")%><!--<%#DataBinder.Eval(Container.DataItem,"ShortDesc").ToString ().Length > 80 ? DataBinder.Eval(Container.DataItem,"ShortDesc").ToString ().Substring ( 0 ,80) + "..." : DataBinder.Eval(Container.DataItem,"ShortDesc")%>--></a></td>
														    </tr>
														    <tr>
														        <td><%=GetResourceString("MarketPrice")%>：<font color=red><s><%=GetCurrency()%><%#DataBinder.Eval(Container.DataItem,"MarketPrice","{0:f}")%></s></font></td>
														    </tr>
														    <tr>
														        <td><% if(XpShop.WebUI.WebUtils.MemberShowPrice()) {%><%=GetResourceString("MemberPrice")%>：<%=GetCurrency()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%><% }%></td>
														    </tr>
														    <tr>
														        <td>
														            <%# XpShop.WebUI.WebUtils.Compare(DataBinder.Eval(Container.DataItem, "ProductID").ToString(), Request.Url.ToString())%>
														        </td>
														    </tr>
													    </table>
													</td>
													<td width="20%" valign="bottom">
													    <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' target=_blank><div style='border:none; height:25px; width:95px; background:url(/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/Images/<%=GetResourceString("ButtonDetails")%>) no-repeat;'></div></a>
													</td>
												</tr>
												<tr>
													<td colspan="3" align="center">
														<%# GetAliPayButton(DataBinder.Eval(Container.DataItem,"ProductID").ToString())%>
													</td>
												</tr>
												<tr>
												    <td colspan="3"><hr size="1" noshade="noshade" style="border:1px #cccccc dotted"/></td>
												</tr>
											</table>
										</ItemTemplate>
									</asp:DataList>
								</div>
								<%}else if(Request.QueryString["display"] == "piclist"){%>
								<div class="pro_piclist">
									<%BindProductList("dlProducts2",20);%>
									<asp:DataList id="dlProducts2" CellPadding="3" CellSpacing="0" GridLines="None" RepeatColumns="4"
										RepeatDirection="Horizontal" RepeatLayout="Table" Visible="true" HorizontalAlign="left" runat="server">
										<ItemStyle CssClass="listproduct" />
										<ItemTemplate>													
											<table cellpadding="0" cellspacing="0" style="border:1px #CCCCCC solid" align="center" width="100px" height="100px">
												<tr>
													<td>
														<a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' target=_blank>
														<img width="167" height="252" src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%=config.Path%>upload/<%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>">
                                                        </a>
													</td>
												</tr>
											</table>
										</ItemTemplate>
									</asp:DataList>
								</div>
								<%}else{%>
								<div class="pro_wlist">
									<%BindProductList("dlProducts3",12);%>
									<asp:DataList id="dlProducts3" CellPadding="3" CellSpacing="0" GridLines="None" RepeatColumns="4"
										RepeatDirection="Horizontal" RepeatLayout="Table" Visible="true" HorizontalAlign="left" runat="server">
										<ItemStyle CssClass="listproduct" />
										<ItemTemplate>													
											<table cellpadding="0" cellspacing="0" border="0" align="center" width="95%">
				                                <tr>
					                                <td align="center">
						                                <A href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' target=_blank>
						                                <IMG width="167" height="252" src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%=config.Path%>upload/<%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>">
						                                </A>
					                                </td>
				                                </tr>
				                                <tr>
				                                    <td valign="top" align="center">
						                                <div class="productname"><a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' title='<%#DataBinder.Eval(Container.DataItem,"Name")%>' target=_blank><%#DataBinder.Eval(Container.DataItem,"Name")%></a></div>
				                                    </td>
				                                </tr>
				                                <%--<tr>
				                                    <td>
						                                <%=GetResourceString("MarketPrice")%>：<b><%=GetCurrency()%><%#DataBinder.Eval(Container.DataItem,"MarketPrice","{0:f}")%></b>
				                                    </td>
				                                </tr>--%>
				                                <tr>
				                                    <td align="center">
						                                <div><% if(XpShop.WebUI.WebUtils.MemberShowPrice()) {%>本店售价：<span class="hnewpdtprice"><%=GetCurrency()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%></span><% }%>元</div>
				                                    </td>
				                                </tr>
											    <tr>
											        <td>
											            <%# XpShop.WebUI.WebUtils.Compare(DataBinder.Eval(Container.DataItem, "ProductID").ToString(), Request.Url.ToString())%>
											        </td>
											    </tr>
				                                <tr>
					                                <td align=center>
						                                <%# GetAliPayButton(DataBinder.Eval(Container.DataItem,"ProductID").ToString())%>
					                                </td>
				                                </tr>
			                                </table>
										</ItemTemplate>
									</asp:DataList>
								</div>
								<%}%>
								<div class="clear"></div>
						    </div>
						    <asp:panel id="plNoProduct" visible="false" runat="server">
								<div class="no_product">
									<h3>抱歉，没有找到符合条件的商品！</h3>
									<h3>温馨提示您：</h3>
									<p>重新选择其它分类或更改关键字进行搜索</p>
								</div>
							</asp:panel>
						</div>
					    <div class="bl"></div>
					    <div class="br"></div>
					    <div class="bm"></div>
					</div>
					<!--商品列表结束-->
					<!-- 翻页开始-->
					<asp:panel id="plPage" visible="true" runat="server">
					<div class="page clear">
						<div class="fpage1">
                            <asp:Label ID="lblPagerInfo" runat="server"></asp:Label>
                            <input id="gopage" type="text" class="gopage" size="1" />
                            <input id="go" type="button" value="Go" class="go" />
                        </div>
                        <div class="fpage2">
                            <span class="prepage"></span>
                            <asp:Label ID="lbPage" runat="server"></asp:Label>
                            <span class="nextpage"></span>
                        </div>                                
					</div>
					</asp:panel>
					<!-- 翻页结束-->					
				</div>
				<div style="clear:both;"></div>
			</div>
			<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
			<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
		</div>
		<div id="btnCompare" class="compare_hidden">
            <button id="doCompare"><%=GetResourceString("ProductCompare")%></button>
        </div>
	</body>
</HTML>   
