<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Store.Default" %>
<%@ 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"/>
		<script src="<%=webSite %>store/inc/default.js" type="text/javascript"></script>
		
		<script type="text/javascript">
		    var extend = '<%=config.html %>';
			var baseUrl="<%=webSite %>store/Default.aspx";
			var shopFolder="<%=webSite %>";
			var prePage="<%=GetResourceString("PreviousPage")%>";
			var nextPage="<%=GetResourceString("NextPage")%>";
			var skey ="<%=Request.QueryString["skey"] == null ? "" : Request.QueryString["skey"] %>";
			var act ="<%=Request.QueryString["act"] == null ? "" : Request.QueryString["act"] %>";
			var sid ="<%=Request.QueryString["sid"] == null ? "0" : Request.QueryString["sid"] %>";
			var cid ="<%=Request.QueryString["cid"] == null ? "0" : Request.QueryString["cid"] %>";
			var bid="<%=Request.QueryString["bid"] == null ? "0" : Request.QueryString["bid"] %>";
			var page="<%=Request.QueryString["page"] == null ? "1" : Request.QueryString["page"] %>";
			var sort="<%=Request.QueryString["sort"] == null ? "1" : Request.QueryString["sort"] %>";
//			var type="<%=Request.QueryString["type"] == null ? "1" : Request.QueryString["type"] %>";
//			var paras="<%=Request.QueryString["p"] == null ? "" : Request.QueryString["p"] %>";

            $(document).ready(function(){
                $(".noimg1").each(function(){
                    var obj = $(this);
                    $(this).children(".text div.titile").mouseover(function(){
                        $('ul.img1').hide();
                        $('.noimg1').show();
                        obj.next().show();
                        obj.hide();
                    });
                });
                
                $(".noimg2").each(function(){
                    var obj = $(this);
                    $(this).children(".text div.titile").mouseover(function(){
                        $('ul.img2').hide();
                        $('.noimg2').show();
                        obj.next().show();
                        obj.hide();
                    });
                });
            });

        </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="on">
	                    <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="out">
	                    <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" style="display:none;">
	                    <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 id="xp-store-content-left">
		        <%-- 店铺信息开始 --%>
		        <div class="xp-store-info">
		            <div class="storelogo"><img src="<%=webSite %>/upload/Supplier/<%=supplierDetail.Logo%>" /></div>
		            <div class="storename"><%=supplierDetail.SupplierName%></div>
		            <div class="storeinfo">
		                <ul>
		                    <li>商品数量：<%=supplierDetail.PdtNum%></li>
		                    <li>开店时间：<%=supplierDetail.AddTime.ToString("yyyy-MM-dd")%></li>
		                    <li>所&nbsp;在&nbsp;地：<%=supplierDetail.Address%></li>
		                    <li>服务：<img src="<%=webSite %>store/images/fwimg.gif" /></li>
		                    <li>营业执照：<img src="<%=webSite %>store/images/yyzzimg.gif" /></li>
		                </ul>
		            </div>
		            <div class="storeevaluation clear">
		                <div style="float:left;">商家评价：</div>
		                <div style="float:left;">
		                    <div class="star<%=string.Format("{0:f0}",supplierDetail.PingFen)%>"></div>
		                     <br /><a href="<%=webSite %>store/ShopEval.aspx?sid=<%=supplierDetail.SupplierID %>" style="color:#1a66b4">共有<%=supplierDetail.Reviews %>条评论</a>
		                </div>
		                
		            </div>
		        </div>
		        <%-- 店铺信息结束 --%>
		        
		        <%--促销信息开始--%>
		        <div class="xp-store-lframe">
		            <div class="tm">促销信息</div>
		            <div class="mm">
		                <ul class="cxxx">
		                    <li>限时抢</li>
		                    <li>送赠品</li>
		                </ul>
		            </div>
		        </div>
		        <%--促销信息结束--%>
		        
		        <%--店内搜索开始--%>
		        <div class="xp-store-lframe">
		            <div class="tm">店内搜索</div>
		            <div class="mm">
		                <dl class="xp-store-search">
		                    <dd class="ddleft">关键词：</dd>
		                    <dd class="ddright"><asp:TextBox ID=txtkey cssclass="xp-store-searchinput" text="" runat=server /></dd>		                    
		                    <dd class="ddleft">店内分类：</dd>
		                    <dd class="ddright"><asp:DropDownList ID="ddlTopCategory" runat=server></asp:DropDownList></dd>
		                    <dd class="ddbottom" style="clear:both;">
		                    <asp:Button ID="btnSearch" runat=server  Text="搜索" onclick="btnSearch_Click"/>
                            <input type="button" id="btnReset"  value="重新填写">
                          </dd>
		                </dl>
		            </div>
		        </div>
		        <%--店内搜索结束--%>
		        
		        <%--店内商品分类开始--%>
		        <div class="xp-store-lframe">
		            <div class="tm">店内商品分类</div>
		            <div class="mm">
		                <ul class="xp-store-category">
		                    <li><a href='Default.aspx?sid=<%=supplierDetail.SupplierID %>&act=list'>所有商品</a></li>
		                    <%--店内分类--%>
		                    <%
		                     if(dtCategory.Rows.Count>0)
                             {
						         int childs=0;
                                 string show="show";
								for(int i=0;i<dtCategory.Rows.Count;i++)
								{
									if(Convert.ToInt32(dtCategory.Rows[i]["depth"])==1)
									{
									    string stype = dtCategory.Rows[i]["stype"].ToString() == "1" ? "close" : "open";
									    show=dtCategory.Rows[i]["stype"].ToString() == "1" ? "show" : "hide";
										childs=Convert.ToInt32(dtCategory.Rows[i]["childs"]);
										Response.Write("<li class=\""+stype+"\"<p></p><span><a href='Default.aspx?sid="+dtCategory.Rows[i]["sid"]+"&act=list&cid="+dtCategory.Rows[i]["cid"]+"'>"+dtCategory.Rows[i]["cname"]+"</a></span>");
									}
									else
									{
										Response.Write("<ul class=\""+show+"\">");
										for(int j=0;j<childs;j++)
										{
											Response.Write("<li><a href='Default.aspx?sid="+dtCategory.Rows[i]["sid"]+"&act=list&cid="+dtCategory.Rows[i]["cid"]+"'>"+dtCategory.Rows[i]["cname"]+"</a></li>");
										i++;
										}
										i--;
										Response.Write("</ul>");
									}
								}
                                Response.Write("</li>");
                             }
                             %>
                             </ul>
		            </div>
		        </div>
		        <%--店内商品分类结束--%>
		        
		        <%--属性开始--%>
		        <div class="xp-store-lframe" style="display:none;">
		            <div class="tm">属性</div>
		            <div class="mm">
		                <ul class="xp-store-attribute">
		                    <li>
		                        价格
		                        <ul style="display:none;">
		                            <li class="first">全部价格</li>
		                            <li>100元以下</li>
		                            <li>100-200元</li>
		                            <li>200-500元</li>
		                            <li>500-1100元</li>
		                            <li>1100元以上</li>
		                        </ul>
		                    </li>
		                    <li>
		                        品牌
		                        <ul style="display:none;">
		                            <li class="first">全部品牌</li>
		                            <li>阿尔卡特</li>
		                            <li>TCL</li>
		                        </ul>
		                    </li>
		                    <li>
		                        网络类型
		                        <ul style="display:none;">
		                            <li class="first">全部网络类型</li>
		                            <li>GSM/TD-S...</li>
		                        </ul>
		                    </li>
		                    <li>颜色</li>
		                    <li>外观</li>
		                    <li>外观样式</li>
		                    <li>系统</li>
		                    <li>上市时间</li>
		                    <li>导航</li>
		                    <li>智能手机</li>
		                    <li>输入</li>
		                </ul>
		                <script type="text/javascript">
	                        $(document).ready(function(){
		                        $(".xp-store-attribute li").toggle(function(){
	                                $(this).addClass("on");
	                                $(this).children().show();
	                            },function(){
	                                $(this).removeClass("on");
	                                $(this).children().hide();
	                            });
	                        });
                        </script>
		            </div>
		        </div>
		        <%--属性结束--%>
		        
		        <%--本店热销开始--%>
		        <div class="xp-store-lframe">
		            <div class="tm">本店热销</div>
		            <div class="mm">
		                <ul class="xp-ul-storehot">
    		                <li>
    		                <asp:Repeater ID="rptHotPdt" runat=server>
                                <ItemTemplate>
                                    <ul class="noimg noimg1" <%#Container.ItemIndex == 0 ? "style='display:none;'" : "style=' '"%>>
                                        <li class="text clear">
                                            <%--<div class="index"><%#Container.ItemIndex+1 %></div>--%>
                                            <div class="img">
                                                <a href='/<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>' target="_blank">
		                                        <img height="53" width="70" src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"ProductImg")%>" alt="<%#DataBinder.Eval(Container.DataItem,"ProductName")%>" />
		                                        </a>
                                            </div>
                                            <div class="titile"><a href='/<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>' title='<%#DataBinder.Eval(Container.DataItem,"ProductName")%>' target="_blank"><%#DataBinder.Eval(Container.DataItem,"ProductName")%></a></div>
                                            <div class="price"><% if(MemberShowPrice()) {%><%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%><% }%></div>
                                        </li>
                                    </ul>
                                    <ul class="img img1" <%#Container.ItemIndex == 0 ? "style=' '" : "style='display:none;'"%>>
                                        <li class="text clear">
                                            <%--<div class="index"><%#Container.ItemIndex+1 %></div>--%>
                                            <div class="img">
                                                <a href='/<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>'  target="_blank">
		                                        <img src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"ProductImg")%>" alt="<%#DataBinder.Eval(Container.DataItem,"ProductName")%>" />
		                                        </a>
                                            </div>
                                            <div class="titile"><a href='<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>'  title='<%#DataBinder.Eval(Container.DataItem,"ProductName")%>' target="_blank"><%#DataBinder.Eval(Container.DataItem,"ProductName")%></a></div>
                                            <div class="price"><% if(MemberShowPrice()) {%><%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%><% }%></div>
                                        </li>
                                    </ul>
                                </ItemTemplate>
    		                </asp:Repeater>
    		                </li>
    		                </ul>
		            </div>
		        </div>
		        		        
		        <%--本店热销结束--%>
	        
		        <%--新品上架开始--%>
		        <div class="xp-store-lframe">
		            <div class="tm">新品上架</div>
		            <div class="mm">
		                <ul class="xp-ul-storehot">
    		                <li>
    		                <asp:Repeater ID="rptNewPdt" runat=server>
                                <ItemTemplate>
                                    <ul class="noimg noimg2" <%#Container.ItemIndex == 0 ? "style='display:none;'" : "style=' '"%>>
                                        <li class="text clear">
                                            <%--<div class="index"><%#Container.ItemIndex+1 %></div>--%>
                                            <div class="img">
                                                <a href='/<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>' target="_blank">
		                                        <img height="53" width="70" src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"ProductImg")%>" alt="<%#DataBinder.Eval(Container.DataItem,"ProductName")%>" />
		                                        </a>
                                            </div>
                                            <div class="titile"><a href='<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>'  title='<%#DataBinder.Eval(Container.DataItem,"ProductName")%>' target="_blank"><%#DataBinder.Eval(Container.DataItem,"ProductName")%></a></div>
                                            <div class="price"><% if(MemberShowPrice()) {%><%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%><% }%></div>
                                        </li>
                                    </ul>
                                    <ul class="img img2" <%#Container.ItemIndex == 0 ? "style=' '" : "style='display:none;'"%>>
                                        <li class="text clear">
                                            <%--<div class="index"><%#Container.ItemIndex+1 %></div>--%>
                                            <div class="img">
                                                <a href='/<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>' target="_blank">
		                                        <img src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"ProductImg")%>" alt="<%#DataBinder.Eval(Container.DataItem,"ProductName")%>" />
		                                        </a>
                                            </div>
                                            <div class="titile"><a href='<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>'  title='<%#DataBinder.Eval(Container.DataItem,"ProductName")%>' target="_blank"><%#DataBinder.Eval(Container.DataItem,"ProductName")%></a></div>
                                            <div class="price"><% if(MemberShowPrice()) {%><%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%><% }%></div>
                                        </li>
                                    </ul>
                                </ItemTemplate>
    		                </asp:Repeater>
    		                </li>
    		                </ul>

		            </div>
		        </div>
		        
		        <%--新品上架结束--%>
		    </div>
		    <%-- 左侧结束 --%>
		    
		    <%-- 右侧开始 --%>
		    
		    <%--当按分类查看商品，或搜索商品时，不显示首页的广告 --%>
		    <div id="xp-store-content-right">
		    	<%if(Request.QueryString["act"]!="list"){%>	
		        <%--广告开始--%>
		        <img src="<%=webSite%>store/images/home_ad1.jpg" />
		        <img src="<%=webSite%>store/images/home_ad2.jpg" />
		        <img src="<%=webSite%>store/images/home_ad3.jpg" />
		        <div class="homepdtad">
		            <ul class="clear">
		                <li><img src="<%=webSite%>store/images/home_pdtad1.jpg" /></li>
		                <li><img src="<%=webSite%>store/images/home_pdtad2.jpg" /></li>
		                <li><img src="<%=webSite%>store/images/home_pdtad3.jpg" /></li>
		                <li><img src="<%=webSite%>store/images/home_pdtad4.jpg" /></li>
		            </ul>
		        </div>
		        <div class="homepdtad">
		            <ul class="clear">
		                <li><img src="<%=webSite%>store/images/home_pdtad6.jpg" /></li>
		                <li><img src="<%=webSite%>store/images/home_pdtad7.jpg" /></li>
		                <li><img src="<%=webSite%>store/images/home_pdtad8.jpg" /></li>
		                <li><img src="<%=webSite%>store/images/home_pdtad9.jpg" /></li>
		            </ul>
		        </div>
		        
		        <div class="homepdtad"><img src="<%=webSite%>store/images/home_pdtad11.jpg" /></div>
		        <div class="homepdtad"><img src="<%=webSite%>store/images/home_pdtad12.jpg" /></div>
		        <div class="homepdtad"><img src="<%=webSite%>store/images/home_pdtad13.jpg" /></div>
		        <%--广告结束--%>
		        <% } else{%>
		            <!--位置导航开始-->
		            <div class="path"><%=GetCurrentPosition()%></div>
		            <!--位置导航结束-->
		        <%} %>
		        <!--商品列表开始-->
		        <div class="list_style">
					<div class="sort_mode">排序方式：</div>
					<%=GetSortMode()%>
					<div class="page_change">
						<span><%=GetResourceString("DoPage")%></span>
                        <span class="prepage"></span>
						<span class="nextpage"></span>
					</div>
		        </div>
		        <div class="xp-store-plist">
					<div class="xp-store-pro_wlist clear">
<%--						<%BindProductList("dlProducts1",10);%>
--%>						<asp:DataList id="dlProducts" CellPadding="3" CellSpacing="0" GridLines="None" RepeatColumns="4"
							RepeatDirection="Horizontal" RepeatLayout="Table" HorizontalAlign="left" Visible="true" runat="server">
							<ItemStyle CssClass="dl_item"/>
							<ItemTemplate>													
								<table cellpadding="3" cellspacing="0" width="100%">
							        <tr>
								        <td>
								            <div class="xp-pdt-img">
                                               <a href='<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>' target="_blank" >
                                               <img width="160" src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"ProductImg")%>" alt="<%#DataBinder.Eval(Container.DataItem,"ProductName")%>" /></a>
                                            </div>
								        </td>
								    </tr>
									<tr>
						                <td>
						                    <div class="listheightoverflow"><a href='<%=webSite %>Products/Product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html %>' target=_blank ><%#DataBinder.Eval(Container.DataItem,"ProductName")%> <%--<%#DataBinder.Eval(Container.DataItem,"ShortDesc")%>--%></a></div>
						                </td>
						            </tr>
							        <tr>
							            <td>
							                <div class="xp-list-memberprice">
                                                <% if(MemberShowPrice()) {%><%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%><% }%>
                                            </div>
							            </td>
							        </tr>

								</table>
							</ItemTemplate>
						</asp:DataList>
					</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>
				
				<asp:panel id="plNoProduct" visible="false" runat="server">
					<div style="margin:20px;">
						<h3>抱歉，没有找到符合条件的商品！</h3>
					</div>
				</asp:panel>
		        <%--商品列表结束--%>
					
			    </div>
			    
		        <%--商品列表结束--%>
		        
		    </div>	
		    <%-- 右侧结束 --%>
		    </form>
		</div>	
	    <uc1:Helper id="Helper1" runat="server"></uc1:Helper>
	    <uc1:Footer id="Footer1" runat="server"></uc1:Footer>
	</body>
</html>