자바 온라인 도서 쇼핑 몰(8)주문 모듈 3

전편 을 계속 공부 하 다.
3.주문 상세 정보 조회
OrderServlet

public String load(HttpServletRequest req, HttpServletResponse resp)
  throws ServletException, IOException {
 String oid = req.getParameter("oid");
 Order order = orderService.load(oid);
 req.setAttribute("order", order);
 String btn = req.getParameter("btn");//btn                   
 req.setAttribute("btn", btn);
 return "/jsps/order/desc.jsp";
}
desc.jsp

<div class="divOrder">
 <span>   :${order.oid }
 <c:choose>
  <c:when test="${order.status eq 1 }">(    )</c:when>
  <c:when test="${order.status eq 2 }">(    )</c:when>
  <c:when test="${order.status eq 3 }">(    )</c:when>
  <c:when test="${order.status eq 4 }">(    )</c:when>
  <c:when test="${order.status eq 5 }">(   )</c:when>
 </c:choose> 
     :${order.ordertime }</span>
</div>
<div class="divContent">
 <div class="div2">
  <dl>
   <dt>     </dt>
   <dd>${order.address }</dd>
  </dl>
 </div>
 <div class="div2">
  <dl>
   <dt>    </dt>
   <dd>
    <table cellpadding="0" cellspacing="0">
     <tr>
      <th class="tt">    </th>
      <th class="tt" align="left">  </th>
      <th class="tt" align="left">  </th>
      <th class="tt" align="left">  </th>
     </tr>
 
     <c:forEach items="${order.orderItemList }" var="item">
      <tr style="padding-top: 20px; padding-bottom: 20px;">
       <td class="td" width="400px">
        <div class="bookname">
         <img align="middle" width="70" src="<c:url value='/${item.book.image_b }'/>"/>
         <a href="<c:url value='/BookServlet?method=load&bid=${item.book.bid }'/>">${item.book.bname }</a>
        </div>
       </td>
       <td class="td" >
        <span>¥${item.book.currPrice }</span>
       </td>
       <td class="td">
        <span>${item.quantity }</span>
       </td>
       <td class="td">
        <span>¥${item.subtotal }</span>
       </td>  
      </tr>
     </c:forEach>
 
    </table>
   </dd>
  </dl>
 </div>
 <div style="margin: 10px 10px 10px 550px;">
  <span style="font-weight: 900; font-size: 15px;">    :</span>
  <span class="price_t">¥${order.total }</span><br/>
  <c:if test="${order.status eq 1 }">
   <a href="<c:url value='/OrderServlet?method=paymentPre&oid=${order.oid }'/>" class="pay"></a><br/>
  </c:if>
  <c:if test="${order.status eq 1 and btn eq 'cancel'}">
   <a id="cancel" href="<c:url value='/OrderServlet?method=cancel&oid=${order.oid }'/>">    </a><br/>
  </c:if>
  <c:if test="${order.status eq 3 and btn eq 'confirm'}">
   <a id="confirm" href="<c:url value='/OrderServlet?method=confirm&oid=${order.oid }'/>">    </a><br/>
  </c:if> 
 </div>
</div>


4.주문 취소,수령 확인
이상 이 바로 본 고의 모든 내용 입 니 다.여러분 의 학습 에 도움 이 되 고 저 희 를 많이 응원 해 주 셨 으 면 좋 겠 습 니 다.

좋은 웹페이지 즐겨찾기