관리자 - 추천 라이브 크리에이터 배너 API 적용
This commit is contained in:
parent
b6fcbaa11a
commit
c788a9e7dd
|
@ -1,27 +1,32 @@
|
|||
import Vue from 'vue';
|
||||
|
||||
async function createRecommendSudaCreator(formData) {
|
||||
return Vue.axios.post('/admin/suda/recommend-suda-creator', formData, {
|
||||
async function createRecommendCreatorBanner(formData) {
|
||||
return Vue.axios.post('/admin/live/recommend-creator', formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async function updateRecommendSudaCreator(formData) {
|
||||
return Vue.axios.put('/admin/suda/recommend-suda-creator', formData, {
|
||||
async function updateRecommendCreatorBanner(formData) {
|
||||
return Vue.axios.put('/admin/live/recommend-creator', formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async function updateRecommendSudaCreatorOrders(firstOrders, ids) {
|
||||
return Vue.axios.put('/admin/suda/recommend-suda-creator/orders', { firstOrders: firstOrders, ids: ids })
|
||||
async function updateRecommendCreatorBannerOrders(firstOrders, ids) {
|
||||
return Vue.axios.put('/admin/live/recommend-creator/orders', {firstOrders: firstOrders, ids: ids})
|
||||
}
|
||||
|
||||
async function getRecommendSudaCreator(page) {
|
||||
return Vue.axios.get("/admin/suda/recommend-suda-creator?page=" + (page - 1) + "&size=20");
|
||||
async function getRecommendCreatorBanner(page) {
|
||||
return Vue.axios.get("/admin/live/recommend-creator?page=" + (page - 1) + "&size=20");
|
||||
}
|
||||
|
||||
export { createRecommendSudaCreator, updateRecommendSudaCreator, updateRecommendSudaCreatorOrders, getRecommendSudaCreator };
|
||||
export {
|
||||
createRecommendCreatorBanner,
|
||||
updateRecommendCreatorBanner,
|
||||
updateRecommendCreatorBannerOrders,
|
||||
getRecommendCreatorBanner
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div>
|
||||
<v-toolbar dark>
|
||||
<v-spacer />
|
||||
<v-toolbar-title>추천 요즘라이브</v-toolbar-title>
|
||||
<v-toolbar-title>추천 라이브 크리에이터</v-toolbar-title>
|
||||
<v-spacer />
|
||||
</v-toolbar>
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
depressed
|
||||
@click="showWriteDialog"
|
||||
>
|
||||
추천 요즘라이브 등록
|
||||
추천 라이브 크리에이터 등록
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
@ -29,7 +29,7 @@
|
|||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="recommendLiveList"
|
||||
:loading="isLoading"
|
||||
:loading="is_loading"
|
||||
:items-per-page="20"
|
||||
item-key="id"
|
||||
class="elevation-1"
|
||||
|
@ -69,7 +69,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<v-btn
|
||||
:disabled="isLoading"
|
||||
:disabled="is_loading"
|
||||
@click="showModifyDialog(item)"
|
||||
>
|
||||
수정
|
||||
|
@ -100,11 +100,11 @@
|
|||
persistent
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title>추천 요즘라이브 등록</v-card-title>
|
||||
<v-card-title>추천 라이브 크리에이터 등록</v-card-title>
|
||||
<v-card-text>
|
||||
<v-row align="center">
|
||||
<v-col cols="4">
|
||||
요즘친구
|
||||
크리에이터
|
||||
</v-col>
|
||||
<v-col cols="8">
|
||||
<v-select
|
||||
|
@ -178,7 +178,7 @@
|
|||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
<v-card-actions v-show="!isLoading">
|
||||
<v-card-actions v-show="!is_loading">
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
|
@ -213,7 +213,7 @@
|
|||
<script>
|
||||
import Draggable from 'vuedraggable';
|
||||
import datetime from 'vuejs-datetimepicker';
|
||||
import * as accountApi from "@/api/member";
|
||||
import * as memberApi from "@/api/member";
|
||||
import * as api from "@/api/recommend_suda_creator"
|
||||
|
||||
export default {
|
||||
|
@ -221,7 +221,7 @@ export default {
|
|||
components: {datetime, Draggable},
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
is_loading: false,
|
||||
page: 1,
|
||||
total_page: 0,
|
||||
show_write_dialog: false,
|
||||
|
@ -242,7 +242,7 @@ export default {
|
|||
value: 'image',
|
||||
},
|
||||
{
|
||||
text: '요즘친구',
|
||||
text: '크리에이터',
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
value: 'creatorNickname',
|
||||
|
@ -271,7 +271,7 @@ export default {
|
|||
|
||||
async created() {
|
||||
await this.getCreatorList()
|
||||
await this.getRecommendSudaCreator()
|
||||
await this.getRecommendCreator()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
@ -284,7 +284,7 @@ export default {
|
|||
|
||||
const firstOrders = (this.page - 1) * 20 + 1
|
||||
|
||||
const res = await api.updateRecommendSudaCreatorOrders(firstOrders, ids)
|
||||
const res = await api.updateRecommendCreatorBannerOrders(firstOrders, ids)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.notifySuccess(res.data.message)
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ export default {
|
|||
|
||||
try {
|
||||
const formData = new FormData()
|
||||
formData.append("recommend_suda_creator_id", this.selected_recommend_live.id)
|
||||
formData.append("recommend_creator_banner_id", this.selected_recommend_live.id)
|
||||
|
||||
if (this.image !== null) {
|
||||
formData.append("image", this.image)
|
||||
|
@ -328,12 +328,12 @@ export default {
|
|||
formData.append("is_adult", this.is_adult)
|
||||
}
|
||||
|
||||
const res = await api.updateRecommendSudaCreator(formData)
|
||||
const res = await api.updateRecommendCreatorBanner(formData)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.cancel()
|
||||
this.notifySuccess('수정되었습니다.')
|
||||
this.page = 1
|
||||
await this.getRecommendSudaCreator()
|
||||
await this.getRecommendCreator()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
this.is_loading = false
|
||||
|
@ -349,7 +349,7 @@ export default {
|
|||
async submit() {
|
||||
if (this.is_loading) return;
|
||||
|
||||
this.isLoading = true
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const formData = new FormData()
|
||||
|
@ -359,13 +359,14 @@ export default {
|
|||
formData.append("end_date", this.end_date)
|
||||
formData.append("is_adult", this.is_adult)
|
||||
|
||||
const res = await api.createRecommendSudaCreator(formData);
|
||||
const res = await api.createRecommendCreatorBanner(formData);
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.cancel()
|
||||
this.notifySuccess('등록되었습니다.')
|
||||
this.page = 1
|
||||
await this.getRecommendSudaCreator()
|
||||
await this.getRecommendCreator()
|
||||
} else {
|
||||
this.is_loading = false
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
this.is_loading = false
|
||||
}
|
||||
|
@ -408,14 +409,14 @@ export default {
|
|||
},
|
||||
|
||||
async next() {
|
||||
await this.getRecommendSudaCreator()
|
||||
await this.getRecommendCreator()
|
||||
},
|
||||
|
||||
async getRecommendSudaCreator() {
|
||||
this.isLoading = true
|
||||
async getRecommendCreator() {
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.getRecommendSudaCreator(this.page)
|
||||
const res = await api.getRecommendCreatorBanner(this.page)
|
||||
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
const data = res.data.data
|
||||
|
@ -435,15 +436,15 @@ export default {
|
|||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
this.is_loading = false
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async getCreatorList() {
|
||||
this.isLoading = true
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await accountApi.getCounselorList()
|
||||
const res = await memberApi.getCreatorAllList()
|
||||
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.creatorList = res.data.data.map((item) => {
|
||||
|
@ -457,7 +458,7 @@ export default {
|
|||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
this.is_loading = false
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
imageAdd(payload) {
|
||||
|
|
Loading…
Reference in New Issue