This commit is contained in:
2020-08-13 16:03:01 +08:00
parent 4413250c40
commit ca9b43a597
2 changed files with 33 additions and 0 deletions

View File

@@ -68,6 +68,7 @@
</div>
<div class="record-loading" v-if="audio.recording"></div>
<video style="width:100%;height: 100%" :src="video.url" v-if="video.visible" id="videoPlayer" autoplay="true" @fullscreenchange="onVideoFullScreenChange" @play="onVideoPlayStart"></video>
<u-toast ref="uToast" />
</div>
</template>
@@ -191,6 +192,13 @@
})
},
sendMessage() {//发送消息
if(!this.imService.status){
this.$refs.uToast.show({
title: '连接聊天中,请稍候',
type: 'warning'
})
return
}
if (this.content.trim() != '') {
this.imService.sendPrivateTextMessage(this.friend.uuid, this.content);
let that = this
@@ -209,6 +217,13 @@
this.imService.loadPrivateHistoryMessage(this.friend.uuid, lastMessageTimeStamp);
},
onRecordStart () {
if(!this.imService.status){
this.$refs.uToast.show({
title: '连接聊天中,请稍候',
type: 'warning'
})
return
}
try{
recorderManager.start();
}catch(e){
@@ -231,6 +246,13 @@
}
},
sendVideo () {//发送文件
if(!this.imService.status){
this.$refs.uToast.show({
title: '连接聊天中,请稍候',
type: 'warning'
})
return
}
uni.chooseVideo({
success : (res) => {
console.log(res)
@@ -239,6 +261,13 @@
})
},
sendImage() {
if(!this.imService.status){
this.$refs.uToast.show({
title: '连接聊天中,请稍候',
type: 'warning'
})
return
}
uni.chooseImage({
count :1,
success :(res) => {
@@ -248,6 +277,7 @@
})
},
showImageFullScreen (e) {
var imagesUrl = [e.currentTarget.dataset.url];
uni.previewImage({
urls: imagesUrl