Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: picture detail 페이지 모달 구현 #65

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Api/src/main/resources/static/css/detail.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@
font-size: 31px;
}

.details-box .btn {
position: absolute;
bottom: 40px;
right: 900px;
width: 110px;
height: 50px;
font-size: 30px;
color: #99F54D;
box-shadow: 0px 0px 10px rgba(219, 134, 129, 86);

background-color: #761766;
z-index: 2;
}
/*.details-box .btn {*/
/* position: absolute;*/
/* bottom: 40px;*/
/* right: 900px;*/
/* width: 110px;*/
/* height: 50px;*/
/* font-size: 30px;*/
/* color: #99F54D;*/
/* box-shadow: 0px 0px 10px rgba(219, 134, 129, 86);*/

/* background-color: #761766;*/
/* z-index: 2;*/
/*}*/

/* Optional: Adjust margin between the box and other elements */
.details-box + * {
Expand Down
9 changes: 9 additions & 0 deletions Api/src/main/resources/static/js/bidModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const inputP = document.getElementById('inputPrice')
const priceAmount = document.getElementById('price_amount')

//결제 가격
function inputPrice(e){
const bidNum = (e.value);
inputP.value = e.value;
priceAmount.textContent = "입찰 금액 : " + bidNum + "원";
}
43 changes: 43 additions & 0 deletions Api/src/main/resources/static/js/detailModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
var amount = document.getElementById('inputPrice');

var userId;
var bidResult = obj => {
$.ajax({
type : 'post',
url : '/user/session-info',
success : function(data, status, xhr) {
userId = data.userId
},
error : function(xhr, status, error) {
alert('입찰 불가')
},
})

var price = document.getElementById("inputPrice").value;
$.ajax({
type: 'post',
url: 'urlurlurl',
dataType: 'json',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({
"bidPrice" : price
})
})
}

// function postPayInfo(tof, response) {
// $.ajax({
// type : 'post',
// url : '넣고싶은 url 넣으시길',
// dataType: 'json',
// contentType: 'application/json; charset=utf-8',
// data : JSON.stringify({
// "payResult" : tof,
// "userId" : userId,
// "merchantUid" : response.merchant_uid,
// "productName" : response.name,
// "pgProvider" : response.pg_provider,
// "paidAmount" : response.paid_amount
// })
// })
// }
2 changes: 2 additions & 0 deletions Api/src/main/resources/static/js/onlyresize.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
});
}

// TODO: 그림의 사이즈는 912 * 600으로 리사이징한다

// 리사이즈된 이미지를 표시하는 함수
async function displayResizedImage() {
const originalImageUrl = '../static/asset/한소희.jpeg';
Expand Down
37 changes: 31 additions & 6 deletions Api/src/main/resources/templates/pictures/pictureDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
>
<main layout:fragment="content">
<link rel="stylesheet" type="text/css" href="/static/css/detail.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Kranky&display=swap">
<link rel="stylesheet" href="https://fonts.google.com/noto/specimen/Noto+Sans+KR">

<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Kranky&display=swap">-->
<!-- <link rel="stylesheet" href="https://fonts.google.com/noto/specimen/Noto+Sans+KR">-->

<div class="container body">
<div th:if="${picture}" class="picture-details">
<img th:src="'http://xgrnsxldyejc19608959.cdn.ntruss.com/' + ${picture.imgUrl} + '?type=f&w=600&h=800&ttype=jpg
' " alt="Picture" class="picture-img">
<!-- <img th:src="'http://xgrnsxldyejc19608959.cdn.ntruss.com/' + ${picture.imgUrl} + '?type=f&w=600&h=800&ttype=jpg-->
<!--' " alt="Picture" class="picture-img">-->
<!-- <img class = "frame" src="/static/asset/기린.png">-->
<!-- <img class = "kuro" src="/static/asset/쿠로미.png">-->
<!-- <img class = "sina" src="/static/asset/시나모.png">-->
Expand All @@ -36,7 +35,27 @@
<p class="text" style="font-size: 27px" th:text="${picture.getStartingPrice()}"></p>
<p th:text="'Minimum Amount'"></p>
<p class="text" style="font-size: 27px" th:text="${picture.getIncrementAmount()}"></p>
<button class="btn">Bid</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
입찰하기
</button>

<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 id="price_amount"></h3>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<input id="inputPrice" onchange="inputPrice(this)" placeholder="입찰 금액 입력"/>
<button id="bidButton" onclick="bidResult(this)" type="button">입찰하기</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div th:unless="${picture}">
Expand All @@ -47,5 +66,11 @@
<br><br><br>
</main>
<th:block layout:fragment="script">
<script type="application/javascript" th:inline="javascript">
</script>
<script type="text/javascript">
</script>
<script src="/static/js/detailModal.js"></script>
<script src="/static/js/bidModal.js"></script>
</th:block>
</html>
Loading