jstl应用3

来源:互联网 发布:atm模拟程序 c语言 编辑:程序博客网 时间:2024/05/29 08:34

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!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>
    <base href="<%=basePath%>">
    <title>订单信息确认</title>
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">   
 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 <meta http-equiv="description" content="This is my page">
    <link href="css/css[1].css" rel="stylesheet" type="text/css" />
    <link href="css/detail[1].css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">var current_shop_id="133";</script>
   
    <!---------- 自己添加的 ----------->
    <script type="text/javascript">
     var bl=true;
  function newAddress(ob){
   if(bl){
    document.getElementById('o_address_write').style.display='block';
    ob.value='不使用新的收货信息';
    var addRadios=document.getElementsByName('addRadio');
    for(var i=0;i<addRadios.length;i++){
     if(addRadios[i].checked){
      addRadios[i].checked=false;
     }
    }
    document.lookOrder_form.addId.value='0';
    bl=false;
   }else{
    document.getElementById('o_address_write').style.display='none';
    ob.value='使用新的收货信息';
    bl=true;
   }
  }
  function changeAddId(v){
   document.lookOrder_form.addId.value=v;
   if(!bl){
    newAddress(document.getElementById('operAddress'));
   }
  }
   
     function subOrderInfo(){
   if(document.lookOrder_form.addId.value=='0'){
    if(document.lookOrder_form.orderName.value.length==0){
     alert('收货人信息不能为空');
     return false;
    }else if(document.lookOrder_form.addName.value.length==0){
     alert('收货地址不能为空');
     return false;
    }else if(document.lookOrder_form.addPhone.value.length==0){
     alert('联系电话不能为空');
     return false;
    }else if(document.lookOrder_form.addEmail.value.length==0){
     alert('收货邮箱不能为空');
     return false;
    }else if(document.lookOrder_form.addPort.value.length<6){
     alert('收货邮编长度小于6位');
     return false;
    }else{
     var email=document.lookOrder_form.addEmail.value;
     if(email.indexOf('@')<1 || (email.indexOf('.')<(email.indexOf('@')+1))){
      alert('邮箱格式不正确');
      return false;
     }
    }
   }
   document.lookOrder_form.submit();
  }
</script>
</head>
<body onkeypress="if(event.keyCode==13)return false;">
    <script language="javascript" type="text/javascript" src="./js/show_ads[1].js"></script>

<div class="clearbox"></div>

    <div id="mainbox">
   <jsp:include page="top.jsp"></jsp:include>
 <div class="clearbox"></div> 
 
<form name="lookOrder_form" action="order.do" method="post">
 <input type="hidden" name="addId" value="0"/>
 <input type="hidden" name="orderAction" value="submitOrder"/> 
      <div class="center_ss">
          <div class="Wrap_cart">
            <div class="Header_cart">  
             <ul class="Order_cart" id="Order_cart_S2">
              <li class="step1">1.我的购物车</li>
              <li class="step2">2.填写核对订单信息</li>
              <li class="step3">3.成功提交订单</li>
             </ul>  
            </div>
          </div>         
         <div class="List_cart" style="margin-top:10px;">
        
         <h2><strong>填写核对订单信息</strong></h2>
         <div class="cart_table">
              <!--收货人地址开始-->
              <div id="part_address">
                  <div class='o_write'>
    <h1>收货人信息&nbsp;</h1>
   
<c:if test="${!empty addList}">
    <div id="part_payandsend">
           <div class='o_write'>
             <h1>历史收货信息&nbsp;</h1>
             <div class='middle'>
              <table style='width:100%;'>
              <c:forEach items="${addList}" var="add" step="1">
               <tr>
                <td style='text-align:left;width:170px;'>
                 <input type="radio" name="addRadio" value="${add.addId}" onclick="changeAddId(this.value)"/>
                 收货人:${add.orderName}
                </td>
                <td style='text-align:left;width:170px;'>电话:${add.addPhone}</td>
                <td style='text-align:left;width:170px;'>邮编:${add.addPort}</td>
                <td style='text-align:left;width:170px;'>Email:${add.addEmail}</td>
               </tr>
               <tr>
                <td style='text-align:left;width:170px;'>&nbsp;</td>
                <td colspan="3" style='text-align:left;'>地址:${add.addName}</td>
               </tr>
              </c:forEach>
              </table>
             </div>
   </div>
       </div>
               
    <input id="operAddress" class='btn_button' value='使用新的收货信息' type='button' onclick="newAddress(this)"/>
</c:if>

    <div <c:choose><c:when test="${empty addList}">style="display:block;"</c:when><c:otherwise>style="display:none;"</c:otherwise></c:choose> id="o_address_write">
         <table>
             <tr><td style='width:90px;' align='right'>
               <span class="red">*</span> 收货人姓名:
              </td>
              <td>
               <input type="text" maxlength="50" name="orderName" size="20" class="txt" id="txt_receiver_name"/>
              </td>
             </tr>
             <tr>
              <td align='right'>
               <span class="red">*</span> 地  址:
              </td>
              <td>
               <span id="span_province_city"></span>
               <input type="text" maxlength="500" name="addName" size="50" class="txt" id="txt_address"/><br />标准格式:**省**市**区**路名**办公地名(小区名)几单元几号,请尽量详细填写
              </td>
             </tr>
             <tr>
              <td align='right'>
               <span class="red">*</span> 电    话:
              </td>
              <td>
               <input type="text" maxlength="30" name="addPhone" size="20" class="txt" id="txt_mobilephone"/> (手机或者固定电话用于接收发货通知短信及送货前确认)
              </td>
             </tr>
             <tr>
              <td align='right'><span class="red">*</span>邮   箱:</td>
              <td>
               <input type="text" maxlength="150" name="addEmail" size="20" class="txt" id="txt_e_mail"/>邮箱格式必须包含'@'和'.'并且不能以'@'开头'@'和'.'之间至少有一个字符
              </td>
             </tr>
             <tr>
              <td align='right'><span class="red">*</span>邮  编:</td>
              <td><input type="text" name="addPort" size="6" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" id='txtPageIndex' onkeyup="value=value.replace(/[^\d]/g,''); if (value.length>maxValue.length || value>maxValue) value=maxValue;" maxlength=6 class="txt" id="txt_postcode"/> 有助于快速确定送货地址</td>
             </tr>
             <tr><td colspan='2'></td></tr>
            
         </table>
    </div>
</div>
                 </div>
                 <!--收货人地址结束-->
                
                <!--支付方式及配送方式开始-->
                <div id="part_payandsend">
                     <div class='o_write'><h1>支付及配送方式&nbsp;</h1><div class='middle'><table style='width:100%;'><tr><td style='text-align:left;width:170px;'><h1>支付方式</h1></td><td>备注</td></tr><tr><td>支付宝</td><td colspan="2">担保交易,收货之后再确认支付</td></tr></table></div><div class='middle' style="margin-top:20px;padding-top:10px;"><table style='width:100%;'><tr><td style='text-align:left;width:170px;'><h1>配送方式</h1></td><td style="width:100px;">运费</td><td>备注</td></tr><tr><td>EMS</td><td>0.00元<span style='color:red'>(免运费)</span></td><td>全国范围送货,到货时间3-5天左右,需签收后验货</td></tr>
<tr><td colspan="2">o</td><td style="padding-top:15px;"><span class="red">声明:</span>系统将优先按照客户选择的快递发货,实际发货快递系统将按照实际情况选择。</td></tr>
</table></div></div>
                </div>
                <!--支付方式及配送方式结束-->
               
               
                <!--备注信息开始-->
                <div id="part_remark">
                    <div class='o_show'><h1>订单备注&nbsp;</h1><div class='middle'><table style='width:100%;'><tr><td style='text-align:left;padding-left:20px;'>暂无备注</td></tr></table></div></div>
                </div>
                <!--备注信息开始-->
               
                <!--Cart信息开始-->
                <div id="CartMessagePanel" style="text-align:right;color:red;padding:3px;"></div>
                <div id="part_cart">
                    <div class='o_show'>
                            <h1><span style='margin-right:700px;'>商品清单</span></h1>
                            <div class='middle'>
                              <table class='Table' cellpadding='0' cellspacing='0' width='100%'>
                                <tr class='align_Center Thead'>
                                    <td width='7%'>商品编号</td>
                                    <td>商品名称</td>
                                   
                                    <td width='10%'>订购价格</td>
                                    <td width='9%'>订购数量</td>
                                    <td width='9%'>小计</td>
                                </tr>
                            <c:forEach items="${ordI.products}" var="prod" step="1" varStatus="s">
                                <tr class="align_Center">
         <td style="padding:5px 0 5px 0;">${prod.proId}&nbsp;</td>
         <td class="align_Left">
          ${prod.proName} &nbsp; &nbsp;
          <img height="30" width="50" src="upload/productImg/${prod.proImage}"/>
         </td>
         
         <td><span class="price">${ordI.orderProducts[s.index].orderPrice}&nbsp;</span></td>
         <td>${ordI.orderProducts[s.index].orderNumber}&nbsp;</td>
         <td>${ordI.orderProducts[s.index].proSum}&nbsp;</td>
        </tr>
       </c:forEach>
                             </table>
                           </div>
                           <div class='footer'></div>
                    </div>
                </div>
                <!--Cart信息开始-->
                            
                 <div id="ware_info">
                      <div style="background:#fff;font-size:14px;font-weight:bold;padding-left:2px;">结算信息</div>
                      <h1></h1>
                      <div class="middle">
                            <!--订单信息-->
                            <ul id='part_info'>
                                <li class='info1' style='padding-bottom:5px' id="lable_order_fee_info">商品金额:${ordI.priceSum}元  -  代金券:<span>0.00</span>元  +  运费:0.00元<br /></li>
                                <li class='info2' style='width:100%;overflow:hidden;'>
                                    <table style='width:100%' cellpadding='0' cellspacing='0'>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td style='text-align:right;font-size:15px;'><b>应付总额:<font color='red' id="lable_order_total_fee">¥${ordI.priceSum}</font>元</b></td>
                                        </tr>
                                    </table>
                                </li>
                            </ul>
                            <!--订单信息结束-->
                      </div>
                </div>
                 <!--提交-->
                <div class="o_show submit">                    
                   
                    <div class="tips"><span id="submitWaitInfo"></span></div>
                    <div>
                     
                     <input type="button" onClick="subOrderInfo()" style="margin-top:2px;border:none;width:160px;height:53px;background:url('images/submits1.jpg')"/>
                    </div>
                </div>
                <!--提交结束-->
               

            </div>
            <div class="round"><div class="lround"></div><div class="rround"></div></div>
         </div>
     
      </div>     
</form>     
      <div class="clearbox"></div>
     
       <jsp:include page="bottom.jsp"></jsp:include>
    </div> 
</body>
</html>