调整聊天窗口

This commit is contained in:
唐明明
2022-01-28 14:57:39 +08:00
17 changed files with 1524 additions and 1129 deletions

View File

@@ -1,8 +1,10 @@
<template>
<view class="im--audio" :class="guest ? 'right': 'left'">
<image v-if="!guest" class="audio-mp3" src="@/static/icon/audio_green.png" mode="widthFix"></image>
<text class="audio-text">"60"</text>
<image v-if="guest" class="audio-mp3" src="@/static/icon/audio_white.png" mode="widthFix"></image>
<view>
<view class="im--audio" :class="guest ? 'right': 'left'" @click="onPlayMsg">
<image v-if="!guest" class="audio-mp3" src="@/static/icon/audio_green.png" mode="widthFix"></image>
<text class="audio-text">"{{msg.time}}"</text>
<image v-if="guest" class="audio-mp3" src="@/static/icon/audio_white.png" mode="widthFix"></image>
</view>
</view>
</template>
@@ -11,8 +13,13 @@
name:"im",
props:{
msg : {
type : String,
default: 'https://images.pexels.com/photos/10266655/pexels-photo-10266655.jpeg'
type : Object,
default: () => {
return {
src: "",
time: "20"
}
}
},
guest: {
type: Boolean,
@@ -20,10 +27,18 @@
}
},
methods:{
openImg(){
uni.previewImage({
urls : [this.msg],
current : 1
// 播放语音消息
onPlayMsg() {
let innerAudioContext = uni.createInnerAudioContext()
innerAudioContext.src = this.audioSrc
if (this.audioContextPaused) {
innerAudioContext.play()
this.audioContextPaused = false
return
}
innerAudioContext.stop()
innerAudioContext.onStop(resStop => {
this.audioContextPaused = true
})
}
}

View File

@@ -15,7 +15,7 @@
props:{
msg : {
type : String,
default: '文字消息'
default: ''
},
guest: {
type: Boolean,
@@ -31,8 +31,6 @@
padding: 20rpx;
font-size: 28rpx;
line-height: 40rpx;
min-height: 40rpx;
min-width: 50rpx;
}
.im--text.left{