Skip to content

Commit

Permalink
[1108] 주문 내역
Browse files Browse the repository at this point in the history
- 회원 주문 내역 조회 api 수정
- 기타 view 화면 수정
- #9 이슈
  • Loading branch information
DESKTOP-4OK39MV\user committed Nov 8, 2022
1 parent 07cac26 commit 964fbea
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public String lookUpOrder(
User user = userBO.getUserByUserId(order.getUserId());

model.addAttribute("user", user);
orderInfoList = orderBO.getOrderInfoByUserId(user.getId());
orderInfoList = orderBO.getOrderInfoByOrderId(orderId);
}

model.addAttribute("orderInfoList", orderInfoList);
Expand Down
9 changes: 7 additions & 2 deletions src/main/resources/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,13 @@ header .header-user-nav {
font-size: large;
}

.mypage-order-list th {
text-align: center;
.orderInfo-atag {
color: gray;
font-weight: normal;
}

.orderInfo-atag:hover {
color: darkgray;
}

/* a tag */
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/jsp/include/header.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ul class="nav nav-fill d-flex justify-content-center">
<li class="nav-item"><span class="user-nav-loginId mr-1">${userLoginId } 님</span></li>
<li class="nav-item"><a href="/user/signout" class="user-nav-text">로그아웃</a></li>
<%-- TODO : 마이페이지 --%><li class="nav-item"><a href="/user/mypage/view?id=${userId }" class="user-nav-text">마이페이지</a></li>
<li class="nav-item"><a href="/user/mypage/view?id=${userId }" class="user-nav-text">마이페이지</a></li>
<%-- TODO : 장바구니 --%><li class="nav-item"><a href="/user/cart/view?id=${userId }" class="user-nav-text">장바구니</a></li>
</ul>
</c:when>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/jsp/store/book/bookDetail.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
let isbn = $(this).data("isbn");
let count = $("#countResult").val();
location.href = "/user/cart/view?isbn=" + isbn + "&count=" + count;
// location.href = "/user/cart/view?isbn=" + isbn + "&count=" + count;
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/jsp/store/main-bestseller.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
$("#cartBtn").on("click", function() {
let count = $("#countResult").val();
location.href = "/user/cart/view?isbn=" + isbn + "&count=" + count;
// location.href = "/user/cart/view?isbn=" + isbn + "&count=" + count;
});
});
Expand Down
21 changes: 15 additions & 6 deletions src/main/webapp/WEB-INF/jsp/store/order/orderInfo.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

<!-- jstl core library -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!-- jstl function library -->
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!-- jstl fmt library -->
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

Expand Down Expand Up @@ -56,10 +58,19 @@

<!-- 책 정보 -->
<tr>
<th><img src="${details.bookDetail.cover }" width="100px"></th>
<td>
<div class="d-flex flex-column justify-content-around align-items-around text-left ml-3">
<div class="orderInfo-text orderInfo-title my-3">${details.bookDetail.title }</div>
<th><img src="${details.bookDetail.cover }" width="110px"></th>
<td class=" d-flex justify-content-center">
<div class="d-flex flex-column justify-content-around align-items-around pl-4">
<div class="orderInfo-text orderInfo-title mt-2 mb-3">
<c:choose>
<c:when test="${fn:length(details.bookDetail.title) > 70 }">
${fn:substring(details.bookDetail.title, 0, 70) } ...
</c:when>
<c:otherwise>
${details.bookDetail.title }
</c:otherwise>
</c:choose>
</div>
<div class="orderInfo-text pb-2">${details.bookDetail.author }</div>
<div class="orderInfo-text">${details.bookDetail.publisher }</div>
</div>
Expand Down Expand Up @@ -191,8 +202,6 @@
let orderId = $(this).data("order-id");
alert(orderId);
$.ajax({
type:"get"
, url:"/store/order/cancelOrder"
Expand Down
34 changes: 23 additions & 11 deletions src/main/webapp/WEB-INF/jsp/user/mypage.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,38 @@
<!-- 주문 내역 리스트 -->
<div class=" my-5 w-100">
<div class="">
<table class="table mypage-order-list">
<tr>
<th>주문 날짜</th>
<th>주문 번호</th>
<th>받는사람</th>
<th>책 제목</th>
<th>상세보기</th>
<table class="table mypage-order-list border-bottom">
<thead>
<tr class="text-center">
<th scope="col">주문 날짜</th>
<th scope="col">주문 번호</th>
<th scope="col">받는사람</th>
<th scope="col">책 제목</th>
<th scope="col">상세보기</th>
</tr>

</thead>
<tbody>
<c:forEach var="orderInfo" items="${orderInfoList }" varStatus="status">
<c:set value="0" var="i" />
<tr>
<tr class="text-center">
<td><fmt:formatDate value="${orderInfo.order.orderDate }" pattern="yyyy년 MM월 dd일 HH:mm:ss"/></td>
<td>${orderInfo.order.orderNumber }</td>
<td>${orderInfo.order.name }</td>
<td>${orderInfo.orderBookDetailList[i].bookDetail.title }</td>
<td><a href="/store/order/info/view?orderId=${orderInfo.order.id }" >상세보기</a></td>
<td>
<c:choose>
<c:when test="${fn:length(orderInfo.orderBookDetailList[i].bookDetail.title) > 30 }">
${fn:substring(orderInfo.orderBookDetailList[i].bookDetail.title, 0, 30) } ...
</c:when>
<c:otherwise>
${orderInfo.orderBookDetailList[i].bookDetail.title }
</c:otherwise>
</c:choose>
</td>
<td><a href="/store/order/info/view?orderId=${orderInfo.order.id }" class="orderInfo-atag">상세보기</a></td>

</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
Expand Down

0 comments on commit 964fbea

Please sign in to comment.