-
-
- {{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 @@
![](../assets/profile_2.png)
-
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 @@