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-roomAdd: popup 구현 #43

Merged
merged 1 commit into from
Dec 14, 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
18 changes: 18 additions & 0 deletions src/components/room/AddRoom.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<div></div>
</template>
<script>
export default {
name: 'AddRoom',
data() {
return {

}
},
mounted() {

}
}
</script>
<style scoped>
</style>
77 changes: 55 additions & 22 deletions src/views/home/MainHome.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<template>
<div id="main-layout" class="row">
<div v-if="addRoomPopup" id="back-off" @click="backOff"></div>
<AddRoom v-if="addRoomPopup" id="addRoom-popup"></AddRoom>
<div id="main-side-layout" class="col-2">
<div id="main-profile-containers">
<div id="my-profile-container">
Expand Down Expand Up @@ -181,11 +183,12 @@
<script>
import axios from 'axios'
import MainHomeRoom from '../../components/home/MainHomeRoom.vue'
import AddRoom from '../../components/room/AddRoom.vue'
import sweetAlert from '../../util/modal.js'

export default {
name: 'MainHome',
components: { MainHomeRoom },
components: { MainHomeRoom, AddRoom },
data() {
return {
roomPage: 0,
Expand All @@ -195,7 +198,8 @@ export default {
nullRoom: { roomNo: null, roomStatus: null, roomTitle: null },
inputRoomNo: null,
memberRankList: [],
memberAuthority: 'ROLE_ADMIN'
memberAuthority: 'ROLE_ADMIN',
addRoomPopup: false,
}
},
methods: {
Expand All @@ -209,26 +213,28 @@ export default {
})
},
createWaitingRoomclickHandler() {
let data = {
quiz: {
quizNo: 1
},
// "roomPwd": "1234",
codeShare: 0,
roomTitle: '테스트방 in vue',
roomDt: new Date().toJSON()
}
data = JSON.stringify(data)
axios
.post(`${this.backURL}/room`, data, {
headers: {
'Content-Type': 'application/json'
}
})
.then((res) => {
console.log(res)
this.$router.push({ path: `/room/${res.data}` })
})
// let data = {
// quiz: {
// quizNo: 1
// },
// // "roomPwd": "1234",
// codeShare: 0,
// roomTitle: '테스트방 in vue',
// roomDt: new Date().toJSON()
// }
// data = JSON.stringify(data)
// axios
// .post(`${this.backURL}/room`, data, {
// headers: {
// 'Content-Type': 'application/json'
// }
// })
// .then((res) => {
// console.log(res)
// this.$router.push({ path: `/room/${res.data}` })
// })

this.addRoomPopup=true
},
rankTierHelpHoverHandler() {},
mypageButtonClickHandler() {
Expand Down Expand Up @@ -287,6 +293,9 @@ export default {
this.totalPages = response.data.totalPages
})
}
},
backOff() {
this.addRoomPopup=false
}
},
mounted() {
Expand Down Expand Up @@ -718,5 +727,29 @@ input[type='number']::-webkit-inner-spin-button {
background-color: var(--main4-hover-color);
border: none;
}

#back-off {
width: 100%;
height: 100%;
display: fixed;
position: fixed;
top: 0%;
left: 0%;
cursor: pointer;
z-index: 1;
background-color: rgba(0, 0, 0, 0.5);
}

#addRoom-popup {
padding: 10px;
position: absolute;
background-color: var(--main1-color);
border: 8px solid var(--main5-color);
border-radius: 10px;
width: 90%;
height: 700px;
margin-top: 50px;
z-index: 2;
}
</style>
../../components/modal/modal.js../../modal/AlertMessage.vue