<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GroupBuyDetail.aspx.cs" Inherits="SocoShop.Web.GroupBuyDetail" %>
<%@ Register Namespace="SkyCES.EntLib" Assembly="SkyCES.EntLib" TagPrefix="SkyCES"%>
<%@ Import Namespace="SocoShop.Common" %>
<%@ Import Namespace="SocoShop.Entity" %>
<%@ Import Namespace="SocoShop.Web" %>
<%@ Register Src="~/Plugins/Template/Red/Controls/Head.ascx" TagName="Head" TagPrefix="SocoShop" %>
<%@ Register Src="~/Plugins/Template/Red/Controls/Top.ascx" TagName="Top" TagPrefix="SocoShop" %>
<%@ Register Src="~/Plugins/Template/Red/Controls/Foot.ascx" TagName="Foot" TagPrefix="SocoShop" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <SocoShop:Head ID="Head" runat="server" />  
    <style type="text/css">
        .content
        {
        	font-size:14px; font-weight:600; line-height:28px;
        }
        .groupBuyPhoto
        {
        	float:left; width:600px; height:240px; border:1px solid #DDDDDD; padding:2px;
        }
        .right
        {
        	float:left; width:300px; text-align:left; margin-left:25px; padding-top:50px;
        }
        .right .groupBuyPrice
        {
        	font-weight:bold; font-size:26px; color:#A10000;
        }
        .right .note
        {
        	font-weight:bold; font-size:15px; color:#A10000; margin-top:26px; text-align:center; line-height:35px;
        }
        .right .userCount
        {
        	border:1px dashed #A10000; line-height:30px; padding:5px; background-color:#EFF1F8;
        }
        .right .userCount span
        {
        	 color:#A10000; font-weight:600; margin:2px;
        }
        .right .buyNow
        {
        	text-align:center; margin-top:10px;
        }
         .pageTag
        {
	        height:23px;margin-left:6px; font-weight:800; font-size:13px;  width:72px; text-align:center; height:23px; line-height:23px;background-image:url(/Plugins/Template/Red/Style/images/pageTagOn.png); color:#fff ;
        }
        .userGroupBuy
        {
        	border-top:solid 2px #66000E; line-height:30px;
        }
        .userGroupBuy .noUser
        {
        	font-weight:600; text-align:center; margin:20px;
        }
        .userGroupBuy li
        {
        	 width:80px; float:left; overflow:hidden; height:30px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <SocoShop:Top ID="Top" runat="server" />
    <div class="main">
        <div class="giftPackName"><%=groupBuy.Name%></div>
        <div class="giftPackTime">活动时间：<%=groupBuy.StartDate.ToString("yyyy-MM-dd")%> 到 <%=groupBuy.EndDate.ToString("yyyy-MM-dd")%></div>
        <div class="content"><%=groupBuy.Description%></div>    
        <div class="groupBuyPhoto"><img src="<%=groupBuy.Photo%>"  onload="photoLoad(this,600,240)"/></div>
        <div class="right">
            <div>团购价：<span class="groupBuyPrice">￥<%=groupBuy.Price%></span>  比市场价节省了 ￥<%=product.MarketPrice - groupBuy.Price%></div>
            <%if(groupBuy.EndDate<DateTime.Now){ %>
            <div class="note">该活动已经结束</div>
            <%}else if(groupBuy.StartDate>DateTime.Now){ %>
            <div class="note">该活动未开始</div>
            <%}else{ %>
            <div>剩余时间：<span id="leftTime" class="note">加载中...</span></div>
            <div class="userCount">总共 <span><%=groupBuy.MaxCount%></span>件；已经售出<span><%=buyCount%></span>件；还剩<span><%=groupBuy.MaxCount - buyCount%></span>件<%if(groupBuy.EachNumber!=-1){ %>；每人限购<span><%=groupBuy.EachNumber%></span>件<%} %></div>
            <div class="buyNow"> <input class="bigbutton" value="立即购买"  type="button" onclick="window.location.href='GroupBuyAdd.aspx?ID=<%=groupBuy.ID %>'" /></div>        
            <%} %>
        </div>
        <div class="height10"></div>
        <div class="pageTag">团购用户</div>
        <div class="userGroupBuy">
            <%if(buyCount>0){ %>
            <ul>
                <%foreach(UserGroupBuyInfo userGroupBuy in userGroupBuyList){ %>
                <li><%=userGroupBuy.UserName%></li>
                <%} %>
            </ul>
            <%}else{ %>
            <div class="noUser">还没有用户参加该团购活动！！</div>
            <%} %>
        </div>     
    </div>    
    <script language="javascript" type="text/javascript" src="/Plugins/Template/Red/Js/LeftTime.js" ></script>
    <script language="javascript" type="text/javascript"> 
        var gmt_end_time = <%=leftTime%>;        
        onload_leftTime();
    </script> 
    <SocoShop:Foot ID="Foot" runat="server" />
    </form>
</body>
</html>
