feedback.vue
6.1 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<template>
<div>
<nav-bar class="fecknav">
<div slot="left" class="back" @click="goBack">
<img src="../../assets/img/back.png" alt="">
</div>
<div slot="center" class="userinfotitle">
学情反馈
</div>
<div slot="right" class="result"></div>
</nav-bar>
<div class="feckcontent">
<van-list
@load="scrollEnd">
<div >
<div v-for="(item,index) in feed" :key="index" class="feed_item display-flex-between">
<div class="img"><van-image
width="100%"
height="100%"
fit="cover"
:src="item.image"
/></div>
<div style="flex: 1;">
<div class="feed_title p-1">{{item.name}}</div>
<div class="feed_time">已完成{{item.class_hours}}课时</div>
<div class="btns">
<div class="feed_but" @click="tochat(item.teacher_id)" >
去聊天
</div>
<div class="feed_but marginleft" @click="evaluateClick(item.content)" >
<!-- <div class='red' v-if="item.is_read==='0'&&item.content!==''"></div> -->
讲师评析
</div>
</div>
</div>
</div>
</div>
</van-list>
</div>
<div class="feedmodel" v-if="ifmodel">
<div class="feedmodel_close" @click="ifmodel=false"></div>
<div class="feedmodel_cont">
<img src="../../assets/img/feedtitle.png" alt="">
<div class="feedmodel_detail" v-html="content"></div>
</div>
</div>
</div>
</template>
<script>
export default {
data () {
return {
feed: [],
ifmodel: false,
page: 1,
pageNum: 20,
content: '',
ifmore: false,
scrollX: false,
height:'',
}
},
created () {
this.height = document.documentElement.clientHeight-110
this.feedback()
},
methods: {
tochat (id) {
this.$router.push(
{ path: '/chatrecord', query: { id: id } }
)
},
goBack () {
this.$router.go(-1)
},
scrollEnd () {
if (this.ifmore) {
++this.page
this.feedback()
}
// else {
// this.$toast({ message: '没有更多了', duration: 1000 })
// }
},
// 学情反馈接口
async feedback () {
const params = {
page: this.page,
page_num: this.pageNum
}
const reslist = await this.api.feedback(params)
if (reslist.code === 1) {
const res = reslist.data.list.data
if (res.length === 0) {
this.ifmore = false
this.feed = this.feed.concat(res)
} else {
this.ifmore = true
this.feed = this.page === 1 ? res : this.feed.concat(res)
}
} else {
this.$toast(reslist.msg)
}
},
// 讲师评析点击事件
async evaluateClick (item) {
this.content = item
this.ifmodel = true
// if (item.is_read === 0) {
// const params = {
// train_class_id: item.train_class_id
// }
// const reslist = await this.api.evaluate(params)
// if (reslist.code === 1) {
// this.feedback()
// } else {
// this.$toast(reslist.msg)
// }
// }
}
}
}
</script>
<style lang="scss" scoped>
.fecknav{
position: fixed;
top: 0;
background: #fff;
z-index: 8;
}
.feckcontent{
margin-top: 0.88rem;
}
.feed_item{
width: 100%;
height: auto;
padding: 0.32rem;
box-sizing: border-box;
border-bottom: 0.01rem solid #eee;
}
.feed_item .img{
width: 2.32rem;
height: 1.28rem;
margin-right: 0.24rem;
}
.feed_title{
font-size: 0.28rem;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
line-height: 0.44rem;
}
.feed_time{
color: rgba(150,151,153,1);
font-size: 0.24rem;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
line-height: 0.4rem;
margin-top: 0.06rem;
}
.btns{
display: flex;
align-items: center;
justify-content: flex-end;
}
.feed_but{
width: 1.44rem;
height: 0.56rem;
border-radius: 0.08rem;
opacity: 1;
background: rgba(37.19,124.31,255,1);
color: rgba(255,255,255,1);
font-size: 0.24rem;
font-weight: 500;
line-height: 0.56rem;
text-align: center;
float: right;
position: relative
}
.red{
width: 0.13rem;
height: 0.13rem;
background-color: red;
border-radius:50%;
position: absolute;
top: -2px;
right: -2px;
}
.feedmodel{
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
position: fixed;
top: 0;
left: 0;
z-index: 3;
}
.feedmodel_close{
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.3);
position: fixed;
top: 0;
left: 0;
z-index: 4;
}
.feedmodel_cont img{
width: 5.9rem;
height: 1.6rem;
}
.feedmodel_cont{
width: 5.9rem;
height: 5.36rem;
border-radius: 0.08rem;
opacity: 1;
background: rgba(255,255,255,1);
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
z-index: 5;
}
.feedmodel_detail{
color: rgba(100,101,102,1);
font-size: 0.28rem;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
line-height: 0.48rem;
padding: 0.32rem;
box-sizing: border-box;
}
.red{
width: 0.13rem;
height: 0.13rem;
background-color: red;
}
.marginleft{
margin-left: 10px;
}
</style>