diff --git a/src/components/common/Modal.vue b/src/components/common/Modal.vue index 4b924be..1bdb8c5 100644 --- a/src/components/common/Modal.vue +++ b/src/components/common/Modal.vue @@ -4,36 +4,29 @@ @@ -24,6 +24,14 @@ components: { RedButton }, + props: { + username: String, + }, + methods: { + reportPage() { + this.$router.push({ path: '/auth/house/report'}) + } + } // methods: { // cancelBtn() { // this.modal = false; diff --git a/src/components/layout/house-header.vue b/src/components/layout/house-header.vue index 96897c5..3455e31 100644 --- a/src/components/layout/house-header.vue +++ b/src/components/layout/house-header.vue @@ -8,10 +8,22 @@ diff --git a/src/components/lobby-explain.vue b/src/components/lobby-explain.vue index eb6caac..4c83145 100644 --- a/src/components/lobby-explain.vue +++ b/src/components/lobby-explain.vue @@ -13,9 +13,10 @@

{{housename}}

House입니다.

-

{{date}}

+

{{ content }}

house picture +

{{ location }}

@@ -26,12 +27,17 @@ export default { props: { Username: String, housename: String, - date: String - } + content: String, + location: String + }, } - - - - - - - {{ todoItem }} - + @@ -13,14 +13,24 @@ diff --git a/src/main.js b/src/main.js index 1c8ca29..cf350f8 100644 --- a/src/main.js +++ b/src/main.js @@ -17,12 +17,12 @@ import MainPage from './views/MainPage.vue' //import InfoInputPage from './views/InfoInputPage.vue' //import MatchingWaitPage from './views/MatchingWaitPage.vue' -import MainPageAuth from './views/MainPageAuth.vue' +// import MainPageAuth from './views/MainPageAuth.vue' //import MateListPage from './views/MateListPage.vue' //import UserProfile from './views/UserProfilePage.vue' //import MyPage from './views/MyPage.vue' -import ChattingList from './views/ChattingListPage.vue' -import Chatting from './views/ChattingPage.vue' +// import ChattingList from './views/ChattingListPage.vue' +// import Chatting from './views/ChattingPage.vue' import HouseLobby from './views/house-lobby.vue' import HouseRule from './views/house-rule.vue' @@ -44,12 +44,12 @@ createApp(MainPage).use(router).mount('#mainpage') //createApp(InfoExplanePage).use(router).mount('#infoexplanepage') //createApp(InfoInputPage).use(router).mount('#infoinputpage') //createApp(MatchingWaitPage).use(router).mount('#matchingwaitpage') -createApp(MainPageAuth).use(router).mount('#mainauthpage') +// createApp(MainPageAuth).use(router).mount('#mainauthpage') //createApp(MateListPage).use(router).mount('#matelistpage') //createApp(UserProfile).use(router).mount('#userprofile') //createApp(MyPage).use(router).mount('#mypage') -createApp(ChattingList).use(router).mount('#chattinglist') -createApp(Chatting).use(router).mount('#chatting') +// createApp(ChattingList).use(router).mount('#chattinglist') +// createApp(Chatting).use(router).mount('#chatting') createApp(HouseLobby).use(router).mount('#houselobby') createApp(HouseRule).use(router).mount('#houserule') diff --git a/src/router/index.js b/src/router/index.js index a6347de..9c0f624 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -84,7 +84,8 @@ const routes = [ { path: '/auth/house/lobby', name: 'HouseLobby', - component: HouseLobby + component: HouseLobby, + props: true, }, { path: '/auth/house/rule', diff --git a/src/views/ChattingPage.vue b/src/views/ChattingPage.vue index 87231d1..55086d5 100644 --- a/src/views/ChattingPage.vue +++ b/src/views/ChattingPage.vue @@ -32,7 +32,7 @@ 전송 - + @@ -131,7 +131,7 @@ export default { send() { console.log("Send message:" + this.message); if (this.stompClient && this.stompClient.connected) { - const msg = { + const msg = { user: { id: this.uid }, @@ -140,7 +140,7 @@ export default { }; this.stompClient.send("/receive/" + this.cid, JSON.stringify(msg), {}); } - }, + }, connect() { let socket = new SockJS(this.mainserve); this.stompClient = Stomp.over(socket); @@ -151,8 +151,8 @@ export default { this.connected = true; console.log('소켓 연결 성공', frame); const msg = { ///너무 중요! 없애지 마! - uid: this.uid, - cid: this.cid, + uid: this.uid, + cid: this.cid, sid: socket._transport.url.split('/')[4] }; console.log(JSON.stringify(msg)); @@ -165,11 +165,11 @@ export default { error => { console.log('소켓 연결 실패', error); this.connected = false; - } - ); - }, + } + ); + }, liveTogether() { - axios.post(this.mainserve + '/user/chatting/'+ this.cid +'/request', + axios.post(this.mainserve + '/user/chatting/'+ this.cid +'/request', { senderUid: this.uid, receiverUid: this.otherid,}, { headers: { 'X-AUTH-TOKEN': localStorage.getItem('token')}} ) @@ -237,7 +237,7 @@ export default { height: 15vh; background-color: #ea803a; padding: 5px; - + } .sub-bt { diff --git a/src/views/InfoInputPage.vue b/src/views/InfoInputPage.vue index dccdb74..92ac897 100644 --- a/src/views/InfoInputPage.vue +++ b/src/views/InfoInputPage.vue @@ -453,7 +453,7 @@ export default { permissionToEnter:'', }, matching_server:{ - uid:'', + id:'', sex: '', age:'', mbti:'', @@ -553,6 +553,7 @@ export default { }); }) .then(() => { //matching server에 정보 전송 + console.log('serverURL:', this.matchingserve); axios.post(this.matchingserve + '/infos', this.matching_server ) diff --git a/src/views/LoginPage.vue b/src/views/LoginPage.vue index 134063f..3c5512c 100644 --- a/src/views/LoginPage.vue +++ b/src/views/LoginPage.vue @@ -34,7 +34,8 @@ export default { data() { return { // mainserve: "http://ec2-15-164-40-127.ap-northeast-2.compute.amazonaws.com", - mainserve: "http://localhost:5000", + // mainserve: "http://localhost:5000", + mainserve: "http://10.14.4.217:5000", loginCheck: 0, login: { email: '', @@ -91,7 +92,7 @@ export default { .then(( )=> { console.log(this.loginCheck) console.log(this.user_id) - + if(this.loginCheck == 1) { //설문조사를 했는 지 확인 axios.get(this.mainserve+'/user/profile/'+this.user_id, { headers: { 'X-AUTH-TOKEN': localStorage.getItem('token') } diff --git a/src/views/UserProfilePage.vue b/src/views/UserProfilePage.vue index 593608e..b93433d 100644 --- a/src/views/UserProfilePage.vue +++ b/src/views/UserProfilePage.vue @@ -26,7 +26,7 @@
chat! -
+ @@ -63,10 +63,6 @@ export default { smoking: '', with_pet: '', bug: '', - makeChattingRoom: { - senderUid: localStorage.getItem('uid'), - receiverUid: this.uid, - } } }, props: ["uid"], diff --git a/src/views/house-list.vue b/src/views/house-list.vue index f89701a..cb1514f 100644 --- a/src/views/house-list.vue +++ b/src/views/house-list.vue @@ -7,24 +7,9 @@
-
- - {{simpletext}} - -
-
- - {{simpletext}} - -
-
- - {{simpletext}} - -
-
- - {{simpletext}} +
+ + {{houselist[i].description}}
@@ -51,25 +36,35 @@ export default { }, data() { return { + mainserve: "http://10.14.4.217:5000", Username: '연희동 빨간지붕', simpletext: '웰컴투네오존', Imgvalue: '', Image: '', + houselist:[], } }, - created() { - axios.get('http://ec2-15-164-40-127.ap-northeast-2.compute.amazonaws.com:8080/house/1') + async created() { + await console.log("-------------------------"); + axios.get(this.mainserve + '/house', + { headers: { 'X-AUTH-TOKEN': localStorage.getItem('token')}}) .then((res)=> { console.log('status code:', res.status); console.log('data:', res.data); - this.Username = res.data.data.name; - this.simpletext = res.data.data.description; - console.log('result:', this.Username); - }) + console.log('data:', res.data.data); + this.houselist = res.data.data; + console.log('house1 id:', this.houselist[0].id); + console.log('house1 id:', this.houselist[0].name); + console.log('house1 id:', this.houselist[0].description); + }); }, methods: { - LobbyPage() { - this.$router.push({ path: '/auth/house/lobby'}) + LobbyPage(i) { + console.log('============house id', this.houselist[i].id); + this.$router.push({ + name: 'HouseLobby', + query: {houseid: this.houselist[i].id } + }) } } } diff --git a/src/views/house-lobby.vue b/src/views/house-lobby.vue index 1eb65fb..313ea0b 100644 --- a/src/views/house-lobby.vue +++ b/src/views/house-lobby.vue @@ -5,12 +5,12 @@
- +
- +
HOUSE RULE → @@ -28,6 +28,7 @@ import RedButton from '../components/red-button.vue' import explanation from '../components/lobby-explain.vue' import todolist from '../components/todolist.vue' import todoinput from '../components/todoinput.vue' +import axios from 'axios' export default { name: 'HouseLobby', @@ -40,13 +41,32 @@ export default { todolist, todoinput }, + // props: { + // houseid: { + // type: String, + // default: '', + // } + // }, data() { return { + mainserve: "http://10.14.4.217:5000", Username: 'Soyoung, Seoki, moosongsong', housename: '연희동빨간지붕', - date: '[2020.10.01~2021.09.30]', todoItems: [], + Itemnum:0, + location: '광야로 걸어가 알아 니 홈그라운드~', // todolist: '거실청소(무송)' + houseid:'', + userid:'', + userName: '', + Send: { + houseId:'', + userId:'', + role:'', + week:'', + startAt:'', + routine:'', + } } }, methods: { @@ -57,27 +77,76 @@ export default { localStorage.clear(); this.todoItems = []; }, - addTodo(todoItem) { - localStorage.setItem(todoItem, todoItem); - this.todoItems.push(todoItem); + async addTodo(todoItem) { + // 보낼 값 지정 + this.Send.role = await todoItem; + this.Send.houseId = await this.houseid; + this.Send.userId = await this.userid; + + console.log(todoItem); + + // 호출 + const res = await axios.post(this.mainserve + '/role/', this.Send); + console.log('status code:', res.status); + console.log('data:', res.data); + + // 값 지정 + await this.todoItems.push(todoItem +` (${this.userName})`); }, removeTodo(todoItem, index) { + localStorage.removeItem(todoItem); this.todoItems.splice(index, 1); }, move_houserule() { - this.$router.push({ path: 'rule'}) + this.$router.push({ + name: 'HouseRule', + query: {houseid: this.houseid} + }) }, leave_house() { this.$router.push({ path: 'report'}) }, }, - created() { - if (localStorage.length > 0) { - for (var i = 0; i < localStorage.length; i++) { - this.todoItems.push(localStorage.key(i)); + async created() { + this.houseid = this.$route.query.houseid; + this.userid = localStorage.getItem('uid'); + console.log('house id:', this.houseid); + console.log('user id:', this.userid); + + const houseRes = await axios.get(this.mainserve + '/house/'+ this.houseid, + { headers: { 'X-AUTH-TOKEN': localStorage.getItem('token')}}); + console.log('status code:', houseRes.status); + console.log('data:=============', houseRes.data); + + this.housename = houseRes.data.data.name; + this.content = houseRes.data.data.description; + this.location = houseRes.data.data.location; + let userList = houseRes.data.data.users; + + let tempStr = ' '; + for(let key in userList) { + if (userList[key].id == this.userid) this.userName = userList[key].name; + if (key == 0) { + tempStr = tempStr + userList[key].name; + }else{ + tempStr = tempStr + ', '+ userList[key].name; } } + this.Username = tempStr; + console.log('result:', tempStr); + + const roleRes = await axios.get(this.mainserve + '/role/house/'+ this.houseid) + const getData = roleRes.data.data; + let tempList = []; + for(let key in getData){ + let tempStr = ` ${getData[key].role} (${getData[key].userName})`; + tempList.push(tempStr); + } + this.todoItems = tempList + console.log(tempList); + + this.Itemnum = this.todoItems.length-1; // 처음부터 크기로 지정 } } diff --git a/src/views/house-mem-report.vue b/src/views/house-mem-report.vue index 037eb6a..28f9b21 100644 --- a/src/views/house-mem-report.vue +++ b/src/views/house-mem-report.vue @@ -10,12 +10,40 @@
-

seoki

+

username

- + + + + + + + + + + + + + + + + + + + +
+ 하우스 룰을 잘 지켰나요? +
+ 하우스 Todo List를 잘 수행했나요? +
+ 같이 지내는데 큰 불편함은 없었나요? +
+
+ + + -
+
-

연희동빨간지붕 HOUSE에서 seoki 님과 함께 한 시간은 어땠나요?

+

{{ housename }} HOUSE에서 {{ username }} 님과 함께 한 시간은 어땠나요?

- + {{ username }}
+
previous - next - finish! + next + finish!
@@ -130,6 +159,7 @@ import Rating from '../components/Rating.vue' import RedButton from '../components/red-button.vue' import reportmodal from '../components/common/Modal_2.vue' import navimenu from '../components/navigator.vue' +// import axios from 'axios' export default { @@ -142,25 +172,48 @@ export default { reportmodal, navimenu, }, - methods: { - PrevBtn() { - this.number--; - }, - NextBtn() { - this.number++; - }, - SubmitBtn() { - this.modal = true; - } + methods: { + PrevBtn() { + this.number--; + }, + NextBtn() { + this.number++; }, + SubmitBtn() { + this.modal = true; + } + }, + props: { + housename: String, + username: String, + }, data() { return { number: 1, modal: false, message1: "", - housename: '연희동빨간지붕' + // housename: '', + // username: '', } - } + }, + // created() { + // axios.get('http://10.14.4.217:5000/house/'+ this.houseid) + // .then((res)=> { + // console.log('status code:', res.status); + // console.log('data:', res.data); + // this.housename = res.data.data.name; + // }) + // } + // created() { + // axios.get('http://10.14.4.42:8080/rule/house/1') + // .then((res)=> { + // console.log('status code:', res.status); + // console.log('data:', res.data); + // this.housename = res.data.data.name; + // // username 필요 + // }) + // } + } @@ -219,19 +272,23 @@ export default { text-align: left; padding: 5px 0 5px 5px; border-bottom: 1px solid black; - background-color: #268372; + /* background-color: #268372; */ } td { padding: 5px 0 5px 15px; border-bottom: 1px solid black; + background-color: #268372; + font-family: a고딕15; + font-size: 14px; } - th, td { + /* th, td { font-size: 14px; font-family: a고딕14; - } + } */ table { border-collapse: collapse; width: 100%; + /* text-align: center; */ } .rule { padding: 0 20px 0 20px; diff --git a/src/views/house-report.vue b/src/views/house-report.vue index 3905a88..fd202da 100644 --- a/src/views/house-report.vue +++ b/src/views/house-report.vue @@ -8,8 +8,11 @@
- - +
+ +
+
@@ -21,6 +24,7 @@ import minilogo from '../components/mini-logo.vue' import GreenButton from '../components/green-button.vue' import navimenu from '../components/navigator.vue' import reportlist from '../components/report_list.vue' +import axios from 'axios' export default { name: 'HouseReport', @@ -33,11 +37,62 @@ export default { }, data() { return { + mainserve: "http://10.14.4.217:5000", user_name: 'moosongsong', status: '<<평가 대기 중...>>', - housename: '연희동빨간지붕' + housename: '연희동빨간지붕', + housereport:[], + } + }, + created() { + axios.get(this.mainserve + 'user/evaluation/1', + { headers: { 'X-AUTH-TOKEN': localStorage.getItem('token')}}) + .then((res)=> { + console.log('status code:', res.status); + console.log('data:', res.data); + console.log('data:', res.data.data); + this.housereport = res.data.data; + console.log('house id:', this.housereport[0].id); + console.log('house userName:', this.housereport[0].userName); + console.log('house name:', this.housereport[0].name); + // console.log('house id:', this.houselist[0].description); + }) + }, + methods: { + ReportPage(i) { + this.$router.push({ + name: 'HouseMemReport', + parmas: {houseid: this.houstreport[i].id } + }) } } + // methods: { + // ReportPage(i) { + // this.$router.push({ + // name: 'HouseMemReport', + // params: { houseid: this.housereport[i].id } + // // path: '/auth/house/report'}) + // }) + // }, + // methods: { + // ReportPage(i) { + // this.$router.push({ path: '/auth/house/report' }), + // // name: 'HouseMemReport', + // // params: {username: this.housereport[i].userName} + // // } + // } + // } + // created() { + // axios.get('http://10.14.4.42:8080/house') + // .then((res)=> { + // console.log('status code:', res.status); + // console.log('data:', res.data); + // console.log('data.data:', res.data.data); + // this.housename = res.data.data.name; + // + // + // }) + // } } diff --git a/src/views/house-rule.vue b/src/views/house-rule.vue index 1d962b3..b0b3b5f 100644 --- a/src/views/house-rule.vue +++ b/src/views/house-rule.vue @@ -9,29 +9,38 @@
- - -
- +
+ - + add button -
-
- - - - - - - - -
{{ index+1 }}{{ row.rule }} - -
+
+ + + + + + + + + + + +
{{ index+1 }}{{ row }} + +
+
+ +
@@ -46,6 +55,7 @@ import SubTitle from '../components/sub-title.vue' import RedButton from '../components/red-button.vue' import editmodal from '../components/common/Modal_3.vue' // import tablerow from '../components/table_row.vue' +import axios from 'axios' export default { name: 'HouseRule', @@ -61,56 +71,57 @@ export default { }, data() { return { + mainserve: "http://10.14.4.217:5000", modal: false, ismodal: false, - message: [], housename: '연희동빨간지붕', - rows: [ - { rule: '조리 후 바로바로 설거지하기' }, - { rule: '가스레인지에 흘린 거 바로 치우기' }, - { rule: '요리하고 환기하기' }, - { rule: '쓴 재료 제자리에 원위치하기' }, - { rule: '맛있는건 나눠먹기' }, - { rule: '친목도모를 위해 주 1회 음주파티 필수 참석' }, - { rule: '안주는 퇴근하면서 각자 먹고싶은 거 배민으로 주문' }, - { rule: '직계가족 방문 허용' }, - { rule: '이성 출입은 사전 협의하기' }, - { rule: '외부인의 숙박을 불가능하다' }, - ] + rows: [], + houseid:'', + addrule:'', } }, + created() { + this.houseid = this.$route.query.houseid; + axios.get(this.mainserve + '/rule/house/' + this.houseid) + .then((res)=> { + console.log('status code:', res.status); + console.log('data:', res.data); + let ruleList = res.data.data; + let tempList = []; + for (let key in ruleList) { + let tempRule = ruleList[key].originalRule; + tempList.push(tempRule); + } + this.rows = tempList + console.log('result:', tempList); + }) + }, methods: { - addRule(message) { - this.modal = true; - localStorage.setItem(message, message); - this.messages.push(message); + addRule(value) { + // this.addrule = value; + this.rows.push({value}); }, - removeRule(row, index) { - this.$emit('removeRule', row, index); + modalopen() { + this.modal = true; }, closeModal() { this.modal = false }, - // editRule() { - // this.modal = true - // }, - cancel_modal() { - this.modal = false + removeRule(row, index) { + localStorage.removeItem(row); + this.rows.splice(index, 1); + // this.$emit('removeRule', row, index); }, - // register_modal() { - // this.modal = false - // }, - // delete_modal() { - // this.modal = false + // register(row) { + // localStorage.setItem(row, row); + // // this.row.push(row); // }, - update_modal() { - this.modal = false - } } }