语音通话类型展示

This commit is contained in:
2022-02-21 12:05:19 +08:00
parent ce954c5dcc
commit f4b06bbf01
7 changed files with 202 additions and 41 deletions

View File

@@ -28,9 +28,6 @@
}
}
},
mounted() {
console.log(this.item);
},
computed: {
contact() {
return function(targetId) {

View File

@@ -22,10 +22,10 @@
<view class="preview" v-if="msg.objectName=='RC:LBSMsg'">
<text v-if="conversationType == 3">{{ user.name }}</text>[位置]
</view>
<view class="preview" v-if="msg.objectName=='RC:AudioMsg'">
<view class="preview" v-if="msg.objectName=='RC:InfoNtf' && msg.message=='0'">
<text v-if="conversationType == 3">{{ user.name }}</text>[语音通话]
</view>
<view class="preview" v-if="msg.objectName=='RC:VideoMsg'">
<view class="preview" v-if="msg.objectName=='RC:InfoNtf' && msg.message=='1'">
<text v-if="conversationType == 3">{{ user.name }}</text>[视频通话]
</view>
<view class="preview" v-if="msg.objectName=='RC:GrpNtf'">

View File

@@ -0,0 +1,76 @@
<template>
<view class="msg--text">
<text class="name" v-if="!guest && name">{{ name }}</text>
<view>
<text class="im--text" :class="guest ? 'right': 'left'" v-if="msg.message == '1'">语音通话</text>
<text class="im--text" :class="guest ? 'right': 'left'" v-else>视频通话</text>
</view>
</view>
</template>
<!-- msg
{
"message": "1",
"objectName": "RC:InfoNtf",
"userInfo": {
"userId": "10051",
"name": "Jason.电信",
"extra": "",
"portraitUrl": "http://storage.zh.shangkelian.cn/uploads/2022/02/16/29b13f5301694721ad7acd8b8b67bbd9.jpg"
}
}
-->
<script>
export default {
name: 'showText',
props: {
msg: {
type: Object,
default: () => {
return {}
}
},
name: {
type: String,
default: ''
},
guest: {
type: Boolean,
default: true
}
},
mounted() {
console.log(this.msg);
}
}
</script>
<style scoped lang="scss">
.msg--text {
.name {
font-size: 26rpx;
color: $text-gray-m;
display: inline-block;
}
.im--text {
max-width: 508rpx;
padding: 20rpx;
line-height: 46rpx;
font-size: 32rpx;
color: $text-color;
display: inline-block;
word-break: break-all;
&.left {
border-radius: 0 20rpx 20rpx 20rpx;
background: white;
}
&.right {
border-radius: 20rpx 0 20rpx 20rpx;
background: $main-color;
color: white;
}
}
}
</style>