first commit
This commit is contained in:
374
src/views/Support/FaqView.vue
Normal file
374
src/views/Support/FaqView.vue
Normal file
@@ -0,0 +1,374 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar dark>
|
||||
<v-spacer />
|
||||
<v-toolbar-title>FAQ</v-toolbar-title>
|
||||
<v-spacer />
|
||||
</v-toolbar>
|
||||
|
||||
<br>
|
||||
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="9">
|
||||
<v-radio-group
|
||||
v-model="selected_category"
|
||||
row
|
||||
@change="getFaqs"
|
||||
>
|
||||
<v-radio
|
||||
v-for="category in categories"
|
||||
:key="category"
|
||||
:label="category"
|
||||
:value="category"
|
||||
/>
|
||||
</v-radio-group>
|
||||
</v-col>
|
||||
<v-spacer />
|
||||
<v-col>
|
||||
<v-btn
|
||||
block
|
||||
color="#9970ff"
|
||||
dark
|
||||
depressed
|
||||
@click="showWriteDialog"
|
||||
>
|
||||
FAQ 등록
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-simple-table
|
||||
class="elevation-10"
|
||||
dark
|
||||
>
|
||||
<template>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
NO
|
||||
</th>
|
||||
<th class="text-center">
|
||||
카테고리
|
||||
</th>
|
||||
<th class="text-center">
|
||||
질문
|
||||
</th>
|
||||
<th class="text-center">
|
||||
답변
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="item in faqs"
|
||||
:key="item.id"
|
||||
@click="clickFaq(item)"
|
||||
>
|
||||
<td>
|
||||
{{ item.id }}
|
||||
</td>
|
||||
<td>
|
||||
{{ item.category }}
|
||||
</td>
|
||||
<td class="text-left">
|
||||
{{ item.question }}
|
||||
</td>
|
||||
<td class="text-left">
|
||||
<div v-html="item.answer" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</template>
|
||||
</v-simple-table>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
<v-row>
|
||||
<v-dialog
|
||||
v-model="show_write_dialog"
|
||||
max-width="1000px"
|
||||
persistent
|
||||
>
|
||||
<v-card>
|
||||
<v-card-text />
|
||||
<v-card-text>
|
||||
<v-radio-group
|
||||
v-model="faq.category"
|
||||
row
|
||||
>
|
||||
<v-radio
|
||||
v-for="category in categories"
|
||||
:key="category"
|
||||
:label="category"
|
||||
:value="category"
|
||||
/>
|
||||
</v-radio-group>
|
||||
</v-card-text>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="faq.question"
|
||||
label="제목"
|
||||
/>
|
||||
</v-card-text>
|
||||
<v-card-text>
|
||||
<VueEditor
|
||||
v-model="faq.answer"
|
||||
:editor-toolbar="customToolbar"
|
||||
/>
|
||||
</v-card-text>
|
||||
<v-card-actions v-show="!is_loading">
|
||||
<v-btn
|
||||
v-show="is_modify"
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="deleteFaq"
|
||||
>
|
||||
삭제
|
||||
</v-btn>
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="cancel"
|
||||
>
|
||||
취소
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="is_modify"
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="modify"
|
||||
>
|
||||
수정
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-else
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="submit"
|
||||
>
|
||||
등록
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as api from '@/api/faq'
|
||||
import {VueEditor} from "vue2-editor";
|
||||
|
||||
export default {
|
||||
name: "FaqView",
|
||||
|
||||
components: {
|
||||
VueEditor,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
is_loading: false,
|
||||
is_modify: false,
|
||||
categories: [],
|
||||
selected_category: '',
|
||||
selected_faq: {},
|
||||
faqs: [],
|
||||
faq: {},
|
||||
show_write_dialog: false,
|
||||
show_delete_confirm_dialog: false,
|
||||
customToolbar: [
|
||||
[{header: [false, 1, 2, 3, 4, 5, 6]}],
|
||||
["bold", "italic", "underline"],
|
||||
[
|
||||
{align: ""},
|
||||
{align: "center"},
|
||||
{align: "right"},
|
||||
{align: "justify"}
|
||||
],
|
||||
[{list: "ordered"}, {list: "bullet"}],
|
||||
[{color: []}, {background: []}],
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getFaqCategories()
|
||||
},
|
||||
|
||||
methods: {
|
||||
notifyError(message) {
|
||||
this.$dialog.notify.error(message)
|
||||
},
|
||||
|
||||
notifySuccess(message) {
|
||||
this.$dialog.notify.success(message)
|
||||
},
|
||||
|
||||
async getFaqCategories() {
|
||||
this.is_loading = true
|
||||
try {
|
||||
const res = await api.getCategories()
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
const data = res.data.data
|
||||
|
||||
this.categories = data
|
||||
this.selected_category = data[0]
|
||||
await this.getFaqs()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async getFaqs() {
|
||||
this.is_loading = true
|
||||
|
||||
this.faqs = []
|
||||
try {
|
||||
const res = await api.getFaqs(this.selected_category)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.faqs = res.data.data
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async submit() {
|
||||
if (!this.validate()) return;
|
||||
if (this.is_loading) return;
|
||||
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.save(this.faq.question, this.faq.answer, this.faq.category)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_write_dialog = false
|
||||
this.notifySuccess('등록되었습니다.')
|
||||
this.faq = {}
|
||||
await this.getFaqs()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async deleteFaq() {
|
||||
this.is_loading = true
|
||||
try {
|
||||
const res = await api.deleteFaq(this.faq.id)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_write_dialog = false
|
||||
this.notifySuccess(res.data.message || '삭제되었습니다.')
|
||||
this.faq = {}
|
||||
await this.getFaqs()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
this.is_modify = false
|
||||
}
|
||||
},
|
||||
|
||||
async modify() {
|
||||
if (this.is_loading) return;
|
||||
|
||||
this.is_loading = true
|
||||
try {
|
||||
let request = {id: this.faq.id}
|
||||
|
||||
if (this.faq.question !== this.selected_faq.question) {
|
||||
request.question = this.faq.question
|
||||
}
|
||||
|
||||
if (this.faq.answer !== this.selected_faq.answer) {
|
||||
request.answer = this.faq.answer
|
||||
}
|
||||
|
||||
if (this.faq.category !== this.selected_faq.category) {
|
||||
request.category = this.faq.category
|
||||
}
|
||||
|
||||
const res = await api.modify(request)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_write_dialog = false
|
||||
this.notifySuccess(res.data.message || '수정되었습니다.')
|
||||
this.faq = {}
|
||||
await this.getFaqs()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
this.is_modify = false
|
||||
}
|
||||
},
|
||||
|
||||
clickFaq(item) {
|
||||
this.faq.id = item.id
|
||||
this.faq.question = item.question
|
||||
this.faq.answer = item.answer
|
||||
this.faq.category = item.category
|
||||
|
||||
this.selected_faq = item
|
||||
this.is_modify = true
|
||||
this.show_write_dialog = true
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.faq = {}
|
||||
this.selected_faq = {}
|
||||
this.is_modify = false
|
||||
this.show_write_dialog = false
|
||||
},
|
||||
|
||||
showWriteDialog() {
|
||||
this.show_write_dialog = true
|
||||
},
|
||||
|
||||
validate() {
|
||||
if (this.faq.question == null || this.faq.question.trim().length === 0) {
|
||||
this.notifyError("질문을 입력하세요.")
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.faq.answer == null || this.faq.answer.trim().length === 0) {
|
||||
this.notifyError("답변을 입력하세요.")
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.faq.category == null || this.faq.category.trim().length === 0) {
|
||||
this.notifyError("카테고리를 선택하세요.")
|
||||
return false;
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
382
src/views/Support/NoticeView.vue
Normal file
382
src/views/Support/NoticeView.vue
Normal file
@@ -0,0 +1,382 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar dark>
|
||||
<v-spacer />
|
||||
<v-toolbar-title>공지사항</v-toolbar-title>
|
||||
<v-spacer />
|
||||
</v-toolbar>
|
||||
|
||||
<br>
|
||||
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="10" />
|
||||
<v-col>
|
||||
<v-btn
|
||||
block
|
||||
color="#9970ff"
|
||||
dark
|
||||
depressed
|
||||
@click="showWriteDialog"
|
||||
>
|
||||
공지사항 등록
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-simple-table
|
||||
class="elevation-10"
|
||||
dark
|
||||
>
|
||||
<template>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
NO
|
||||
</th>
|
||||
<th class="text-left">
|
||||
제목
|
||||
</th>
|
||||
<th class="text-center">
|
||||
등록일
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="item in notices"
|
||||
:key="item.id"
|
||||
@click="clickNotice(item)"
|
||||
>
|
||||
<td>
|
||||
{{ item.id }}
|
||||
</td>
|
||||
<td class="text-left">
|
||||
{{ item.title }}
|
||||
</td>
|
||||
<td>
|
||||
{{ item.date }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</template>
|
||||
</v-simple-table>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="text-center">
|
||||
<v-col>
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="total_page"
|
||||
circle
|
||||
@input="next"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
<v-row>
|
||||
<v-dialog
|
||||
v-model="show_write_dialog"
|
||||
max-width="1000px"
|
||||
persistent
|
||||
>
|
||||
<v-card>
|
||||
<v-card-text />
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="notice.title"
|
||||
label="제목"
|
||||
/>
|
||||
</v-card-text>
|
||||
<v-card-text>
|
||||
<VueEditor
|
||||
v-model="notice.content"
|
||||
:editor-toolbar="customToolbar"
|
||||
/>
|
||||
</v-card-text>
|
||||
<v-card-actions v-show="!is_loading">
|
||||
<v-btn
|
||||
v-show="is_modify"
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="deleteConfirm"
|
||||
>
|
||||
삭제
|
||||
</v-btn>
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="cancel"
|
||||
>
|
||||
취소
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-show="!is_modify"
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="submit"
|
||||
>
|
||||
등록
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-show="is_modify"
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="modify"
|
||||
>
|
||||
수정
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-dialog
|
||||
v-model="show_delete_confirm_dialog"
|
||||
max-width="400px"
|
||||
persistent
|
||||
>
|
||||
<v-card>
|
||||
<v-card-text />
|
||||
<v-card-text>
|
||||
삭제하시겠습니까?
|
||||
</v-card-text>
|
||||
<v-card-actions v-show="!is_loading">
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="deleteCancel"
|
||||
>
|
||||
취소
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="deleteNotice"
|
||||
>
|
||||
확인
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {VueEditor} from "vue2-editor";
|
||||
import * as api from '@/api/notice'
|
||||
|
||||
export default {
|
||||
name: "NoticeView",
|
||||
|
||||
components: {
|
||||
VueEditor,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
is_loading: false,
|
||||
is_modify: false,
|
||||
page: 1,
|
||||
total_page: 0,
|
||||
notices: [],
|
||||
notice: {},
|
||||
show_write_dialog: false,
|
||||
show_delete_confirm_dialog: false,
|
||||
customToolbar: [
|
||||
[{header: [false, 1, 2, 3, 4, 5, 6]}],
|
||||
["bold", "italic", "underline"],
|
||||
[
|
||||
{align: ""},
|
||||
{align: "center"},
|
||||
{align: "right"},
|
||||
{align: "justify"}
|
||||
],
|
||||
[{list: "ordered"}, {list: "bullet"}],
|
||||
[{color: []}, {background: []}],
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getNotices()
|
||||
},
|
||||
|
||||
methods: {
|
||||
notifyError(message) {
|
||||
this.$dialog.notify.error(message)
|
||||
},
|
||||
|
||||
notifySuccess(message) {
|
||||
this.$dialog.notify.success(message)
|
||||
},
|
||||
|
||||
async next() {
|
||||
await this.getNotices()
|
||||
},
|
||||
|
||||
async getNotices() {
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.getNotices(this.page)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
const data = res.data.data
|
||||
|
||||
const total_page = Math.ceil(data.totalCount / 20)
|
||||
this.notices = res.data.data.noticeList
|
||||
|
||||
if (total_page <= 0)
|
||||
this.total_page = 1
|
||||
else
|
||||
this.total_page = total_page
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
showWriteDialog() {
|
||||
this.show_write_dialog = true
|
||||
},
|
||||
|
||||
clickNotice(item) {
|
||||
this.is_modify = true
|
||||
this.notice.id = item.id;
|
||||
this.notice.title = item.title;
|
||||
this.notice.content = item.content;
|
||||
this.show_write_dialog = true
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.is_modify = false
|
||||
this.notice = {}
|
||||
this.show_write_dialog = false
|
||||
},
|
||||
|
||||
validate() {
|
||||
if (this.notice.title == null || this.notice.title.trim().length === 0) {
|
||||
this.notifyError("제목을 입력하세요.")
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.notice.content == null || this.notice.content.trim().length === 0) {
|
||||
this.notifyError("내용을 입력하세요.")
|
||||
return false;
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
async submit() {
|
||||
if (!this.validate()) return;
|
||||
if (this.is_loading) return;
|
||||
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.save(this.notice.title, this.notice.content)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_write_dialog = false
|
||||
this.notifySuccess('등록되었습니다.')
|
||||
this.page = 1
|
||||
await this.getNotices()
|
||||
this.notice = {}
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async modify() {
|
||||
if (!this.validate()) return;
|
||||
if (this.is_loading) return;
|
||||
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.modify(this.notice.id, this.notice.title, this.notice.content)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_write_dialog = false
|
||||
this.notifySuccess('수정되었습니다.')
|
||||
this.page = 1
|
||||
await this.getNotices()
|
||||
this.notice = {}
|
||||
this.is_modify = false
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
deleteConfirm() {
|
||||
this.show_delete_confirm_dialog = true
|
||||
},
|
||||
|
||||
deleteCancel() {
|
||||
this.show_delete_confirm_dialog = false
|
||||
},
|
||||
|
||||
async deleteNotice() {
|
||||
if (this.is_loading) return;
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.deleteNotice(this.notice.id)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_write_dialog = false
|
||||
this.show_delete_confirm_dialog = false
|
||||
this.notifySuccess('삭제되었습니다.')
|
||||
this.page = 1
|
||||
await this.getNotices()
|
||||
this.notice = {}
|
||||
this.is_modify = false
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
table {
|
||||
width: 100%;
|
||||
border-top: 1px solid #444444;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border-left: 1px solid #444444;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
th:first-child, th:last-child {
|
||||
width: 20%
|
||||
}
|
||||
|
||||
th:first-child, td:first-child {
|
||||
border-left: none;
|
||||
}
|
||||
</style>
|
134
src/views/Support/PrivacyView.vue
Normal file
134
src/views/Support/PrivacyView.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar dark>
|
||||
<v-spacer />
|
||||
<v-toolbar-title>개인정보 처리방침</v-toolbar-title>
|
||||
<v-spacer />
|
||||
</v-toolbar>
|
||||
|
||||
<br>
|
||||
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<VueEditor
|
||||
v-model="privacy_policy"
|
||||
:editor-toolbar="customToolbar"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col cols="10" />
|
||||
<v-col v-if="!is_loading">
|
||||
<v-btn
|
||||
block
|
||||
color="#9970ff"
|
||||
dark
|
||||
depressed
|
||||
@click="save"
|
||||
>
|
||||
수정
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {VueEditor} from "vue2-editor";
|
||||
import * as api from "@/api/stplat";
|
||||
|
||||
export default {
|
||||
name: "PrivacyView",
|
||||
|
||||
components: {
|
||||
VueEditor,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
is_loading: false,
|
||||
stiplat_id: 0,
|
||||
privacy_policy: '',
|
||||
customToolbar: [
|
||||
[{header: [false, 1, 2, 3, 4, 5, 6]}],
|
||||
["bold", "italic", "underline"],
|
||||
[
|
||||
{align: ""},
|
||||
{align: "center"},
|
||||
{align: "right"},
|
||||
{align: "justify"}
|
||||
],
|
||||
[{list: "ordered"}, {list: "bullet"}],
|
||||
[{color: []}, {background: []}],
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getPrivacyPolicy()
|
||||
},
|
||||
|
||||
methods: {
|
||||
notifyError(message) {
|
||||
this.$dialog.notify.error(message)
|
||||
},
|
||||
|
||||
notifySuccess(message) {
|
||||
this.$dialog.notify.success(message)
|
||||
},
|
||||
|
||||
async getPrivacyPolicy() {
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.getPrivacyPolicy()
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
const data = res.data.data
|
||||
this.privacy_policy = data.description
|
||||
this.stiplat_id = data.id
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async save() {
|
||||
if (this.stiplat_id < 1) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
return;
|
||||
}
|
||||
if (this.privacy_policy.length < 10) {
|
||||
this.notifyError('내용을 입력하세요')
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.is_loading) return;
|
||||
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.modify(this.stiplat_id, this.privacy_policy)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.notifySuccess(res.data.message || '수정되었습니다.')
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
13
src/views/Support/ReportView.vue
Normal file
13
src/views/Support/ReportView.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>신고내역</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ReportView"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
134
src/views/Support/TermsOfServiceView.vue
Normal file
134
src/views/Support/TermsOfServiceView.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar dark>
|
||||
<v-spacer />
|
||||
<v-toolbar-title>서비스 이용약관</v-toolbar-title>
|
||||
<v-spacer />
|
||||
</v-toolbar>
|
||||
|
||||
<br>
|
||||
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<VueEditor
|
||||
v-model="terms_of_service"
|
||||
:editor-toolbar="customToolbar"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col cols="10" />
|
||||
<v-col v-if="!is_loading">
|
||||
<v-btn
|
||||
block
|
||||
color="#9970ff"
|
||||
dark
|
||||
depressed
|
||||
@click="save"
|
||||
>
|
||||
수정
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {VueEditor} from "vue2-editor";
|
||||
import * as api from "@/api/stplat";
|
||||
|
||||
export default {
|
||||
name: "TermsOfServiceView",
|
||||
|
||||
components: {
|
||||
VueEditor,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
is_loading: false,
|
||||
stiplat_id: 0,
|
||||
terms_of_service: '',
|
||||
customToolbar: [
|
||||
[{header: [false, 1, 2, 3, 4, 5, 6]}],
|
||||
["bold", "italic", "underline"],
|
||||
[
|
||||
{align: ""},
|
||||
{align: "center"},
|
||||
{align: "right"},
|
||||
{align: "justify"}
|
||||
],
|
||||
[{list: "ordered"}, {list: "bullet"}],
|
||||
[{color: []}, {background: []}],
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getTermsOfService()
|
||||
},
|
||||
|
||||
methods: {
|
||||
notifyError(message) {
|
||||
this.$dialog.notify.error(message)
|
||||
},
|
||||
|
||||
notifySuccess(message) {
|
||||
this.$dialog.notify.success(message)
|
||||
},
|
||||
|
||||
async getTermsOfService() {
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.getTermsOfService()
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
const data = res.data.data
|
||||
this.terms_of_service = data.description
|
||||
this.stiplat_id = data.id
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async save() {
|
||||
if (this.stiplat_id < 1) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
return;
|
||||
}
|
||||
if (this.terms_of_service.length < 10) {
|
||||
this.notifyError('내용을 입력하세요')
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.is_loading) return;
|
||||
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.modify(this.stiplat_id, this.terms_of_service)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.notifySuccess(res.data.message || '수정되었습니다.')
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user