index.vue
2.9 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<template>
<view>
<view class="ListItem" @click="openInfoPop">
<view class="ListItem-t">
<view class="ListItem-t-l">
<text class="ListItem-t-l-1">{{ info.uname }}</text>
<image class="ListItem-t-l-2" src="@/static/images/admin/icon12.png" v-if="info.usex === GENDER.MALE" mode="widthFix"></image>
<image class="ListItem-t-l-2" src="@/static/images/admin/icon13.png" v-else mode="widthFix"></image>
</view>
<view class="ListItem-t-r" v-if="info.is_read === READINGSTATUS.READ">已读</view>
<view class="ListItem-t-r ListItem-t-r2" v-else @click.stop="openMarkReadPop">
<image src="@/static/images/admin/icon15.png" mode=""></image>
<text>未读</text>
</view>
</view>
<view class="ListItem-c">
{{ info.message }}
</view>
<view class="ListItem-b">{{ info.create_time }}</view>
</view>
<mark-read-pop ref="markReadPop" @success="successRead"></mark-read-pop>
<info-pop ref="infoPop"></info-pop>
</view>
</template>
<script>
import MarkReadPop from "../MarkReadPop/index.vue"
import InfoPop from "../InfoPop/index.vue"
import { READINGSTATUS } from "../../emit.js"
import { GENDER } from "@/emit/index.js"
export default {
name: 'ListItem',
props: {
info: {
type: Object,
default: () => {
return {}
}
}
},
components: {
MarkReadPop,
InfoPop
},
data() {
return {
GENDER,
READINGSTATUS
}
},
methods: {
successRead(e) {
this.$emit('successRead', e)
},
openInfoPop() {
this.$refs.infoPop.open(this.info)
},
openMarkReadPop() {
this.$refs.markReadPop.open(this.info)
}
}
}
</script>
<style lang="scss" scoped>
.ListItem {
padding: 30rpx 38rpx;
border-radius: 15px;
box-shadow: 7rpx 0rpx 24rpx 0rpx rgba(153, 153, 153, 0.22);
background: #fff;
margin-bottom: 20rpx;
.ListItem-t {
display: flex;
justify-content: space-between;
align-items: center;
.ListItem-t-l {
display: flex;
align-items: center;
.ListItem-t-l-1 {
font-size: 30rpx;
color: #3D4054;
}
.ListItem-t-l-2 {
height: 27rpx;
width: 27rpx;
flex-shrink: 0;
margin-left: 10rpx;
}
}
.ListItem-t-r {
line-height: 38rpx;
padding: 0 15rpx;
font-size: 24rpx;
background-color: #F7F8FA;
color: #A1A0AB;
}
.ListItem-t-r2{
background: linear-gradient(0deg, #0088FF 0%, #2C9DFF 100%);
color: #fff;
display: flex;
align-items: center;
image{
margin-right: 5rpx;
height: 22rpx;
width: 22rpx;
}
}
}
.ListItem-c {
margin-top: 29rpx;
color: #8E8D97;
font-size: 26rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
white-space: normal;
-webkit-line-clamp: 2;
}
.ListItem-b {
text-align: right;
font-size: 24rpx;
color: #A1A0AB;
margin-top: 15rpx;
}
}
</style>