<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="buy.aspx.cs" Inherits="web.tuan.buy" %>
 
<!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>
<title>提交订单 － <%=config.SiteTitle%></title>
<meta name="description" content="<%=config.MetaDescription %>" />
<meta name="keywords" content="<%= config.MetaKeywords %>" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="image/cd.css" rel="stylesheet" type="text/css" />
<script src="image/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="image/jd.js"></script>

			<script type="text/javascript" src="image/jquery.js"></script>
			 <script type="text/javascript" src="image/register.js"></script>
<script type="text/javascript" language="javascript"> 
           
              function jb() 
              { 
                 var A=null; 
               try 
               { 
                   A=new ActiveXObject("Msxml2.XMLHTTP"); 
                } 
                 catch(e) 
                 { 
                  try 
                   { 
                      A=new ActiveXObject("Microsoft.XMLHTTP"); 
                   } 
                       catch(oc) 
                      { 
                     A=null 
                   } 
              } 
           if ( !A && typeof XMLHttpRequest != "undefined" ) 
            { 
               A=new XMLHttpRequest() 
             } 
           return A 
              } 
              
           
              function Go(obj) 
              { 
             
                var svalue = obj.value; 
           
                 var weburl = "ajax.aspx?parent_id="+svalue; 
             
                 var xmlhttp = jb(); 
             
                 xmlhttp.open("get",weburl,true); 
          
                 xmlhttp.onreadystatechange=function() 
                 { 
                   if(xmlhttp.readyState==4) 
                    { 
                       var result = xmlhttp.responseText;
                    
                    
                      document.getElementById("ddlSubAreas").length = 0; 
                      
                       document.getElementById("ddlSubAreas").options.add(new Option("选择地区","0")); 
                       
                       if(result!="")
                       { 
                        
                          var allArray = result.split("<")[0].toString().split(","); 
                       
                          for(var i=1;i<allArray.length;i++) 
                          { 
                     
                            var thisArray = allArray[i].split("|"); 
                      
                             document.getElementById("ddlSubAreas").options.add(new Option(thisArray[1].toString(),thisArray[0].toString())); 
                          } 
                       } 
                    } 
                 } 
               
                 xmlhttp.send(null); 
               

   
              } 
		</script>

<script type="text/javascript" language="javascript">
function ts()
{
return confirm("确认提交订单吗？提交后将生成既定订单，不能修改！！");
}
</script>
</head>
<body onLoad="showdiv()">
<form id="Form1" method="post" runat="server">
<div class="header clearfix">
<h1 class="lf"><a href="../default.html" target="_blank"><%=config.SiteLogo %></a></h1>
	<h2 id="desc"></h2>
	
	<div class="rss rf clearfix">
		<p>输入邮箱地址，订阅每日精品团购!</p>
	
			<div class="lf">
				<input type="text" id="email" datatype="email" require="true" value="" class="txt lf" name="email" />
			<asp:Button ID="Bem" runat="server" class="but lf" OnClick="Bem_Click" />
				</div>
				<span class="lf"></span>
		

	</div>
</div>
 
	
  <div class="navWrap"> 
    <div class="wrap clearfix"> 
      <ul class="nav lf">
 	<li class="on"><a href="index.aspx">首页</a></li>
					<li class="on"><a href="index.aspx?type=2">团购</a></li>
					<li class="on"><a href="index.aspx?type=4">限时抢购</a></li>
				
					<li class="on"><a href="odate.aspx">往期热卖</a></li>
					<li class="on"><a href="book.aspx">问题答疑</a></li>
					<li class="on"><a href="../HelpListInfo_1.html" target="_blank">帮助中心</a></li>
      </ul>
      <div class="member rf"> 
        <%if (member.MemberID > 0)
    {%>
        <span class="username lf">欢迎你, 
        <%=member.Name%>
        &nbsp;&nbsp;|</span> 
        <div id="menulist"> <a class="top" href="../MemberCenter.aspx" target="_blank">我的会员中心</a> 
          <div class="ml-bottom"> 
            <div class="menu-t"></div>
            <div class="menu-c"> 	<a href="../MytgOrders.aspx" target="_blank">我的团购订单</a>
              <a href="../Mydjqrec.aspx" target="_blank">我的返利</a> <a href="../Mymemb.aspx" target="_blank"> 
              我推荐的会员</a> <a href="../MymembPay.aspx" target="_blank"> 我的提成</a> 
              <a href="../Myget.aspx" target="_blank"> 账户余额</a> <a href="../IndividualInformation.aspx" target="_blank">账户设置</a> 
             <a href="../Logout.aspx" target="_blank">退出</a> 
            </div>
            <div class="menu-b"></div>
          </div>
        </div>
        <%}else{ %>
        <a href="login.aspx">登录</a> | <a href="reg.aspx">注册</a> 
        <%} %>
      </div>
    </div>
  </div>
	<div class="boxWrap m10 clearfix">
<div class="mainWrap lf">
<div class="sect bor">


<div class="clr width972"> 
 

  <div class="clr" style="width:700px;">
  <div class="flow09">

      
       <div class="flowbg" style="clear:both; overflow:hidden; width:690px; height:auto;">
        <h2 class="title">您选择的套餐：</h2>
  
         <div class="clr shop" style="margin-top: 0px;">
       <div class="alignC" style="padding-top: 0px; width:680px;margin:0px auto;">
                    <table width="684" border="0" cellspacing="0" cellpadding="0" align="center" style="border:1px #DDD solid;">
                      <thead class="col49" bordercolor="#cccccc" style="border-collapse: collapse;background-color:#eeeeee">
                        <td width="210" height="33" align="center"> 
                          <%=GetResourceString("ProductName")%>
                        </td>
                      <td width="100" align="center">单价</td>
                      <td width="90" align="center"> 
                        <%=GetResourceString("Quantity")%>
                      </td>
                      <td width="110" align="center"> 
                        <%=GetResourceString("zjf") %>
                      </td>
                           <td width="90" align="left"> 
                      <%=GetResourceString("zdjq") %>
                      </td>
                      <td colspan="2" align="center"> 
                        <%=GetResourceString("Total")%></thead> 
                      </td>
                      <!--products 商品 start-->
                      <tbody id="productList">
                        <asp:repeater id="rptShoppingCart" Runat="server"> 
                          <ItemTemplate> 
                            <tr class="col33"> 
                              <td width="280" align="left" style="padding:10px 10px 10px 10px;"> <a href='showproduct.aspx?productID=<%# DataBinder.Eval(Container.DataItem, "ProductID") %>' target=_blank> 
                                <%# DataBinder.Eval(Container.DataItem, "Name") %>
                                </a>  </td>
                              <td width="100"> 
                              <div align="center">  <%=GetCurrency() %>
                                <%# DataBinder.Eval(Container.DataItem, "MemberPrice","{0:f2}")%>
                                <%# GetFieldItemPrice(DataBinder.Eval(Container.DataItem, "Items").ToString())>0?" + (配件价格) "+GetCurrency()+""+GetFieldItemPrice(DataBinder.Eval(Container.DataItem, "Items").ToString()).ToString("0.00")+"":"" %>
                                </div></td>
                              <td width="90"> 
                               <div align="center">
                               
                          
                                
                                
                                   <a href="javascript:void(0);" onclick="changeQty('reduce','<%# Container.ItemIndex+1 %>','<%# DataBinder.Eval(Container.DataItem, "RecordID") %>','<%# getck(DataBinder.Eval(Container.DataItem, "RecordID").ToString()) %>');" class="reduce"><img src="image/shoppingCart_Less.gif" /></a>
                            <input style="border:1px #DDD solid;width:30px;height:18px;" id="txtQ<%# Container.ItemIndex+1 %>" type="text" value='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>'  onblur='Gckuname(<%# DataBinder.Eval(Container.DataItem, "RecordID") %>,<%# Container.ItemIndex+1 %>,<%# getck(DataBinder.Eval(Container.DataItem, "RecordID").ToString()) %>)'/>
                            <a href="javascript:void(0);" onclick="changeQty('add','<%# Container.ItemIndex+1 %>','<%# DataBinder.Eval(Container.DataItem, "RecordID") %>','<%# getck(DataBinder.Eval(Container.DataItem, "RecordID").ToString()) %>');" class="add"><span class="img"><img src="image/shoppingCart_Add.gif" /></span></a>  
                        
                                </div></td>
                              <td width="110"> 
                               <div align="center"> <%# DataBinder.Eval(Container.DataItem, "Score").ToString() == "0" ? "0点" : "" + DataBinder.Eval(Container.DataItem, "Score").ToString() + "</b>点"%>
                                </div></td>
                                 <td width="90">
          <%# DataBinder.Eval(Container.DataItem, "yhq").ToString() == "0.0000" ? "0元" : "" + DataBinder.Eval(Container.DataItem, "yhq","{0:f2}").ToString() + "</b>元"%>
          </td>
                              <td width="100" class="link_red"> 
                              <div align="center">  
                                       <%=GetCurrency() %><span id="nprice<%# Container.ItemIndex+1 %>"><%# (decimal)Convert.ToDecimal(DataBinder.Eval(Container.DataItem, "MemberPrice","{0:f}")) * (int)DataBinder.Eval(Container.DataItem, "Quantity") + GetFieldItemPrice(DataBinder.Eval(Container.DataItem, "Items").ToString()) * (int)DataBinder.Eval(Container.DataItem, "Quantity")%></span>

                                  </div></td>
                            </tr>
                          </ItemTemplate>
                        </asp:repeater>
                      </tbody>
                      <!--products 商品 end-->
                      <!--订单金额 start-->
                      <tr bgcolor="#EFEFEF" class="col49" height="30"> <a name="activemain"></a> 
                        <td colspan="9"> 
                          <div style="text-align:right;padding-right:20px;"> 
                       <%=GetResourceString("Total")%>：<%=GetCurrency()%><span id="hj"><%=GetTotal()%></span></div></td>
                      </tr>
                    </table>
</div>
</div>
 
       <div class="clr martop18">
       <h2 class="title">请正确添加你的手机号（团购成功后，我们会给您发送团购认领码）：</h2>
        <div class="pad shop_clr flowbg" style="width:620px;margin:0px auto;">
    
          <div id="modAddress" class="order_newbg" style="padding-top:24px; padding-bottom:25px;margin:0px auto;">
           您的手机号码：<asp:textbox id="txtRPhone" runat="server" class="new_login_ip" Width="250"></asp:textbox> <FONT color="red">*</FONT>
		<SCRIPT type="text/javascript" language="JavaScript">
		function showdiv() 
		{
			var bt=document.getElementById("isdx");
 if(bt.checked==true)
 {
 document.getElementById('dxje').disabled=false;
 }
 else
 {
 document.getElementById('dxje').disabled=true;
 }
 
			
		}
		</SCRIPT>
    <script language="javascript">

function isdx_onclick() {

 if(document.Form1.isdx.checked)
 
 {
 document.getElementById('dxje').disabled=false;
 }
 else
 {
 document.getElementById('dxje').disabled=true;
 }

}

				</script>
				
          </div>
          <div class="own_address_bot" style=" margin:0px auto;"></div>
        </div>
      </div>
      

       <div class="martop18">
    <h2 class="title">选择支付方式：</h2>
       <div class="flowbg" style="width:700px; text-align:left; height:auto; overflow:hidden; padding-bottom:20px; height:auto; clear:both; padding-left:32px;margin:0px auto;">
    
          <div  style="margin-top:20px;line-height:28px;">
          		<asp:RadioButtonList ID="rblPayment" Runat="server" RepeatDirection="Horizontal" RepeatColumns="1" RepeatLayout="Table" Width="100%"></asp:RadioButtonList>
          </div>
           
    
     
      </div>
      </div>
       <div class="martop18">
         <h2 class="title">订单备注与其他：</h2>
         <div class="flowbg" style="width:700px; text-align:left; height:auto; overflow:hidden; padding-bottom:20px; height:auto; clear:both; padding-left:72px;margin:0px auto;margin-bottom:20px;">
       
            <div class="clr">
              <div style="float:left; width:355px; padding-top:30px; overflow:hidden">
           <asp:textbox id="txtRemark" runat="server" Width="400" Height="40px" TextMode="MultiLine" style="width:350px; height:85px; overflow-y:auto;"></asp:textbox>
              </div>
            
            </div>
            <div class="clr alignL" style="width:700px; padding-top:12px;padding-bottom:12px;" id="bill">
    
               <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>
        
            
          <table width="99%" border="0" align="center" cellpadding="0" cellspacing="" >
            <tr>
              <td height="36" > &nbsp;<asp:CheckBox ID="cbPayment" Runat="server" Text=" 是否从预付款扣除?"></asp:CheckBox> <%=GetResourceString("AdvancePaymentt")%>
                ： 
                <%= string.Format("{0:f}",member.AdvancePayment)%>
                              

			  </td>
            </tr>
          </table>
  
   
               <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" style="display:none;" >
            <tr> 
              <td height="36">
                  &nbsp;<br />

                  <asp:CheckBox ID="isdx" runat="server" />
                  是否使用代金券抵消部分金额? &nbsp;&nbsp; 抵消金额:<input id="dxje" style="width: 76px" type="text"  name="dxje" />
                元 
                <table width="89%" border="0" align="center" cellpadding="1" cellspacing="15">
                  <tr>
                    <td>&nbsp;
                    
                    <asp:Label ID="djsm" runat="server" ForeColor="Red"></asp:Label>
                        <asp:Label ID="zje" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                  </tr>
                </table>
            
                  </td>
            </tr>
          </table>
          
          </td>
      </tr>
    </table>
            </div>
    
          <div style="padding:25px 0px 40px 0px; " id="orderAdd"><asp:ImageButton
                                    ID="ImageButton1" runat="server" ImageUrl="image/flow_btn09.jpg" style="cursor:pointer;"/></div>
        </div>
      </div>
  
  </div>  
  </div>
  </div>

</div>


</div>
 
</div>
 
<div class="toolWrap rf">
<div class="sidemain mb10 bor">
<h3>账户余额：</h3>
<p>您的帐户余额：<%=GetCurrency() %><strong class="c1"><%=member.AdvancePayment.ToString("0.00") %></strong></p>
</div>
<div class="sidemain mb10 bor">
<h3>代餐券：</h3>
<p>您可使用的代餐券：<%=GetCurrency() %><strong class="c1"><%=member.Djq.ToString("0.00")%></strong></p>
</div>
 
</div>
 
</div>
 

<div class="footer">
<div class="wrap clearfix">Copyright © 2011 - 2112 <%=config.SiteUrl %> All Rights Reserved
<%=config.SiteName%> 版权所有</div>

</div>
</form>
<input type="hidden" id="shoppingcart_max_qty" value="999"/> 
	 <script language="javascript" type="text/javascript">
 function changeQty(a,zhi,rid,k)
{

var d=document.getElementById("txtQ"+zhi).value;

var c=parseInt(document.getElementById("shoppingcart_max_qty").value);
var b=false;
if(d=="")
{b=true}
else
{b=new RegExp("^[1-9]\\d*$").test(d)}
if(b)
{
if(a=="add")
{

d++;

 if(d>k)
 {
 
   d--;
   alert("库存不足！");
   document.getElementById("txtQ"+zhi).value=d;
   Gckuname(rid,zhi,k);
   return false;
 }
if(d<=c)
{
document.getElementById("txtQ"+zhi).value=d;

Gckuname(rid,zhi,k);
}
else
{
document.getElementById("txtQ"+zhi).value=c;
alert("最大购买数量为"+c);
document.getElementById("txtQ"+zhi).focus();
document.getElementById("txtQ"+zhi).value=c;
return false
}
}


if(a=="reduce")
{
d--;
if(d>=1)
{
document.getElementById("txtQ"+zhi).value=d;
Gckuname(rid,zhi,k);
}
else
{
document.getElementById("txtQ"+zhi).value="";
alert("您至少购买一件商品！");
document.getElementById("txtQ"+zhi).focus();
document.getElementById("txtQ"+zhi).value=1;
return false
}}}}

				    </script>
</body>
</html>

