TeamList.vue
1.34 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
<template>
<div class='g-inherit m-article p-teamlist'>
<x-header class="m-tab" :left-options="{backText: ' '}">
<h1 class="m-tab-top">{{pageTitle}}</h1>
<a slot="left"></a>
</x-header>
<div class="m-list">
<group>
<cell v-for='team in teamList' :key='team.teamId' :title='team.name' is-link :link='`/chat/team-${team.teamId}`'>
<span class="icon icon-team-advanced" slot="icon"></span>
</cell>
</group>
</div>
<div class='empty-hint' v-if='!teamList || teamList.length<1'>暂无内容</div>
</div>
</template>
<script>
export default {
mounted () {
this.$nextTick(() => {
this.teamType = this.$route.params.teamType
})
},
data () {
return {
teamType: 'normal' // normal or advanced
}
},
computed: {
teamList: function () {
return this.$store.state.teamlist && this.$store.state.teamlist.filter(team => {
return team.type === this.teamType && team.validToCurrentUser
})
},
pageTitle: function () {
return this.teamType === 'advanced' ? '高级群' : '讨论组'
}
}
}
</script>
<style scoped>
.p-teamlist {
.m-list {
padding-top: 3.6rem;
}
.empty-hint{
position: absolute;
left: 0;
right: 0;
top: 5rem;
margin: auto;
text-align: center;
}
}
</style>