<template>
    <view>
        <view class="preview" v-if="msg.objectName=='RC:TxtMsg'">
            <text v-if="conversationType == 3">{{ user.name }}: </text>{{ msg.content || '' }}
        </view>
        <view class="preview" v-if="msg.objectName=='RC:HQVCMsg'">
            <text v-if="conversationType == 3">{{ user.name }}: </text>[语音]
        </view>
        <view class="preview" v-if="msg.objectName=='RC:ImgMsg'">
            <text v-if="conversationType == 3">{{ user.name }}: </text>[图片]
        </view>
        <view class="preview" v-if="msg.objectName=='RC:GIFMsg'">
            <text v-if="conversationType == 3">{{ user.name }}: </text>[表情]
        </view>
        <view class="preview" v-if="msg.objectName=='RC:FileMsg'">
            <text v-if="conversationType == 3">{{ user.name }}: </text>[文件]
        </view>
        <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'">
            <text v-if="conversationType == 3">{{ user.name }}: </text>[语音通话]
        </view>
        <view class="preview" v-if="msg.objectName=='RC:VideoMsg'">
            <text v-if="conversationType == 3">{{ user.name }}: </text>[视频通话]
        </view>
    </view>
</template>

<script>
    export default {
        props: {
            msg: {
                type: Object,
                default: {}
            },
            conversationType: {
                type: Number,
                default: 0
            },
            user: {
                type: Object,
                default: function() {
                    return {
                        name: ''
                    }
                }
            }
        }
    }
</script>

<style lang="scss" scoped>
    .preview {
        word-break: break-all;
        color: $text-gray-m;
        padding-top: $padding - 20;
        padding-bottom: $padding;
        font-size: $title-size-m;
        height: 32rpx;
        line-height: 32rpx;
        width: 520rpx;
        @extend .nowrap;
    }
</style>
