<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SecKill.aspx.cs" Inherits="XpShop.WebUI.SecKill" %>

<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.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>秒杀-<%=config.SiteTitle%></title>
    <!--#include file="../../inc/head.inc"-->

    <script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/SecKill.js" type="text/javascript"></script>

    <link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/list.css" type="text/css"
        rel="stylesheet" />
    <link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/seckill.css" type="text/css"
        rel="stylesheet" />
    
    
    <link href="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/seckill_files/jquery.css"
        rel="stylesheet" type="text/css">
    <link href="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/seckill_files/seckillProduct.css"
        rel="stylesheet" type="text/css">

    <script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/seckill_files/jquery_003.js"></script>

    <script type="text/javascript" src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/seckill_files/jquery.js"></script>

    <script type="text/javascript">
	           $(document).ready(function () {
			        $('#mycarousel').jcarousel({
				        wrap: 'last'
			        });
		        });
    </script>

</head>
<body>
    <uc1:Header id="Header1" runat="server">
    </uc1:Header>
    <div class="xp-w">
        <%=GetAD(166)%>
    </div>
    <div class="xp-w clear">
            <!--商品列表开始-->
            <asp:Repeater ID="rptPdt" runat="server">
                <ItemTemplate>
                    <div class="clear">
                    <div class="seckill-left seckill clear">
                        <div class="tm">
                            <span>第<%#DataBinder.Eval(Container.DataItem,"RuleNo")%>期</span>
                        </div>
                        
                        <div class="mm clear">
                            <div class="seckill-pdtname">
                                    <a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>'
                                        target="_blank">
                                        <%#DataBinder.Eval(Container.DataItem,"ProductName")%></a></div>
                            <div class="seckill_left">
                                <a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>'
                                    target="_blank">
                                    <img width="270" height="270" src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"img1")%>" alt='' />
                                </a>
                                <div class="subimg clear">
						            <div class="a">
						            <div class="prev prev1 disabled">&nbsp;</div>
						            </div>
                                    <div class="carousel main" style="width:250px;">
                                        <div class="jCarouselLite">
							                <ul class="thumbnail_ul">
								                <li class="thumbnail_li"><img width="50" height="50" src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"img1")%>" alt='' /></li>
							                </ul>
							            </div>
                                    </div>
                                    <div class="b">
                                    <div class="next next1">&nbsp;</div>
                                    </div>
                                    <script type="text/javascript">
                                        $(document).ready(function(){
                                             $(".carousel").jCarouselLite({btnNext: ".next1",btnPrev: ".prev1",visible: 5,circular: false,scroll:1,speed:300});
                                        });
                                    </script>                                      
                                     <div style="clear:both;"></div>
                                     <a id="viewbig"><div class="viewimg"></div></a>
						        </div>
                            </div>
                            <div class="seckill_right">
                                <div class="seckill-see-detial">
                                    <a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>'
                                        target="_blank">查看商品详情</a>
                                </div>
                                <div class="seckill-price">
                                    秒杀价：￥<span><%#DataBinder.Eval(Container.DataItem, "PmtPrice", "{0:f}")%></span></div>
                                <div class="seckill-markerprice">
                                    商城价：<%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%></div>
                                <div class="seckill-xianliang">
                                    秒杀数量：<%#DataBinder.Eval(Container.DataItem,"PmtNumber")%>件</div>
                                <div class="seckill-status">
                                    秒杀状态：<span id="status<%#DataBinder.Eval(Container.DataItem,"ProductID")%>"></span></div>
                                <div>
                                    <div class="seckill-djs-title">倒计时：</div>
                                    <div class="seckill-time clear" id="time<%#DataBinder.Eval(Container.DataItem,"ProductID")%>"></div>
                                    <script>
				                        var t=new calculagraph();
				                        t._id='<%#DataBinder.Eval(Container.DataItem,"ProductID")%>';
				                        t._cT='<%=DateTime.Now%>';
				                        t._sT='<%#DataBinder.Eval(Container.DataItem,"BeginTime")%>';
				                        //t._xT='<%#DataBinder.Eval(Container.DataItem,"leavingday")%>';
				                        t._eT='<%#DataBinder.Eval(Container.DataItem,"EndTime")%>';
				                        t._interval();
                                    </script>
                                    <div class="sp_zc">
                                        请 <a target="_blank" href="<%=webSite %>login.<%=config.html%>">登录</a>/<a target="_blank"
                                            href="<%=webSite %>register.<%=config.html%>">注册</a>，只有注册用户才能秒杀哦。</div>

                                    <input type="button" id="seckill<%#DataBinder.Eval(Container.DataItem,"ProductID")%>"
                                        onclick="DoSecKill(<%#DataBinder.Eval(Container.DataItem,"RuleID")%>,<%#DataBinder.Eval(Container.DataItem,"ProductID")%>,<%#DataBinder.Eval(Container.DataItem,"GoodsID")%>,'seckill<%#DataBinder.Eval(Container.DataItem,"ProductID")%>','time<%#DataBinder.Eval(Container.DataItem,"ProductID")%>')"
                                        class="<%#DateTime.Parse(DataBinder.Eval(Container.DataItem,"BeginTime").ToString())>DateTime.Now ? "wait" : (DateTime.Parse(DataBinder.Eval(Container.DataItem,"EndTime").ToString())<DateTime.Now || DataBinder.Eval(Container.DataItem,"Balance").ToString()=="0" ? "end" : "start")%>"
                                        value="" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="seckill-right">
                        <div class="seckill-pnum">
                            <span>已有<%#(int)DataBinder.Eval(Container.DataItem, "PmtNumber") - (int)DataBinder.Eval(Container.DataItem, "Balance")%>人秒杀成功</span>
                        </div>
                        <%--<div class="seckill-pnum">
                            <span><%#(int)DataBinder.Eval(Container.DataItem, "PmtNumber") - (int)DataBinder.Eval(Container.DataItem, "Balance")%></span>
                        </div>--%>
                        <!--秒杀须知start-->
                        <div class="seckill-ad">
                            <div class="tm">
                                秒杀规则</div>
                            <div class="mm">
                                <ul>
                                    <li> 1、参与秒杀前，请详细阅读秒杀规则。凡参与<%=config.SiteName %>秒杀，则视为同意秒杀规则。</li>
                                    <li>2、参与秒杀必须为<%=config.SiteName %>注册会员，活动前请仔细填写您的个人信息并确保真实有效，以便秒杀结束后及时为你配送商品。</li>
                                    <li>3、禁止有作弊行为的秒杀，代替秒杀等，若有发现，<%=config.SiteName %>有权在事先不通知的情况下取消该用户的秒杀资格，并保留法律究权。</li>
                                    <li>4、<%=config.SiteName %>秒杀不对因网络和其他因素等原因导致参加者提交的信息错误承担任务责任。</li>
                                    <li>5、秒杀成功后，会员请到<%=config.SiteName %>后台确认订单信息，填写好收货地址，成功提交订单，生成订单即可付款。
                                会员务必在30分钟内进行提交订单，如过期限<%=config.SiteName %>视为用户自动放弃，订单自动无效。若成功提交订单后，用户需在1个小时内进行支付，超时视为自动放弃，
                                订单取消。订单成功支付后请保持您的联系方式的畅通，我们会在第一时间联系您，为您配送商品。</li>
                                    <li> 6、每一位<%=config.SiteName %>会员只能对本期秒杀一次，多次秒杀同一商品，<%=config.SiteName %>有权视为无效。</li>
                                    <li>7、本活动最终解释权归<%=config.SiteName %>所有</li>
                                </ul>                                
                            </div>
                        </div>
                        <!--秒杀须知end-->
                    </div>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            <!--商品列表结束-->
            <div style="display: none;">
                <asp:Panel ID="plPage" Visible="true" runat="server">
                    <!-- 翻页开始-->
                    <div class="page clear">
                        <div class="fpage clearfix">
                            <asp:Label ID="lbPage" class="lb-page" runat="server"></asp:Label>
                        </div>
                    </div>
                    <!-- 翻页结束-->
                </asp:Panel>
            </div>
            <asp:Panel ID="plNoProduct" Visible="false" runat="server">
                <div style="margin: 20px;">
                    <h3>
                        抱歉，还没有秒杀活动！</h3>
                </div>
            </asp:Panel>
        </div>
    <div class="xp-w clear">
        <div class="seckill-yg">
            <div class="tm">百悦预告</div>
            <div class="mm">
                <div class="jcarousel-skin-tango">
                    <div class="jcarousel-container jcarousel-container-horizontal">
                        <div class="jcarousel-prev jcarousel-prev-horizontal jcarousel-prev-disabled jcarousel-prev-disabled-horizontal">
                        </div>
                        <div class="jcarousel-next jcarousel-next-horizontal">
                        </div>
                        <div class="jcarousel-clip jcarousel-clip-horizontal">
                            <ul id="mycarousel" class="jcarousel-list jcarousel-list-horizontal clear">
			                    <%for (int i = 0; i < dtPreSecKillPdt.Rows.Count; i++){%>
			                        <li jcarouselindex="<%= i+1 %>" class="jcarousel-item jcarousel-item-horizontal jcarousel-item-<%= i+1 %> jcarousel-item-<%= i+1 %>-horizontal">
                                        <div class="sg_con">
                                            <ul>
                                                <li>开始时间：<span class="sp_hong01"><%=string.Format("{0:MM}",dtPreSecKillPdt.Rows[i]["BeginTime"])%>月</span><span class="sp_hong01"><%=string.Format("{0:dd}", dtPreSecKillPdt.Rows[i]["BeginTime"])%>日</span><span class="sp_hong01"><%=string.Format("{0:HH:mm:ss}", dtPreSecKillPdt.Rows[i]["BeginTime"])%></span></li>
                                                <li class="sg_con-tu">
                                                    <a href='<%=webSite %>products/product-<%=dtPreSecKillPdt.Rows[i]["ProductID"]%>.<%=config.html%>' target="_blank"><img width="250" height="250" src="<%=webSite %>upload/ProductImg/<%=dtPreSecKillPdt.Rows[i]["ImgFolder"]%><%=dtPreSecKillPdt.Rows[i]["ThumbnailImg"]%>" alt='' /></a>
                                                </li>
                                                <li class="sg_con-zi"><a href='<%=webSite %>products/product-<%=dtPreSecKillPdt.Rows[i]["ProductID"]%>.<%=config.html%>'target="_blank"><%=dtPreSecKillPdt.Rows[i]["ProductName"]%></a></li>
                                                <li><span class="sp_lv01">限量<%=dtPreSecKillPdt.Rows[i]["PmtNumber"]%>个</span></li>
                                                <li><span class="sp_l">商城价：￥<%=string.Format("{0:f}", dtPreSecKillPdt.Rows[i]["MemberPrice"])%></span></li>
                                                <li>
                                                    <div class="sg_con01">
                                                        <span class="sp_hong">秒杀价：￥</span><span class="sp_hong02"><%=string.Format("{0:f}", dtPreSecKillPdt.Rows[i]["PmtPrice"])%></span></div>
                                                    <div class="sg_con02">第<%=dtPreSecKillPdt.Rows[i]["RuleNo"]%>期</div>
                                                </li>
                                            </ul>
                                        </div>
                                    </li>
                                    <%if (i+1 == dtPreSecKillPdt.Rows.Count) {%>
                                    <li jcarouselindex="<%= i+2 %>" class="jcarousel-item jcarousel-item-horizontal jcarousel-item-<%= i+2 %> jcarousel-item-<%= i+2 %>-horizontal"> </li>
                                    <%} %>
                                <%} %>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        
    </div>
    <uc1:Helper id="Helper1" runat="server">
    </uc1:Helper>
    <uc1:Footer id="Footer1" runat="server">
    </uc1:Footer>
</body>
</html>
