Skip to content
Snippets Groups Projects
Commit 5b12fba8 authored by KimDoHyun's avatar KimDoHyun
Browse files

거의 끝

parent 73f56e03
No related branches found
No related tags found
No related merge requests found
...@@ -17,12 +17,7 @@ ...@@ -17,12 +17,7 @@
<router-link to='/login' v-if="isLogin === false">로그인</router-link><br> <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='/mypage' v-if="isLogin == true">마이 페이지</router-link><br><br>
<router-link to='/club' v-if="isLogin == true">동아리 구경</router-link><br><br> <router-link to='/club' v-if="isLogin == true">동아리 구경</router-link><br><br>
<div style="list-style:none;" v-if="isLogin == true">내 동아리 <router-link to='/myclub' v-if="isLogin == true">내 동아리</router-link><br><br>
{{clublist}}
<li v-for= "club in clublist">
<router-link :to="{name: 'club_page',params:{clubId:club.club}}">{{club.clubname}}</router-link>
</li>
</div><br>
<div @click="$store.dispatch('logout')"> <div @click="$store.dispatch('logout')">
<router-link to='/' v-if="isLogin == true">로그아웃</router-link><br><br> <router-link to='/' v-if="isLogin == true">로그아웃</router-link><br><br>
</div> </div>
...@@ -46,10 +41,6 @@ export default { ...@@ -46,10 +41,6 @@ export default {
...mapState(['userInfo']) ...mapState(['userInfo'])
}, },
async created(){ 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
console.log(this.clublist)
const res2 = await axios.get('http://jnhonlinux.ddns.net:3000/club') const res2 = await axios.get('http://jnhonlinux.ddns.net:3000/club')
this.club = res2.data.result this.club = res2.data.result
} }
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<div id="clubMenu"> <div id="clubMenu">
<router-link :to="{path:`/club_page/${club[0].id}`}">홈페이지</router-link> | <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_post/${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_free/${club[0].id}`}">자유게시판 </router-link> |
<router-link :to="{path:`/club_manage/${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> <router-link :to="{path:`/club_join/${club[0].id}`}">가입신청</router-link>
...@@ -32,22 +31,9 @@ export default { ...@@ -32,22 +31,9 @@ export default {
this.club = res.data.result this.club = res.data.result
}, },
methods:{ methods:{
post(){
let id = this.$route.params.clubId;
axios.post(`http://jnhonlinux.ddns.net:3000/freeBoard/${id}`,{
uid: this.userInfo.uid
}).then(res=>{
console.log(res.data)
if(res.data.success == true){
router.push(`/club_free/${id}`)
} else {
alert('Not User');
}
})
} }
} }
}
</script> </script>
<style> <style>
......
...@@ -41,6 +41,12 @@ const routes = [ ...@@ -41,6 +41,12 @@ const routes = [
component: () => component: () =>
import(/* webpackChunkName: "about" */ "../views/SignUp.vue") import(/* webpackChunkName: "about" */ "../views/SignUp.vue")
}, },
{
path: '/myclub',
name: 'myclub',
component: () =>
import(/* webpackChunkName: "about" */ "../views/left_bar/Myclub.vue")
},
{ {
path: "/mypage", path: "/mypage",
name: "mypage", name: "mypage",
...@@ -97,6 +103,12 @@ const routes = [ ...@@ -97,6 +103,12 @@ const routes = [
component: () => component: () =>
import(/* webpackChunkName: "about" */ "../views/Post_Free.vue") import(/* webpackChunkName: "about" */ "../views/Post_Free.vue")
}, },
{
path: "/notice_write/:clubId",
name: "notice_write",
component: () =>
import(/* webpackChunkName: "about" */ "../views/notice_write.vue")
},
{ {
path: "/club_join/:clubId", path: "/club_join/:clubId",
name: "club_join", name: "club_join",
...@@ -126,7 +138,20 @@ const routes = [ ...@@ -126,7 +138,20 @@ const routes = [
name: "free", name: "free",
component: () => component: () =>
import(/* webpackChunkName: "about" */ "../views/Free.vue") import(/* webpackChunkName: "about" */ "../views/Free.vue")
},
{
path: "/notice/one/:clubId/:noticeId",
name: "notice",
component: () =>
import(/* webpackChunkName: "about" */ "../views/notice.vue")
},
{
path: "/introduce/:clubId",
name: "introduce",
component: () =>
import(/* webpackChunkName: "about" */ "../views/introduce.vue")
} }
] ]
const router = new VueRouter({ const router = new VueRouter({
......
...@@ -21,7 +21,9 @@ export default { ...@@ -21,7 +21,9 @@ export default {
}, },
data(){ data(){
return{ return{
club:[], club:[{
id:'',
}],
board:[{ board:[{
title:'' title:''
}] }]
......
...@@ -21,7 +21,9 @@ export default { ...@@ -21,7 +21,9 @@ export default {
}, },
data(){ data(){
return{ return{
club:[], club:[{
id:'',
}],
free:[{ free:[{
title:'' title:''
}] }]
......
...@@ -20,14 +20,22 @@ ...@@ -20,14 +20,22 @@
<script> <script>
import NavClub from '@/components/NavClub.vue' import NavClub from '@/components/NavClub.vue'
export default { export default {
name: 'club_detail', name: 'applymember',
components: { components: {
'NavClub': NavClub 'NavClub': NavClub
}, },
data(){ data(){
return { return {
club:[], club:[{
member:[] id:'',
}],
member:[{
name:'',
department:'',
sid:'',
email:'',
phone:''
}]
} }
}, },
async created(){ async created(){
...@@ -35,9 +43,8 @@ export default { ...@@ -35,9 +43,8 @@ export default {
const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`)
this.club = res.data.result this.club = res.data.result
let uid = this.$route.params.uid let uid = this.$route.params.uid
const res2 = await this.$http.get(`http://jnhonlinux.ddns.net:3000/users/${uid}`) const res2 = await this.$http.get(`http://jnhonlinux.ddns.net:3000/joinedClub/detail/${uid}`)
this.member = res2.data this.member = res2.data.result
} }
} }
......
...@@ -26,8 +26,12 @@ export default { ...@@ -26,8 +26,12 @@ export default {
}, },
data(){ data(){
return { return {
club:[], club:[{
member:[] id:'',
}],
member:[{
name:'',
}]
} }
}, },
async created(){ async created(){
......
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
</div> </div>
<h3>가입 신청자 목록</h3> <h3>가입 신청자 목록</h3>
<div class="waitmember"> <div class="waitmember">
<div v-for="clubmem in applymember"> <div v-for="applymem in applymember">
<h3 style="display:inline">이름: {{clubmem.user}}</h3> <h3 style="display:inline">이름: {{applymem.user}}</h3>
<button><router-link :to="{name:'applymember', params:{clubId: `${club[0].id}`, uid:clubmem.user}}">자세히</router-link></button> {{applymem}}
<button><router-link :to="{name:'applymember', params:{clubId: `${club[0].id}`, uid: applymem.user}}">자세히</router-link></button>
</div> </div>
<!--관리자만 볼 수 있도록 가입 신청 대기자들 목록 표시--> <!--관리자만 볼 수 있도록 가입 신청 대기자들 목록 표시-->
</div> </div>
......
<!--동아리 내에서 메인 화면--> <!--동아리 내에서 메인 화면-->
<template> <template>
<div class="clubView"> <div class="clubView">
<NavClub id="navClub">가나다</NavClub> <NavClub id="navClub"></NavClub>
<h1>{{club[0].name}}</h1> <h1>{{club[0].name}}</h1>
{{club[0].logo}} {{club[0].logo}}
<hr/> <hr/>
<div> <div>
<h1>소개</h1> <h1>소개</h1>
{{club[0].produce}} {{club[0].introduce}}
<router-link :to="{path:`/introduce/${club[0].id}`}">수정하기</router-link>
</div> </div>
<hr/> <hr/>
<div>
<h1>공지사항</h1> <h1>공지사항</h1>
<div v-for="notice in noticeBoard"> <div v-for="notice in noticeBoard" class="board">
작성자: {{notice}} <router-link :to="{ name: 'notice', params: {clubId: `${club[0].id}`, noticeId: notice.id}}">
<div class="boardlist">
{{notice.writer}}{{notice.title}}{{notice.date}}
</div> </div>
</router-link>
</div> </div>
<router-link :to="{path:`/notice_write/${club[0].id}`}">글쓰기</router-link>
</div> </div>
</template> </template>
......
<!--활동 일지 글 쓸 때-->
<template>
<div class="posting">
<NavClub id="navClub"></NavClub>
<h2>동아리 소개 글 수정</h2>
<div class="board">
<h4>소개</h4>
<textarea style="resize:none;" cols="60" rows="13" v-model="introduce" 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:'',
}],
introduce:'',
}
},
methods: {
post(){
if(this.introduce != ''){
let id = this.$route.params.clubId;
axios.post(`http://jnhonlinux.ddns.net:3000/club/${id}/introduce`, {
introduce: this.introduce
})
router.push(`/club_page/${id}`)
}
if(this.introduce == ''){
alert("내용을 써주세요.")
}
},
cancel(){
let id = this.$route.params.clubId;
router.push(`/club_page/${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
<template>
<div>
<div v-for = "club in clublist" class="clubImage">
<router-link :to="{path:`/club_page/${club.club}`,params:{clubId:club.club}}">
<div>
<h3>{{club.clubname}}</h3>
</div>
</router-link>
</div>
</div>
</template>
<script>
import axios from "axios"
import {mapState} from "vuex"
export default {
data(){
return {
club:[],
clublist:[]
}
},
computed:{
...mapState(['userInfo'])
},
async created(){
let uid = this.userInfo.uid
const res2 = await axios.get('http://jnhonlinux.ddns.net:3000/club')
this.club = res2.data.result
const res = await axios.get(`http://jnhonlinux.ddns.net:3000/joinedClub/user/${uid}`)
this.clublist = res.data.result
}
}
</script>
\ No newline at end of file
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<router-link :to="{path:`/club_page/${club.id}`,params:{clubId:club.id}}"> <router-link :to="{path:`/club_page/${club.id}`,params:{clubId:club.id}}">
<div> <div>
<h3>{{club.name}}</h3> <h3>{{club.name}}</h3>
<p>{{club.detail}}</p> <p>{{club.introduce}}</p>
</div> </div>
</router-link> </router-link>
</div> </div>
...@@ -62,6 +62,9 @@ export default { ...@@ -62,6 +62,9 @@ export default {
return ele.name.match(this.search) return ele.name.match(this.search)
}) })
} }
this.clublist.filter(ele => {
return ele.isClub == true
})
if(this.selected == 'content' && this.search != ''){ if(this.selected == 'content' && this.search != ''){
return this.clublist.filter((ele)=>{ return this.clublist.filter((ele)=>{
return ele.detail.match(this.search) return ele.detail.match(this.search)
......
<!--공지사항에서 게시글 눌렀을 때-->
<template>
<div class="board">
<NavClub id="navClub"></NavClub>
<div>
제목: {{notice[0].title}}<br>
내용: {{notice[0].content}}<br>
글쓴이: {{notice[0].writer}}<br>
작성 날짜: {{notice[0].date}}<br>
</div>
<router-link :to="{path:`/club_page/${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:[],
notice:[{
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 nid = this.$route.params.noticeId;
const notice = await this.$http.get(`http://jnhonlinux.ddns.net:3000/noticeBoard/one/${id}/${nid}`)
this.notice = notice.data.result
}
}
</script>
\ No newline at end of file
<!--활동 일지 글 쓸 때-->
<template>
<div class="posting">
<NavClub id="navClub"></NavClub>
<h2>공지사항</h2>
<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/noticeBoard/${id}`, {
title: this.title,
content: this.content,
writer: this.userInfo.name,
// c_id: this.club[0].id
})
router.push(`/club_page/${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_page/${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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment