diff --git a/src/router/index.js b/src/router/index.js index 6636ed838c817eaff99baafc62a7ed41bf61d7d9..bebb63931a28273a4742bf6dd025c3d217fb2b42 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -103,6 +103,24 @@ const routes = [ component: () => import(/* webpackChunkName: "about" */ "../views/Post.vue") }, + { + path: "/club_join/:clubId", + name: "club_join", + component: () => + import(/* webpackChunkName: "about" */ "../views/club_Join.vue") + }, + { + path: "/joinedClub/user/:uid", + name: "club_detail", + component: () => + import(/* webpackChunkName: "about" */ "../views/club_Detail.vue") + }, + { + path: "/activityLog/one/:clubId/:boardId", + name: "board", + component: () => + import(/* webpackChunkName: "about" */ "../views/Board.vue") + }, ] const router = new VueRouter({ diff --git a/src/views/Board.vue b/src/views/Board.vue index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..297070cdf53ccc8e63923c79290914fa943baf89 100644 --- a/src/views/Board.vue +++ b/src/views/Board.vue @@ -0,0 +1,35 @@ +<!--활동일지 게시판에서 게시글 눌렀을 때--> +<template> + <div class="board"> + <NavClub id="navClub"></NavClub> + 제목: {{board[0].title}}<br> + 내용: {{board[0].content}}<br> + 글쓴이: {{board[0].writer}}<br> + 작성 날짜: {{board[0].date}}<br> + </div> +</template> + +<script> +import axios from "axios" +import NavClub from '@/components/NavClub.vue' +export default { + components: { + 'NavClub': NavClub + }, + data(){ + return{ + club:[], + board:[] + } + }, + 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 bid = this.$route.params.boardId; + const board = await this.$http.get(`http://jnhonlinux.ddns.net:3000/activityLog/one/${id}/${bid}`) + this.board = board.data.result + } + +} +</script> \ No newline at end of file diff --git a/src/views/Modify_profile.vue b/src/views/Modify_profile.vue index 8efcfeb65a5adf3f5b57af8664a836c3ab0fcedd..3b2cf54cea1974e11192b2ffac5726eccbccad26 100644 --- a/src/views/Modify_profile.vue +++ b/src/views/Modify_profile.vue @@ -2,52 +2,63 @@ <template> <div class="modify"> <div> - 이름: <input type="text" name="name" placeholder="김도현" readonly/> + 이름: <input type="text" name="name"> <br> - 이메일: <input type="email" v-model="user.email" placeholder="kdh5998@ajou.ac.kr" required> + 이메일: <input type="email" v-model="email" required> <br> - 대학교: <input type="text" v-model="user.university" placeholder="아주대학교" required> + 대학교: <input type="text" v-model="univ" required> <br> - 전공: <input type="text" v-model="user.major" placeholder="소프트웨어학과" required> + 전공: <input type="text" v-model="department" required> <br> - 학번: <input type="text" v-model="user.student_num" placeholder="201720726"> + 학번: <input type="text" v-model="sid"> + <br> + 전화번호: <input type="text" v-model="phone" pattern="(010)-\d{3,4}-\d{4}"> + <br> + 비밀번호: <input type="password" v-model="password"> + <br> + 비밀번호 재확인: <input type="password" v-model="repassword"> <br> - 전화번호: <input type="text" v-model="user.phone_num" placeholder="01092495992" pattern="(010)-\d{3,4}-\d{4}"> <br><br> - <!--아직 못함--> <button @click="submit()">제출하기</button> </div> </div> </template> <script> -import { eventBus } from '../main' +import axios from "axios" import {mapState} from "vuex" export default { data(){ return { + name:'', email:'', - university:'', - major:'', - student_num:'', - phone_num:'', - user:{} + univ:'', + department:'', + sid:'', + phone:'', + password:'', + repassword:'' } }, - created(){ - this.user.email = this.email - this.user.university = this.university - this.user.major = this.major - this.user.student_num = this.student_num - this.user.phone_num = this.phone_num - }, computed: { ...mapState(['userInfo']) }, methods: { submit(){ - console.log(this.user) - // eventBus.$emit("userWasModified",new Date()) + // if(this.name==''||this.email==''||this.univ==''||this.department==''||this.sid==''||this.phone==''||this.password==''||this.repassword==''){ + // alert("빈칸을 채워주세요.") + // } + + let id = this.userInfo.id + axios.post(`http://jnhonlinux.ddns.net:3000/users/${id}`, { + name: this.name, + email: this.email, + phone: this.phone, + department: this.department, + univ: this.univ, + sid: this.sid, + password: this.password + }) } } } diff --git a/src/views/Mypage.vue b/src/views/Mypage.vue index 1fc61605f1d88a6f9f2eef95241f5ca193a9c7b9..7e0eeb989db9be8665fcb7aa78b87a3a7aa320d1 100644 --- a/src/views/Mypage.vue +++ b/src/views/Mypage.vue @@ -14,7 +14,6 @@ </template> <script> -import { eventBus } from "../main" import {mapState} from "vuex" export default { data() { diff --git a/src/views/Post.vue b/src/views/Post.vue index 55197ddeb147027481f96d8b45a6a34fb480dd36..7d0589d69d5be5941e41e3d36aae0bb43e86a54e 100644 --- a/src/views/Post.vue +++ b/src/views/Post.vue @@ -9,6 +9,7 @@ <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> @@ -33,13 +34,28 @@ export default { }, methods: { post(){ + if(this.title != '' && this.content != ''){ + let id = this.$route.params.clubId; + axios.post(`http://jnhonlinux.ddns.net:3000/activityLog/${id}`, { + title: this.title, + content: this.content, + writer: this.userInfo.name, + // c_id: this.club[0].id + }) + router.push(`/club_post/${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; - axios.post(`http://jnhonlinux.ddns.net:3000/activityLog/${id}`, { - title: this.title, - content: this.content, - writer: this.userInfo.name, - // c_id: this.club[0].id - }) router.push(`/club_post/${id}`) } }, diff --git a/src/views/club_Detail.vue b/src/views/club_Detail.vue new file mode 100644 index 0000000000000000000000000000000000000000..e8f82a8da9669c820fa193bc81c078f96233f7f4 --- /dev/null +++ b/src/views/club_Detail.vue @@ -0,0 +1,32 @@ +<!--클럽 회원 관리에서 유저 정보 자세히 보기--> +<template> + <div class="detail"> + <NavClub id="navClub"></NavClub> + hi + </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 + + // const member = await this.$http.get(`http://jnhonlinux.ddns.net:3000/joinedClub/${id}`) + // this.member = member.data.result + + // }, +} +</script> \ No newline at end of file diff --git a/src/views/club_Free.vue b/src/views/club_Free.vue index 1f21c04a5be9a4ccf3185a4c43ec755f03e59a99..1e53f209cfc6058a0008969f1bafb9a55f5ec426 100644 --- a/src/views/club_Free.vue +++ b/src/views/club_Free.vue @@ -16,13 +16,10 @@ <script> import NavClub from '@/components/NavClub.vue' -import Post from '@/views/Post.vue' - export default { - name: 'club_post', + name: 'club_free', components: { - 'NavClub': NavClub, - 'Post' : Post + 'NavClub': NavClub }, data(){ return { diff --git a/src/views/club_Join.vue b/src/views/club_Join.vue new file mode 100644 index 0000000000000000000000000000000000000000..d7fbeea62a45a8f8d02dd94dc3c3da5a2b597509 --- /dev/null +++ b/src/views/club_Join.vue @@ -0,0 +1,59 @@ +<template> + <div> + <NavClub id="navClub"></NavClub> + <div class="join"> + <h2>가입 신청서</h2> + <textarea style="resize:none;" cols="60" rows="13" v-model="comment" placeholder="자기 소개 및 하고싶은 말씀을 적어주세요." class="comment"></textarea> + </div> + <button @click="post">제출</button> + </div> +</template> + +<script> +import NavClub from '@/components/NavClub.vue' +import router from "../router/index" +import axios from "axios" +import {mapState} from "vuex" +export default { + data(){ + return { + comment:'', + club:[{ + id:'' + }] + } + }, + components: { + 'NavClub': NavClub + }, + 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']) + }, + methods: { + post(){ + if(this.comment != ''){ + let id = this.$route.params.clubId; + axios.put(`http://jnhonlinux.ddns.net:3000/applyClub/${id}`, { + user: this.userInfo.name, + comment: this.comment, + club: this.club[0].id + }) + alert("가입신청이 완료되었습니다.") + router.push(`/club_page/${id}`) + } + else{ + alert("빈칸을 채워주세요.") + } + } + } +} +</script> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/club_Manage.vue b/src/views/club_Manage.vue index f5d070f7d548e37c93edd686846de24e5a390e09..b2f754d3077a03530327b1377f73bc345b4e3a71 100644 --- a/src/views/club_Manage.vue +++ b/src/views/club_Manage.vue @@ -1,18 +1,19 @@ <!--동아리 내에서 동아리 회원 관리--> <template> <div class="manage"> - <NavClub id="navClub">가나다</NavClub> - <h3>{{$route.query.clubName}}</h3> - + <NavClub id="navClub"></NavClub> <h3>동아리원 목록</h3> <div class="clubmember"> - <div v-for="clubmem in club"> - <h3>이름: {{clubmem.name}}, 학번: {{club.student_num}}, 학과:{{club.major}}</h3> + <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> </div> </div> - <br><br> - <div> + <h3>가입 신청자 목록</h3> + <div class="waitmember"> + <!--관리자만 볼 수 있도록 가입 신청 대기자들 목록 표시--> </div> + <br><br> </div> </template> @@ -24,13 +25,17 @@ export default { }, data(){ return { - club:{} + 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 + this.club = res.data.result + + const member = await this.$http.get(`http://jnhonlinux.ddns.net:3000/joinedClub/${id}`) + this.member = member.data.result }, } </script> @@ -41,4 +46,7 @@ export default { height: 300px; overflow: scroll; } +.clubmember h3 { + margin-right: 80px; +} </style> \ No newline at end of file diff --git a/src/views/club_Post.vue b/src/views/club_Post.vue index 900a243dd2ab85a3faf3a204650e01bcfded2041..35e22a3d8b19299be991749c59a4bf5ae92c9b4f 100644 --- a/src/views/club_Post.vue +++ b/src/views/club_Post.vue @@ -3,8 +3,8 @@ <div class="clubView"> <NavClub id="navClub"></NavClub> <div v-for="board in activityLog" class="board"> - <router-link :to="{ name: 'board', params: { id: board.id}}"> - <div> + <router-link :to="{ name: 'board', params: { clubId: `${club[0].id}`, boardId: board.id }}"> + <div class="boardlist"> {{board.writer}} ㅣ {{board.title}} ㅣ {{board.date}} </div> </router-link> @@ -16,13 +16,11 @@ <script> import NavClub from '@/components/NavClub.vue' -import Post from '@/views/Post.vue' export default { name: 'club_post', components: { - 'NavClub': NavClub, - 'Post' : Post + 'NavClub': NavClub }, data(){ return { @@ -41,12 +39,11 @@ export default { } }, async created() { - let id = this.$route.params.clubId; + 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 activityLog = await this.$http.get(`http://jnhonlinux.ddns.net:3000/activityLog/${id}`) + const activityLog = await this.$http.get(`http://jnhonlinux.ddns.net:3000/activityLog/all/${id}`) this.activityLog = activityLog.data.result - } } </script>