From 80e2e7d8027211e0f63abb170b8a359f1dfb9955 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 24 Apr 2024 01:13:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=EB=A6=AC=EC=A6=88=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20-=20=EC=BD=98?= =?UTF-8?q?=ED=85=90=EC=B8=A0=20=EB=A6=AC=EC=8A=A4=ED=8A=B8/=EC=BD=98?= =?UTF-8?q?=ED=85=90=EC=B8=A0=20=EC=82=AD=EC=A0=9C=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/audio_content_series.js | 2 +- src/views/Content/ContentCategoryList.vue | 27 ---- src/views/Content/ContentSeriesDetail.vue | 143 +++++++++++++++++++++- 3 files changed, 142 insertions(+), 30 deletions(-) diff --git a/src/api/audio_content_series.js b/src/api/audio_content_series.js index 304c8c8..a2c19c5 100644 --- a/src/api/audio_content_series.js +++ b/src/api/audio_content_series.js @@ -42,7 +42,7 @@ async function addingContentToTheSeries(seriesId, contentIdList) { } async function removeContentInTheSeries(seriesId, contentId) { - return Vue.axios.post( + return Vue.axios.put( "/creator-admin/audio-content/series/remove/content", {seriesId: seriesId, contentId: contentId} ) diff --git a/src/views/Content/ContentCategoryList.vue b/src/views/Content/ContentCategoryList.vue index 12f54dc..5431067 100644 --- a/src/views/Content/ContentCategoryList.vue +++ b/src/views/Content/ContentCategoryList.vue @@ -339,33 +339,6 @@ export default { page: 1, total_page: 0, - - headers: [ - { - text: '커버이미지', - align: 'center', - sortable: false, - value: 'image', - }, - { - text: '제목', - align: 'center', - sortable: false, - value: 'title', - }, - { - text: '19금', - align: 'center', - sortable: false, - value: 'isAdult', - }, - { - text: '관리', - align: 'center', - sortable: false, - value: 'management' - }, - ] } }, diff --git a/src/views/Content/ContentSeriesDetail.vue b/src/views/Content/ContentSeriesDetail.vue index 077edd2..b0263b7 100644 --- a/src/views/Content/ContentSeriesDetail.vue +++ b/src/views/Content/ContentSeriesDetail.vue @@ -41,7 +41,92 @@ - 콘텐츠 + + + + + 콘텐츠 추가 + + + + + 콘텐츠 등록 + + + + + + + + + + + 등록된 콘텐츠가 없습니다. + + @@ -75,12 +160,19 @@ export default { data() { return { is_loading: false, + series_id: 0, series_detail: {}, + series_content_list: [], + selected_series_content: null, + page: 1, + total_page: 0, } }, async created() { + this.series_id = this.$route.params.seriesId await this.getSeriesDetail() + await this.getSeriesContentList() }, methods: { @@ -96,7 +188,7 @@ export default { this.is_loading = true try { - const res = await api.getSeriesDetail(this.$route.params.seriesId) + const res = await api.getSeriesDetail(this.series_id) if (res.status === 200 && res.data.success === true) { this.series_detail = res.data.data } else { @@ -108,6 +200,48 @@ export default { this.is_loading = false } }, + + async getSeriesContentList() { + try { + const res = await api.getSeriesContent(this.series_id, this.page) + if (res.status === 200 && res.data.success === true) { + const data = res.data.data + this.series_content_list = data.items + + const total_page = Math.ceil(data.totalCount / 20) + if (total_page <= 0) + this.total_page = 1 + else + this.total_page = total_page + } else { + this.notifyError(res.data.message || '콘텐츠를 불러오지 못했습니다. 다시 시도해 주세요.') + } + } catch (e) { + this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') + } + }, + + async removeContentInSeries(content) { + this.is_loading = true + + try { + const res = await api.removeContentInTheSeries(this.series_id, content.contentId) + + if (res.status === 200 && res.data.success === true) { + this.page = 1 + this.total_page = 0 + this.series_content_list = [] + this.notifySuccess('삭제되었습니다.') + await this.getSeriesContentList() + } else { + this.notifyError('콘텐츠를 삭제하지 못했습니다. 다시 시도해 주세요.') + } + } catch (e) { + this.notifyError('콘텐츠를 삭제하지 못했습니다. 다시 시도해 주세요.') + } finally { + this.is_loading = false + } + }, }, } @@ -120,4 +254,9 @@ export default { .cover-image { aspect-ratio: 1/1.4; } + +.no-series-content { + height: 50vh; + margin-top: 100px; +}