This commit is contained in:
77
2024-05-15 01:15:52 +08:00
parent ab6b01bc41
commit 48fa454101
2 changed files with 30 additions and 2 deletions

View File

@@ -43,6 +43,14 @@ export function updateAnchor(data) {
}) })
} }
export function updateVideoStatusOnline(data) {
return request({
url: '/cai/anchor/updateVideoStatusOnline',
method: 'post',
data: data
})
}
// 删除女神列表 // 删除女神列表
export function delAnchor(id) { export function delAnchor(id) {
return request({ return request({

View File

@@ -103,7 +103,8 @@
</el-table-column> </el-table-column>
<el-table-column label="视频状态" align="center" prop="videoStatus" > <el-table-column label="视频状态" align="center" prop="videoStatus" >
<template v-slot="scope"> <template v-slot="scope">
<cai-dict-tag :options="videoStatusList" :value="scope.row.videoStatus" /> <el-tag :key="1" :index="1" type="danger" v-if="scope.row.videoStatus === 1" class="click-class" @click="updateVideoStatusHandle(scope.row)">视频中</el-tag>
<el-tag :key="2" :index="2" type="info" v-if="scope.row.videoStatus === 0">休息中</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="首页展示" align="center" prop="indexDisplay" > <el-table-column label="首页展示" align="center" prop="indexDisplay" >
@@ -187,7 +188,7 @@
</template> </template>
<script> <script>
import {delAnchor, listAnchor, updateAnchor} from '@/api/cai/anchor' import {delAnchor, listAnchor, updateAnchor, updateVideoStatusOnline} from '@/api/cai/anchor'
import {genderList, onlineStatusList, userStatusList, videoStatusList} from '@/constant/statusMap' import {genderList, onlineStatusList, userStatusList, videoStatusList} from '@/constant/statusMap'
import AddAnchorDialog from "@/views/cai/anchor/add-anchor-dialog"; import AddAnchorDialog from "@/views/cai/anchor/add-anchor-dialog";
import UpdateAnchorDialog from "@/views/cai/anchor/update-anchor-dialog"; import UpdateAnchorDialog from "@/views/cai/anchor/update-anchor-dialog";
@@ -300,6 +301,19 @@ export default {
row.openVideoStatus = row.openVideoStatus === 1 ? 0 : 1 row.openVideoStatus = row.openVideoStatus === 1 ? 0 : 1
}) })
}, },
updateVideoStatusHandle(row){
this.$confirm('确认把主播[' + row.nickname + ']状态切换为休闲吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return updateVideoStatusOnline({ id: row.userId})
}).then(() => {
this.getList()
this.$modal.msgSuccess('操作成功')
}).catch(function() {
})
},
handleIndexDisplayChange(row){ handleIndexDisplayChange(row){
let text = row.indexDisplay === 0 ? '封禁' : '恢复' let text = row.indexDisplay === 0 ? '封禁' : '恢复'
this.$confirm('确认要' + text + '[' + row.nickname + ']首页展示吗?', '警告', { this.$confirm('确认要' + text + '[' + row.nickname + ']首页展示吗?', '警告', {
@@ -357,3 +371,9 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
.click-class {
cursor: pointer;
}
</style>