<!--#include file="htmlhead.html"-->
<!--#include file="header.html"-->
<form id="bbr-fill-form" name="bbr-fill-form" method="post" action="" >
	<div class="wbox">
		<ul class="flow-steps">
			<li><b class="f"></b><span>1、查看购物车</span><s></s></li>
			<li class="on"><b></b><span>2、确认订单信息</span><s></s></li>
			<li><b></b><span>3、为订单付款</span><s></s></li>
			<li><b></b><span>4、确认收货</span><s></s></li>
			<li><b></b><span>5、评价</span><s></s></li>
		</ul>
	</div>
	<div class="wbox">
		<br/>
		<p class="gleft fbold120">确认收货地址</p>
		<br/>
		<div class="grid-container grid-ttl-tr fn-clear">
			<div class="grid10 gleft gridnomargin">收件地址</div>
			<div class="grid2 gleft">邮政编码</div>
			<div class="grid2 gleft">收件人</div>
			<div class="grid3 gleft">手机</div>
			<div class="grid3 gleft">固定电话</div>
			<div class="grid4 gleft">常用电子邮箱地址</div>
		</div>
		<div class="grid-container grid-cnt-tr fn-clear">
			<div class="grid10 gleft gridnomargin"><input id="loginedaddress" name="loginedaddress" type="text" value="<%=loginedaddress%>" size="70"/></div>
			<div class="grid2 gleft"><input id="loginedzipcode" name="loginedzipcode" type="text" value="<%=loginedzipcode%>" size="6"/></div>
			<div class="grid2 gleft"><input id="loginedrealname" name="loginedrealname" type="text" value="<%=loginedrealname%>" size="6"/></div>
			<div class="grid3 gleft"><input id="loginedmobile" name="loginedmobile" type="text" value="<%=loginedmobile%>" size="10"/></div>
			<div class="grid3 gleft"><input id="loginedtelephone" name="loginedtelephone" type="text" value="<%=loginedtelephone%>" size="10"/></div>
			<div class="grid4 gleft"><input id="loginedemail" name="loginedemail" type="text" value="<%=loginedemail%>" size="20"/></div>
		</div>
	</div>
	<div class="wbox">
		<br/>
		<p class="gleft fbold120">确认订单信息</p>
		<br/>
		<div class="grid-container grid-ttl-tr fn-clear">
			<div class="grid2 gcenter gridnomargin">图片</div>
			<div class="grid9 gleft">域名名称</div>
			<div class="grid2 gright">单价(元)</div>
			<div class="grid3 gright">优惠价(元)</div>
			<div class="grid2 gcenter">数量(件)</div>
			<div class="grid3 gcenter">运送方式</div>
			<div class="grid3 gright">小计(元)</div>
		</div>
		<% dim carttotalmoney:carttotalmoney=0 %>
		<% do while not rs.eof %>
			<%
			dim cartaucbuyprice
			cartaucbuyprice=rs("aucbuyprice")
			if chknum(rs("msaucdiscountprice")) then
				cartaucbuyprice=rs("msaucdiscountprice")
			end if
			cartaucbuyprice=formatNumber(cartaucbuyprice,2,-1,0,0)
			%>
			<div class="grid-container grid-cnt-tr fn-clear" J-cart-list="item">
				<div class="grid2 gcenter gridnomargin"><img src="<%=SYS_HTTP_WEBURL & rs("aucimageurl")%>" width="50" height="50" border="0" alt="" style="border:1px #eee solid;"/></div>
				<div class="grid9 gleft">
					<a href="<%=SYS_HTTP_WEBURL%>item.asp?aucid=<%=rs("aucid")%>" target="_blank"><%=rs("aucitemtitle")%></a><br/>
					卖家：<%=rs("bbruname")%> &nbsp; <%=Disp_UserCredit(rs("aucitemowner"),rs("creditseller"),0)%><br/>
					可购数量：<%=rs("aucnum")%>件 &nbsp; 所在地：<%=rs("BBR_AucProv")%><%=rs("BBR_AucCity")%>
				</div>
				<div class="grid2 gright">
					<% if chknum(rs("msaucdiscountprice")) then %>
						<s><%=formatNumber(rs("aucbuyprice"),2,-1,0,0)%></s>
					<% else %>
						<span id="cartitemprice<%=rs("cartid")%>"><%=formatNumber(rs("aucbuyprice"),2,-1,0,0)%></span>
					<% end if %>
				</div>
				<div class="grid3 gright">
					<% if chknum(rs("msaucdiscountprice")) then %>
						<span id="cartitemprice<%=rs("cartid")%>" class="CurrentPrice_ex"><%=formatNumber(rs("msaucdiscountprice"),2,-1,0,0)%></span>
					<% end if %>
				</div>
				<div id="cartitemquantity<%=rs("cartid")%>" class="grid2 gcenter"><%=rs("cartgoodsquantity")%></div>
				<div class="grid3">
				<input name="goodsid" type="hidden" value="<%=rs("aucid")%>" />
				<% if rs("BBR_PayforTM")=2 then %>
					<select name="goodstm" cartid="<%=rs("cartid")%>">
						<option value="">==请选择==</option>
						<% if cdbl(rs("BBR_AucTM1"))>0 then %><option value="1" moneyval="<%=formatNumber(rs("BBR_AucTM1"),2,-1,0,0)%>">平邮 <%=formatNumber(rs("BBR_AucTM1"),2,-1,0,0)%><%=SYS_WEBMONEY%></option><% end if %>
						<% if cdbl(rs("BBR_AucTM2"))>0 then %><option value="2" moneyval="<%=formatNumber(rs("BBR_AucTM2"),2,-1,0,0)%>">快递 <%=formatNumber(rs("BBR_AucTM2"),2,-1,0,0)%><%=SYS_WEBMONEY%></option><% end if %>
						<% if cdbl(rs("BBR_AucTM3"))>0 then %><option value="3" moneyval="<%=formatNumber(rs("BBR_AucTM3"),2,-1,0,0)%>">EMS <%=formatNumber(rs("BBR_AucTM3"),2,-1,0,0)%><%=SYS_WEBMONEY%></option><% end if %>
					</select>
				<% else %>
					免邮费<input name="goodstm" type="hidden" value="0" />
				<% end if %>
			</div>
				<div id="cartitemmoney<%=rs("cartid")%>" class="grid3 gright" J-bbr-cart="itemmoney"><%=formatNumber(cartaucbuyprice*rs("cartgoodsquantity"),2,-1,0,0)%></div>
			</div>
			<% carttotalmoney=carttotalmoney+formatNumber(cartaucbuyprice*rs("cartgoodsquantity"),2,-1,0,0) %>
			<% rs.movenext %>
		<% loop %>
		<div class="grid-container grid-ttl-tr fn-clear">
			<div class="grid10 gleft gridnomargin">
				给卖家留言：<input name="buydemo" type="text" value="" size="60" />
			</div>
			<div class="grid12 gright">
				域名总价(含运费)：<span class="carttotalmoney"><%=formatNumber(carttotalmoney,2,-1,0,0)%></span> 元
				<input name="carttotalmoney" type="hidden" value="<%=formatNumber(carttotalmoney,2,-1,0,0)%>" />
			</div>
		</div>
		<!--
		<div class="grid-container fn-clear">
			<div class="grid6 gleft gridnomargin"><br/><br/>
				&nbsp;
			</div>
			<div class="grid18 gright">
				<br/>
				<%=selector("radio","cartpaystyle",0,PayStyleValueStr,PayStyleStr,false)%>
				<br/><br/>
			</div>
		</div>
		-->
		<div class="grid-container fn-clear">
			<div class="grid6 gleft gridnomargin"><br/><br/>
				<a href="<%=SYS_HTTP_WEBURL%>">继续购物</a> &nbsp; | &nbsp;
				<a href="<%=SYS_HTTP_WEBURL%>bbr_ajaxaddtocart.asp?act=clearall">清空购物车</a> &nbsp; | &nbsp;
				<a href="cart.asp">返回购物车</a>
			</div>
			<div class="grid18 gright">
				<br/>
				<a class="bbr-button"><input id="bbr_form_fill_submitbtn" type="button" value="提交订单" /></a>
				<br/><br/>
			</div>
		</div>
	</div>
	<input name="act" type="hidden" value="submitorder" />
</form>
<script type="text/javascript">
	$(document).ready(function(){
		//修改运送方式
		$("select[name=goodstm]").each(function(){
			$(this).change(function(){
				var thisval=$(this).find('option:selected').attr("moneyval");
				if(isNaN(thisval)){ thisval=0; }
				var thiscartid=$(this).attr("cartid");
				var $cartitemprice=$("#cartitemprice"+thiscartid.toString());
				var $cartitemquantity=$("#cartitemquantity"+thiscartid.toString());
				var $cartitemmoney=$("#cartitemmoney"+thiscartid.toString());
				var cartitemmoney=parseFloat($cartitemprice.text())*parseInt($cartitemquantity.text())+parseFloat(thisval);
				cartitemmoney=Math.round(cartitemmoney*Math.pow(10, 2))/Math.pow(10, 2);
				cartitemmoney=cartitemmoney.toString();
				if(cartitemmoney.indexOf(".")>0){cartitemmoney=cartitemmoney.substr(0,cartitemmoney.indexOf(".")+3);}
				$cartitemmoney.text(cartitemmoney);
				var carttotalmoney=0;
				$("div[J-bbr-cart=itemmoney]").each(function(){
					carttotalmoney=carttotalmoney + parseFloat($(this).text());
				});
				$("input[name=carttotalmoney]").val(carttotalmoney);
				$(".carttotalmoney").text(carttotalmoney);
			
			});
		});
		$("#bbr_form_fill_submitbtn").click(function(){
			var validatestatus=true;
			//检测收件信息
			var loginedaddress=$("#loginedaddress").val();
			if(loginedaddress==""){
				alert('请填写收件地址');
				return false;
			}
			var loginedrealname=$("#loginedrealname").val();
			if(loginedrealname==""){
				alert('请填写收件人姓名');
				return false;
			}
			var loginedmobile=$("#loginedmobile").val();
			var loginedtelephone=$("#loginedtelephone").val();
			if(loginedmobile==""&&loginedtelephone==""){
				alert('请填写收件人联系手机或者固定电话号码');
				return false;
			}
			var loginedemail=$("#loginedemail").val();
			if(loginedemail==""){
				alert('请填写常用电子邮件地址');
				return false;
			}
			if(loginedemail.indexOf('@')<=0){
				alert('常用电子邮件地址格式错误');
				return false;
			}
			//检测运送方式选择
			$("select[name=goodstm]").each(function(){
				if($(this).val()==''){
					alert('请选择订单信息列表里的运送方式！');
					validatestatus=false;
					return false;
				}
			});
			//检测购物车项目数量
			if($("div[J-cart-list=item]").length==0){
				alert('购物车为空，请先购物将您需要的域名加入购物车');
				return false;
			}
			if(validatestatus){ $("#bbr-fill-form").submit(); }
		});
	});
</script>
<!--#include file="footer.html"-->