NavBar.vue
2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<template>
<!--<tab class="g-header">-->
<!--<tab-item class="vux-tab">-->
<!--<router-link :to="{name:'contacts'}">-->
<!--<!–系统通知–>-->
<!--<span class="contacts-icon"></span>-->
<!--<!–<span class="dot"></span>–>-->
<!--</router-link>-->
<!--</tab-item>-->
<!--<tab-item class="vux-tab" :line-width="0">-->
<!--<router-link :to="{name:'session'}">-->
<!--<!–最近会话–>-->
<!--<span class="session-icon"></span>-->
<!--<span v-if="unreadArr.length !=0 " class="dot"></span>-->
<!--</router-link>-->
<!--</tab-item>-->
<!--</tab>-->
</template>
<script>
import {Tab,TabItem,Loading,ViewBox,XHeader} from 'vux'
export default {
components:{
Tab,
TabItem,
Loading,
ViewBox,
XHeader
},
data(){
return {
}
},
computed: {
route () {
return this.$store.getters.route
},
unreadArr(){
let allSession = this.$store.state.sessionlist;
let enableSession = [];
for(let i=0;i<allSession.length;i++){
if( allSession[i].scene == 'p2p' && allSession[i].lastMsg){
if(allSession[i].lastMsg.content){
let content = JSON.parse(allSession[i].lastMsg.content);
if(allSession[i].lastMsg.type == 'custom' && content.type == 10){
continue;
}else{
enableSession.push(allSession[i]);
}
}else{
enableSession.push(allSession[i]);
}
}
}
let unreadArr = [];
for(let i=0;i<enableSession.length;i++){
if(enableSession[i].unread != 0){
unreadArr.push(enableSession[i])
}
}
return unreadArr
}
},
methods: {
}
}
</script>
<style type="text/css">
.dot{
display:inline-block;
width:8px;
height:8px;
border-radius:4px;
background-color:#f00;
margin-left:-11.5px;
vertical-align:top;
margin-top:4.5px;
}
.session-icon,.contacts-icon{
display:inline-block;
width:30px;
height:30px;
background-size:contain;
margin-top:5.2px;
}
.session-icon{
background-image:url('/yunxin/res/im/msg_N.png')
}
.router-link-active .session-icon{
background-image:url('/yunxin/res/im/msg_H.png')
}
.contacts-icon{
background-image:url('/yunxin/res/im/sysMsg_N.png')
}
.router-link-active .contacts-icon{
background-image:url('/yunxin/res/im/sysMsg_H.png')
}
</style>