im-MIXINS
This commit is contained in:
@@ -2,13 +2,12 @@
|
||||
<view class="message--cell">
|
||||
<view class="avatar">
|
||||
<u-badge max="99" shape="horn" absolute :offset="[-5, -8]" :value="item.unreadMessageCount" />
|
||||
<!-- <u-avatar :src="item.portraitUrl !== '' ? contact(item.targetId).portraitUrl : require('@/static/user/cover-s.png')" shape="square" :size="avatarSize" /> -->
|
||||
<u-avatar :src="require('@/static/user/cover-s.png')" shape="square" :size="avatarSize" />
|
||||
<u-avatar :src="contact(item.targetId).portraitUrl" shape="square" :size="avatarSize" />
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="header">
|
||||
<view class="name">
|
||||
{{ contact(item.targetId).name }} {{item.portraitUrl}}
|
||||
{{ contact(item.targetId).name }}
|
||||
<text v-if="item.conversationType === 3" class='group'>[群]</text>
|
||||
</view>
|
||||
<view class="time">{{ item.sentTime|timeCustomCN }}</view>
|
||||
@@ -22,8 +21,12 @@
|
||||
<script>
|
||||
import messagePreview from './messagePreview'
|
||||
import utils from '@/utils/index.js'
|
||||
import imBase from '@/utils/im/imBase.js'
|
||||
|
||||
export default {
|
||||
mixins: [
|
||||
imBase
|
||||
],
|
||||
props: {
|
||||
item: {
|
||||
type: Object,
|
||||
@@ -32,21 +35,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
avatarRpx: 84
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
avatarSize() {
|
||||
return utils.rpx2px(this.avatarRpx)
|
||||
},
|
||||
contact() {
|
||||
return function(targetId) {
|
||||
return this.$store.getters.contactInfo(targetId)
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
messagePreview
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user