|
|
|
@ -2,16 +2,16 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-03-22 16:13:00
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-05-20 17:33:56
|
|
|
|
|
* @LastEditTime: 2022-05-21 19:11:50
|
|
|
|
|
* @Description: file content
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<view >
|
|
|
|
|
<BsEmpty tips="暂时还没有消息哦~" v-if="!$store.state.imData.length"
|
|
|
|
|
<BsEmpty tips="暂时还没有消息哦~" v-if="!sessionData.length"
|
|
|
|
|
:icon="require('@/static/message/empty.png')" />
|
|
|
|
|
<view class="msgItem" v-for="item in $store.state.imData" :key="item.id"
|
|
|
|
|
<view class="msgItem" v-for="item in sessionData" :key="item.id"
|
|
|
|
|
@click="openMsg(item)">
|
|
|
|
|
<image class="msgItem--headImg" src="@/static/account/tx.png"></image>
|
|
|
|
|
<image class="msgItem--headImg" :src="item.fromAvatar || require('@/static/message/xt.png')"></image>
|
|
|
|
|
<view class="msgItem--con">
|
|
|
|
|
<view>
|
|
|
|
|
<text class="msgItem--title">{{item.fromNickname}}</text>
|
|
|
|
@ -23,7 +23,7 @@
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="msgItem--right">
|
|
|
|
|
<text class="msgItem--time" v-if="item.lastMessage">{{item.lastMessage.createTimeStamp}}</text>
|
|
|
|
|
<text class="msgItem--time" v-if="item.lastMessage">{{FormatDate(item.lastMessage.createTimeStamp, 'mm-dd hh:ii:ss')}}</text>
|
|
|
|
|
<u-badge class="msgItem--badge" :value="item.unreadCount"></u-badge>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
@ -33,12 +33,13 @@
|
|
|
|
|
<script>
|
|
|
|
|
import BsEmpty from '../../../components/BsEmpty.vue';
|
|
|
|
|
import {MSG_TYPE} from '@/common/dicts/im';
|
|
|
|
|
import {FormatDate} from '@/common/utils';
|
|
|
|
|
export default {
|
|
|
|
|
components: { BsEmpty },
|
|
|
|
|
data (){
|
|
|
|
|
return {
|
|
|
|
|
msgType : MSG_TYPE,
|
|
|
|
|
sessionData : this.$store.state.imData
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onShow(){
|
|
|
|
@ -46,7 +47,13 @@ export default {
|
|
|
|
|
this.$Router.push('/login');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed:{
|
|
|
|
|
sessionData (){
|
|
|
|
|
return this.$store.state.imData;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
|
|
|
|
FormatDate,
|
|
|
|
|
openMsg(item){
|
|
|
|
|
if(item.type === 3){
|
|
|
|
|
this.$Router.push(`/messageChat?sessionId=${item.id}`);
|
|
|
|
|