|
@@ -282,6 +282,7 @@ export default defineComponent({
|
|
|
nextTick(() => {
|
|
|
scrollToBottom()
|
|
|
})
|
|
|
+ store.commit('userListSort', store.state.chatUserInfo)
|
|
|
if (store.state.chatUserInfo.isGroup === 1) {
|
|
|
await sendMessageToUser(data)
|
|
|
} else {
|
|
@@ -301,21 +302,32 @@ export default defineComponent({
|
|
|
let chatUserInfo = store.state.chatUserInfo
|
|
|
let userInfo = store.state.userInfo
|
|
|
if (action.value === 'deleteFriend') {
|
|
|
- await deleteFriend({id: chatUserInfo.friendId})
|
|
|
- let i = store.state.userList.indexOf(chatUserInfo)
|
|
|
- store.state.userList.splice(i, 1)
|
|
|
- store.commit('setIsShowChat', false)
|
|
|
- store.commit('setIsShowRight', false)
|
|
|
+ Dialog.confirm({
|
|
|
+ title: '温馨提示',
|
|
|
+ message: `确定删除${chatUserInfo.username}吗?`
|
|
|
+ }).then(async () => {
|
|
|
+ await deleteFriend({id: chatUserInfo.friendId})
|
|
|
+ let i = store.state.userList.indexOf(chatUserInfo)
|
|
|
+ store.state.userList.splice(i, 1)
|
|
|
+ store.commit('setIsShowChat', false)
|
|
|
+ store.commit('setIsShowRight', false)
|
|
|
+ Toast.success('删除成功')
|
|
|
+ })
|
|
|
}
|
|
|
if (action.value === 'exitGroup') { //如果自己是群主的话,那就解散群
|
|
|
- await deleteExitGroup({
|
|
|
- groupId: chatUserInfo.friendId,
|
|
|
- username: userInfo.username
|
|
|
+ Dialog.confirm({
|
|
|
+ title: '温馨提示',
|
|
|
+ message: `确定离开${store.state.chatUserInfo.friendName}群吗?`
|
|
|
+ }).then(async () => {
|
|
|
+ await deleteExitGroup({
|
|
|
+ groupId: chatUserInfo.friendId,
|
|
|
+ username: userInfo.username
|
|
|
+ })
|
|
|
+ let i = store.state.userList.indexOf(chatUserInfo)
|
|
|
+ store.state.userList.splice(i, 1)
|
|
|
+ store.commit('setIsShowChat', false)
|
|
|
+ store.commit('setIsShowRight', false)
|
|
|
})
|
|
|
- let i = store.state.userList.indexOf(chatUserInfo)
|
|
|
- store.state.userList.splice(i, 1)
|
|
|
- store.commit('setIsShowChat', false)
|
|
|
- store.commit('setIsShowRight', false)
|
|
|
}
|
|
|
if (action.value === 'createLink') {
|
|
|
let {data} = await creatZoom({zoomName: store.state.userInfo.username})
|