diff --git a/im-platform/src/main/java/com/bx/implatform/service/impl/FriendServiceImpl.java b/im-platform/src/main/java/com/bx/implatform/service/impl/FriendServiceImpl.java index 3b13f28..cc23c15 100644 --- a/im-platform/src/main/java/com/bx/implatform/service/impl/FriendServiceImpl.java +++ b/im-platform/src/main/java/com/bx/implatform/service/impl/FriendServiceImpl.java @@ -162,8 +162,8 @@ public class FriendServiceImpl extends ServiceImpl impleme Friend friend = this.getOne(wrapper); LambdaQueryWrapper wrapperAnother = Wrappers.lambdaQuery(); - wrapper.eq(Friend::getUserId, userId); - wrapper.eq(Friend::getFriendId, customerId); + wrapperAnother.eq(Friend::getUserId, userId); + wrapperAnother.eq(Friend::getFriendId, customerId); Friend friendAnother = this.getOne(wrapperAnother); if (Objects.isNull(friend) || Objects.isNull(friendAnother)) { diff --git a/im-platform/src/main/java/com/bx/implatform/service/impl/PrivateMessageServiceImpl.java b/im-platform/src/main/java/com/bx/implatform/service/impl/PrivateMessageServiceImpl.java index 80d1264..0bd6cbc 100644 --- a/im-platform/src/main/java/com/bx/implatform/service/impl/PrivateMessageServiceImpl.java +++ b/im-platform/src/main/java/com/bx/implatform/service/impl/PrivateMessageServiceImpl.java @@ -248,7 +248,7 @@ public class PrivateMessageServiceImpl extends ServiceImpl wrapperAnother = new LambdaQueryWrapper<>(); - wrapper.eq(PrivateMessage::getSendId, userId).eq(PrivateMessage::getRecvId, customerId); + wrapperAnother.eq(PrivateMessage::getSendId, userId).eq(PrivateMessage::getRecvId, customerId); List messages2 = this.list(wrapperAnother); //修改接收对象 if(!messages2.isEmpty()) { diff --git a/im-web/src/components/chat/ChangeCustomer.vue b/im-web/src/components/chat/ChangeCustomer.vue new file mode 100644 index 0000000..ba3c118 --- /dev/null +++ b/im-web/src/components/chat/ChangeCustomer.vue @@ -0,0 +1,134 @@ + + + + + \ No newline at end of file diff --git a/im-web/src/components/chat/ChatBox.vue b/im-web/src/components/chat/ChatBox.vue index a74ba7f..5111d13 100644 --- a/im-web/src/components/chat/ChatBox.vue +++ b/im-web/src/components/chat/ChatBox.vue @@ -56,6 +56,7 @@ @click="showPrivateVideo('video')"> -->
+
+
@@ -94,7 +97,7 @@ import ChatAtBox from "./ChatAtBox.vue" import GroupMemberSelector from "../group/GroupMemberSelector.vue" import RtcGroupJoin from "../rtc/RtcGroupJoin.vue" import ChatInput from "./ChatInput"; - +import ChangeCustomer from "./ChangeCustomer.vue"; export default { name: "chatPrivate", @@ -108,7 +111,8 @@ export default { ChatHistory, ChatAtBox, GroupMemberSelector, - RtcGroupJoin + RtcGroupJoin, + ChangeCustomer }, props: { chat: { @@ -127,6 +131,7 @@ export default { showRecord: false, // 是否显示语音录制弹窗 showSide: false, // 是否显示群聊信息栏 showHistory: false, // 是否显示历史聊天记录 + showChangeCustomer: false, // 是否显示转接客服弹窗 lockMessage: false, // 是否锁定发送, showMinIdx: 0, // 下标低于showMinIdx的消息不显示,否则页面会很卡置 reqQueue: [], // 等待发送的请求队列 @@ -750,7 +755,17 @@ export default { } this.maxTmpId = id; return id; - } + }, + showChangeCustomerBox() { + this.showChangeCustomer = true; + }, + closeChangeCustomerBox() { + this.showChangeCustomer = false; + }, + onTransferSuccess() { + this.$message.success('已成功转接客服'); + // 可以在这里添加额外的处理逻辑 + }, }, computed: { mine() { @@ -800,6 +815,14 @@ export default { }, loading() { return this.chatStore.loading; + }, + targetUserId() { + if (this.chat.type === 'PRIVATE') { + return this.chat.targetId; + } else if (this.chat.type === 'GROUP') { + return this.group.id; + } + return 0; } }, watch: {