|
|
|
@ -9,8 +9,8 @@ |
|
|
|
<scroll-view class="scroll-box" scroll-y="true" upper-threshold="200" @scrolltoupper="onScrollToTop" |
|
|
|
:scroll-into-view="'chat-item-'+scrollMsgIdx"> |
|
|
|
<view v-if="chat" v-for="(msgInfo,idx) in chat.messages" :key="idx"> |
|
|
|
<chat-message-item v-if="idx>=showMinIdx" :headImage="headImage(msgInfo)" |
|
|
|
@call="onRtCall(msgInfo)" :showName="showName(msgInfo)" @recall="onRecallMessage" |
|
|
|
<chat-message-item v-if="idx>=showMinIdx" :headImage="headImage(msgInfo)" @call="onRtCall(msgInfo)" |
|
|
|
:showName="showName(msgInfo)" @recall="onRecallMessage" @copy="onCopyMessage" |
|
|
|
@delete="onDeleteMessage" @longPressHead="onLongPressHead(msgInfo)" @download="onDownloadFile" |
|
|
|
:id="'chat-item-'+idx" :msgInfo="msgInfo" :groupMembers="groupMembers"> |
|
|
|
</chat-message-item> |
|
|
|
@ -75,8 +75,7 @@ |
|
|
|
<view class="tool-name">语音消息</view> |
|
|
|
</view> |
|
|
|
<view v-if="chat.type == 'GROUP'" class="chat-tools-item" @click="switchReceipt()"> |
|
|
|
<view class="tool-icon iconfont icon-receipt" |
|
|
|
:class="isReceipt?'active':''"></view> |
|
|
|
<view class="tool-icon iconfont icon-receipt" :class="isReceipt?'active':''"></view> |
|
|
|
<view class="tool-name">回执消息</view> |
|
|
|
</view> |
|
|
|
<!-- #ifndef MP-WEIXIN --> |
|
|
|
@ -109,8 +108,7 @@ |
|
|
|
@complete="onAtComplete"></chat-at-box> |
|
|
|
<!-- 群语音通话时选择成员 --> |
|
|
|
<!-- #ifndef MP-WEIXIN --> |
|
|
|
<group-member-selector ref="selBox" :members="groupMembers" |
|
|
|
:maxSize="configStore.webrtc.maxChannel" |
|
|
|
<group-member-selector ref="selBox" :members="groupMembers" :maxSize="configStore.webrtc.maxChannel" |
|
|
|
@complete="onInviteOk"></group-member-selector> |
|
|
|
<group-rtc-join ref="rtcJoin" :groupId="group.id"></group-rtc-join> |
|
|
|
<!-- #endif --> |
|
|
|
@ -189,20 +187,10 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
onGroupVideo() { |
|
|
|
this.$http({ |
|
|
|
url: "/webrtc/group/info?groupId="+this.group.id, |
|
|
|
method: 'GET' |
|
|
|
}).then((rtcInfo)=>{ |
|
|
|
if(rtcInfo.isChating){ |
|
|
|
// 已在通话中,可以直接加入通话 |
|
|
|
this.$refs.rtcJoin.open(rtcInfo); |
|
|
|
}else { |
|
|
|
// 邀请成员发起通话 |
|
|
|
let ids = [this.mine.id]; |
|
|
|
this.$refs.selBox.init(ids, ids); |
|
|
|
this.$refs.selBox.open(); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
onInviteOk(ids) { |
|
|
|
if (ids.length < 2) { |
|
|
|
@ -264,7 +252,6 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
sendTextMessage() { |
|
|
|
const timeStamp = new Date().getTime(); |
|
|
|
if (!this.sendText.trim() && this.atUserIds.length == 0) { |
|
|
|
return uni.showToast({ |
|
|
|
title: "不能发送空白信息", |
|
|
|
@ -283,10 +270,8 @@ |
|
|
|
// 填充对方id |
|
|
|
this.fillTargetId(msgInfo, this.chat.targetId); |
|
|
|
this.sendMessageRequest(msgInfo).then((m) => { |
|
|
|
console.log("请求耗时:",new Date().getTime()-timeStamp) |
|
|
|
m.selfSend = true; |
|
|
|
this.chatStore.insertMessage(m); |
|
|
|
console.log("insertMessage耗时:",new Date().getTime()-timeStamp) |
|
|
|
// 会话置顶 |
|
|
|
this.moveChatToTop(); |
|
|
|
}).finally(() => { |
|
|
|
@ -368,6 +353,7 @@ |
|
|
|
this.showKeyBoard = true; |
|
|
|
this.switchChatTabBox('none', false) |
|
|
|
this.keyboardHeight = this.rpxTopx(e.detail.height); |
|
|
|
this.scrollToBottom(); |
|
|
|
} else { |
|
|
|
this.showKeyBoard = false; |
|
|
|
} |
|
|
|
@ -505,6 +491,17 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
onCopyMessage(msgInfo) { |
|
|
|
uni.setClipboardData({ |
|
|
|
data: msgInfo.content, |
|
|
|
success: () => { |
|
|
|
uni.showToast({ title: '已复制', icon: 'none' }); |
|
|
|
}, |
|
|
|
fail: () => { |
|
|
|
uni.showToast({ title: '复制失败', icon: 'none' }); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
onDownloadFile(msgInfo) { |
|
|
|
let url = JSON.parse(msgInfo.content).url; |
|
|
|
uni.downloadFile({ |
|
|
|
@ -839,6 +836,7 @@ |
|
|
|
border: #dddddd solid 1px; |
|
|
|
background-color: #f7f8fd; |
|
|
|
height: 80rpx; |
|
|
|
|
|
|
|
.iconfont { |
|
|
|
font-size: 68rpx; |
|
|
|
margin: 6rpx; |
|
|
|
@ -857,6 +855,7 @@ |
|
|
|
border-radius: 20rpx; |
|
|
|
font-size: 30rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
.send-text-area { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
@ -890,6 +889,7 @@ |
|
|
|
border-radius: 20%; |
|
|
|
background-color: white; |
|
|
|
color: black; |
|
|
|
|
|
|
|
&.active { |
|
|
|
background-color: #ddd; |
|
|
|
} |
|
|
|
|