fix: bug修复

This commit is contained in:
kaizheng(郑凯) 2025-03-03 19:30:42 +08:00
parent 5672b74037
commit 6c1c2ccd53
8 changed files with 67 additions and 49 deletions

View File

@ -66,6 +66,8 @@ export default {
userPhone: this.formProhibition.phone,
scope: this.scope,
content: this.formProhibition.content
? this.formProhibition.content
: ""
};
addCommentBlack(data).then(res => {
if (res.code === 0) {

View File

@ -62,7 +62,8 @@ export default {
this.searchMsg();
},
modifyStateObj(value) {
if (value.modifyType) {
// modifyType: 1 2
if (value.modifyType === 2) {
this.searchMsg();
}
}
@ -81,10 +82,12 @@ export default {
if (ret && ret.code === 0 && ret.data.list) {
const list = ret.data.list;
list.forEach(item => {
item.privateUserId = item.phone;
item.privateUserName = item.userName;
item.userId = item.phone;
item.nickName = item.userName;
item.isForbidden = 1;
this.userIdsObj[item.privateUserId] = item;
item.joinTime = item.startTime;
item.expireTime = item.endTime;
this.userIdsObj[item.userId] = item;
});
this.list = this.list.concat(list);
this.hasNext = ret.data.list.length === this.params.size;
@ -92,6 +95,7 @@ export default {
this.loading = false;
},
searchMsg() {
this.params.lastId = "";
this.hasNext = true;
this.params.current = 0;
this.list = [];

View File

@ -13,18 +13,20 @@
<div>操作</div>
</dt>
<dd v-for="item in list" :key="item.id">
<div><img src="" alt="" /></div>
<div>
<img :src="item.headPicUrl || defaultAvatar.student" alt="" />
</div>
<div>
<div>
<p>{{ item.privateUserId }}</p>
<p>{{ item.privateUserName }}</p>
<p>{{ item.userId }}</p>
<p>{{ item.nickName }}</p>
</div>
</div>
<div>
<p>数据缺失</p>
<p>{{ item.joinTime }}</p>
</div>
<div>
<p>数据缺失</p>
<p>{{ item.expireTime }}</p>
</div>
<div>
<div>
@ -80,6 +82,9 @@ export default {
},
data() {
return {
defaultAvatar: {
student: require("@/assets/images/defaultAvatar/student.png")
},
currentUserObj: {} //
};
},
@ -101,7 +106,7 @@ export default {
})
.then(() => {
removeCommentBlack({
userPhone: item.privateUserId,
userPhone: item.userId,
productId: this.groupId,
productType: 41
}).then(res => {
@ -113,7 +118,7 @@ export default {
});
item.isForbidden = 2;
this.modifyStateCallback({
userId: item.privateUserId,
userId: item.userId,
isForbidden: 2,
modifyType: 2
});
@ -125,15 +130,15 @@ export default {
this.currentUserObj = item;
const forbidSpeakRef = this.$refs.forbidSpeakRef;
forbidSpeakRef.dialogFormVisible = true;
forbidSpeakRef.formProhibition.userName = item.privateUserName;
forbidSpeakRef.formProhibition.phone = item.privateUserId;
forbidSpeakRef.formProhibition.userName = item.nickName;
forbidSpeakRef.formProhibition.phone = item.userId;
forbidSpeakRef.formProhibition.content = item.content;
}
},
forbidSpeakCallback() {
this.currentUserObj.isForbidden = 1;
this.modifyStateCallback({
userId: this.currentUserObj.privateUserId,
userId: this.currentUserObj.userId,
isForbidden: 1,
modifyType: 2
});

View File

@ -13,7 +13,10 @@
:src="item.advisor ? item.advisor.avatar : defaultAvatar.teacher"
/>
<img v-else-if="item.userType === 3" :src="defaultAvatar.assistant" />
<img v-else-if="item.userType === 2" :src="defaultAvatar.student" />
<img
v-else-if="item.userType === 2"
:src="item.userHeadPicUrl || defaultAvatar.student"
/>
<div class="news-info">
<div class="news-info-top">
<div class="news-user">

View File

@ -2,7 +2,7 @@
<div class="list-wrap">
<div class="search">
<el-input
v-model.trim="keyword"
v-model.trim="params.nickName"
size="mini"
placeholder="请输入用户昵称"
clearable
@ -25,7 +25,14 @@
<!-- <el-badge is-dot class="item"
><img :src="defaultAvatar.student" alt="" />
</el-badge> -->
<img :src="defaultAvatar.student" alt="" />
<img
:src="
item.userType !== 2
? item.privateUserHeadPicUrl || defaultAvatar.student
: item.userHeadPicUrl
"
alt=""
/>
</div>
<div class="user-info">
<p>
@ -73,11 +80,11 @@ export default {
filterList: [],
list: [],
params: {
current: 0,
id: null,
lastId: "",
nickName: "",
groupId: null,
size: 10
},
keyword: "",
loading: false,
hasNext: true
};
@ -89,8 +96,8 @@ export default {
},
watch: {
groupId(value) {
this.params.id = value;
this.keyword = "";
this.params.groupId = value;
this.params.nickName = "";
this.searchMsg();
},
privateNewMsg(msg) {
@ -114,13 +121,16 @@ export default {
this.$emit("toPrivateChat", item);
},
async getPrivateChatList() {
if (this.loading) return;
this.loading = true;
this.params.current++;
const ret = await getPrivateChatList(this.params).catch(() => {
this.loading = false;
});
if (ret && ret.code === 0 && ret.data.list) {
let list = ret.data.list;
if (ret.data.list.length) {
this.params.lastId = ret.data.list[ret.data.list.length - 1].id;
}
list = ret.data.list.sort((x, y) => {
return (
new Date(y.createTime).getTime() - new Date(x.createTime).getTime()
@ -135,23 +145,16 @@ export default {
});
this.list = this.list.concat(list);
this.filterList = this.list;
this.hasNext = ret.data.list.length === this.params.size;
this.hasNext = ret.data.hasNext;
}
this.loading = false;
},
async searchMsg() {
this.params.lastId = "";
this.hasNext = true;
this.list = [];
this.userIdsMsgObj = {};
this.params.current = 0;
await this.getPrivateChatList();
// if (this.keyword) {
// this.filterList = this.list.filter(item => {
// const userName =
// item.userType !== 2 ? item.privateUserName : item.userName;
// return userName.includes(this.keyword);
// });
// }
}
}
};

View File

@ -2,7 +2,7 @@
<div class="list-wrap">
<div class="search">
<el-input
v-model="params.userName"
v-model="params.nickName"
size="mini"
placeholder="请输入用户昵称"
clearable
@ -40,12 +40,12 @@ export default {
},
data() {
return {
loading: true,
loading: false,
hasNext: true,
params: {
userName: "",
current: 0,
id: null,
nickName: "",
lastId: "",
groupId: null,
size: 10
},
list: [],
@ -54,8 +54,8 @@ export default {
},
watch: {
groupId(value) {
this.params.id = value;
this.params.userName = "";
this.params.groupId = value;
this.params.nickName = "";
this.searchMsg();
},
modifyStateObj(value) {
@ -70,29 +70,34 @@ export default {
this.$emit("modifyStateCallback", item);
},
async getList() {
if (this.loading) return;
this.loading = true;
this.params.current++;
const ret = await getCustomerList(this.params).catch(() => {
this.loading = false;
});
if (ret && ret.code === 0 && ret.data.list) {
const list = ret.data.list;
if (ret.data.list.length) {
this.params.lastId = ret.data.list[ret.data.list.length - 1].id;
}
list.forEach((item, index) => {
if (this.userIdsObj[item.privateUserId]) {
if (this.userIdsObj[item.userId]) {
list.splice(index, 1);
} else {
this.userIdsObj[item.privateUserId] = item;
this.userIdsObj[item.userId] = item;
item.isForbidden = item.commentBlackStatus; // 1 2
item.userHeadPicUrl = item.headPicUrl; //
}
});
this.list = this.list.concat(list);
this.hasNext = ret.data.list.length === this.params.size;
this.hasNext = ret.data.hasNext;
}
this.loading = false;
},
searchMsg() {
this.params.lastId = "";
this.hasNext = true;
this.params.current = 0;
this.userIdsObj = {};
this.list = [];
this.getList();

View File

@ -18,7 +18,7 @@
>
<li v-for="(item, index) in list" :key="index">
<div class="new-header">
<img :src="defaultAvatar.student" />
<img :src="item.userHeadPicUrl || defaultAvatar.student" />
<div class="news-info">
<div class="news-info-top">
<div class="news-user">

View File

@ -183,9 +183,7 @@
/>
<userList
v-show="userTabIndex === 1"
:key="1"
:group-id="detail.id"
:type="1"
:modify-state-obj="modifyStateObj"
@toPrivateChat="toPrivateChat"
@modifyStateCallback="modifyStateCallback"
@ -198,9 +196,7 @@
/>
<bannedUserList
v-show="userTabIndex === 3"
:key="2"
:group-id="detail.id"
:type="2"
:modify-state-obj="modifyStateObj"
@modifyStateCallback="modifyStateCallback"
@toPrivateChat="toPrivateChat"