praise_item.vue
4.8 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<template>
<view class="praise_Item">
<!-- 学生端显示 -->
<view class="praise_ItemV2-1" v-if="type === LIKETYPE.STUDENTEND">
<view class="praise_ItemV2-1-l">{{ info.create_time }}</view>
<view v-if="info.is_my">
<view class="praise_ItemV2-1-r" v-if="info.status === OPERATIONSTATUS.ADOPT">审核中</view>
<view class="praise_ItemV2-1-r praise_ItemV2-1-r2" v-else-if="info.status === OPERATIONSTATUS.PENDINGREVIEW">审核成功</view>
<view class="praise_ItemV2-1-r praise_ItemV2-1-r3" v-else>未通过</view>
</view>
</view>
<view class="praise_ItemV2-2">
{{ info.content }}
</view>
<!-- 老师端/管理员端显示 -->
<view class="praise_Item-t" v-if="type === LIKETYPE.TEACHERSEND || type === LIKETYPE.ADMINEND">
<view class="praise_Item-t-l">
<u--image
shape="circle"
height="72rpx"
width="72rpx"
:src="info.uimg"></u--image>
</view>
<view class="praise_Item-t-r">
<view class="praise_Item-t-r-1">{{ info.uname }}</view>
<view class="praise_Item-t-r-2">{{ info.create_time }}</view>
</view>
</view>
<view class="praise_Item-3">
<u--image
v-for="(item, index) in info.imgs"
:key="index"
radius="15rpx"
height="145rpx"
width="145rpx"
@click.native="seeImg(index)"
:src="item"></u--image>
</view>
<view class="praise_Item-4" v-if="type === LIKETYPE.ADMINEND && info.showOperation">
<view class="praise_Item-4-1" @click="operation(OPERATIONSTATUS.REFUSE)">不通过</view>
<view class="praise_Item-4-2" @click="operation(OPERATIONSTATUS.ADOPT)">通过</view>
</view>
</view>
</template>
<script>
import { LIKETYPE, OPERATIONSTATUS } from "@/emit/index.js"
export default {
name:"praise_Item",
props: {
type: {
type: [String, Number],
default: LIKETYPE.STUDENTEND
},
info: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
OPERATIONSTATUS,
LIKETYPE
};
},
methods: {
operation(type) {
var datas = {
id: this.info.id,
status: type
}
var jkurl = '/admin/praise_check'
this.$service.P_post(jkurl, datas).then(res => {
this.$emit('success', this.info.id)
})
},
seeImg(index) {
uni.previewImage({
current: index, // 当前显示图片的链接,不填则默认为 urls 的第一张图片
urls: this.info.imgs // 需要预览的图片链接列表
})
}
}
}
</script>
<style lang="scss">
.praise_Item{
background: #fff;
border-radius: 20rpx;
padding: 35rpx 30rpx;
box-shadow: 7rpx 0rpx 24rpx 0rpx rgba(153,153,153,0.22);
margin-bottom: 20rpx;
.praise_ItemV2-1{
display: flex;
justify-content: space-between;
.praise_ItemV2-1-l{
}
.praise_ItemV2-1-r{
background: linear-gradient(0deg, #0AC49C 0%, #34D5AA 100%);
border-radius: 21rpx 21rpx 0px 21rpx;
font-size: 22rpx;
color: #fff;
height: 42rpx;
width: 103rpx;
line-height: 42rpx;
text-align: center;
}
.praise_ItemV2-1-r2{
background: linear-gradient(0deg, #0088FF 0%, #2C9DFF 100%);
}
.praise_ItemV2-1-r3{
background: linear-gradient(0deg, #BEBEBE 0%, #AAAAAA 100%);
}
}
.praise_ItemV2-2{
line-height: 42rpx;
color: #323232;
font-size: 26rpx;
margin-top: 25rpx;
}
.praise_Item-1{
display: flex;
align-items: center;
.praise_Item-1-l{
.praise_Item-1-l-1{
line-height: 36rpx;
padding: 0 7rpx;
background-color: #18BD7A;
font-size: 22rpx;
color: #FFFFFF;
border-radius: 5rpx;
}
.praise_Item-1-l-1s{
line-height: 36rpx;
padding: 0 7rpx;
background-color: #2D9FFF;
font-size: 22rpx;
color: #FFFFFF;
border-radius: 5rpx;
}
}
.praise_Item-1-l-2{
color: #A1A0AB;
font-size: 24rpx;
margin-left: 20rpx;
}
}
.praise_Item-t{
display: flex;
align-items: center;
.praise_Item-t-l{
flex-shrink: 0;
}
.praise_Item-t-r{
margin-left: 25rpx;
.praise_Item-t-r-1{
color: #3D4054;
font-size: 28rpx;
}
.praise_Item-t-r-2{
color: #A1A0AB;
font-size: 24rpx;
}
}
}
.praise_Item-2{
font-size: 26rpx;
line-height: 39rpx;
color: #3D4054;
margin-top: 28rpx;
}
.praise_Item-3{
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-row-gap: 20rpx;
grid-column-gap: 20rpx;
margin-top: 30rpx;
}
.praise_Item-4{
display: flex;
justify-content: flex-end;
padding-top: 20rpx;
border-top: #EEEEEE solid 1rpx;
margin-top: 20rpx;
.praise_Item-4-1{
width: 172rpx;
border: 1rpx solid #2D81FF;
color: #2D81FF;
background: rgba(45,159,255,0.1);
border-radius: 200rpx;
font-size: 28rpx;
line-height: 63rpx;
text-align: center;
}
.praise_Item-4-2{
width: 172rpx;
border: 1rpx solid #2D81FF;
color: #FFFFFF;
background: #2D81FF;
border-radius: 200rpx;
font-size: 28rpx;
line-height: 63rpx;
text-align: center;
margin-left: 29rpx;
}
}
}
</style>