2025-01-26 21:07:26 +08:00
|
|
|
|
<template>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<div class="list-wrap">
|
2025-01-26 21:07:26 +08:00
|
|
|
|
<div class="search">
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<el-input v-model="userName" size="mini" placeholder="请输入用户昵称" />
|
|
|
|
|
|
<el-button type="primary" size="mini" @click="searchMsg">搜索</el-button>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
</div>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<dl
|
|
|
|
|
|
v-infinite-scroll="getList"
|
|
|
|
|
|
infinite-scroll-disabled="disabled"
|
|
|
|
|
|
infinite-scroll-immediate="false"
|
|
|
|
|
|
>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
<dt>
|
|
|
|
|
|
<div>头像</div>
|
|
|
|
|
|
<div>uid</div>
|
|
|
|
|
|
<div>加入时间</div>
|
|
|
|
|
|
<div>到期时间</div>
|
|
|
|
|
|
<div>操作</div>
|
|
|
|
|
|
</dt>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<dd v-for="(item, index) in list" :key="item.id">
|
2025-02-12 22:54:37 +08:00
|
|
|
|
<div><img src="" alt="" /></div>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
<div>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<!-- <p>{{ item.phone }}</p> -->
|
|
|
|
|
|
<p>{{ item.userName }}</p>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<p>数据缺失</p>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<p>数据缺失</p>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<el-link type="success" :underline="false">私聊</el-link>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
2025-02-12 22:54:37 +08:00
|
|
|
|
<el-link v-if="type === 1" type="success" :underline="false"
|
|
|
|
|
|
>根据用户的禁言状态来显示禁言还是取消禁言</el-link
|
|
|
|
|
|
>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<el-link
|
|
|
|
|
|
v-else-if="type === 2"
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
:underline="false"
|
|
|
|
|
|
@click="setCommentBlack(2, item)"
|
2025-02-12 22:54:37 +08:00
|
|
|
|
>取消禁言</el-link
|
|
|
|
|
|
>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
</dl>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
<p v-if="loading" class="load-tip">加载中...</p>
|
|
|
|
|
|
<p v-if="!hasNext" class="load-tip">没有更多了...</p>
|
|
|
|
|
|
<p v-else-if="!loading && hasNext" class="load-tip">下拉加载更多...</p>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2025-02-08 23:04:37 +08:00
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
queryCommentBlackList,
|
|
|
|
|
|
addCommentBlack,
|
|
|
|
|
|
removeCommentBlack
|
|
|
|
|
|
} from "@/api/videoLive";
|
|
|
|
|
|
export default {
|
2025-02-12 21:40:09 +08:00
|
|
|
|
props: {
|
|
|
|
|
|
groupId: {
|
|
|
|
|
|
type: Number
|
|
|
|
|
|
},
|
|
|
|
|
|
type: {
|
|
|
|
|
|
type: Number,
|
|
|
|
|
|
default: 1 // 1:用户列表 2:禁言列表
|
2025-02-13 22:04:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
modifyStateObj: {
|
|
|
|
|
|
// 修改了状态的对象
|
|
|
|
|
|
type: Object
|
2025-02-12 21:40:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
loading: true,
|
|
|
|
|
|
hasNext: true,
|
|
|
|
|
|
userName: "",
|
|
|
|
|
|
list: []
|
|
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
groupId() {
|
|
|
|
|
|
this.userName = "";
|
|
|
|
|
|
this.searchMsg();
|
2025-02-13 22:04:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
modifyStateObj(value) {
|
|
|
|
|
|
debugger;
|
|
|
|
|
|
if (value.modifyType === 2 && value.isForbidden === 2) {
|
|
|
|
|
|
this.list = this.list.filter(citem => value.userId !== citem.phone);
|
|
|
|
|
|
!this.list.lenght && this.searchMsg();
|
|
|
|
|
|
}
|
2025-02-12 21:40:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-02-08 23:04:37 +08:00
|
|
|
|
methods: {
|
2025-02-12 21:40:09 +08:00
|
|
|
|
setCommentBlack(type, item) {
|
|
|
|
|
|
if (type === 1) {
|
|
|
|
|
|
// 禁言
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// 取消禁言
|
|
|
|
|
|
this.$confirm(`您确定取消禁言?`, {
|
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
|
type: "warning"
|
|
|
|
|
|
})
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
removeCommentBlack({
|
|
|
|
|
|
userPhone: item.phone,
|
|
|
|
|
|
productId: item.productId,
|
|
|
|
|
|
productType: 41 // 41 交易圈
|
|
|
|
|
|
}).then(res => {
|
2025-02-08 23:04:37 +08:00
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
|
this.$message({
|
|
|
|
|
|
message: "取消禁言成功",
|
|
|
|
|
|
showClose: false,
|
|
|
|
|
|
type: "success"
|
|
|
|
|
|
});
|
2025-02-13 22:04:59 +08:00
|
|
|
|
this.list = this.list.filter(
|
|
|
|
|
|
citem => item.phone !== citem.phone
|
|
|
|
|
|
);
|
|
|
|
|
|
!this.list.lenght && this.searchMsg();
|
|
|
|
|
|
this.$emit("modifyStateCallback", {
|
|
|
|
|
|
userId: item.phone,
|
|
|
|
|
|
isForbidden: 2,
|
|
|
|
|
|
modifyType: 2
|
|
|
|
|
|
});
|
2025-02-08 23:04:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
2025-02-12 21:40:09 +08:00
|
|
|
|
})
|
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
async getList() {
|
|
|
|
|
|
if (this.type === 2) {
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
const ret = await queryCommentBlackList({
|
|
|
|
|
|
size: 10,
|
|
|
|
|
|
current: 1,
|
|
|
|
|
|
productId: this.groupId,
|
|
|
|
|
|
userName: this.userName,
|
|
|
|
|
|
productType: 41,
|
2025-02-12 22:54:37 +08:00
|
|
|
|
status: 0,
|
2025-02-12 21:40:09 +08:00
|
|
|
|
userType: 3 // 作为何种角色访问 1:投顾 2:运营(非投顾) 3:忽略数据权限
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
});
|
|
|
|
|
|
if (ret && ret.code === 0) {
|
|
|
|
|
|
this.list = ret.data.list;
|
|
|
|
|
|
this.hasNext = ret.data.hasNext;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
}
|
2025-02-08 23:04:37 +08:00
|
|
|
|
},
|
2025-02-12 21:40:09 +08:00
|
|
|
|
searchMsg() {
|
|
|
|
|
|
this.list = [];
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
},
|
|
|
|
|
|
toPrivateChat(item) {
|
|
|
|
|
|
this.$emit("toPrivateChat", item);
|
2025-02-08 23:04:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|
2025-01-26 21:07:26 +08:00
|
|
|
|
<style lang="scss" scoped>
|
2025-02-12 21:40:09 +08:00
|
|
|
|
.list-wrap {
|
|
|
|
|
|
height: 600px;
|
|
|
|
|
|
overflow-y: scroll;
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
}
|
2025-01-26 21:07:26 +08:00
|
|
|
|
.search {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
.el-input {
|
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
dl {
|
|
|
|
|
|
list-style: none;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
list-style: none;
|
|
|
|
|
|
padding: 10px;
|
|
|
|
|
|
dt {
|
|
|
|
|
|
padding: 10px 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
dd {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
dt,
|
|
|
|
|
|
dd {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
border-bottom: 1px dashed #999;
|
|
|
|
|
|
& > div {
|
|
|
|
|
|
display: flex;
|
2025-02-12 21:40:09 +08:00
|
|
|
|
// flex-direction: column;
|
2025-01-26 21:07:26 +08:00
|
|
|
|
justify-content: center;
|
|
|
|
|
|
padding: 6px 0;
|
2025-02-12 21:40:09 +08:00
|
|
|
|
align-items: center;
|
2025-01-26 21:07:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
& > div:nth-child(1) {
|
|
|
|
|
|
width: 60px;
|
|
|
|
|
|
}
|
|
|
|
|
|
& > div:nth-child(2) {
|
2025-02-12 21:40:09 +08:00
|
|
|
|
flex: 1;
|
|
|
|
|
|
text-align: center;
|
2025-01-26 21:07:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
& > div:nth-child(3) {
|
|
|
|
|
|
width: 100px;
|
2025-02-12 21:40:09 +08:00
|
|
|
|
text-align: center;
|
2025-01-26 21:07:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
& > div:nth-child(4) {
|
|
|
|
|
|
width: 100px;
|
2025-02-12 21:40:09 +08:00
|
|
|
|
text-align: center;
|
2025-01-26 21:07:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
& > div:nth-child(5) {
|
2025-02-12 21:40:09 +08:00
|
|
|
|
display: block;
|
|
|
|
|
|
width: 60px;
|
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
& > div {
|
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
}
|
2025-01-26 21:07:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
p {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
line-height: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
::v-deep .el-button--medium {
|
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
img {
|
|
|
|
|
|
width: 36px;
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-02-12 21:40:09 +08:00
|
|
|
|
.load-tip {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
|
}
|
2025-01-26 21:07:26 +08:00
|
|
|
|
</style>
|