clean
This commit is contained in:
@@ -1,91 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="msg--call">
|
|
||||||
<view class="name" v-if="isGroup && isRemote">{{ contact(message.senderUserId).name }}</view>
|
|
||||||
<view class="im--text" :class="isRemote ? 'left': 'right'">
|
|
||||||
<uni-icons type="videocam" size="44rpx" v-if="msg.mediaType == 1" />
|
|
||||||
<uni-icons type="phone" size="40rpx" v-else />
|
|
||||||
{{ label }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import utils from '@/utils/index.js'
|
|
||||||
import moment from 'moment'
|
|
||||||
import imBase from '../../mixins/imBase.js'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [
|
|
||||||
imBase
|
|
||||||
],
|
|
||||||
name: 'showText',
|
|
||||||
props: {
|
|
||||||
message: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
isGroup: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
msg() {
|
|
||||||
return JSON.parse(this.message.content.message)
|
|
||||||
},
|
|
||||||
label() {
|
|
||||||
return this.msg.connected ? '通话时长:' + duration : '未接通'
|
|
||||||
},
|
|
||||||
isRemote() {
|
|
||||||
return this.message.messageDirection == 2
|
|
||||||
},
|
|
||||||
duration() {
|
|
||||||
if (this.message.duration > 3600) {
|
|
||||||
return moment.utc(this.message.duration * 1000).format('HH:mm:ss')
|
|
||||||
} else {
|
|
||||||
return moment.utc(this.message.duration * 1000).format('mm:ss')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.msg--call {
|
|
||||||
.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: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&.left {
|
|
||||||
border-radius: 0 20rpx 20rpx 20rpx;
|
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.right {
|
|
||||||
border-radius: 20rpx 0 20rpx 20rpx;
|
|
||||||
background: $main-color;
|
|
||||||
color: white;
|
|
||||||
|
|
||||||
.uni-icons {
|
|
||||||
color: white !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
<show-text v-if="message.objectName === 'RC:TxtMsg'" :message="message" :isGroup="isGroup" />
|
<show-text v-if="message.objectName === 'RC:TxtMsg'" :message="message" :isGroup="isGroup" />
|
||||||
<show-voice v-else-if="message.objectName === 'RC:HQVCMsg'" :message="message" :isGroup="isGroup" />
|
<show-voice v-else-if="message.objectName === 'RC:HQVCMsg'" :message="message" :isGroup="isGroup" />
|
||||||
<show-image v-else-if="message.objectName === 'RC:ImgMsg'" :message="message" :isGroup="isGroup" />
|
<show-image v-else-if="message.objectName === 'RC:ImgMsg'" :message="message" :isGroup="isGroup" />
|
||||||
<show-call v-else-if="message.objectName === 'RC:InfoNtf'" :message="message" :isGroup="isGroup" />
|
|
||||||
<show-file v-else-if="message.objectName === 'RC:FileMsg'" :message="message" :isGroup="isGroup" />
|
<show-file v-else-if="message.objectName === 'RC:FileMsg'" :message="message" :isGroup="isGroup" />
|
||||||
<show-normal v-else-if="message.objectName === 'RC:IWNormalMsg'" :message="message" :isGroup="isGroup" />
|
<show-normal v-else-if="message.objectName === 'RC:IWNormalMsg'" :message="message" :isGroup="isGroup" />
|
||||||
|
|
||||||
@@ -36,7 +35,6 @@
|
|||||||
import showVoice from './show/showVoice'
|
import showVoice from './show/showVoice'
|
||||||
import showImage from './show/showImage'
|
import showImage from './show/showImage'
|
||||||
import showText from './show/showText'
|
import showText from './show/showText'
|
||||||
import showCall from './show/showCall'
|
|
||||||
import showFile from './show/showFile'
|
import showFile from './show/showFile'
|
||||||
import showNormal from './show/showNormal'
|
import showNormal from './show/showNormal'
|
||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
@@ -47,7 +45,6 @@
|
|||||||
imBase
|
imBase
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
showCall,
|
|
||||||
showVoice,
|
showVoice,
|
||||||
showImage,
|
showImage,
|
||||||
showText,
|
showText,
|
||||||
|
|||||||
Reference in New Issue
Block a user