<template>
|
|
<view class="comment-card">
|
|
<uv-avatar :src="item.hanHaiMember.headImage" size="44" shape="circle" class="avatar" />
|
|
<view class="comment-main">
|
|
<view class="comment-header">
|
|
<text class="username">{{ item.hanHaiMember.nickName }}</text>
|
|
<text class="from">来自《{{ item.commonShop.name }}》</text>
|
|
</view>
|
|
<view class="comment-content">{{ item.comment }}</view>
|
|
<view class="comment-footer">
|
|
<text class="comment-time">{{ item.createTime }}</text>
|
|
|
|
|
|
<view class="reply-btn-wrap"
|
|
v-if="edit"
|
|
@click="deleteItem(item)">
|
|
<text class="reply-btn">删除</text>
|
|
</view>
|
|
|
|
<view class="reply-btn-wrap"
|
|
v-else
|
|
@click="goToReply(item)">
|
|
<text class="reply-btn">回复</text>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: ['item', 'edit'],
|
|
data() {
|
|
return {
|
|
|
|
}
|
|
},
|
|
methods: {
|
|
goToReply(item) {
|
|
|
|
// this.$fetch('updateCommentRead', {
|
|
// commentId : item.id,
|
|
// })
|
|
|
|
uni.navigateTo({
|
|
url: '/pages_order/comment/respondComments?id=' + item.id
|
|
})
|
|
},
|
|
deleteItem(item){
|
|
|
|
uni.showModal({
|
|
title : '确认删除该评论吗',
|
|
success : (r) => {
|
|
if (r.confirm) {
|
|
this.$fetch('deleteComment', {
|
|
commentId : item.id,
|
|
}).then(res => {
|
|
this.$emit('getData')
|
|
})
|
|
}
|
|
}
|
|
})
|
|
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.comment-card {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
margin-bottom: 32rpx;
|
|
|
|
.avatar {
|
|
width: 56rpx;
|
|
height: 56rpx;
|
|
border-radius: 50%;
|
|
margin-right: 16rpx;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.comment-main {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
margin-left: 10rpx;
|
|
}
|
|
|
|
.comment-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12rpx;
|
|
margin-bottom: 4rpx;
|
|
}
|
|
|
|
.username {
|
|
font-size: 26rpx;
|
|
color: #222;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.from {
|
|
font-size: 22rpx;
|
|
color: #bdbdbd;
|
|
}
|
|
|
|
.comment-content {
|
|
font-size: 26rpx;
|
|
color: #333;
|
|
margin-bottom: 12rpx;
|
|
}
|
|
|
|
.comment-footer {
|
|
display: flex;
|
|
align-items: center;
|
|
font-size: 22rpx;
|
|
color: #bdbdbd;
|
|
justify-content: space-between;
|
|
padding-right: 8rpx;
|
|
}
|
|
|
|
.comment-time {
|
|
color: #bdbdbd;
|
|
}
|
|
|
|
.reply-btn-wrap {
|
|
display: flex;
|
|
align-items: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.reply-btn {
|
|
color: #223a6b;
|
|
font-weight: 500;
|
|
margin-left: 0;
|
|
font-size: 24rpx;
|
|
}
|
|
|
|
.history-section {
|
|
margin-top: 24rpx;
|
|
}
|
|
}
|
|
</style>
|