Files

166 lines
3.1 KiB
Vue
Raw Normal View History

2023-10-11 11:27:47 +08:00
<template>
2023-11-14 17:21:03 +08:00
<view
:class="{
2023-10-11 11:27:47 +08:00
reply: true,
noPic: !data?.pics
2023-11-14 17:21:03 +08:00
}"
>
2023-10-11 11:27:47 +08:00
<view class="reply-content">
2023-11-14 17:21:03 +08:00
<view class="reply-warp">
<view class="reply-user">
<view class="reply-user-pic">
<image
class="img"
:src="data.avatar"
@click="doPreviewImage(0,[data.avatar])"
/>
2023-10-11 11:27:47 +08:00
</view>
2023-11-14 17:21:03 +08:00
<view class="reply-user-name">
<view class="name">
{{ data.nickname }}
</view>
<view class="productScore">
<uv-rate
count="5"
:value="data.productScore"
readonly
size="26rpx"
gutter="1"
active-color="#ee6d46"
inactive-color="#999999"
></uv-rate>
</view>
2023-10-11 11:27:47 +08:00
</view>
</view>
2023-11-14 17:21:03 +08:00
<view class="reply-time">{{ data.createTime }}</view>
2023-10-11 11:27:47 +08:00
</view>
<view class="reply-text">
{{ data.comment }}
</view>
2023-11-14 17:21:03 +08:00
<view
class="reply-pic flex flex-ai__center"
2023-11-15 19:59:37 +08:00
v-if="data.pics && data.pics.filter(item=>!!item).length>0"
2023-11-14 17:21:03 +08:00
>
<template
2023-11-15 19:59:37 +08:00
v-for="(pic,index) in data.pics.filter(item=>!!item)"
2023-11-14 17:21:03 +08:00
:key="index"
>
<image
class="image"
:src="pic"
@click="doPreviewImage(index, data.pics)"
/>
</template>
</view>
<view class="reply-sku">规格{{data.sku}}</view>
2023-10-11 11:27:47 +08:00
</view>
2023-11-14 17:21:03 +08:00
2023-10-11 11:27:47 +08:00
</view>
</template>
<script setup>
2023-11-14 17:21:03 +08:00
import { toRefs } from 'vue';
import { useImage } from "@/hooks/useImage";
2023-10-11 11:27:47 +08:00
const props = defineProps(['data'])
2023-11-14 17:21:03 +08:00
const {data} = toRefs(props);
const {preview} = useImage()
function doPreviewImage(current, urls) {
preview({
current,
urls,
})
}
2023-10-11 11:27:47 +08:00
</script>
2023-11-14 17:21:03 +08:00
<style lang="scss">
2023-10-11 11:27:47 +08:00
.reply {
2023-11-14 17:21:03 +08:00
border-top: 1rpx solid #E6E6E6;
padding-bottom: 10rpx;
&-content {
padding: 32rpx 34rpx;
border-right: 0;
flex: 1;
font-size: 30rpx;
color: #333333;
2023-10-11 11:27:47 +08:00
2023-11-14 17:21:03 +08:00
.reply-warp {
display: flex;
justify-content: space-between;
align-items: center;
2023-10-11 11:27:47 +08:00
2023-11-14 17:21:03 +08:00
.reply-time {
font-size: 24rpx;
line-height: 1em;
color: #999999;
}
}
}
&.noPic {
.reply-content {
}
2023-10-11 11:27:47 +08:00
}
&-pic {
2023-11-14 17:21:03 +08:00
//width: 180rpx;
//height: 180rpx;
//background: #FFFFFF;
//border-radius: 15rpx;
padding: 0 24rpx;
2023-10-11 11:27:47 +08:00
}
&-user {
display: flex;
align-items: center;
margin-bottom: 16rpx;
&-pic {
border-radius: 50%;
2023-11-14 17:21:03 +08:00
margin-right: 20rpx;
2023-10-11 11:27:47 +08:00
.img {
2023-11-14 17:21:03 +08:00
width: 70rpx;
height: 70rpx;
2023-10-11 11:27:47 +08:00
display: block;
border-radius: 50%;
}
}
&-name {
2023-11-14 17:21:03 +08:00
line-height: 40rpx;
font-size: 28rpx;
2023-10-11 11:27:47 +08:00
color: #333333;
}
}
2023-11-14 17:21:03 +08:00
&-text {
margin-top: 30rpx;
font-size: 28rpx;
line-height: 40rpx;
2023-10-11 11:27:47 +08:00
color: #333333;
}
2023-11-14 17:21:03 +08:00
&-sku{
font-size: 24rpx;
line-height: 33rpx;
color: #999999;
margin-top: 20rpx;
}
}
.reply-pic {
gap: 20rpx;
2023-11-15 19:59:37 +08:00
margin: 20rpx 0;
flex-wrap: wrap;
padding: 0;
2023-11-14 17:21:03 +08:00
.image {
2023-11-15 19:59:37 +08:00
width: 212rpx;
height: 212rpx;
2023-11-14 17:21:03 +08:00
}
2023-10-11 11:27:47 +08:00
}
</style>