first commit
This commit is contained in:
13
src/views/Creator/CreatorCalculate.vue
Normal file
13
src/views/Creator/CreatorCalculate.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>수다친구-정산관리</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "CounselorCalculate"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
274
src/views/Creator/CreatorList.vue
Normal file
274
src/views/Creator/CreatorList.vue
Normal file
@@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar dark>
|
||||
<v-spacer />
|
||||
<v-toolbar-title>요즘친구 리스트</v-toolbar-title>
|
||||
<v-spacer />
|
||||
</v-toolbar>
|
||||
|
||||
<br>
|
||||
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
v-model="utm_source"
|
||||
label="예) youtube, google"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
v-model="utm_medium"
|
||||
label="예) email, cpc"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
v-model="utm_campaign"
|
||||
label="예) 화이트데이"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="2" />
|
||||
<v-col cols="4">
|
||||
<v-text-field
|
||||
v-model="search_word"
|
||||
label="이메일 혹은 닉네임을 입력하세요"
|
||||
@keyup.enter="search"
|
||||
>
|
||||
<v-btn
|
||||
slot="append"
|
||||
color="#9970ff"
|
||||
dark
|
||||
@click="search"
|
||||
>
|
||||
검색
|
||||
</v-btn>
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-simple-table class="elevation-10">
|
||||
<template>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
회원번호
|
||||
</th>
|
||||
<th class="text-center">
|
||||
이메일
|
||||
</th>
|
||||
<th class="text-center">
|
||||
닉네임
|
||||
</th>
|
||||
<th class="text-center">
|
||||
이미지
|
||||
</th>
|
||||
<th class="text-center">
|
||||
회원타입
|
||||
</th>
|
||||
<th class="text-center">
|
||||
OS
|
||||
</th>
|
||||
<th class="text-center">
|
||||
성인인증
|
||||
</th>
|
||||
<th class="text-center">
|
||||
가입일
|
||||
</th>
|
||||
<th class="text-center">
|
||||
이용중지/탈퇴일
|
||||
</th>
|
||||
<th class="text-center">
|
||||
공유
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="item in accounts"
|
||||
:key="item.id"
|
||||
>
|
||||
<td>{{ item.id }}</td>
|
||||
<td>{{ item.email }}</td>
|
||||
<td>{{ item.nickname }}</td>
|
||||
<td align="center">
|
||||
<v-img
|
||||
max-width="100"
|
||||
max-height="100"
|
||||
:src="item.profileUrl"
|
||||
class="rounded-circle"
|
||||
/>
|
||||
</td>
|
||||
<td>{{ item.userType }}</td>
|
||||
<td>
|
||||
<div v-if="item.container === 'aos'">
|
||||
Android
|
||||
</div>
|
||||
<div v-else>
|
||||
iOS
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div v-if="item.auth">
|
||||
O
|
||||
</div>
|
||||
<div v-else>
|
||||
X
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ item.signUpDate }}</td>
|
||||
<td>{{ item.signOutDate }}</td>
|
||||
<td>
|
||||
<v-btn
|
||||
:disabled="is_loading"
|
||||
@click="shareCreatorChannel(item)"
|
||||
>
|
||||
공유
|
||||
</v-btn>
|
||||
</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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as api from "@/api/member";
|
||||
import * as dynamicLink from "@/api/firebase_dynamic_link";
|
||||
|
||||
export default {
|
||||
name: "CounselorList",
|
||||
|
||||
data() {
|
||||
return {
|
||||
is_loading: false,
|
||||
page: 1,
|
||||
total_page: 0,
|
||||
search_word: '',
|
||||
accounts: [],
|
||||
account: {},
|
||||
utm_source: '',
|
||||
utm_medium: '',
|
||||
utm_campaign: '',
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getAccounts()
|
||||
},
|
||||
|
||||
methods: {
|
||||
notifyError(message) {
|
||||
this.$dialog.notify.error(message)
|
||||
},
|
||||
|
||||
notifySuccess(message) {
|
||||
this.$dialog.notify.success(message)
|
||||
},
|
||||
|
||||
async search() {
|
||||
this.page = 1
|
||||
await this.searchAccount()
|
||||
},
|
||||
|
||||
async searchAccount() {
|
||||
if (this.search_word.length === 0) {
|
||||
await this.getAccounts()
|
||||
} else if (this.search_word.length < 2) {
|
||||
this.notifyError('검색어를 2글자 이상 입력하세요.')
|
||||
} else {
|
||||
this.is_loading = true
|
||||
try {
|
||||
const res = await api.searchCreatorAccount(this.search_word, this.page)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
const data = res.data.data
|
||||
|
||||
const total_page = Math.ceil(data.totalCount / 20)
|
||||
this.accounts = data.items
|
||||
|
||||
if (total_page <= 0)
|
||||
this.total_page = 1
|
||||
else
|
||||
this.total_page = total_page
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
|
||||
this.is_loading = false
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
this.is_loading = false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async next() {
|
||||
if (this.search_word.length < 2) {
|
||||
this.search_word = ''
|
||||
await this.getAccounts()
|
||||
} else {
|
||||
await this.searchAccount()
|
||||
}
|
||||
},
|
||||
|
||||
async getAccounts() {
|
||||
this.is_loading = true
|
||||
try {
|
||||
const res = await api.getCreatorAccountList(this.page)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
const data = res.data.data
|
||||
|
||||
const total_page = Math.ceil(data.totalCount / 20)
|
||||
this.accounts = data.items
|
||||
|
||||
if (total_page <= 0)
|
||||
this.total_page = 1
|
||||
else
|
||||
this.total_page = total_page
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
|
||||
this.is_loading = false
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async shareCreatorChannel(item) {
|
||||
this.is_loading = true
|
||||
try {
|
||||
const linkData = await dynamicLink.shareCreatorChannel(item, this.utm_source, this.utm_medium, this.utm_campaign);
|
||||
if (linkData.status === 200) {
|
||||
await navigator.clipboard.writeText(linkData.data.shortLink)
|
||||
this.notifySuccess("링크가 복사되었습니다.")
|
||||
} else {
|
||||
this.notifyError("링크를 생성하지 못했습니다.")
|
||||
}
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
13
src/views/Creator/CreatorReview.vue
Normal file
13
src/views/Creator/CreatorReview.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>후기관리</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "CounselorReview"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
316
src/views/Creator/CreatorTags.vue
Normal file
316
src/views/Creator/CreatorTags.vue
Normal file
@@ -0,0 +1,316 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar dark>
|
||||
<v-spacer />
|
||||
<v-toolbar-title>수다친구 관심사 관리</v-toolbar-title>
|
||||
<v-spacer />
|
||||
</v-toolbar>
|
||||
|
||||
<br>
|
||||
|
||||
<v-row>
|
||||
<v-dialog
|
||||
v-model="show_dialog"
|
||||
max-width="400px"
|
||||
persistent
|
||||
>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="10" />
|
||||
<v-col>
|
||||
<v-btn
|
||||
block
|
||||
color="#9970ff"
|
||||
dark
|
||||
depressed
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
>
|
||||
관심사 추가등록
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<draggable
|
||||
v-model="tags"
|
||||
class="row"
|
||||
@end="onDropCallback(tags)"
|
||||
>
|
||||
<v-col
|
||||
v-for="(tag, i) in tags"
|
||||
:key="i"
|
||||
cols="2"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<v-spacer />
|
||||
<v-img
|
||||
:src="tag.image"
|
||||
class="rounded-circle"
|
||||
/>
|
||||
<v-spacer />
|
||||
</v-card-title>
|
||||
<v-card-title>
|
||||
<v-spacer />
|
||||
{{ tag.tag }}
|
||||
<v-spacer />
|
||||
</v-card-title>
|
||||
<v-card-actions>
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
text
|
||||
@click="showModifyTagDialog(tag)"
|
||||
>
|
||||
수정
|
||||
</v-btn>
|
||||
<v-btn
|
||||
text
|
||||
@click="deleteTag(tag)"
|
||||
>
|
||||
삭제
|
||||
</v-btn>
|
||||
<v-spacer />
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</draggable>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<v-card>
|
||||
<v-card-title>관심사 등록</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="tag_text"
|
||||
label="관심사"
|
||||
required
|
||||
/>
|
||||
</v-card-text>
|
||||
<div class="image-select">
|
||||
<label for="image">
|
||||
이미지 등록
|
||||
</label>
|
||||
<v-file-input
|
||||
id="image"
|
||||
v-model="image"
|
||||
@change="imageAdd"
|
||||
/>
|
||||
</div>
|
||||
<img
|
||||
v-if="image_url"
|
||||
:src="image_url"
|
||||
alt=""
|
||||
class="image-preview"
|
||||
>
|
||||
<v-card-actions v-show="!isLoading">
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="cancel"
|
||||
>
|
||||
취소
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="selected_tag !== null"
|
||||
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/counselor_tag";
|
||||
import Draggable from "vuedraggable";
|
||||
|
||||
export default {
|
||||
name: "CounselorTags",
|
||||
|
||||
components: {Draggable},
|
||||
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
tags: [],
|
||||
show_dialog: false,
|
||||
selected_tag: null,
|
||||
tag_text: null,
|
||||
image: null,
|
||||
image_url: null
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getTags()
|
||||
},
|
||||
|
||||
methods: {
|
||||
async onDropCallback(items) {
|
||||
const ids = items.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
|
||||
const res = await api.updateTagOrders(ids)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.notifySuccess(res.data.message)
|
||||
}
|
||||
},
|
||||
|
||||
imageAdd(payload) {
|
||||
const file = payload;
|
||||
if (file) {
|
||||
this.image_url = URL.createObjectURL(file)
|
||||
URL.revokeObjectURL(file)
|
||||
} else {
|
||||
this.image_url = null
|
||||
}
|
||||
},
|
||||
|
||||
notifyError(message) {
|
||||
this.$dialog.notify.error(message)
|
||||
},
|
||||
|
||||
notifySuccess(message) {
|
||||
this.$dialog.notify.success(message)
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.show_dialog = false
|
||||
this.image = null
|
||||
this.image_url = null
|
||||
this.tag_text = null
|
||||
},
|
||||
|
||||
showModifyTagDialog(tag) {
|
||||
this.selected_tag = tag
|
||||
this.image_url = tag.image
|
||||
this.tag_text = tag.tag
|
||||
this.show_dialog = true
|
||||
},
|
||||
|
||||
async submit() {
|
||||
this.isLoading = true
|
||||
|
||||
const formData = new FormData()
|
||||
formData.append("image", this.image)
|
||||
formData.append("request", JSON.stringify({tag: this.tag_text}))
|
||||
|
||||
const res = await api.enrollment(formData)
|
||||
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_dialog = false
|
||||
this.image = null
|
||||
this.image_url = null
|
||||
this.tag_text = null
|
||||
this.tags = []
|
||||
this.notifySuccess(res.data.message)
|
||||
|
||||
await this.getTags()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
|
||||
this.isLoading = false
|
||||
},
|
||||
|
||||
async getTags() {
|
||||
this.isLoading = true
|
||||
|
||||
try {
|
||||
let res = await api.getTags();
|
||||
this.tags = res.data.data
|
||||
} catch (e) {
|
||||
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
async deleteTag(tag) {
|
||||
this.isLoading = true
|
||||
try {
|
||||
let res = await api.deleteTag(tag.id)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.notifySuccess(res.data.message)
|
||||
await this.getTags()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
async modify() {
|
||||
this.isLoading = true
|
||||
|
||||
const formData = new FormData()
|
||||
formData.append("image", this.image)
|
||||
formData.append("request", JSON.stringify({tag: this.tag_text}))
|
||||
|
||||
const res = await api.modifyTag(this.selected_tag.id, formData)
|
||||
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_dialog = false
|
||||
this.image = null
|
||||
this.image_url = null
|
||||
this.tag_text = null
|
||||
this.tags = []
|
||||
this.notifySuccess(res.data.message)
|
||||
|
||||
await this.getTags()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
|
||||
this.isLoading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.image-select label {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
background-color: #232d4a;
|
||||
color: #fff;
|
||||
vertical-align: middle;
|
||||
font-size: 15px;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.v-file-input {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.image-preview {
|
||||
max-width: 100%;
|
||||
width: 250px;
|
||||
object-fit: cover;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user