|
|
@ -1,26 +1,26 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="chat-msg-item"> |
|
|
<view class="chat-msg-item"> |
|
|
<view class="chat-msg-tip" |
|
|
<view class="chat-msg-tip" |
|
|
v-if="msgInfo.type==$enums.MESSAGE_TYPE.RECALL||msgInfo.type == $enums.MESSAGE_TYPE.TIP_TEXT"> |
|
|
v-if="msgInfo.type == $enums.MESSAGE_TYPE.RECALL || msgInfo.type == $enums.MESSAGE_TYPE.TIP_TEXT"> |
|
|
{{msgInfo.content}} |
|
|
{{ msgInfo.content }} |
|
|
</view> |
|
|
</view> |
|
|
<view class="chat-msg-tip" v-if="msgInfo.type==$enums.MESSAGE_TYPE.TIP_TIME"> |
|
|
<view class="chat-msg-tip" v-if="msgInfo.type == $enums.MESSAGE_TYPE.TIP_TIME"> |
|
|
{{$date.toTimeText(msgInfo.sendTime)}} |
|
|
{{ $date.toTimeText(msgInfo.sendTime) }} |
|
|
</view> |
|
|
</view> |
|
|
<view class="chat-msg-normal" v-if="isNormal" :class="{'chat-msg-mine':msgInfo.selfSend}"> |
|
|
<view class="chat-msg-normal" v-if="isNormal" :class="{ 'chat-msg-mine': msgInfo.selfSend }"> |
|
|
<head-image class="avatar" @longpress.prevent="$emit('longPressHead')" :id="msgInfo.sendId" :url="headImage" |
|
|
<head-image class="avatar" @longpress.prevent="$emit('longPressHead')" :id="msgInfo.sendId" :url="headImage" |
|
|
:name="showName" size="small"></head-image> |
|
|
:name="showName" size="small"></head-image> |
|
|
<view class="chat-msg-content"> |
|
|
<view class="chat-msg-content"> |
|
|
<view v-if="msgInfo.groupId && !msgInfo.selfSend" class="chat-msg-top"> |
|
|
<view v-if="msgInfo.groupId && !msgInfo.selfSend" class="chat-msg-top"> |
|
|
<text>{{showName}}</text> |
|
|
<text>{{ showName }}</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="chat-msg-bottom"> |
|
|
<view class="chat-msg-bottom"> |
|
|
<view v-if="msgInfo.type==$enums.MESSAGE_TYPE.TEXT"> |
|
|
<view v-if="msgInfo.type == $enums.MESSAGE_TYPE.TEXT"> |
|
|
<pop-menu :items="menuItems" @select="onSelectMenu"> |
|
|
<pop-menu :items="menuItems" @select="onSelectMenu"> |
|
|
<rich-text class="chat-msg-text" :nodes="$emo.transform(msgInfo.content)"></rich-text> |
|
|
<rich-text class="chat-msg-text" :nodes="$emo.transform(msgInfo.content)"></rich-text> |
|
|
</pop-menu> |
|
|
</pop-menu> |
|
|
</view> |
|
|
</view> |
|
|
<view class="chat-msg-image" v-if="msgInfo.type==$enums.MESSAGE_TYPE.IMAGE"> |
|
|
<view class="chat-msg-image" v-if="msgInfo.type == $enums.MESSAGE_TYPE.IMAGE"> |
|
|
<pop-menu :items="menuItems" @select="onSelectMenu"> |
|
|
<pop-menu :items="menuItems" @select="onSelectMenu"> |
|
|
<view class="img-load-box"> |
|
|
<view class="img-load-box"> |
|
|
<image class="send-image" mode="widthFix" :src="JSON.parse(msgInfo.content).thumbUrl" |
|
|
<image class="send-image" mode="widthFix" :src="JSON.parse(msgInfo.content).thumbUrl" |
|
|
@ -32,13 +32,13 @@ |
|
|
<text title="发送失败" v-if="loadFail" @click="onSendFail" |
|
|
<text title="发送失败" v-if="loadFail" @click="onSendFail" |
|
|
class="send-fail iconfont icon-warning-circle-fill"></text> |
|
|
class="send-fail iconfont icon-warning-circle-fill"></text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="chat-msg-file" v-if="msgInfo.type==$enums.MESSAGE_TYPE.FILE"> |
|
|
<view class="chat-msg-file" v-if="msgInfo.type == $enums.MESSAGE_TYPE.FILE"> |
|
|
<pop-menu :items="menuItems" @select="onSelectMenu"> |
|
|
<pop-menu :items="menuItems" @select="onSelectMenu"> |
|
|
<view class="chat-file-box"> |
|
|
<view class="chat-file-box"> |
|
|
<view class="chat-file-info"> |
|
|
<view class="chat-file-info"> |
|
|
<uni-link class="chat-file-name" :text="data.name" showUnderLine="true" |
|
|
<uni-link class="chat-file-name" :text="data.name" showUnderLine="true" |
|
|
color="#007BFF" :href="data.url"></uni-link> |
|
|
color="#007BFF" :href="data.url"></uni-link> |
|
|
<view class="chat-file-size">{{fileSize}}</view> |
|
|
<view class="chat-file-size">{{ fileSize }}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="chat-file-icon iconfont icon-file"></view> |
|
|
<view class="chat-file-icon iconfont icon-file"></view> |
|
|
<loading v-if="loading"></loading> |
|
|
<loading v-if="loading"></loading> |
|
|
@ -47,32 +47,32 @@ |
|
|
<text title="发送失败" v-if="loadFail" @click="onSendFail" |
|
|
<text title="发送失败" v-if="loadFail" @click="onSendFail" |
|
|
class="send-fail iconfont icon-warning-circle-fill"></text> |
|
|
class="send-fail iconfont icon-warning-circle-fill"></text> |
|
|
</view> |
|
|
</view> |
|
|
<pop-menu v-if="msgInfo.type==$enums.MESSAGE_TYPE.AUDIO" :items="menuItems" @select="onSelectMenu"> |
|
|
<pop-menu v-if="msgInfo.type == $enums.MESSAGE_TYPE.AUDIO" :items="menuItems" @select="onSelectMenu"> |
|
|
<view class="chat-msg-audio chat-msg-text" @click="onPlayAudio()"> |
|
|
<view class="chat-msg-audio chat-msg-text" @click="onPlayAudio()"> |
|
|
<text class="iconfont icon-voice-play"></text> |
|
|
<text class="iconfont icon-voice-play"></text> |
|
|
<text class="chat-audio-text">{{JSON.parse(msgInfo.content).duration+'"'}}</text> |
|
|
<text class="chat-audio-text">{{ JSON.parse(msgInfo.content).duration + '"' }}</text> |
|
|
<text v-if="audioPlayState=='PAUSE'" class="iconfont icon-play"></text> |
|
|
<text v-if="audioPlayState == 'PAUSE'" class="iconfont icon-play"></text> |
|
|
<text v-if="audioPlayState=='PLAYING'" class="iconfont icon-pause"></text> |
|
|
<text v-if="audioPlayState == 'PLAYING'" class="iconfont icon-pause"></text> |
|
|
</view> |
|
|
</view> |
|
|
</pop-menu> |
|
|
</pop-menu> |
|
|
<pop-menu v-if="isAction" :items="menuItems" @select="onSelectMenu"> |
|
|
<pop-menu v-if="isAction" :items="menuItems" @select="onSelectMenu"> |
|
|
<view class="chat-realtime chat-msg-text" @click="$emit('call')"> |
|
|
<view class="chat-realtime chat-msg-text" @click="$emit('call')"> |
|
|
<text v-if="msgInfo.type==$enums.MESSAGE_TYPE.ACT_RT_VOICE" |
|
|
<text v-if="msgInfo.type == $enums.MESSAGE_TYPE.ACT_RT_VOICE" |
|
|
class="iconfont icon-chat-voice"></text> |
|
|
class="iconfont icon-chat-voice"></text> |
|
|
<text v-if="msgInfo.type==$enums.MESSAGE_TYPE.ACT_RT_VIDEO" |
|
|
<text v-if="msgInfo.type == $enums.MESSAGE_TYPE.ACT_RT_VIDEO" |
|
|
class="iconfont icon-chat-video"></text> |
|
|
class="iconfont icon-chat-video"></text> |
|
|
<text>{{msgInfo.content}}</text> |
|
|
<text>{{ msgInfo.content }}</text> |
|
|
</view> |
|
|
</view> |
|
|
</pop-menu> |
|
|
</pop-menu> |
|
|
<view class="chat-msg-status" v-if="!isAction"> |
|
|
<view class="chat-msg-status" v-if="!isAction"> |
|
|
<text class="chat-readed" v-show="msgInfo.selfSend && !msgInfo.groupId |
|
|
<text class="chat-readed" v-show="msgInfo.selfSend && !msgInfo.groupId |
|
|
&& msgInfo.status==$enums.MESSAGE_STATUS.READED">已读</text> |
|
|
&& msgInfo.status == $enums.MESSAGE_STATUS.READED">已读</text> |
|
|
<text class="chat-unread" v-show="msgInfo.selfSend && !msgInfo.groupId |
|
|
<text class="chat-unread" v-show="msgInfo.selfSend && !msgInfo.groupId |
|
|
&& msgInfo.status!=$enums.MESSAGE_STATUS.READED">未读</text> |
|
|
&& msgInfo.status != $enums.MESSAGE_STATUS.READED">未读</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="chat-receipt" v-show="msgInfo.receipt" @click="onShowReadedBox"> |
|
|
<view class="chat-receipt" v-show="msgInfo.receipt" @click="onShowReadedBox"> |
|
|
<text v-if="msgInfo.receiptOk" class="tool-icon iconfont icon-ok"></text> |
|
|
<text v-if="msgInfo.receiptOk" class="tool-icon iconfont icon-ok"></text> |
|
|
<text v-else>{{msgInfo.readedCount}}人已读</text> |
|
|
<text v-else>{{ msgInfo.readedCount }}人已读</text> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -83,7 +83,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
export default { |
|
|
export default { |
|
|
name: "chat-message-item", |
|
|
name: "chat-message-item", |
|
|
props: { |
|
|
props: { |
|
|
headImage: { |
|
|
headImage: { |
|
|
@ -220,11 +220,11 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
|
.chat-msg-item { |
|
|
.chat-msg-item { |
|
|
padding: 2rpx 20rpx; |
|
|
padding: 2rpx 20rpx; |
|
|
|
|
|
|
|
|
.chat-msg-tip { |
|
|
.chat-msg-tip { |
|
|
@ -393,6 +393,7 @@ |
|
|
line-height: $im-font-size-smaller-extra; |
|
|
line-height: $im-font-size-smaller-extra; |
|
|
font-size: $im-font-size-smaller-extra; |
|
|
font-size: $im-font-size-smaller-extra; |
|
|
padding-top: 2rpx; |
|
|
padding-top: 2rpx; |
|
|
|
|
|
|
|
|
.chat-readed { |
|
|
.chat-readed { |
|
|
display: block; |
|
|
display: block; |
|
|
padding-top: 2rpx; |
|
|
padding-top: 2rpx; |
|
|
@ -482,5 +483,5 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |