<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Order_Check.aspx.cs" Inherits="Mall.Order.Order_Check" %>

<%@ Register Src="/usercontrol/Top.ascx" TagName="uchead" TagPrefix="headuc" %>
<%@ Register Src="/usercontrol/Footer.ascx" TagName="ucfooter" TagPrefix="footeruc" %>
 <%
     
    List<MODEL.MModelProductListHelper> plist = plists;  
     
     MODEL.MOrder model_order = (MODEL.MOrder)Session["model_order"];

      %> 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>订单确认</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK  media=screen href="/content/images/mkl/global.css" type=text/css rel=stylesheet>
<LINK media=screen href="/content/images/mkl/shopc.css" type=text/css rel=stylesheet>
<SCRIPT src="/content/images/mkl/jquery-1.3.2.min.js" type=text/javascript></SCRIPT>
<LINK media=screen href="/content/images/mkl/global2.css" type=text/css 
rel=stylesheet><LINK href="/content/images/mkl/c2.css" rel=stylesheet>
<LINK media=screen href="/content/images/mkl/thickbox.css" type=text/css 
rel=stylesheet>
<SCRIPT>
    function stopBubble(e) {
        //如果提供了事件对象，则这是一个非IE浏览器
        if (e && e.stopPropagation)
        //因此它支持W3C的stopPropagation()方法
            e.stopPropagation();
        else
        //否则，我们需要使用IE的方式来取消事件冒泡
            window.event.cancelBubble = true;
    }

    //阻止浏览器的默认行为
    function stopDefault(e) {
        //阻止默认浏览器动作(W3C)
        if (e && e.preventDefault)
            e.preventDefault();
        //IE中阻止函数器默认动作的方式
        else
            window.event.returnValue = false;
        return false;
    }

    function setBalance(payTypeID, payAmount) {

        document.all('td_' + payTypeID).innerText = '￥' + payAmount;
    }

    function CheckEmail(obj) {
        var liMessage = document.getElementById("liEmailMessage");
        if (obj.value == "" || obj.value == "Email地址") {
            liMessage.className = "c_info_msg ml10";
            liMessage.innerHTML = "请填写您的Email地址";
            return false;
        }
        if (!f_CheckEMail(document.getElementById("ctl00_MainPlace_txtEMail").value)) {
            liMessage.className = "c_info_msg ml10";
            liMessage.innerHTML = "Email格式错误，请重新填写";
            return false;
        }
        else {
            liMessage.className = "c_info_msg_gray ml10";
            liMessage.innerHTML = "您可以随时使用Email登录麦网查看订单状态";
            liMessage.style.color = "";
            M18Web.Order.CartService.HasEmail(obj.value, CheckEmailCallBack);
            return true;
        }
    }
    function CheckEmailCallBack(str) {
        if (str == "Y") {
            var liMessage = document.getElementById("liEmailMessage");
            liMessage.className = "c_info_msg ml10";
            liMessage.innerHTML = "此Email已被注册，请重新填写";
        }
    }
    function CheckPwd(isFirstPwd) {
        var liMessage = document.getElementById("liPwdMessage");
        var liDouErr = document.getElementById("liDouMessage");
        var pwd1 = document.getElementById("ctl00_MainPlace_txt_Reg_Pwd");
        var pwd2 = document.getElementById("ctl00_MainPlace_txt_Dou_Pwd");
        liMessage.className = "c_info_msg_gray ml10";
        liMessage.innerHTML = "密码设为6-20位字母或数字";
        liDouErr.className = "c_info_msg_gray ml10";
        liDouErr.innerHTML = "";
        if (isFirstPwd) {
            if (pwd1.value == "") {
                liMessage.className = "c_info_msg ml10";
                liMessage.innerHTML = "请填写您的密码";
                return false;
            }
        }
        else {
            if (pwd2.value == "") {
                liDouErr.className = "c_info_msg ml10";
                liDouErr.innerHTML = "请再次填写您的密码";
                return false;
            }
        }

        var reg = /^(\w|@|#|\$){6,20}/;
        if (!reg.test(pwd1.value) && isFirstPwd) {
            liMessage.className = "c_info_msg ml10";
            liMessage.innerHTML = "密码格式错误，请输入6-20位字母或数字";
            return false;
        }
        else if (!reg.test(pwd2.value) && !isFirstPwd) {
            liDouErr.className = "c_info_msg ml10";
            liDouErr.innerHTML = "密码格式错误，请输入6-20位字母或数字";
        }
        else if (pwd1.value != pwd2.value && pwd1.value != "" && pwd2.value != "") {
            if (isFirstPwd) {
                liMessage.className = "c_info_msg ml10";
                liMessage.innerHTML = "两次密码输入不一致，请重新输入";
            }
            else {
                liDouErr.className = "c_info_msg ml10";
                liDouErr.innerHTML = "两次密码输入不一致，请重新输入";
            }
            return false;
        }
        return true;
    }
    function MessageChanged(obj) {
        var cbxNeedInvoice = document.getElementById("ctl00_MainPlace_chkbox_NeedInvoice");
        if (obj.value != "")
            cbxNeedInvoice.checked = true;
    }
    function checkRegister() {
        //发票检查
        var text = document.getElementById("ctl00_MainPlace_lblInvoiceInfos").innerText;
        var styleValue = $("#ctl00_MainPlace_divinvoice").css("display");
        if (document.getElementById("ctl00_MainPlace_chkbox_NeedInvoice1").checked &&
                text == "") {
            $("#ctl00_MainPlace_error").attr("style", "display:inline");
            $("html,body").animate({ scrollTop: $("#a1").offset().top }, 100);
            return false;
        }
        if (document.getElementById("ctl00_MainPlace_chkbox_NeedInvoice1").checked && styleValue == "none") {
            $("#ctl00_MainPlace_error").attr("style", "display:inline");
            $("html,body").animate({ scrollTop: $("#a1").offset().top }, 100);
            return false;
        }
        //注册检查
        if ('mcvrlab@gmail.com' != '')
            return true;
        if (!document.getElementById("ctl00_MainPlace_CheckBox1").checked) {
            $("#regMsg").attr("style", "display:inline");
            alert("您不同意《麦网用户服务协议》，不能进行注册");
            $("html,body").animate({ scrollTop: $("#a1").offset().top }, 100);
            return false;
        }
        if (!CheckEmail(document.getElementById("ctl00_MainPlace_txtEMail"))) {
            $("#regMsg").attr("style", "display:inline");
            $("html,body").animate({ scrollTop: $("#a1").offset().top }, 100);
            return false;
        }
        if (!CheckPwd(true)) {
            $("#regMsg").attr("style", "display:inline");
            $("html,body").animate({ scrollTop: $("#a1").offset().top }, 100);
            return false;
        }
        if (!CheckPwd(false)) {
            $("#regMsg").attr("style", "display:inline");
            $("html,body").animate({ scrollTop: $("#a1").offset().top }, 100);
            return false;
        }
        return true;
    }
    function RegisterRemark() {
        window.open("http://www.m18.com/Contact/RegisterRemark.html", "RegisterRemark", "height=165, width=590, toolbar= no, menubar=no, scrollbars=no, resizable=no, location=no, status=no,top=100,left=300")
    }

    //发票脚本
    $(function () {
        $("#ctl00_MainPlace_chkbox_NeedInvoice1").click(
            function () {
                var text = document.getElementById("ctl00_MainPlace_lblInvoiceInfos").innerText;
                var styleValue = $("#ctl00_MainPlace_divinvoice").css("display");
                if ($("#ctl00_MainPlace_chkbox_NeedInvoice1").attr("checked") == true && text == "") {
                    $("#ctl00_MainPlace_chkbox_NeedInvoice1").attr("checked", false);
                    $("#ctl00_MainPlace_alink").click();
                }
                if ($("#ctl00_MainPlace_chkbox_NeedInvoice1").attr("checked") == false && text != "") {
                    $("#ctl00_MainPlace_divinvoice").attr("style", "display:none");
                }
                if ($("#ctl00_MainPlace_chkbox_NeedInvoice1").attr("checked") == true && text != "") {
                    $("#ctl00_MainPlace_chkbox_NeedInvoice1").attr("checked", false);
                    $("#ctl00_MainPlace_alink").click();
                }
            });
    });

    //发票新增方法, 增加InvoiceTypeCode
    function AjaxMethod(InvoiceCategory, InvoiceContent, InvoiceType, InvoiceTypeCode) {
        //设置隐藏值
        $("#ctl00_MainPlace_hidInvoiceCategory").attr("value", InvoiceCategory);
        $("#ctl00_MainPlace_hidInvoiceContent").attr("value", decodeURIComponent(InvoiceContent));
        $("#ctl00_MainPlace_hidInvoiceType").attr("value", InvoiceType);
        $("#ctl00_MainPlace_hidInvoiceTypeCode").attr("value", InvoiceTypeCode);

        var textValue = "";
        if (InvoiceCategory != null && InvoiceCategory == "P") {
            textValue = "个人，";
        }
        else {
            textValue = decodeURIComponent(InvoiceContent) + "，";
        }
        if (InvoiceType != "") {
            textValue += InvoiceType;
        }
        else {
            textValue += "明细";
        }
        if (textValue != null) {
            $("#ctl00_MainPlace_lblInvoiceInfos").text(textValue);
            $("#ctl00_MainPlace_divinvoice").attr("style", "display:block");
            $("#ctl00_MainPlace_chkbox_NeedInvoice1").attr("checked", true);
        }
    }
    </SCRIPT>
 
<META content="MSHTML 6.00.6000.17092" name=GENERATOR></HEAD>
<BODY>
<SCRIPT type=text/javascript> 
//<![CDATA[
    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
        theForm = document.aspnetForm;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
//]]>
</SCRIPT>
<SCRIPT src="/content/images/mkl/js" type=text/javascript></SCRIPT>
 
<headuc:uchead ID="headuc" runat="server" />
 
<DIV>
 
<form action="/order/order_end.aspx" method="post" id="ordersave" >
<input type="hidden" name="ProdId" value="0130"> 
<input type="hidden" value="12012318574479" name="funck">
<DIV class=wrap>
<DIV class=step><A class=step1 
href="/order/order_address.aspx"><SPAN>1.</SPAN><EM>收货地址</EM></A> 
<A class=step3 
href="/order/order_ship.aspx"><SPAN>2.</SPAN><EM>送货方式</EM></A> 
<A class=step2 
href="/order/order_pay.aspx"><SPAN>3.</SPAN><EM>付款方式</EM></A> 
<A class=step4cur 
href="#"><SPAN>4.</SPAN><EM>确认订单</EM></A><A 
id=a1 name=a1></A> </DIV>
<DIV class=order-confirm-box><!-- 提交订单 -->
<DIV class="mt10 mb10"><INPUT class="sub-order fl" id=ctl00_MainPlace_btnNext  onClick="checkn()"  type=submit value=提交订单 name=ctl00$MainPlace$btnNext> 
<A class="sub-order-back ml10" 
href="/cart/cart.aspx">返回购物车，修改订单商品</A> </DIV><!-- 注册 -->
<DIV class="user-login bor1" style="DISPLAY: none">
<DIV class="Offerstitle color-org blod">您需要创建一个帐户来记录您获得的积分和订单信息</DIV>
<DIV class="mt10 mb10">
<DIV class="clearfix mb10"><LABEL for=user-name>用户名：</LABEL> <INPUT class=text 
id=ctl00_MainPlace_txtEMail onclick='if( this.value=="Email地址" ) this.value=""' 
maxLength=40 onchange=CheckEmail(this) value=Email地址 
name=ctl00$MainPlace$txtEMail><SPAN class="color-gray ml10" 
id=liEmailMessage>您可以随时使用Email登录麦网查看订单状态</SPAN> </DIV>
<DIV class="clearfix mb10"><LABEL for=pwd>密码：</LABEL><INPUT class=text 
id=ctl00_MainPlace_txt_Reg_Pwd type=password maxLength=20 
onchange=CheckPwd(true) name=ctl00$MainPlace$txt_Reg_Pwd><SPAN 
class="color-gray ml10" id=liPwdMessage>密码设为6-20位字母或数字</SPAN> </DIV>
<DIV class="clearfix mb10"><LABEL for=pwdr>确认密码：</LABEL> <INPUT class=text 
id=ctl00_MainPlace_txt_Dou_Pwd type=password maxLength=20 
onchange=CheckPwd(false) name=ctl00$MainPlace$txt_Dou_Pwd><SPAN 
class="color-gray ml10" id=liDouMessage></SPAN> </DIV>
<DIV class="clearfix align"><INPUT id=ctl00_MainPlace_CheckBox1 type=checkbox 
CHECKED name=ctl00$MainPlace$CheckBox1><LABEL 
for=ctl00_MainPlace_CheckBox1>我已阅并同意</LABEL> <A 
href="javascript:RegisterRemark()">《用户服务协议》</A> </DIV></DIV><SPAN 
class="error-tips color-red bor1-r f14 blod" id=regMsg 
style="DISPLAY: none">您需要创建一个帐户来记录您获得的积分和订单信息</SPAN> </DIV>
<DIV id=goods-con style="width:805px;"><!-- 全部可用 -->
<DIV class=list_big_body style="width:805px;">
<DIV id=shopc_list_title style="width:800px;">
<UL>
  <LI class=title_width1 style="width:400px;"></LI>
  <LI class=title_width2></LI>
  <LI class=title_width2></LI>
  <LI class=title_width2></LI>
</UL></DIV>
<TABLE class=vi_inf_color id=TableOrderLine cellSpacing=0 cellPadding=0 
width="800" border=0>
  <!--DWLayoutTable-->
  <TBODY>


            

<%
    int buypontc = 0;
    int buyPricec = 0;
    for (int i = 0; i < plist.Count; i++)
    {
        MODEL.MModelProductListHelper model = plist[i];
        MODEL.MProduct model_priduct = model.Model_product;
        string BuyPrice = Convert.ToString(model_priduct.Price * model.CountBuy);
        buypontc = Convert.ToInt32(BuyPrice) + buypontc;
        BuyPrice = Convert.ToInt32(model_priduct.Point * model.CountBuy) + BuyPrice;
      
           
      
      %>                 
<TR align="left">
    <TD  style="BORDER-BOTTOM: #999 1px dashed;" width="150"  align="left"><A 
      href='/views.aspx?ProductId=<%=model.Priductid.ToString()%>' target=_blank><IMG  
      src="<%=model_priduct.Img_Logo==null?"":model_priduct.Img_Logo.ToString() %>" width=70></A></TD>
    <TD class=vi_inf style="BORDER-BOTTOM: #999 1px dashed" align="left" width="200"><SPAN 
      class=vi_inf_h1_color><input type="hidden" name="ProdId" value="0130"> 
                      <a href='/views.aspx?ProductId=<%=model.Priductid.ToString()%>'><%=model_priduct.ProductName==null?"":model_priduct.ProductName.ToString()%></a><SPAN>
					 
					  <p style="font-size:12px">颜色：<%=model.Cima %></p>
					  <p style="font-size:12px">尺码:<%=model.Yanse%>'</p>
     <br></SPAN></TD>
    <TD style="BORDER-BOTTOM: #999 1px dashed" align=middle 
width=120><%=model_priduct.Price.ToString()%></TD>   
    <TD style="BORDER-BOTTOM: #999 1px dashed" align=middle width=120>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD vAlign=bottom align=middle height=40>
            <DIV><%=model.CountBuy.ToString() %></DIV></TD></TR>
        <TR>
          <TD id=tdErrorInfo12 style="COLOR: #f30" align=middle 
        height=22></TD></TR></TBODY></TABLE></TD>
 <TD style="BORDER-BOTTOM: #999 1px dashed" align=middle width=120></TD>
    <TD style="BORDER-BOTTOM: #999 1px dashed" align=middle width=120><SPAN 
      id=spanAmount12 style="COLOR: #f00"> <%=(model_priduct.Price * model.CountBuy).ToString()%></SPAN></TD></TR>
<%} %>			 
				 
  
 
 
 </TBODY></TABLE>
</DIV></DIV><!-- 发票 -->
<DIV class="mt10 clearfix receipt-box">
<DIV class=fl style="display:none"><INPUT id=ctl00_MainPlace_chkbox_NeedInvoice1 type=checkbox 
name=ctl00$MainPlace$chkbox_NeedInvoice1><LABEL 
for=ctl00_MainPlace_chkbox_NeedInvoice1>索要发票</LABEL> 
<DIV id=ctl00_MainPlace_divinvoice style="DISPLAY: none"><SPAN 
id=ctl00_MainPlace_lblInvoicetag>发票信息：</SPAN> <SPAN 
id=ctl00_MainPlace_lblInvoiceInfos></SPAN><A class="link-b ml10 thickbox" 
id=ctl00_MainPlace_alink title=索要发票 
href="OrderInvoice.aspx?keepThis=true&amp;TB_iframe=true&amp;height=132&amp;width=402">修改</A> 
</DIV><!-- 保存发票值 -->
<DIV style="DISPLAY: none"><INPUT id=ctl00_MainPlace_hidInvoiceCategory 
type=hidden name=ctl00$MainPlace$hidInvoiceCategory> <INPUT 
id=ctl00_MainPlace_hidInvoiceContent type=hidden 
name=ctl00$MainPlace$hidInvoiceContent> <INPUT id=ctl00_MainPlace_hidInvoiceType 
type=hidden name=ctl00$MainPlace$hidInvoiceType> <INPUT 
id=ctl00_MainPlace_hidInvoiceTypeCode type=hidden 
name=ctl00$MainPlace$hidInvoiceTypeCode> </DIV></DIV>
<DIV class=fr><!--如何额外增加运费-->
<P>商品金额总计：<%=buypontc%><SPAN class=ml10>运费：<SPAN id=shipTips><%=model_order.EmsPrice %></SPAN><SPAN 
id=shipfee style="DISPLAY: none">0.00</SPAN></SPAN></P>
<P class="f14 blod tr">您需要为订单支付：<SPAN class=color-red 
id=payAmount><%=Convert.ToInt32(buypontc) + Convert.ToInt32(model_order.EmsPrice)%></SPAN><SPAN id=payAmountHidden 
style="DISPLAY: none">199.00</SPAN></P></DIV></DIV>
<DIV class="mt10 clearfix" style="DISPLAY: none">
<DIV class=fr>帐户余额冲抵：<SPAN class=color-red>0.00</SPAN></DIV></DIV>
<DIV class="mt10 clearfix" style="DISPLAY: none">
<DIV class=fr>购物礼券冲抵：<SPAN class=color-red>0.00</SPAN></DIV></DIV><!-- 商品清单 -->
<DIV class=setp_1_list_div style="DISPLAY: none">
<TABLE style="MARGIN-RIGHT: 10px" cellSpacing=0 cellPadding=0 width=700 
align=right border=0>
  <TBODY>
  <TR>
    <TD align=right></TD>
    <TD align=right>商品金额总计： </TD>
    <TD class=setp_3_conut width=80><%=buypontc %></TD></TR>
  <TR>
    <TD align=left><LABEL style="DISPLAY: none"><INPUT 
      id=ctl00_MainPlace_chkbox_NeedInvoice type=checkbox 
      name=ctl00$MainPlace$chkbox_NeedInvoice></LABEL> </TD>
    <TD align=right>运费： </TD>
    <TD class=setp_3_conut><%=model_order.EmsPrice %> </TD></TR>
  <TR style="DISPLAY: none">
    <TD align=left>&nbsp; </TD>
    <TD align=right>帐户余额冲抵： </TD>
    <TD class=setp_3_conut>0.00 </TD></TR><!--Benio start-->
  <TR style="DISPLAY: none">
    <TD align=left>&nbsp; </TD>
    <TD align=right>购物礼券冲抵： </TD>
    <TD class=setp_3_conut>0.00 </TD></TR><!--Benio end-->
  <TR>
    <TD class="blod setp_3_conut_all" align=left>
      <TABLE class=shr cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD width=8><IMG style="DISPLAY: none" height=28 
            src="/content/images/mkl/input_l.gif" width=8 align=absBottom> </TD>
          <TD width=8><IMG style="DISPLAY: none" height=28 
            src="/content/images/mkl/input_r.gif" width=8 align=absBottom> 
        </TD></TR></TBODY></TABLE></TD>
    <TD class="blod setp_3_conut_all" align=right>您需要为订单支付： </TD>
    <TD class="blod setp_3_conut_all"><SPAN><%=Convert.ToInt32(buyPricec)+Convert.ToInt32(model_order.EmsPrice) %></SPAN>元 
</TD></TR></TBODY></TABLE></DIV>
<DIV class="bor1 mt10 mb10">
<DIV class=Offerstitle>核对订单信息</DIV>
<div style="clear:both;"></div>
<DIV class=order-info>
 
 <div style="clear:both;"></div>
 
 
 
 
 
<UL>
  <LI class=clearfix><SPAN class="fl blod">收货信息：</SPAN> 
  <DIV class=fl><%=model_order.RecAddress+model_order.RecName+model_order.RecMobile+model_order.RecZip %></DIV><A class="fr link-r" 
  href="/order/order_address.aspx">修改</A> </LI><div style="clear:both;"></div>
  <LI class=clearfix><SPAN class="fl blod">运送方式：</SPAN> 
  <DIV class=fl><%=model_order.EmsIntro %>，<SPAN class="lower ml5"></SPAN><%=model_order.EmsIntro %></DIV><A 
  class="fr link-r" href="/order/order_ship.aspx">修改</A> </LI><div style="clear:both;"></div>
  <LI class=clearfix style="DISPLAY: none"><SPAN class="fl blod">优惠方式：</SPAN> 
  <DIV class=fl></DIV><A class="fr link-r" 
  href="ordership.aspx">修改</A> </LI><div style="clear:both;"></div>
  <LI class="clearfix border-none"><SPAN class="fl blod">付款方式：</SPAN> 
  <DIV class=fl><%=model_order.PayInfo %></DIV><A class="fr link-r" 
  href="/order/order_pay.aspx">修改</A> </LI><div style="clear:both;"></div></UL></DIV><div style="clear:both;"></div></DIV><!-- 提交 -->
<DIV class=mt10><INPUT class="sub-order fl" id=ctl00_MainPlace_btnNext2 onClick="checkn();" type=submit value=提交订单 name=ctl00$MainPlace$btnNext2> 
 
 
<script language="javascript">
    function checkn() {
        ordersave.submit();
    }
</script>
<A class="sub-order-back ml10" 
href="/cart/cart.aspx">返回购物车，修改订单商品</A> <SPAN 
class="bor1-r fag-error ml5" id=ctl00_MainPlace_error 
style="DISPLAY: none">请重新填写发票信息并保存</SPAN> </DIV></DIV></DIV>
</form>
</DIV>
<footeruc:ucfooter ID="footeruc" runat="server" />
 
 
<SCRIPT src="/content/images/mkl/comm.js" type=text/javascript></SCRIPT>
 
<SCRIPT src="/content/images/mkl/o_code.js" type=text/javascript></SCRIPT>
</BODY></HTML>



