|
|
@@ -4,8 +4,9 @@
|
|
|
<el-radio-button label="ad">活动直播管理</el-radio-button>
|
|
|
<el-radio-button label="topic">文章管理</el-radio-button>
|
|
|
<el-radio-button label="video">视频管理</el-radio-button>
|
|
|
+ <el-radio-button label="kol">KOL管理</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
- <br />
|
|
|
+ <br/>
|
|
|
<template v-if="tab==='ad'">
|
|
|
<div>
|
|
|
<el-button type="success" style="margin-top: 20px;" @click="showAdEdit(null)">添加活动</el-button>
|
|
|
@@ -169,6 +170,61 @@
|
|
|
@current-change="handleCurrentChange"
|
|
|
/>
|
|
|
</template>
|
|
|
+ <template v-if="tab==='kol'">
|
|
|
+ <div>
|
|
|
+ <el-button type="success" style="margin-top: 20px;" @click="onAddAu(null)">添加KOL</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="content" v-if="kols">
|
|
|
+ <el-table :data="kols" height="100%" border style="width: 100%">
|
|
|
+ <el-table-column prop="name" :className="`clickable`" label="作者名">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.name}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="introduction" :className="`clickable`" label="简介">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.introduction}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="is_signing" label="是否签约">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.row.is_signing ==1">
|
|
|
+ 未签约
|
|
|
+ </div>
|
|
|
+ <div v-else>签约</div>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="uid" label="客栈UID"></el-table-column>
|
|
|
+ <el-table-column label="关联渠道" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-for="item in scope.row.channle">
|
|
|
+ {{item.code}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+<!-- <el-table-column label="关联领域">-->
|
|
|
+<!-- <template slot-scope="scope">-->
|
|
|
+<!-- <el-tag type="success">浏览:{{scope.row.name}}</el-tag>-->
|
|
|
+<!-- <el-tag type="danger">评论:</el-tag>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- </el-table-column>-->
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link icon="el-icon-edit" @click="onEditAu(scope.row.id)">编辑</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <el-pagination
|
|
|
+ class="order-footer"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :page-size="20"
|
|
|
+ :total="total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
|
|
|
<el-dialog title="活动管理" :visible.sync="dialogFormVisible">
|
|
|
<el-form :model="form">
|
|
|
@@ -209,6 +265,88 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+
|
|
|
+ <el-dialog title="KOL管理" :visible.sync="kolFormVisible" :closeOnClickModal="false" :closeOnPressEscape="false">
|
|
|
+ <el-form :model="kolform">
|
|
|
+ <el-form-item label="作者名" :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="kolform.name" autocomplete="off"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="简介" :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="kolform.introduction" autocomplete="off"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="客栈UID" :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="kolform.uid" autocomplete="off" :disabled="isEdit"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否签约" :label-width="formLabelWidth">
|
|
|
+ <el-switch v-model="kolform.is_signing"></el-switch>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label-width="formLabelWidth">
|
|
|
+ <template>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <div class="grid-content bg-purple">渠道</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <div class="grid-content bg-purple">通道ID</div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <div class="grid-content bg-purple">渠道URL</div>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="6"><div class="grid-content bg-purple"></div></el-col>-->
|
|
|
+ </el-row>
|
|
|
+ <template v-for="(item,index) in channelData">
|
|
|
+ <el-row :gutter="20" style="margin-top: 5px">
|
|
|
+ <el-col :span="6">
|
|
|
+ <div class="grid-content bg-purple">
|
|
|
+ <el-select v-model="channelData[index].code" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <div class="grid-content bg-purple">
|
|
|
+ <el-input v-model="item.channel_id" placeholder="请输入内容"></el-input>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <div class="grid-content bg-purple">
|
|
|
+ <el-input v-model="item.url" placeholder="请输入内容"></el-input>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <div class="grid-content bg-purple">
|
|
|
+ <el-button
|
|
|
+ @click="deleteChannleRow(index)"
|
|
|
+ type="text"
|
|
|
+ size="small" v-if="index != 0">
|
|
|
+ 移除
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ @click="addChannleRow()"
|
|
|
+ type="text"
|
|
|
+ size="small">
|
|
|
+ 添加
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="kolFormVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="editAu">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<el-dialog title="标签管理" :visible.sync="labelEditFormVisible">
|
|
|
<el-form :model="form">
|
|
|
<el-form-item label="当前标签" :label-width="formLabelWidth">
|
|
|
@@ -219,7 +357,8 @@
|
|
|
closable
|
|
|
:disable-transitions="false"
|
|
|
@close="handleClose('is_top')"
|
|
|
- >置顶</el-tag>
|
|
|
+ >置顶
|
|
|
+ </el-tag>
|
|
|
<el-tag
|
|
|
type="info"
|
|
|
v-if="this.currentLabel.is_must_see===1"
|
|
|
@@ -227,7 +366,8 @@
|
|
|
closable
|
|
|
:disable-transitions="false"
|
|
|
@close="handleClose('is_must_see')"
|
|
|
- >进站必看</el-tag>
|
|
|
+ >进站必看
|
|
|
+ </el-tag>
|
|
|
<el-tag
|
|
|
type="info"
|
|
|
v-if="this.currentLabel.is_hot===1"
|
|
|
@@ -235,7 +375,8 @@
|
|
|
closable
|
|
|
:disable-transitions="false"
|
|
|
@close="handleClose('is_hot')"
|
|
|
- >热门</el-tag>
|
|
|
+ >热门
|
|
|
+ </el-tag>
|
|
|
<el-tag
|
|
|
type="info"
|
|
|
v-if="this.currentLabel.is_good===1"
|
|
|
@@ -243,7 +384,8 @@
|
|
|
closable
|
|
|
:disable-transitions="false"
|
|
|
@close="handleClose('is_good')"
|
|
|
- >优质</el-tag>
|
|
|
+ >优质
|
|
|
+ </el-tag>
|
|
|
<el-tag
|
|
|
type="info"
|
|
|
v-if="this.currentLabel.is_new===1"
|
|
|
@@ -251,7 +393,8 @@
|
|
|
closable
|
|
|
:disable-transitions="false"
|
|
|
@close="handleClose('is_new')"
|
|
|
- >最新</el-tag>
|
|
|
+ >最新
|
|
|
+ </el-tag>
|
|
|
<el-tag
|
|
|
type="info"
|
|
|
v-if="this.currentLabel.is_ad===1"
|
|
|
@@ -259,7 +402,8 @@
|
|
|
closable
|
|
|
:disable-transitions="false"
|
|
|
@close="handleClose('is_ad')"
|
|
|
- >广告</el-tag>
|
|
|
+ >广告
|
|
|
+ </el-tag>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="添加标签" :label-width="formLabelWidth">
|
|
|
<el-select v-model="addCurrentLabel" placeholder="请选择位置">
|
|
|
@@ -282,342 +426,458 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- labelTab: "",
|
|
|
- page: 1,
|
|
|
- size: 20,
|
|
|
- tab: "ad",
|
|
|
- total: 1,
|
|
|
- ads: [],
|
|
|
- topics: [],
|
|
|
- videos: [],
|
|
|
- addCurrentLabel: "",
|
|
|
- form: {
|
|
|
- title: "",
|
|
|
- url: "",
|
|
|
- type: "1",
|
|
|
- tags: "",
|
|
|
- status: "1",
|
|
|
- position: "1"
|
|
|
- },
|
|
|
- currentLabel: {
|
|
|
- is_ad: 0,
|
|
|
- is_new: 0,
|
|
|
- is_good: 0,
|
|
|
- is_hot: 0,
|
|
|
- is_must_see: 0,
|
|
|
- is_top: 0
|
|
|
- },
|
|
|
- currentId: 0,
|
|
|
- dialogFormVisible: false,
|
|
|
- formLabelWidth: "120px",
|
|
|
- labelEditFormVisible: false
|
|
|
- };
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- goTopic(topic) {
|
|
|
- console.log(topic);
|
|
|
- window.open(
|
|
|
- this.$store.state.domainConfig.jishuinUrl + "/p/" + topic.id + ".html"
|
|
|
- );
|
|
|
- },
|
|
|
- goVideo(topic) {
|
|
|
- console.log(topic);
|
|
|
- window.open(
|
|
|
- this.$store.state.domainConfig.jishuinUrl + "/video/" + topic.video_id
|
|
|
- );
|
|
|
- },
|
|
|
- goRooterUser(topic) {
|
|
|
- window.open(
|
|
|
- this.$store.state.domainConfig.siteUrl + "/rooter/user/" + topic.user_id
|
|
|
- );
|
|
|
- },
|
|
|
- addLabel() {
|
|
|
- if (this.addCurrentLabel) {
|
|
|
- let res = this.$post("/api/admin/jishuquan/add_label", {
|
|
|
- id: this.currentId,
|
|
|
- type: this.addCurrentLabel
|
|
|
- }).then(res => {
|
|
|
- if (res.status === 1) {
|
|
|
- this.currentLabel[this.addCurrentLabel] = 1;
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "添加成功!"
|
|
|
- });
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ labelTab: "",
|
|
|
+ page: 1,
|
|
|
+ size: 20,
|
|
|
+ tab: "ad",
|
|
|
+ total: 1,
|
|
|
+ ads: [],
|
|
|
+ topics: [],
|
|
|
+ videos: [],
|
|
|
+ kols: [], //作者
|
|
|
+ addCurrentLabel: "",
|
|
|
+ form: {
|
|
|
+ title: "",
|
|
|
+ url: "",
|
|
|
+ type: "1",
|
|
|
+ tags: "",
|
|
|
+ status: "1",
|
|
|
+ position: "1"
|
|
|
+ },
|
|
|
+ kolform: {
|
|
|
+ portrait: './',
|
|
|
+ name: "",
|
|
|
+ introduction: "",
|
|
|
+ uid: "",
|
|
|
+ is_signing: true,
|
|
|
+ },
|
|
|
+ options: [{
|
|
|
+ value: 'wechat',
|
|
|
+ label: 'wechat'
|
|
|
+ }, {
|
|
|
+ value: 'juejin',
|
|
|
+ label: 'juejin'
|
|
|
+ }, {
|
|
|
+ value: 'zhihu',
|
|
|
+ label: 'zhihu'
|
|
|
+ }, {
|
|
|
+ value: 'csdn',
|
|
|
+ label: 'csdn'
|
|
|
+ }],
|
|
|
+ currentLabel: {
|
|
|
+ is_ad: 0,
|
|
|
+ is_new: 0,
|
|
|
+ is_good: 0,
|
|
|
+ is_hot: 0,
|
|
|
+ is_must_see: 0,
|
|
|
+ is_top: 0
|
|
|
+ },
|
|
|
+ currentId: 0,
|
|
|
+ dialogFormVisible: false,
|
|
|
+ formLabelWidth: "120px",
|
|
|
+ labelEditFormVisible: false,
|
|
|
+ kolFormVisible: false, //kol
|
|
|
+ isEdit:false,
|
|
|
+ channelData: [
|
|
|
+ {
|
|
|
+ channel_id: '',
|
|
|
+ url: '',
|
|
|
+ code: 'wechat'
|
|
|
}
|
|
|
- });
|
|
|
+ ] //
|
|
|
}
|
|
|
},
|
|
|
- handleClose(type) {
|
|
|
- this.$confirm("此操作将永久删除该标签, 是否继续?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- let res = this.$post("/api/admin/jishuquan/remove_label", {
|
|
|
+ mounted() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ goTopic(topic) {
|
|
|
+ console.log(topic);
|
|
|
+ window.open(
|
|
|
+ this.$store.state.domainConfig.jishuinUrl + "/p/" + topic.id + ".html"
|
|
|
+ );
|
|
|
+ },
|
|
|
+ goVideo(topic) {
|
|
|
+ console.log(topic);
|
|
|
+ window.open(
|
|
|
+ this.$store.state.domainConfig.jishuinUrl + "/video/" + topic.video_id
|
|
|
+ );
|
|
|
+ },
|
|
|
+ goRooterUser(topic) {
|
|
|
+ window.open(
|
|
|
+ this.$store.state.domainConfig.siteUrl + "/rooter/user/" + topic.user_id
|
|
|
+ );
|
|
|
+ },
|
|
|
+ addLabel() {
|
|
|
+ if (this.addCurrentLabel) {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/add_label", {
|
|
|
id: this.currentId,
|
|
|
- type: type
|
|
|
+ type: this.addCurrentLabel
|
|
|
}).then(res => {
|
|
|
if (res.status === 1) {
|
|
|
- this.currentLabel[type] = 0;
|
|
|
+ this.currentLabel[this.addCurrentLabel] = 1;
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: "删除成功!"
|
|
|
+ message: "添加成功!"
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleClose(type) {
|
|
|
+ this.$confirm("此操作将永久删除该标签, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消删除"
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/remove_label", {
|
|
|
+ id: this.currentId,
|
|
|
+ type: type
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.currentLabel[type] = 0;
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除"
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- editLabel(topic) {
|
|
|
- this.currentLabel = {
|
|
|
- is_ad: 0,
|
|
|
- is_new: 0,
|
|
|
- is_good: 0,
|
|
|
- is_hot: 0,
|
|
|
- is_must_see: 0,
|
|
|
- is_top: 0
|
|
|
- }; //复位
|
|
|
- this.currentId = topic.id;
|
|
|
- if (Number(topic.is_ad) === 1) this.currentLabel.is_ad = 1;
|
|
|
- if (Number(topic.is_new) === 1) this.currentLabel.is_new = 1;
|
|
|
- if (Number(topic.is_hot) === 1) this.currentLabel.is_hot = 1;
|
|
|
- if (Number(topic.is_top) === 1) this.currentLabel.is_top = 1;
|
|
|
- if (Number(topic.is_good) === 1) this.currentLabel.is_good = 1;
|
|
|
- if (Number(topic.is_must_see) === 1) this.currentLabel.is_must_see = 1;
|
|
|
- this.labelEditFormVisible = true;
|
|
|
- },
|
|
|
- delTopic(id) {
|
|
|
- this.$confirm("此操作将永久删除该文章, 是否继续?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- let res = this.$post("/api/admin/jishuquan/delete_topic", {
|
|
|
- id: id
|
|
|
- }).then(res => {
|
|
|
- if (res.status == 1) {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!"
|
|
|
- });
|
|
|
- this.getList();
|
|
|
- }
|
|
|
+ },
|
|
|
+ editLabel(topic) {
|
|
|
+ this.currentLabel = {
|
|
|
+ is_ad: 0,
|
|
|
+ is_new: 0,
|
|
|
+ is_good: 0,
|
|
|
+ is_hot: 0,
|
|
|
+ is_must_see: 0,
|
|
|
+ is_top: 0
|
|
|
+ }; //复位
|
|
|
+ this.currentId = topic.id;
|
|
|
+ if (Number(topic.is_ad) === 1) this.currentLabel.is_ad = 1;
|
|
|
+ if (Number(topic.is_new) === 1) this.currentLabel.is_new = 1;
|
|
|
+ if (Number(topic.is_hot) === 1) this.currentLabel.is_hot = 1;
|
|
|
+ if (Number(topic.is_top) === 1) this.currentLabel.is_top = 1;
|
|
|
+ if (Number(topic.is_good) === 1) this.currentLabel.is_good = 1;
|
|
|
+ if (Number(topic.is_must_see) === 1) this.currentLabel.is_must_see = 1;
|
|
|
+ this.labelEditFormVisible = true;
|
|
|
+ },
|
|
|
+ delTopic(id) {
|
|
|
+ this.$confirm("此操作将永久删除该文章, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/delete_topic", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除"
|
|
|
+ });
|
|
|
});
|
|
|
+ },
|
|
|
+ approveVideo(id) {
|
|
|
+ this.$confirm("更改视频状态", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消删除"
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/audit_video", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消"
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- approveVideo(id) {
|
|
|
- this.$confirm("更改视频状态", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- let res = this.$post("/api/admin/jishuquan/audit_video", {
|
|
|
- id: id
|
|
|
- }).then(res => {
|
|
|
- if (res.status == 1) {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- this.getList();
|
|
|
- }
|
|
|
+ },
|
|
|
+ deleteVideo(id) {
|
|
|
+ this.$confirm("此操作将永久删除该视频, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/delete_video", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除"
|
|
|
+ });
|
|
|
});
|
|
|
+ },
|
|
|
+ showAdEdit(item) {
|
|
|
+ console.log(item);
|
|
|
+ if (item != null) {
|
|
|
+ this.form.id = item.id;
|
|
|
+ this.form.title = item.title;
|
|
|
+ this.form.url = item.url;
|
|
|
+ this.form.type = item.type;
|
|
|
+ this.form.tags = item.tags;
|
|
|
+ this.form.status = item.status;
|
|
|
+ this.form.position = item.position;
|
|
|
+ this.form.uid = item.uid;
|
|
|
+ }
|
|
|
+ this.dialogFormVisible = true;
|
|
|
+ },
|
|
|
+ deleteAd(id) {
|
|
|
+ this.$confirm("此操作将永久删除该活动, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消"
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/delete_ad", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除"
|
|
|
+ });
|
|
|
});
|
|
|
+ },
|
|
|
+ async editAd() {
|
|
|
+ let form = this.form;
|
|
|
+ if (form.id) {
|
|
|
+ let res = await this.$post("/api/admin/jishuquan/update_ad", form);
|
|
|
+ console.log(res);
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/create_ad", form);
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message.success("创建成功");
|
|
|
+ this.form = {
|
|
|
+ title: "",
|
|
|
+ url: "",
|
|
|
+ type: "1",
|
|
|
+ tags: "",
|
|
|
+ status: "1",
|
|
|
+ position: "1"
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.getList();
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.page = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ async getList() {
|
|
|
+ const page = this.page;
|
|
|
+ const size = this.size;
|
|
|
+ const data = {
|
|
|
+ page,
|
|
|
+ size
|
|
|
+ };
|
|
|
+ let res;
|
|
|
+ switch (this.tab) {
|
|
|
+ case "ad":
|
|
|
+ res = await this.$post("/api/admin/jishuquan/get_ads", data);
|
|
|
+ this.ads = res.data.ads;
|
|
|
+ this.total = res.data.total;
|
|
|
+ break;
|
|
|
+ case "video":
|
|
|
+ res = await this.$post("/api/admin/jishuquan/get_videos", data);
|
|
|
+ this.videos = res.data.videos;
|
|
|
+ this.total = res.data.total;
|
|
|
+ break;
|
|
|
+ case "topic":
|
|
|
+ if (this.labelTab) data.type = this.labelTab;
|
|
|
+ res = await this.$post("/api/admin/jishuquan/get_topics", data);
|
|
|
+ this.topics = res.data.topics;
|
|
|
+ this.total = res.data.total;
|
|
|
+ break;
|
|
|
+ case "kol":
|
|
|
+ res = await this.$post("/api/admin/author/get_aus", data);
|
|
|
+ this.kols = res.data.aus;
|
|
|
+ this.total = res.data.total;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async contact(id) {
|
|
|
+ const data = {
|
|
|
+ id
|
|
|
+ };
|
|
|
+ let res = await this.$post("/api/admin/jishuquan/get_ads", data);
|
|
|
+ this.$message({
|
|
|
+ message: res.info,
|
|
|
+ type: "success"
|
|
|
});
|
|
|
- },
|
|
|
- deleteVideo(id) {
|
|
|
- this.$confirm("此操作将永久删除该视频, 是否继续?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- let res = this.$post("/api/admin/jishuquan/delete_video", {
|
|
|
- id: id
|
|
|
- }).then(res => {
|
|
|
+ },
|
|
|
+ deleteChannleRow(index) {
|
|
|
+ this.channelData.splice(index, 1);
|
|
|
+ },
|
|
|
+ addChannleRow() {
|
|
|
+ this.channelData.push({channel_id: '', url: '', code: 'wechat'})
|
|
|
+ },
|
|
|
+ onEditAu(id) {
|
|
|
+ this.isEdit = true;
|
|
|
+ let res = this.$post("/api/admin/author/get_row", {id: id})
|
|
|
+ .then(res => {
|
|
|
if (res.status == 1) {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!"
|
|
|
- });
|
|
|
- this.getList();
|
|
|
+ this.kolform = res.data;
|
|
|
+ this.kolform.is_signing = res.data.is_signing == 0 ? true : false;
|
|
|
+ this.channelData = res.data.channel || [];
|
|
|
+ this.kolFormVisible = true;
|
|
|
}
|
|
|
+ }).catch((re) => {
|
|
|
+ this.$message({
|
|
|
+ type: "error",
|
|
|
+ message: "网络连接错误"
|
|
|
+ });
|
|
|
});
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消删除"
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- showAdEdit(item) {
|
|
|
- console.log(item);
|
|
|
- if (item != null) {
|
|
|
- this.form.id = item.id;
|
|
|
- this.form.title = item.title;
|
|
|
- this.form.url = item.url;
|
|
|
- this.form.type = item.type;
|
|
|
- this.form.tags = item.tags;
|
|
|
- this.form.status = item.status;
|
|
|
- this.form.position = item.position;
|
|
|
- this.form.uid = item.uid;
|
|
|
- }
|
|
|
- this.dialogFormVisible = true;
|
|
|
- },
|
|
|
- deleteAd(id) {
|
|
|
- this.$confirm("此操作将永久删除该活动, 是否继续?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- let res = this.$post("/api/admin/jishuquan/delete_ad", {
|
|
|
- id: id
|
|
|
- }).then(res => {
|
|
|
- if (res.status == 1) {
|
|
|
+
|
|
|
+ },
|
|
|
+ onAddAu(item) {
|
|
|
+ this.clearA();
|
|
|
+ this.kolFormVisible = true;
|
|
|
+ },
|
|
|
+ async editAu() {
|
|
|
+ let form = this.kolform;
|
|
|
+ form.is_signing = form.is_signing ? 0 : 1;
|
|
|
+ form.channelData = JSON.stringify(this.channelData);
|
|
|
+ if (form.id) {
|
|
|
+ let res = this.$post("/api/admin/author/update_au", form)
|
|
|
+ .then(res => {
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功!"
|
|
|
+ });
|
|
|
+ this.clearA();
|
|
|
+ this.kolFormVisible = false;
|
|
|
+ }
|
|
|
+ }).catch((re) => {
|
|
|
this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!"
|
|
|
+ type: "error",
|
|
|
+ message: "修改失败"
|
|
|
});
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消删除"
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- async editAd() {
|
|
|
- let form = this.form;
|
|
|
- if (form.id) {
|
|
|
- let res = await this.$post("/api/admin/jishuquan/update_ad", form);
|
|
|
- console.log(res);
|
|
|
- if (res.status == 1) {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "修改成功"
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- let res = this.$post("/api/admin/jishuquan/create_ad", form);
|
|
|
- if (res.status == 1) {
|
|
|
- this.$message.success("创建成功");
|
|
|
- this.form = {
|
|
|
- title: "",
|
|
|
- url: "",
|
|
|
- type: "1",
|
|
|
- tags: "",
|
|
|
- status: "1",
|
|
|
- position: "1"
|
|
|
- };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let res = await this.$post("/api/admin/author/create_au", form)
|
|
|
+ .then(res => {
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "添加成功!"
|
|
|
+ });
|
|
|
+ this.clearA();
|
|
|
+ this.kolFormVisible = false;
|
|
|
+ }
|
|
|
+ }).catch((re) => {
|
|
|
+ this.$message({
|
|
|
+ type: "error",
|
|
|
+ message: "添加失败"
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- this.getList();
|
|
|
- this.dialogFormVisible = false;
|
|
|
- },
|
|
|
- handleCurrentChange(val) {
|
|
|
- this.page = val;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- async getList() {
|
|
|
- const page = this.page;
|
|
|
- const size = this.size;
|
|
|
- const data = {
|
|
|
- page,
|
|
|
- size
|
|
|
- };
|
|
|
- let res;
|
|
|
- switch (this.tab) {
|
|
|
- case "ad":
|
|
|
- res = await this.$post("/api/admin/jishuquan/get_ads", data);
|
|
|
- this.ads = res.data.ads;
|
|
|
- this.total = res.data.total;
|
|
|
- break;
|
|
|
- case "video":
|
|
|
- res = await this.$post("/api/admin/jishuquan/get_videos", data);
|
|
|
- this.videos = res.data.videos;
|
|
|
- this.total = res.data.total;
|
|
|
- break;
|
|
|
- case "topic":
|
|
|
- if (this.labelTab) data.type = this.labelTab;
|
|
|
- res = await this.$post("/api/admin/jishuquan/get_topics", data);
|
|
|
- this.topics = res.data.topics;
|
|
|
- this.total = res.data.total;
|
|
|
- break;
|
|
|
+ },
|
|
|
+ clearA() {
|
|
|
+ this.isEdit = false;
|
|
|
+ this.kolform = {
|
|
|
+ portrait: './',
|
|
|
+ name: "",
|
|
|
+ introduction: "",
|
|
|
+ uid: '',
|
|
|
+ is_signing: true,
|
|
|
+ };
|
|
|
+ this.channelData = [{channel_id: '', url: '', code: 'wechat'}];
|
|
|
+ this.getList();
|
|
|
}
|
|
|
- },
|
|
|
- async contact(id) {
|
|
|
- const data = {
|
|
|
- id
|
|
|
- };
|
|
|
- let res = await this.$post("/api/admin/jishuquan/get_ads", data);
|
|
|
- this.$message({
|
|
|
- message: res.info,
|
|
|
- type: "success"
|
|
|
- });
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.count-list {
|
|
|
- padding-bottom: 10px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
-}
|
|
|
+ .count-list {
|
|
|
+ padding-bottom: 10px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
|
|
|
-.count-item {
|
|
|
- margin-right: 20px;
|
|
|
- font-size: 16px;
|
|
|
-}
|
|
|
+ .count-item {
|
|
|
+ margin-right: 20px;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
|
|
|
-.content {
|
|
|
- margin-top: 30px;
|
|
|
- white-space: nowrap;
|
|
|
- overflow-x: scroll;
|
|
|
- height: calc(100vh - 150px);
|
|
|
-}
|
|
|
+ .content {
|
|
|
+ margin-top: 30px;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow-x: scroll;
|
|
|
+ height: calc(100vh - 150px);
|
|
|
+ }
|
|
|
|
|
|
-.btn {
|
|
|
- width: 80px;
|
|
|
-}
|
|
|
+ .btn {
|
|
|
+ width: 80px;
|
|
|
+ }
|
|
|
|
|
|
-.order-footer {
|
|
|
- margin-top: 10px;
|
|
|
-}
|
|
|
+ .order-footer {
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
|
|
|
-.custom-label {
|
|
|
- margin-bottom: 5px;
|
|
|
-}
|
|
|
+ .custom-label {
|
|
|
+ margin-bottom: 5px;
|
|
|
+ }
|
|
|
</style>
|