Skip to content

Commit

Permalink
Merge pull request #78 from hyosung-second-team1/37-jsp-voting
Browse files Browse the repository at this point in the history
[Feat] 투표 기능 1차 종료
  • Loading branch information
Koneweekk authored May 15, 2024
2 parents 797a593 + 0dbf791 commit 52477cb
Show file tree
Hide file tree
Showing 14 changed files with 315 additions and 118 deletions.
1 change: 0 additions & 1 deletion src/main/resources/static/css/create/group.css
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ body {
#right-section {
width: 400px;
gap: 20px;
box-shadow: 0px 10px 10px 5px #BBBBBB;
border-radius: 10px;
padding: 30px;
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/static/css/create/personal.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ body {
#right-section {
width: 650px;
gap: 20px;
box-shadow: 0px 10px 10px 5px #BBBBBB;
border-radius: 10px;
padding: 30px;
}
Expand Down
9 changes: 7 additions & 2 deletions src/main/resources/static/css/inc/alarm.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@
color: #ffffff;
border-radius: .5rem;
cursor: pointer;
transition: all 0.5s;
box-shadow: 5px 5px 5px lightgray;
}

#alarmIcon:hover {
background-color: #ffffff;
color: #4FD1C5;
}


#alarmIcon.active-icon {
background-color: #ffffff;
color: #4FD1C5;
border-radius: .1rem;
z-index: 9999;

}

.overlay-container {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/static/css/inc/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ body {
height: 40px;
border-radius: 10px;
background-color: white;
cursor: pointer;
}

#profile-img {
Expand Down
58 changes: 53 additions & 5 deletions src/main/resources/static/css/schedule/vote.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ body {
z-index: 0;
}


/* 장소 검색 */
.search-container {
width: 300px;
Expand All @@ -24,6 +25,7 @@ body {
z-index: 3;
transition: all 0.5s;
padding-bottom: 20px;
gap:5px;
}
/* ---- 검색창 ---- */
.place-search {
Expand Down Expand Up @@ -61,7 +63,7 @@ body {
/* ---- 검색 리스트 ---- */
.search-list-container {
position: absolute;
top:35px;
top: 85px;
width: 100%;
max-height: 250px;
overflow-y: auto;
Expand Down Expand Up @@ -170,11 +172,12 @@ body {

/* ---- 투표 항목 ---- */
.vote-list-container{
max-height: 90%;
padding: 20px 0px 60px;
position: absolute;
top: 100px;
max-height: 80%;
padding: 25px 0 100px;
overflow-y: auto;
z-index: 1;
cursor: pointer;
}

.vote-list-container > .vote-list{
Expand All @@ -197,6 +200,7 @@ body {
display: flex;
flex-direction: column;
gap: 5px;
cursor: pointer;
}

.vote-item > .row-container{
Expand Down Expand Up @@ -284,7 +288,7 @@ body {
.vote-list-container {
max-height: 100%;
position: fixed;
top: 50px;
top: 90px;
left: 270px;
width: 300px;
z-index: 1;
Expand Down Expand Up @@ -470,6 +474,50 @@ body {
.del-btn:hover{
background-color: crimson;
}


/* ---- 정보창 ----*/
.info-container {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}

.text-container > p {
margin: 0;
}

.text-container > .name {
font-size: 18px;
}

.text-container > .deadline {
font-size: 14px;
}

.end-btn {
width: 45px;
width: 45px;
display: flex;
justify-content: center;
align-items: center;
font-size: 18px;
padding: 10px;
border-radius: 10px;
color: white;
background-color: cornflowerblue;
box-shadow: 5px 5px 5px lightgray;
transition: all 0.3s;
cursor: pointer;
}

.end-btn:hover {
background-color: slateblue;
}
/* ---- 정보창 End----*/


/* 기타 버튼들 End */

@media (max-width: 800px) {
Expand Down
5 changes: 2 additions & 3 deletions src/main/resources/static/js/create/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ $('#save-btn').click(function(e) {

const promise = [];
for (const member of voteDetail.memberList) {
const memberHome = await locFromAddress(member.address);
const startPoint = member.lat? [member.lat, member.lng] : await locFromAddress(member.address);
promise.push(startPoint);
}
Expand All @@ -390,8 +389,8 @@ $('#save-btn').click(function(e) {
let lat = 0;
let lng = 0;
for (const val of cordArr) {
lat += Number(val[0]);
lng += Number(val[1]);
lat += Number(val[0]? val[0] : 127.0495556);
lng += Number(val[1]? val[1] : 37.514575);
}
const placeData = {
"placeName": "중간 지점",
Expand Down
44 changes: 43 additions & 1 deletion src/main/resources/static/js/inc/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,46 @@ $.each($('.nav-content').children(), function (index, el) {
$(el).click(function(e) {
window.location.href = `/${menuList[index]}`;
})
});
});


// 회원 정보 수정
async function updateMemberInfo(data) {
const response = await $.ajax({
type: "PUT",
url: '/api/member/me',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(data),
});
if (!response.isSuccess) {
// 실패 시 예외 처리
}

return response;
}


// // ----- 배경사진 변경
// $('.profile-img-container').click(async function(e) {
// updateMemberInfo()
// const file = await Swal.fire({
// title: "배경사진 변경",
// input: "file",
// inputAttributes: {
// "accept": "image/*",
// "aria-label": "Upload your profile picture"
// }
// });
// if (file) {
// const reader = new FileReader();
// reader.onload = (e) => {
// Swal.fire({
// title: "Your uploaded picture",
// imageUrl: e.target.result,
// imageAlt: "The uploaded picture"
// });
// };
// reader.readAsDataURL(file);
// }
// })
33 changes: 33 additions & 0 deletions src/main/resources/static/js/module/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,38 @@ export async function inviteMember(data) {
// 실패 시 예외 처리
}

return response;
}


// 맴버 초대
export async function getMemberInvite(email) {
const response = await $.ajax({
type: "GET",
url: '/api/member/invite',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(data),
});
if (!response.isSuccess) {
// 실패 시 예외 처리
}

return response;
}


// 장소 투표 확정
export async function endVote(scheduleID) {
const response = await $.ajax({
type: "POST",
url: `/api/voting/schedule/place/confirm?placeToVoteId=${scheduleID}`,
dataType: "json",
contentType: 'application/json',
});
if (!response.isSuccess) {
// 실패 시 예외 처리
}

return response;
}
2 changes: 1 addition & 1 deletion src/main/resources/static/js/schedule/detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const myPoint = myScheduleInfo.lat? [myScheduleInfo.lat, myScheduleInfo.lng] : a
const scheduleInfoContainer = $(`
<div class="schedule-info">
<p class="name">${targetInfo.name}</p>
<p class="description">${targetInfo.description}</p>
<p class="description">${targetInfo.description? targetInfo.description : "즐거운 하루 되세요!"}</p>
</div>
`)
scheduleInfoContainer.css('border-color', targetInfo.color)
Expand Down
Loading

0 comments on commit 52477cb

Please sign in to comment.