evaluate.vue
6 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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<template>
<view>
<image src="../../static/beijing.png" class="background" mode=""></image>
<!-- 头部 -->
<view class="commentView" v-for="(item,index) in commentList" :key="index">
<view class="head">
<!-- 图片 -->
<view class="headPortrait">
<image class="headPortraitImg" :src="item.UserImg" mode=""></image>
</view>
<!-- 名称 和id-->
<view class="userName">
<!-- 用户名称 -->
<view class="userName-1" style="font-size:25rpx;">
{{item.UserName}}
</view>
<!-- 用户id -->
<view class="userName-1" style="font-size:20rpx;">
ID:{{item.UserId}}
</view>
</view>
</view>
<!-- 评论 评分-->
<view class="commentScore" >
<!-- 评论 -->
<view class="comment">
<view class="commentChart">
<!-- <image src="../../static/shiliang.png" mode=""></image> -->
</view>
<view class="commentText">
评论:{{item.commentContent}}
</view>
</view>
<!-- 评分 -->
<view class="score">
<view class="scoreText">评分:</view>
<rate class="onChange" :value="item.commetNum" disabled></rate>
</view>
</view>
<!-- 图片 -->
<view class="commentImg" v-if="item.commentSendImg[0] !=''">
<view class="commentImg-1">
<!-- @click="previewImg(item.commentSendImg)" -->
<image class="commentImg-1-1" :src='BASE_URL+items' mode="" v-for="(items,index) in item.commentSendImg" :key="index" ></image>
<!-- <image class="commentImg-1-1" src="" mode=""></image>
<image class="commentImg-1-1" src="" mode=""></image>
<image class="commentImg-1-1" src="" mode=""></image> -->
</view>
</view>
<!-- 养护管家回复 -->
<view class="replyFromCarMaintenanceHousekeeper" v-if="item.ReturnName==null?false:true">
{{item.ReturnName}}:{{item.ReturnContent}}
</view>
</view>
</view>
</template>
<script>
import rate from '../../components/rate.vue';
import BASE_URL from '../../common/config.js'
export default {
name: 'evaluate',
data() {
return {
BASE_URL,
// 评论列表
commentList: [],
comentModel: {
"UserId": 0,
"Type": 1,
"KeyWord": "",
"TotalCount": 0,
"PageIndex": 1,
"PageSize": 20,
"Sort": [{
"Field": "add_time",
"Type": 1
}]
},
// 用户评论图片数据
// commentImgList:[]
}
},
onLoad() {
this.ShowComment()
},
onShow() {
// this.IsLogin()
},
methods: {
previewImg(itemarray){
let url='https://shangten.yiqituancity.com'
let _this = this;
let imgsArray = [];
itemarray.forEach((itesm,index)=>{
imgsArray.push(url+itesm);
})
uni.previewImage({
urls: imgsArray,
indicator: 'number',
loop: true
});
},
ce(){
uni.navigateTo({
url:'resultEvaluate/resultEvaluate',
})
},
onChange(d) {
console.log(d)
},
// 查询所有经过审核的评论
ShowComment(){
this.API.GetCommentList(this.comentModel).then(res=>{
console.log('数据',res)
res.data.data.rows.forEach((item,index)=>{
item.commentSendImg=item.commentSendImg.split(',')
if(item.UserImg.startsWith('https')==false){
item.UserImg='https://shangten.yiqituancity.com'+item.UserImg
}
})
// console.log('上传图片数据',this.commentImgList)
this.commentList=res.data.data.rows
console.log('评论数据',this.commentList)
this.comentModel.TotalCount=res.data.data.total
})
},
// 判断是否授权登录
IsLogin() {
let jsonstorage = uni.getStorageSync('userinfo')
if (jsonstorage == undefined || jsonstorage == '' || jsonstorage == null) {
uni.redirectTo({
url: '../login/login',
})
return
}
},
},
components: {
rate
}
}
</script>
<style>
.commentView{
border-bottom: 1px solid rgb(242, 226, 172,0.5);
}
/* 背景图片 */
.background {
width: 100%;
height: 100%;
position: fixed;
background-size: 100% 100%;
z-index: -1;
}
/* 头部 */
.head {
width: 700rpx;
height: 130rpx;
display: flex;
margin: 0 auto;
}
/* 图片 */
.headPortrait {
width: 80rpx;
height: 80rpx;
margin-top: 47rpx;
border-radius: 40rpx;
overflow: hidden;
}
.headPortraitImg {
width: 100%;
height: 100%;
}
/* 名称和id */
.userName {
width: 50%;
height: 80rpx;
margin-top: 47rpx;
margin-left: 37rpx;
display: flex;
flex-direction: column;
}
.userName-1 {
width: 100%;
height: 50%;
color: #ffffff;
display: flex;
align-items: center;
}
/* 评论 评分 */
.commentScore {
width: 700rpx;
min-height: 50rpx;
margin: 0 auto;
/* border: #008000 solid 2rpx; */
display: flex;
margin-top: 15rpx;
}
.comment {
width: 50%;
height: 100%;
/* background-color: #007AFF; */
display: flex;
align-items: center;
}
.commentChart {
/* background-color: #AD1212; */
width: 30rpx;
height: 30rpx;
background-image: url(../../static/shiliang.png);
background-size: 100%;
}
.commentText {
width: 300rpx;
height: 30rpx;
margin-left: 8rpx;
color: #FFFFFF;
font-size: 22rpx;
/* overflow: auto; */
text-overflow: ellipsis;
}
/* 评分 */
.score {
width: 50%;
height: 100%;
/* background-color: #8A6DE9; */
display: flex;
justify-content: flex-end;
align-items: center;
}
.scoreText {
width: 80rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
font-size: 20rpx;
color: #FFFFFF;
}
.onChange {
width: 200rpx;
height: 40rpx;
/* background-color: #007AFF; */
display: flex;
align-items: center;
}
/* 评论图片 */
.commentImg {
width: 700rpx;
height: 100%;
/* background-color: #007AFF; */
margin: 10rpx auto;
display: flex;
margin-top: 10px;
}
.commentImg-1-1 {
/* width: 100%;
height: 100%; */
width: 148rpx;
height: 148rpx;
margin-right: 28rpx;
}
/* 汽车养护管家回复 */
.replyFromCarMaintenanceHousekeeper {
width: 700rpx;
height: 100%;
margin: 12rpx auto;
/* border: #008000 solid 2rpx; */
font-size: 23rpx;
color: #f9c777;
line-height: 40rpx;
}
</style>