|
@@ -177,6 +177,7 @@
|
|
|
heigth="80%"
|
|
|
class="chat-dialog"
|
|
|
top="2vh"
|
|
|
+ :model="false"
|
|
|
>
|
|
|
<!--右侧菜单 start------------------------------------------------------------>
|
|
|
<div class="hallRight">
|
|
@@ -618,7 +619,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <el-dialog :visible.sync="groupWindowStatus" :close-on-click-modal="false" width="1028px">
|
|
|
+ <el-dialog :visible.sync="groupWindowStatus" :modal="false" :close-on-click-modal="false" width="1028px">
|
|
|
<div class="searchWindow">
|
|
|
<div class="searchWindowLeft">
|
|
|
<div class="searchUserWindowBox">
|
|
@@ -705,7 +706,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!--分享群聊 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="shareGroupWindowStatus" title="分享群聊" :close-on-click-modal="false" width="420px">
|
|
|
+ <el-dialog :visible.sync="shareGroupWindowStatus" :modal="false" title="分享群聊" :close-on-click-modal="false" width="420px">
|
|
|
<div>
|
|
|
<div class="shareCardWindowBox">
|
|
|
<el-tabs v-model="shareGroupActive" type="card" @tab-click="handleClickShareGroupCard">
|
|
@@ -750,7 +751,7 @@
|
|
|
<!--分享群聊 end------------------------------------------------------------>
|
|
|
|
|
|
<!--放大图片 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="imgZoomStatus" title="图片详情" :close-on-click-modal="false" max-width="600px">
|
|
|
+ <el-dialog :visible.sync="imgZoomStatus" :modal="false" title="图片详情" :close-on-click-modal="false" max-width="600px">
|
|
|
<div>
|
|
|
<div class="imgZoomBox">
|
|
|
<img :src="imgZoomUrl">
|
|
@@ -760,8 +761,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <!--聊天记录弹出框 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="fileWindowStatus" title="聊天记录" :close-on-click-modal="false" width="757px">
|
|
|
+ <!--聊天记录弹出框 start------------------------------------------------------------>
|
|
|
+ <el-dialog :visible.sync="fileWindowStatus" title="聊天记录" :model="false" :close-on-click-modal="false" width="757px">
|
|
|
<div class="fileWindow">
|
|
|
<div class="fileWindowHeader">
|
|
|
<el-input
|
|
@@ -927,7 +928,7 @@
|
|
|
<div class="fileWindowMessageItemName">用户名称</div>
|
|
|
<div class="fileWindowMessageItemTime">12:40</div>
|
|
|
</div>
|
|
|
- <div class="fileWindowMessageItemText">用用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息</div>
|
|
|
+ <div class="fileWindowMessageItemText">用用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -957,7 +958,7 @@
|
|
|
<!--聊天记录弹出框 end------------------------------------------------------------>
|
|
|
<!--编辑群成员弹出框 start------------------------------------------------------------>
|
|
|
<!--编辑时 左侧显示的是好友列表 右侧显示的是群成员-->
|
|
|
- <el-dialog :visible.sync="groupEditWindowStatus" :close-on-click-modal="false" width="1028px" @closed="cancelEditGroupMember">
|
|
|
+ <el-dialog :visible.sync="groupEditWindowStatus" :model="false" :close-on-click-modal="false" width="1028px" @closed="cancelEditGroupMember">
|
|
|
<div class="searchWindow">
|
|
|
<div class="searchWindowLeft">
|
|
|
<div class="searchUserWindowBox">
|
|
@@ -1052,7 +1053,7 @@
|
|
|
</el-dialog>
|
|
|
<!--编辑群成员弹出框 end------------------------------------------------------------>
|
|
|
<!--群名称弹出框 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="editGroupNameWindow" title="编辑群名称" :close-on-click-modal="false" width="420px">
|
|
|
+ <el-dialog :visible.sync="editGroupNameWindow" title="编辑群名称" :model="false" :close-on-click-modal="false" width="420px">
|
|
|
<div>
|
|
|
<div>
|
|
|
<el-input type="textarea" resize="none" v-model="editMessageTitle" placeholder="请输入" maxlength="20"></el-input>
|
|
@@ -1064,8 +1065,8 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!--群名称弹出框 end------------------------------------------------------------>
|
|
|
- <!--群公告弹出框 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="editGroupNoticeWindow" title="编辑群公告" :close-on-click-modal="false" width="420px">
|
|
|
+ <!--群公告弹出框 start------------------------------------------------------------>
|
|
|
+ <el-dialog :visible.sync="editGroupNoticeWindow" title="编辑群公告" :model="false" :close-on-click-modal="false" width="420px">
|
|
|
<div>
|
|
|
<div>
|
|
|
<el-input type="textarea" resize="none" v-model="editGroupProfile" placeholder="请输入" rows="10" maxlength="500"></el-input>
|
|
@@ -1079,7 +1080,7 @@
|
|
|
<!--群公告弹出框 end------------------------------------------------------------>
|
|
|
|
|
|
<!--查看群公告 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="groupProfileWindow" title="群公告详情" :close-on-click-modal="false" width="420px">
|
|
|
+ <el-dialog :visible.sync="groupProfileWindow" title="群公告详情" :model="false" :close-on-click-modal="false" width="420px">
|
|
|
<div>
|
|
|
<div class="groupProfileBox">
|
|
|
{{groupProfile}}
|
|
@@ -1090,8 +1091,8 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!--查看群公告 end------------------------------------------------------------>
|
|
|
- <!--分享名片 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="userCardWindowStatus" title="分享名片" :close-on-click-modal="false" width="420px">
|
|
|
+ <!--分享名片 start------------------------------------------------------------>
|
|
|
+ <el-dialog :visible.sync="userCardWindowStatus" title="分享名片" :model="false" :close-on-click-modal="false" width="420px">
|
|
|
<div>
|
|
|
<div class="shareCardWindowBox">
|
|
|
<el-tabs v-model="shareTableActive" type="card" @tab-click="handleClickShareCard">
|
|
@@ -1136,7 +1137,7 @@
|
|
|
<!--分享名片 end------------------------------------------------------------>
|
|
|
|
|
|
<!--发送好友申请弹出框 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="addFriendWindowStatus" title="朋友申请" :close-on-click-modal="false" width="420px">
|
|
|
+ <el-dialog :visible.sync="addFriendWindowStatus" title="朋友申请" :model="false" :close-on-click-modal="false" width="420px">
|
|
|
<div>
|
|
|
<div>
|
|
|
<el-form :model="form" ref="form" autocomplete="off" label-position="left">
|
|
@@ -1156,7 +1157,7 @@
|
|
|
<!--发送好友申请弹出框 end------------------------------------------------------------>
|
|
|
|
|
|
<!--加入群聊弹出框 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="addGroupWindow" title="加入群聊" :close-on-click-modal="false" width="420px">
|
|
|
+ <el-dialog :visible.sync="addGroupWindow" title="加入群聊" :model="false" :close-on-click-modal="false" width="420px">
|
|
|
<div class="addGroupWindow">
|
|
|
<div class="addGroupWindowImg">
|
|
|
<img src="@/assets/chat/user/group.jpg" alt="">
|
|
@@ -1175,6 +1176,7 @@
|
|
|
title=" "
|
|
|
:close-on-click-modal="false"
|
|
|
width="420px"
|
|
|
+ :model="false"
|
|
|
>
|
|
|
<div class="searchFriendBox" >
|
|
|
<div class="searchFriendItem">
|
|
@@ -1200,17 +1202,9 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!--请求验证弹出框 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="friendWindowStatus" title="通过朋友验证" :close-on-click-modal="false" width="420px">
|
|
|
+ <el-dialog :visible.sync="friendWindowStatus" title="通过朋友验证" :model="false" :close-on-click-modal="false" width="420px">
|
|
|
<div>
|
|
|
<div class="friendWindowText">
|
|
|
- <!--此处修改备注是没用的,修改备注需要friendId,但是此时你们还不是好友,改不了备注-->
|
|
|
- <!-- <el-form :model="form" ref="form" autocomplete="off" label-position="left">
|
|
|
- <div class="formDiv">
|
|
|
- <el-form-item label="备注名" :label-width="formLabelWidth" class="custom-align-right">
|
|
|
- <el-input v-model="form.remark" autocomplete="off" placeholder="请输入备注名.."></el-input>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </el-form> -->
|
|
|
确定要添加<span>{{friendInfo.user_name}}</span>为好友吗?
|
|
|
</div>
|
|
|
<div class="footerButtonBox">
|
|
@@ -1221,7 +1215,7 @@
|
|
|
</el-dialog>
|
|
|
<!--请求验证弹出框 end------------------------------------------------------------>
|
|
|
<!--修改备注弹出框 start------------------------------------------------------------>
|
|
|
- <el-dialog :visible.sync="editWindowStatus" title="修改备注" :close-on-click-modal="false" width="420px">
|
|
|
+ <el-dialog :visible.sync="editWindowStatus" title="修改备注" :modal="false" :close-on-click-modal="false" width="420px">
|
|
|
<div>
|
|
|
<div>
|
|
|
<el-form :model="form" ref="form" autocomplete="off" label-position="left">
|
|
@@ -1261,6 +1255,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- <el-button class="top-button" type="primary" @click="viewGroupChat">查看群聊</el-button> -->
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
@@ -1278,9 +1273,11 @@
|
|
|
name: "ChatPanel",
|
|
|
data() {
|
|
|
return {
|
|
|
+ token:'',
|
|
|
ones:0,
|
|
|
messageContent:{},
|
|
|
avatar:this.$store.state.user.avatar,
|
|
|
+ user_id:this.$store.state.user.userid,
|
|
|
showfrindDialog:false,
|
|
|
activeTab: 0,
|
|
|
groupList: [],
|
|
@@ -1452,7 +1449,6 @@
|
|
|
clickShowMessage() {
|
|
|
// 先关闭所有旧消息
|
|
|
this.$message.closeAll();
|
|
|
-
|
|
|
this.$message({
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
message: `
|
|
@@ -1463,7 +1459,8 @@
|
|
|
<span>收到新消息</span>
|
|
|
</div>
|
|
|
`,
|
|
|
- duration: 3000,
|
|
|
+ duration: 300000,
|
|
|
+ customClass:'message-new'
|
|
|
});
|
|
|
|
|
|
setTimeout(() => {
|
|
@@ -1853,6 +1850,7 @@
|
|
|
//2.2 选择群聊
|
|
|
//2.1.1 在会话列表中选择一个群聊
|
|
|
selectGroup(item){
|
|
|
+ console.log("群聊接收值:",item)
|
|
|
this.$fixModalZIndex();
|
|
|
this.showDialog = true;
|
|
|
//选择会话的时候开启loading框
|
|
@@ -2020,6 +2018,7 @@
|
|
|
},
|
|
|
//2.3.8 群弹出框回显群内成员
|
|
|
editGroupMember(){
|
|
|
+
|
|
|
//1.打开编辑窗口
|
|
|
this.groupEditWindowStatus = true;
|
|
|
//2.获得好友列表
|
|
@@ -2029,8 +2028,7 @@
|
|
|
item.status = false; //默认未选中
|
|
|
}
|
|
|
this.friendsList = res.data;
|
|
|
- console.log(this.friendsList)
|
|
|
- console.log(this.groupUserList)
|
|
|
+
|
|
|
//4.判断一下groupUserList是否包含friendsList中的成员,如果包含,就把friendsList中的成员status设置为true
|
|
|
this.friendsList.forEach(item => {
|
|
|
console.log(item.user_id)
|
|
@@ -2421,20 +2419,23 @@
|
|
|
//5.1 接受消息
|
|
|
handleIncomingMessage(event) {
|
|
|
const message = JSON.parse(event.data);
|
|
|
- this.clickShowMessage();
|
|
|
- console.log("监听消息1:",message)
|
|
|
- if(this.ones==0){
|
|
|
- this.ones = 1
|
|
|
- this.getConversationList();
|
|
|
- }
|
|
|
- console.log(message.receiver_id)
|
|
|
- this.conversationList.forEach(item => {
|
|
|
- if(item.receiver_id==message.receiver_id){
|
|
|
- console.log("当前消息属于当前的聊天窗口!")
|
|
|
- this.messageContent = message;
|
|
|
- }
|
|
|
- });
|
|
|
+ // this.clickShowMessage();
|
|
|
+ console.log("监听消息1:",message.user_id,"===",this.myUserId,"##",this.user_id)
|
|
|
+ // if(this.ones==0){
|
|
|
+ // this.ones = 1
|
|
|
+ // this.getConversationList();
|
|
|
+ // }
|
|
|
+ // console.log(message.receiver_id)
|
|
|
+ // this.conversationList.forEach(item => {
|
|
|
+ // if(item.receiver_id==message.receiver_id){
|
|
|
+ // console.log("当前消息属于当前的聊天窗口!")
|
|
|
+ // this.messageContent = message;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
// console.log(message.receiver_id.length == 18)
|
|
|
+ if(message.user_id && (message.user_id !=this.user_id)){
|
|
|
+ this.clickShowMessage(message);
|
|
|
+ }
|
|
|
//第一步:先判断是否为群消息
|
|
|
if (message.receiver_id && message.receiver_id.length == 18) {
|
|
|
//第二步:判断当前接收的消息是否显示到聊天框中
|
|
@@ -2867,7 +2868,7 @@
|
|
|
|
|
|
//2.3 删除好友
|
|
|
deleteFriend(id){
|
|
|
- console.log(id);
|
|
|
+ this.showfrindDialog = false;
|
|
|
if(id){
|
|
|
this.editFriendId = String(id);
|
|
|
}
|
|
@@ -2876,14 +2877,14 @@
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
- zIndex: 11000, // 新增,确保弹窗在最上层
|
|
|
- modal: false // 移除蒙层
|
|
|
+ // zIndex: 11000, // 新增,确保弹窗在最上层
|
|
|
}).then(() => {
|
|
|
console.log(this.editFriendId);
|
|
|
this.$store.dispatch('chat/delFriend',{friend_id:this.editFriendId}).then(res=> {
|
|
|
this.$message.success('删除成功!')
|
|
|
//关闭用户详情显示
|
|
|
this.pagestatus = 1;
|
|
|
+ this.showfrindDialog = false;
|
|
|
//重新装在用户列表
|
|
|
this.getUserFriendList();
|
|
|
})
|
|
@@ -2955,6 +2956,7 @@
|
|
|
//3.操作弹出框 start------------------------------------------------------------>
|
|
|
//用户菜单操作
|
|
|
openWindow(item){
|
|
|
+ this.$message.closeAll();
|
|
|
this.form.id = item.id;
|
|
|
this.form.friend_id = item.friend_id;
|
|
|
this.friendInfo = item;
|
|
@@ -2962,6 +2964,7 @@
|
|
|
this.friendWindowStatus = true;
|
|
|
},
|
|
|
openEditWindow(id){
|
|
|
+
|
|
|
//打开修改备注弹出框
|
|
|
this.editWindowStatus = true;
|
|
|
},
|
|
@@ -3067,12 +3070,35 @@
|
|
|
document.addEventListener('mouseup', onMouseUp);
|
|
|
});
|
|
|
},
|
|
|
+ viewGroupChat(info) {
|
|
|
+ // 这里可以添加查看群聊的逻辑
|
|
|
+ console.log('查看群聊',info);
|
|
|
+ const item = {
|
|
|
+ "receiver_id": info.group_id,
|
|
|
+ "num": 18085,
|
|
|
+ "max_id": '',
|
|
|
+ "user_name": null,
|
|
|
+ "avatar": null,
|
|
|
+ "mobile": null,
|
|
|
+ "group_name": info.group_name,
|
|
|
+ "type": "group",
|
|
|
+ "name": info.group_name,
|
|
|
+ "is_group": 1
|
|
|
+ }
|
|
|
+ this.selectGroup(item);
|
|
|
+ },
|
|
|
+ openGroupChat(id) {
|
|
|
+ console.log('打开群聊',id);
|
|
|
+ // 你的逻辑,比如显示面板、加载群聊数据等
|
|
|
+ // this.showPanel = true;
|
|
|
+ // this.loadGroupChat(id);
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log("=====fuck")
|
|
|
+ console.log("用户头像信息:",this.$store.state.user.avatar)
|
|
|
//开启websocket连接 start---------------------------------------->
|
|
|
//1.获取admin-token
|
|
|
- const adminToken = document.cookie.split('; ').find(row => row.startsWith('Admin-Token=')).split('=')[1];
|
|
|
+ const adminToken = this.token;
|
|
|
console.log("Admin-Token:", adminToken);
|
|
|
|
|
|
//2.连接websocket
|
|
@@ -3125,35 +3151,6 @@
|
|
|
}
|
|
|
};
|
|
|
//从通讯录创建单聊 end---------------------------------------->
|
|
|
-
|
|
|
- // if (!document.getElementById('custom-message-style')) {
|
|
|
- // const style = document.createElement('style');
|
|
|
- // style.id = 'custom-message-style';
|
|
|
- // style.innerHTML = `
|
|
|
- // .el-message {
|
|
|
- // min-width: auto !important;
|
|
|
- // padding: 0 !important;
|
|
|
- // background: transparent !important;
|
|
|
- // border: none !important;
|
|
|
- // box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
|
|
|
- // border-radius:100px !important;
|
|
|
- // }
|
|
|
- // .el-message .el-message__icon {
|
|
|
- // display: none !important;
|
|
|
- // }
|
|
|
- // .el-message .my-custom-message {
|
|
|
- // background: #fff !important;
|
|
|
- // color: #000 !important;
|
|
|
- // border-radius: 4px !important;
|
|
|
- // box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
|
|
|
- // border: none !important;
|
|
|
- // padding: 8px 16px !important;
|
|
|
- // display: flex;
|
|
|
- // align-items: center;
|
|
|
- // }
|
|
|
- // `;
|
|
|
- // document.head.appendChild(style);
|
|
|
- // }
|
|
|
this.initDrag();
|
|
|
},
|
|
|
beforeDestroy() {
|
|
@@ -3165,6 +3162,33 @@
|
|
|
this.ws.close();
|
|
|
}
|
|
|
clearInterval(this.getFriendApplyListStatus);
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 监听 user.avatar 的变化
|
|
|
+ '$store.state.user.avatar'(newVal, oldVal) {
|
|
|
+ if (newVal) {
|
|
|
+ // 这里可以安全地使用 avatar
|
|
|
+ this.avatar = newVal
|
|
|
+ console.log('avatar 变化了:', newVal);
|
|
|
+ // 你的逻辑...
|
|
|
+ }
|
|
|
+ },
|
|
|
+ '$store.state.user.userid'(newVal, oldVal) {
|
|
|
+ if (newVal) {
|
|
|
+ // 这里可以安全地使用 avatar
|
|
|
+ this.user_id = newVal
|
|
|
+ console.log('user_id 变化了:', newVal);
|
|
|
+ // 你的逻辑...
|
|
|
+ }
|
|
|
+ },
|
|
|
+ '$store.state.user.token': {
|
|
|
+ handler(newValue, oldValue) {
|
|
|
+ this.token = newValue
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -4167,7 +4191,7 @@
|
|
|
.hallRight {
|
|
|
flex: 1;
|
|
|
background: #fff;
|
|
|
- border-radius: 20px;
|
|
|
+ border-radius: 2px;
|
|
|
position: relative;
|
|
|
// min-height: 500px;
|
|
|
display: flex;
|
|
@@ -5798,8 +5822,8 @@
|
|
|
color: #999;
|
|
|
}
|
|
|
}
|
|
|
- //发送名片
|
|
|
- .messageTypeCard {
|
|
|
+ //发送名片
|
|
|
+ .messageTypeCard {
|
|
|
width: 321px;
|
|
|
background: #fff;
|
|
|
border-radius: 16px;
|
|
@@ -5840,8 +5864,8 @@
|
|
|
border: 1px solid #ECECEC;
|
|
|
}
|
|
|
}
|
|
|
- //发送群聊
|
|
|
- .messageGroupInvite {
|
|
|
+ //发送群聊
|
|
|
+ .messageGroupInvite {
|
|
|
background: #fff;
|
|
|
border-radius: 16px;
|
|
|
border: 1px solid #E9EDF7;
|
|
@@ -5904,9 +5928,6 @@
|
|
|
}
|
|
|
}
|
|
|
.searchFriendBox {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
.searchFriendItem {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -5995,8 +6016,30 @@
|
|
|
text-align: center;
|
|
|
font-size: 18px;
|
|
|
height: 400px;
|
|
|
- line-height: 400px;
|
|
|
+ line-height: 350px;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
+</style>
|
|
|
+<style >
|
|
|
+.message-new {
|
|
|
+ min-width: auto !important;
|
|
|
+ padding: 0 !important;
|
|
|
+ background: transparent !important;
|
|
|
+ border: none !important;
|
|
|
+ box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
|
|
|
+ border-radius:100px !important;
|
|
|
+}
|
|
|
+.message-new .el-message__icon {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
+.message-new .my-custom-message {
|
|
|
+ background: #fff !important;
|
|
|
+ color: #000 !important;
|
|
|
+ border-radius: 4px !important;
|
|
|
+ box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
|
|
|
+ border: none !important;
|
|
|
+ padding: 8px 16px !important;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
</style>
|