diff --git a/src/components/Nav.vue b/src/components/Nav.vue index 8460a8cef5c360533105fcb83a2d7cc755d7c163..a6452da1a50c5bf5f8ff046a16c39c3faaad07ea 100644 --- a/src/components/Nav.vue +++ b/src/components/Nav.vue @@ -17,9 +17,13 @@ <router-link to='/login' v-if="isLogin === false">로그인</router-link><br> <router-link to='/mypage' v-if="isLogin == true">마이 페이지</router-link><br><br> <router-link to='/club' v-if="isLogin == true">동아리 구경</router-link><br><br> - - <li style="list-style:none;" v-if="isLogin == true">내 동아리</li><br><br><br><br> + <div style="list-style:none;" v-if="isLogin == true">내 동아리 + <div v-for= "club in clublist"> + <router-link :to="{path:`/club_page/${club.club}`,params:{clubId:club.club}}"></router-link> + {{club.clubname}} + </div> + </div><br> <div @click="$store.dispatch('logout')"> <router-link to='/' v-if="isLogin == true">로그아웃</router-link><br><br> </div> @@ -29,16 +33,26 @@ <script> import {mapState} from "vuex" +import axios from "axios" export default { name: 'Nav', data() { return { - + clublist:[], + club:[] } }, computed:{ ...mapState(['isLogin']), ...mapState(['userInfo']) + }, + async created(){ + let uid = this.userInfo.uid + const res = await axios.get(`http://jnhonlinux.ddns.net:3000/joinedClub/user/${uid}`) + this.clublist = res.data.result + + const res2 = await axios.get('http://jnhonlinux.ddns.net:3000/club') + this.club = res2.data.result } } </script> diff --git a/src/components/NavClub.vue b/src/components/NavClub.vue index 94715d6538d4e40621c1a70ed9a2bed5117a74de..b21aba7120cb792f3bfe926eb84f6afc4b6c4478 100644 --- a/src/components/NavClub.vue +++ b/src/components/NavClub.vue @@ -3,9 +3,8 @@ <div id="clubMenu"> <router-link :to="{path:`/club_page/${club[0].id}`}">홈페이지</router-link> | <router-link :to="{path:`/club_post/${club[0].id}`}">활동일지 </router-link> | - <router-link :to="{path:`/club_free/${club[0].id}`}">자유게시판 </router-link> | - <router-link :to="{path:`/club_calendar/${club[0].id}`}">캘린더 </router-link> | - <router-link :to="{path:`/club_question/${club[0].id}`}">자주묻는질문 </router-link> | + <button @click="post()">자게</button> + <router-link :to="{path:`/club_free/${club[0].id}`}">자유게시판 </router-link> | <router-link :to="{path:`/club_manage/${club[0].id}`}">회원 관리</router-link> | <router-link :to="{path:`/club_join/${club[0].id}`}">가입신청</router-link> </div> @@ -13,6 +12,9 @@ </template> <script> +import axios from "axios" +import router from "../router/index" +import {mapState} from "vuex" export default { data(){ return { @@ -21,10 +23,26 @@ export default { }] } }, + computed: { + ...mapState(['userInfo']) + }, async created() { let id = this.$route.params.clubId; const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) this.club = res.data.result + }, + methods:{ + post(){ + axios.post(`http://jnhonlinux.ddns.net:3000/freeBoard`,{ + uid: this.userInfo.uid + }).then(res=>{ + + let id = this.$route.params.clubId; + router.push(`/club_free/${id}`) + + }) + + } } } </script> diff --git a/src/router/index.js b/src/router/index.js index bebb63931a28273a4742bf6dd025c3d217fb2b42..c71852a1696fbdfbaa5cb130234d17a5ee6de7b7 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -27,13 +27,13 @@ const routes = [ path: '/', name: 'home', component: () => - import(/* webpackChunkName: "about" */ "../views/Home.vue") + import(/* webpackChunkName: "about" */ "../views/left_bar/Home.vue") }, { path: '/login', name: 'login', component: () => - import(/* webpackChunkName: "about" */ "../views/Login.vue") + import(/* webpackChunkName: "about" */ "../views/left_bar/Login.vue") }, { path: '/signup', @@ -46,14 +46,14 @@ const routes = [ name: "mypage", // beforeEnter: onlyAuthUser, component: () => - import(/* webpackChunkName: "about" */ "../views/Mypage.vue") + import(/* webpackChunkName: "about" */ "../views/left_bar/Mypage.vue") }, { path: "/club", name: "club", // beforeEnter: onlyAuthUser, component: () => - import(/* webpackChunkName: "about" */ "../views/club.vue") + import(/* webpackChunkName: "about" */ "../views/left_bar/club.vue") }, { path: "/modify_profile", @@ -65,37 +65,25 @@ const routes = [ path: "/club_page/:clubId", name: "club_page", component: () => - import(/* webpackChunkName: "about" */ "../views/club_Page.vue") - }, - { - path: "/club_calendar/:clubId", - name: "club_calendar", - component: () => - import(/* webpackChunkName: "about" */ "../views/club_Calendar.vue") + import(/* webpackChunkName: "about" */ "../views/club_top_bar/club_Page.vue") }, { path: "/club_post/:clubId", name: "club_post", component: () => - import(/* webpackChunkName: "about" */ "../views/club_Post.vue") + import(/* webpackChunkName: "about" */ "../views/club_top_bar/club_Post.vue") }, { path: "/club_free/:clubId", name: "club_free", component: () => - import(/* webpackChunkName: "about" */ "../views/club_Free.vue") - }, - { - path: "/club_question/:clubId", - name: "club_question", - component: () => - import(/* webpackChunkName: "about" */ "../views/club_Question.vue") + import(/* webpackChunkName: "about" */ "../views/club_top_bar/club_Free.vue") }, { path: "/club_manage/:clubId", name: "club_manage", component: () => - import(/* webpackChunkName: "about" */ "../views/club_Manage.vue") + import(/* webpackChunkName: "about" */ "../views/club_top_bar/club_Manage.vue") }, { path: "/post/:clubId", @@ -103,24 +91,42 @@ const routes = [ component: () => import(/* webpackChunkName: "about" */ "../views/Post.vue") }, + { + path: "/post_free/:clubId", + name: "post_free", + component: () => + import(/* webpackChunkName: "about" */ "../views/Post_Free.vue") + }, { path: "/club_join/:clubId", name: "club_join", component: () => - import(/* webpackChunkName: "about" */ "../views/club_Join.vue") + import(/* webpackChunkName: "about" */ "../views/club_top_bar/club_Join.vue") }, { - path: "/joinedClub/user/:uid", + path: "/joinedClub/:clubId/:uid", name: "club_detail", component: () => import(/* webpackChunkName: "about" */ "../views/club_Detail.vue") }, + { + path: "/applymember/:clubId/:uid", + name: "applymember", + component: () => + import(/* webpackChunkName: "about" */ "../views/applymember.vue") + }, { path: "/activityLog/one/:clubId/:boardId", name: "board", component: () => import(/* webpackChunkName: "about" */ "../views/Board.vue") }, + { + path: "/freeBoard/one/:clubId/:freeId", + name: "free", + component: () => + import(/* webpackChunkName: "about" */ "../views/Free.vue") + } ] const router = new VueRouter({ diff --git a/src/views/Board.vue b/src/views/Board.vue index 297070cdf53ccc8e63923c79290914fa943baf89..83b296d172aaeed42a6cbf279bc757a764f78fbc 100644 --- a/src/views/Board.vue +++ b/src/views/Board.vue @@ -2,11 +2,14 @@ <template> <div class="board"> <NavClub id="navClub"></NavClub> + <div> 제목: {{board[0].title}}<br> 내용: {{board[0].content}}<br> 글쓴이: {{board[0].writer}}<br> 작성 날짜: {{board[0].date}}<br> </div> + <router-link :to="{path:`/club_post/${club[0].id}`}">뒤로 가기</router-link> + </div> </template> <script> @@ -19,7 +22,9 @@ export default { data(){ return{ club:[], - board:[] + board:[{ + title:'' + }] } }, async created(){ diff --git a/src/views/Free.vue b/src/views/Free.vue new file mode 100644 index 0000000000000000000000000000000000000000..2077d4f40a02991324985966ecda3034ecb39ef3 --- /dev/null +++ b/src/views/Free.vue @@ -0,0 +1,40 @@ +<!--자유게시판에서 게시글 눌렀을 때--> +<template> + <div class="Free"> + <NavClub id="navClub"></NavClub> + <div> + 제목: {{free[0].title}}<br> + 내용: {{free[0].content}}<br> + 글쓴이: {{free[0].writer}}<br> + 작성 날짜: {{free[0].date}}<br> + </div> + <router-link :to="{path:`/club_free/${club[0].id}`}">뒤로 가기</router-link> + </div> +</template> + +<script> +import axios from "axios" +import NavClub from '@/components/NavClub.vue' +export default { + components: { + 'NavClub': NavClub + }, + data(){ + return{ + club:[], + free:[{ + title:'' + }] + } + }, + async created(){ + let id = this.$route.params.clubId; + const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) + this.club = res.data.result + let fid = this.$route.params.freeId; + const free = await this.$http.get(`http://jnhonlinux.ddns.net:3000/freeBoard/one/${id}/${fid}`) + this.free = free.data.result + } + +} +</script> \ No newline at end of file diff --git a/src/views/Modify_profile.vue b/src/views/Modify_profile.vue index 3b2cf54cea1974e11192b2ffac5726eccbccad26..c3fcebc9a0afddda25fe2f7d3b4255181c4d0d67 100644 --- a/src/views/Modify_profile.vue +++ b/src/views/Modify_profile.vue @@ -2,7 +2,7 @@ <template> <div class="modify"> <div> - 이름: <input type="text" name="name"> + 이름: <input type="text" v-model="name"> <br> 이메일: <input type="email" v-model="email" required> <br> @@ -27,6 +27,7 @@ <script> import axios from "axios" import {mapState} from "vuex" +import router from "../router/index" export default { data(){ return { @@ -44,11 +45,11 @@ export default { ...mapState(['userInfo']) }, methods: { - submit(){ + async submit(){ // if(this.name==''||this.email==''||this.univ==''||this.department==''||this.sid==''||this.phone==''||this.password==''||this.repassword==''){ // alert("빈칸을 채워주세요.") // } - + if((this.password == this.repassword) && (this.password == this.userInfo.password)){ let id = this.userInfo.id axios.post(`http://jnhonlinux.ddns.net:3000/users/${id}`, { name: this.name, @@ -59,6 +60,12 @@ export default { sid: this.sid, password: this.password }) + // await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) + router.push("/mypage") + } + else{ + alert("비밀번호 다시 입력") + } } } } diff --git a/src/views/Post.vue b/src/views/Post.vue index 7d0589d69d5be5941e41e3d36aae0bb43e86a54e..ca80bc52f54bb3af4f3c16137ec6249785a3ea7a 100644 --- a/src/views/Post.vue +++ b/src/views/Post.vue @@ -1,7 +1,7 @@ <!--활동 일지 글 쓸 때--> <template> <div class="posting"> - <NavClub id="navClub">가나다</NavClub> + <NavClub id="navClub"></NavClub> <div class="board"> <h4 style="display:inline">제목:</h4> <input type="text" class="content" v-model="title" required> @@ -44,6 +44,7 @@ export default { }) router.push(`/club_post/${id}`) } + if(this.title == '' && this.content != ''){ alert("제목을 써주세요.") } diff --git a/src/views/Post_Free.vue b/src/views/Post_Free.vue new file mode 100644 index 0000000000000000000000000000000000000000..4c24f9c7352844f22ea91b6555a79f1cb704936f --- /dev/null +++ b/src/views/Post_Free.vue @@ -0,0 +1,82 @@ +<!--자유게시판 글 쓸 때--> +<template> + <div class="posting"> + <NavClub id="navClub"></NavClub> + <div class="board"> + <h4 style="display:inline">제목:</h4> + <input type="text" class="content" v-model="title" required> + <h4>내용</h4> + <textarea style="resize:none;" cols="60" rows="13" v-model="content" placeholder="게시글을 작성하세요." class="content" required></textarea> + </div> + <br> + <button @click="cancel">취소</button> + <button @click="post">게시</button> + </div> +</template> +<script> +import router from "../router/index" +import NavClub from '@/components/NavClub.vue' +import axios from "axios" +import {mapState} from "vuex" +export default { + components: { + 'NavClub': NavClub + }, + data(){ + return { + club:[{ + id:'', + }], + title:'', + content:'', + + } + }, + methods: { + post(){ + if(this.title != '' && this.content != ''){ + let id = this.$route.params.clubId; + axios.post(`http://jnhonlinux.ddns.net:3000/freeBoard/${id}`, { + title: this.title, + content: this.content, + writer: this.userInfo.name + }) + router.push(`/club_free/${id}`) + } + + if(this.title == '' && this.content != ''){ + alert("제목을 써주세요.") + } + if(this.title != '' && this.content == ''){ + alert("내용을 써주세요.") + } + if(this.title == '' && this.content == ''){ + alert("제목과 내용을 써주세요.") + } + }, + cancel(){ + let id = this.$route.params.clubId; + router.push(`/club_free/${id}`) + } + }, + async created() { + let id = this.$route.params.clubId; + const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) + this.club = res.data.result + }, + computed:{ + ...mapState(['userInfo']) + } +} +</script> +<style scoped> +.board { + display:inline-block; + margin-top: 15px; + padding-top: 15px; + border: 1px solid #000; +} +.content { + margin-left: 15px; +} +</style> \ No newline at end of file diff --git a/src/views/applymember.vue b/src/views/applymember.vue new file mode 100644 index 0000000000000000000000000000000000000000..8d37015e057ced8cfd218f0a373db47a31daafab --- /dev/null +++ b/src/views/applymember.vue @@ -0,0 +1,44 @@ +<!--클럽 회원 관리에서 유저 정보 자세히 보기--> +<template> + <div class="detail"> + <NavClub id="navClub"></NavClub> + <div> + 이름: {{member[0].name}} + <br> + 학과: {{member[0].department}} + <br> + 학번: {{member[0].sid}} + <br> + 이메일: {{member[0].email}} + <br> + 전화번호: {{member[0].phone}} + </div> + <router-link :to="{path:`/club_manage/${club[0].id}`}">뒤로 가기</router-link> + </div> +</template> + +<script> +import NavClub from '@/components/NavClub.vue' +export default { + name: 'club_detail', + components: { + 'NavClub': NavClub + }, + data(){ + return { + club:[], + member:[] + } + }, + async created(){ + let id = this.$route.params.clubId; + const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) + this.club = res.data.result + let uid = this.$route.params.uid + const res2 = await this.$http.get(`http://jnhonlinux.ddns.net:3000/users/${uid}`) + this.member = res2.data + + + } +} +</script> \ No newline at end of file diff --git a/src/views/club_Calendar.vue b/src/views/club_Calendar.vue deleted file mode 100644 index 29e343d580e3413b5b6033f79425bc96fe8de131..0000000000000000000000000000000000000000 --- a/src/views/club_Calendar.vue +++ /dev/null @@ -1,29 +0,0 @@ -<template> - <div class="clubView"> - <NavClub id="navClub">가나다</NavClub> - <h2>{{club[0].name}}의 캘린더를 적어보자</h2> - - </div> -</template> - -<script> -import NavClub from '@/components/NavClub.vue' - -export default { - name: 'club_calendar', - components: { - 'NavClub': NavClub - }, - data(){ - return { - club:{} - } - }, - async created() { - let id = this.$route.params.clubId; - const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) - console.log(res.data.result) - this.club = res.data.result - }, -} -</script> diff --git a/src/views/club_Detail.vue b/src/views/club_Detail.vue index e8f82a8da9669c820fa193bc81c078f96233f7f4..8d37015e057ced8cfd218f0a373db47a31daafab 100644 --- a/src/views/club_Detail.vue +++ b/src/views/club_Detail.vue @@ -2,7 +2,18 @@ <template> <div class="detail"> <NavClub id="navClub"></NavClub> - hi + <div> + 이름: {{member[0].name}} + <br> + 학과: {{member[0].department}} + <br> + 학번: {{member[0].sid}} + <br> + 이메일: {{member[0].email}} + <br> + 전화번호: {{member[0].phone}} + </div> + <router-link :to="{path:`/club_manage/${club[0].id}`}">뒤로 가기</router-link> </div> </template> @@ -19,14 +30,15 @@ export default { member:[] } }, - // async created() { - // let id = this.$route.params.clubId; - // const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) - // this.club = res.data.result - - // const member = await this.$http.get(`http://jnhonlinux.ddns.net:3000/joinedClub/${id}`) - // this.member = member.data.result - - // }, + async created(){ + let id = this.$route.params.clubId; + const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) + this.club = res.data.result + let uid = this.$route.params.uid + const res2 = await this.$http.get(`http://jnhonlinux.ddns.net:3000/users/${uid}`) + this.member = res2.data + + + } } </script> \ No newline at end of file diff --git a/src/views/club_Question.vue b/src/views/club_Question.vue deleted file mode 100644 index d68a61f68e066b17e38314ecae22c5a66b1102c3..0000000000000000000000000000000000000000 --- a/src/views/club_Question.vue +++ /dev/null @@ -1,33 +0,0 @@ -<!--동아리 내에서 자주묻는질문 눌렀을 때--> -<template> - <div class="clubView"> - <NavClub id="navClub">가나다</NavClub> - <h2>{{club[0].name}}의 질문들을 적어보자</h2> - <div id="clubMain"> - <router-view/> - </div> - </div> -</template> - -<script> -import NavClub from '@/components/NavClub.vue' - - -export default { - name: 'club_question', - components: { - 'NavClub': NavClub - }, - data(){ - return { - club:{} - } - }, - async created() { - let id = this.$route.params.clubId; - const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) - console.log(res.data.result) - this.club = res.data.result - }, -} -</script> diff --git a/src/views/club_Free.vue b/src/views/club_top_bar/club_Free.vue similarity index 70% rename from src/views/club_Free.vue rename to src/views/club_top_bar/club_Free.vue index 1e53f209cfc6058a0008969f1bafb9a55f5ec426..eaa9aa50fec82882eeaf3b2202f71e67a967861a 100644 --- a/src/views/club_Free.vue +++ b/src/views/club_top_bar/club_Free.vue @@ -1,15 +1,15 @@ -<!--동아리 내에서 활동일지 눌렀을 때--> +<!--동아리 내에서 자유게시판 눌렀을 때--> <template> <div class="clubView"> <NavClub id="navClub"></NavClub> - <div v-for="board in freeboard" class="board"> - <router-link :to="{ name: 'board', params: { id: board.id}}"> + <div v-for="board in freeBoard" class="board"> + <router-link :to="{ name: 'free', params: { clubId: `${club[0].id}`, freeId: board.id}}"> <div> {{board.writer}} ㅣ {{board.title}} ㅣ {{board.date}} </div> </router-link> </div> - <router-link :to="{path:`/post/${club[0].id}`}">글쓰기</router-link> + <router-link :to="{path:`/post_free/${club[0].id}`}">글쓰기</router-link> </div> </template> @@ -30,7 +30,7 @@ export default { logo:'', produce:'' }], - freeboard:[{ + freeBoard:[{ title:'', content:'', writer:'' @@ -41,9 +41,8 @@ export default { let id = this.$route.params.clubId; const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) this.club = res.data.result - const freeboard = await this.$http.get(`http://jnhonlinux.ddns.net:3000/freeboard/${id}`) - this.freeboard = freeboard.data.result - + const freeboard = await this.$http.get(`http://jnhonlinux.ddns.net:3000/freeBoard/all/${id}`) + this.freeBoard = freeboard.data.result } } </script> diff --git a/src/views/club_Join.vue b/src/views/club_top_bar/club_Join.vue similarity index 74% rename from src/views/club_Join.vue rename to src/views/club_top_bar/club_Join.vue index d7fbeea62a45a8f8d02dd94dc3c3da5a2b597509..66ad3c1fe74523088dedaa063b2623376f08703e 100644 --- a/src/views/club_Join.vue +++ b/src/views/club_top_bar/club_Join.vue @@ -11,7 +11,7 @@ <script> import NavClub from '@/components/NavClub.vue' -import router from "../router/index" +import router from "../../router/index" import axios from "axios" import {mapState} from "vuex" export default { @@ -38,13 +38,19 @@ export default { post(){ if(this.comment != ''){ let id = this.$route.params.clubId; - axios.put(`http://jnhonlinux.ddns.net:3000/applyClub/${id}`, { + axios.post(`http://jnhonlinux.ddns.net:3000/applyClub/${id}`, { user: this.userInfo.name, comment: this.comment, club: this.club[0].id + }).then((res) => { + if(res.data.success == false){ + alert(res.data.result) + router.push(`/club_page/${id}`) + } else { + alert(res.data.result) + router.push(`/club_page/${id}`) + } }) - alert("가입신청이 완료되었습니다.") - router.push(`/club_page/${id}`) } else{ alert("빈칸을 채워주세요.") diff --git a/src/views/club_Manage.vue b/src/views/club_top_bar/club_Manage.vue similarity index 52% rename from src/views/club_Manage.vue rename to src/views/club_top_bar/club_Manage.vue index b2f754d3077a03530327b1377f73bc345b4e3a71..75135b732160bad8863a5d14773ebd80db594c2e 100644 --- a/src/views/club_Manage.vue +++ b/src/views/club_top_bar/club_Manage.vue @@ -6,11 +6,15 @@ <div class="clubmember"> <div v-for="clubmem in member"> <h3 style="display:inline">이름: {{clubmem.user}}</h3> - <button><router-link :to="{path:`/joinedClub/user/${clubmem.user}`}">자세히</router-link></button> + <button><router-link :to="{name:'club_detail', params:{clubId: `${club[0].id}`, uid:clubmem.user}}">자세히</router-link></button> </div> </div> <h3>가입 신청자 목록</h3> <div class="waitmember"> + <div v-for="clubmem in applymember"> + <h3 style="display:inline">이름: {{clubmem.user}}</h3> + <button><router-link :to="{name:'applymember', params:{clubId: `${club[0].id}`, uid:clubmem.user}}">자세히</router-link></button> + </div> <!--관리자만 볼 수 있도록 가입 신청 대기자들 목록 표시--> </div> <br><br> @@ -19,6 +23,7 @@ <script> import NavClub from '@/components/NavClub.vue' +import axios from "axios" export default { components: { 'NavClub': NavClub @@ -26,16 +31,21 @@ export default { data(){ return { club:[], - member:[] + member:[], + applymember:[] } }, async created() { let id = this.$route.params.clubId; - const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) + const res = await axios.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) this.club = res.data.result - const member = await this.$http.get(`http://jnhonlinux.ddns.net:3000/joinedClub/${id}`) - this.member = member.data.result + const member = await axios.get(`http://jnhonlinux.ddns.net:3000/joinedClub/${id}`) + this.member = member.data.result + + const applymember = await axios.get(`http://jnhonlinux.ddns.net:3000/applyClub/${id}`) + this.applymember = applymember.data.result + console.log(this.applymember) }, } </script> diff --git a/src/views/club_Page.vue b/src/views/club_top_bar/club_Page.vue similarity index 100% rename from src/views/club_Page.vue rename to src/views/club_top_bar/club_Page.vue diff --git a/src/views/club_Post.vue b/src/views/club_top_bar/club_Post.vue similarity index 97% rename from src/views/club_Post.vue rename to src/views/club_top_bar/club_Post.vue index 35e22a3d8b19299be991749c59a4bf5ae92c9b4f..5c91585f404167077a647a7f6b4cf39fdffa7d5c 100644 --- a/src/views/club_Post.vue +++ b/src/views/club_top_bar/club_Post.vue @@ -43,6 +43,7 @@ export default { const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) this.club = res.data.result const activityLog = await this.$http.get(`http://jnhonlinux.ddns.net:3000/activityLog/all/${id}`) + console.log(activityLog) this.activityLog = activityLog.data.result } } diff --git a/src/views/Home.vue b/src/views/left_bar/Home.vue similarity index 100% rename from src/views/Home.vue rename to src/views/left_bar/Home.vue diff --git a/src/views/Login.vue b/src/views/left_bar/Login.vue similarity index 100% rename from src/views/Login.vue rename to src/views/left_bar/Login.vue diff --git a/src/views/Mypage.vue b/src/views/left_bar/Mypage.vue similarity index 100% rename from src/views/Mypage.vue rename to src/views/left_bar/Mypage.vue diff --git a/src/views/Club.vue b/src/views/left_bar/club.vue similarity index 84% rename from src/views/Club.vue rename to src/views/left_bar/club.vue index 2636d712b84f3c233a4a019016bf47634fa17b4e..17002dfa6179b896d82c6c437fa8a5d1ec11afe4 100644 --- a/src/views/Club.vue +++ b/src/views/left_bar/club.vue @@ -5,8 +5,8 @@ <span><b>Filter · ·</b></span> <br><br> <h4 style="display:inline">그룹:</h4> - <input type="checkbox" name="club" value="소학회">소학회 - <input type="checkbox" name="club" value="동아리">동아리 + <input type="checkbox" name="club" v-model="isClub0">소학회 + <input type="checkbox" name="club" v-model="isClub1">동아리 <br><br> <h4 style="display:inline">분야:</h4> <input type="checkbox" name="club" value="운동">운동 @@ -14,7 +14,6 @@ <input type="checkbox" name="club" value="토론">토론 <input type="checkbox" name="club" value="영어">영어 <br><br> - <h4 style="display:inline">동아리 검색:</h4> <select v-model="selected"> <option value="name">클럽 이름</option> @@ -25,7 +24,8 @@ <hr/> </div> <div class="clublist"> - <div v-for = "club in searching" class="clubImage"> + <div v-for = "club in searching" class="clubImage"> + {{club.isClub}} <router-link :to="{path:`/club_page/${club.id}`,params:{clubId:club.id}}"> <div> <h3>{{club.name}}</h3> @@ -44,11 +44,19 @@ export default { return { clublist:[], selected:'', - search:'' + search:'', + isClub0:'', + isClub1:'' } }, computed:{ searching(){ + + if(this.isClub0 == true || this.isClub1 == true){ + return this.clublist.filter((ele)=>{ + return this.isClub.includes(ele.isClub) + }) + } if(this.selected == 'name' && this.search != ''){ return this.clublist.filter((ele)=>{ return ele.name.match(this.search)