diff --git a/VamPa/src/main/webapp/WEB-INF/views/goodsDetail.jsp b/VamPa/src/main/webapp/WEB-INF/views/goodsDetail.jsp index 140a2c9..a6b01cc 100644 --- a/VamPa/src/main/webapp/WEB-INF/views/goodsDetail.jsp +++ b/VamPa/src/main/webapp/WEB-INF/views/goodsDetail.jsp @@ -130,10 +130,10 @@
주문수량 - + - - + +
@@ -232,6 +232,51 @@ $(document).ready(function(){ $(".publeyear").html(publeYear); }); + + +// 수량 버튼 조작 +let quantity = $(".quantity_input").val(); +$(".plus_btn").on("click", function(){ + $(".quantity_input").val(++quantity); +}); +$(".minus_btn").on("click", function(){ + if(quantity > 1){ + $(".quantity_input").val(--quantity); + } +}); + +// 서버로 전송할 데이터 +const form = { + memberId : '${member.memberId}', + bookId : '${goodsInfo.bookId}', + bookCount : '' +} +// 장바구니 추가 버튼 + $(".btn_cart").on("click", function(e){ + form.bookCount = $(".quantity_input").val(); + $.ajax({ + url: '/cart/add', + type: 'POST', + data: form, + success: function(result){ + cartAlert(result); + } + }) + }); + + function cartAlert(result){ + if(result == '0'){ + alert("장바구니에 추가를 하지 못하였습니다."); + } else if(result == '1'){ + alert("장바구니에 추가되었습니다."); + } else if(result == '2'){ + alert("장바구니에 이미 추가되어져 있습니다."); + } else if(result == '5'){ + alert("로그인이 필요합니다."); + } + } + + diff --git a/VamPa_MySQL/src/main/webapp/WEB-INF/views/goodsDetail.jsp b/VamPa_MySQL/src/main/webapp/WEB-INF/views/goodsDetail.jsp new file mode 100644 index 0000000..a6b01cc --- /dev/null +++ b/VamPa_MySQL/src/main/webapp/WEB-INF/views/goodsDetail.jsp @@ -0,0 +1,283 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + +Welcome BookMall + + + + + +
+
+
+ +
+
+ +
+ +
+
+
+
+
+ + "> + +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+

+ ${goodsInfo.bookName} +

+
+
+
+
+ + ${goodsInfo.authorName} 지음 + + | + + ${goodsInfo.publisher} + + | + + ${goodsInfo.publeYear} + +
+
+
+
+
정가 :
+
+ 판매가 : + [% + 할인]
+
+
+
+
+
+ 주문수량 + + + + + +
+ +
+
+
+
+
+
+
+ ${goodsInfo.bookIntro} +
+
+ ${goodsInfo.bookContents } +
+
+
+
+
+ 리뷰 +
+ +
+ + + + + + +
+
+ + + + + \ No newline at end of file