commentDetail.vue
2.67 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
<!-- 评论详情 -->
<template>
<div class="comment-detail marketing edit-box">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<div class="comment-container">
<div class="flex">
<img class="img-100" :src="commentInfo.goodsImage" />
<span class="good-name">{{ commentInfo.goodsName }}</span>
</div>
<div class="flex m-t-24">
<span class="comment-label">评分星级:</span>
<img v-for="(item, index) in starList" :key="index" class="icon-star" src="@/assets/icon-star.png" />
</div>
<div class="flex m-t-24">
<span class="comment-label">评价内容:</span>
<span class="comment-txt">{{ commentInfo.commentContent || '-' }}</span>
</div>
<div v-show="commentInfo.imgUrls" class="m-t-24">
<span class="comment-label">图片:</span>
<div class="flex" style="flex-wrap: wrap;">
<span v-for="(item, index) in commentInfo.imgUrls" :key="index">
<el-image class="img-60 comment-img" :src="item" :preview-src-list="[item]"></el-image>
</span>
</div>
</div>
</div>
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">返回</el-button>
</GLFooter>
</div>
</template>
<script>
export default {
name: 'commentDetail',
data() {
return {
size: 'small',
title: '评论详情',
editChildRef: 'editChildRef',
routeInfo: {
id: ''
},
starList: [],
commentInfo: {}
}
},
mounted() {
this.setMinHeight()
this.routeInfo = this.$route.query
this.getInfo()
},
methods: {
getInfo() {
this.$apis.orderComment.commentDetailApi({ id: this.routeInfo.id }).then(res => {
this.commentInfo = res || {}
this.starList = new Array(this.commentInfo.starLevel)
})
},
handleCancel() {
this.$router.push({
path: '/orderComment/index'
})
}
}
}
</script>
<style>
.comment-detail .comment-container {
padding: 32px 52px;
color: #333333;
font-size: 14px;
}
.comment-detail .comment-container .flex {
justify-content: flex-start;
}
.comment-detail .comment-container .m-t-24 {
margin-top: 24px;
}
.comment-detail .comment-label {
display: inline-block;
width: 80px;
line-height: 20px;
flex-shrink: 0;
}
.comment-detail .comment-txt {
line-height: 20px;
word-break: break-all;
}
.comment-detail .good-name {
padding-left: 20px;
font-size: 16px;
font-weight: 500;
}
.comment-detail .icon-star {
width: 20px;
height: 20px;
}
.comment-detail .comment-img {
margin-top: 10px;
margin-right: 20px;
}
</style>