【商品详情】

1. 接入评论逻辑
This commit is contained in:
YunaiV committed 2023-06-10 00:17:07 +08:00
1 parent 8fbdec3738
commit 33311ae19c
3 files changed
+69 -61

No files matched your search

+31 -30
View File
@@ -1,39 +1,37 @@
<template>
<view class="evaluateWtapper" v-if="reply.length > 0">
<view class="evaluateItem" v-for="(item, indexw) in reply" :key="indexw">
<view class="evaluateItem" v-for="(item, index) in reply" :key="index">
<view class="pic-text acea-row">
<view class="pictrue">
<image :src="item.avatar"></image>
<image :src="item.userAvatar"></image>
</view>
<view class="content">
<view>
<view class="acea-row row-between">
<view class="acea-row">
<view class="name line1">{{ item.nickname }}</view>
<view class="start" :class="'star' + item.score"></view>
<view class="name line1">{{ item.userNickname }}</view>
<view class="start" :class="'star' + item.scores"></view>
</view>
<view class="time">{{ item.createTime }}</view>
<view class="time">{{ formatDate(item.createTime) }}</view>
</view>
<view class="sku">规格:{{ item.sku?item.sku:'无' }}</view>
</view>
<view class="evaluate-infor">{{ item.comment }}</view>
<view class="imgList acea-row" v-if="item.pics && item.pics.length && item.pics[0]">
<view class="pictrue" v-for="(itemn, indexn) in item.pics" :key="indexn">
<image :src="itemn" class="image" @click='getpreviewImage(indexw, indexn)'></image>
<view class="evaluate-infor">{{ item.content }}</view>
<view class="imgList acea-row" v-if="item.picUrls && item.picUrls.length > 0">
<view class="pictrue" v-for="(picUrl, indexn) in item.picUrls" :key="indexn">
<image :src="picUrl" class="image" @click='getpreviewImage(index, indexn)'></image>
</view>
</view>
<view class="reply" v-if="item.merchantReplyContent">
<text class="font-color">店小二</text>:{{ item.merchantReplyContent }}
<view class="reply" v-if="item.replyContent">
<text class="font-color">店小二</text>:{{ item.replyContent }}
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import dayjs from "@/plugin/dayjs/dayjs.min.js";
export default {
props: {
reply: {
@@ -47,10 +45,13 @@
methods: {
getpreviewImage: function(indexw, indexn) {
uni.previewImage({
urls: this.reply[indexw].pics,
current: this.reply[indexw].pics[indexn]
urls: this.reply[indexw].picUrls,
current: this.reply[indexw].picUrls[indexn]
});
}
},
formatDate: function(date) {
return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
}
}
}
</script>
@@ -61,11 +62,11 @@
border-bottom-left-radius: 14rpx;
border-bottom-right-radius: 14rpx;
}
.evaluateWtapper .evaluateItem~.evaluateItem {
border-top: 1rpx solid #f5f5f5;
}
.evaluateWtapper .evaluateItem .pic-text {
font-size: 26rpx;
color: #282828;
@@ -74,26 +75,26 @@
margin-left: 20rpx;
}
}
.evaluateWtapper .evaluateItem .pic-text .pictrue {
width: 62rpx;
height: 62rpx;
}
.evaluateWtapper .evaluateItem .pic-text .pictrue image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.evaluateWtapper .evaluateItem .pic-text .name {
max-width: 450rpx;
}
.evaluateWtapper .evaluateItem .time {
font-size: 24rpx;
color: #999999;
}
.sku{
font-size: 24rpx;
@@ -105,12 +106,12 @@
color: #333;
margin-bottom: 14rpx;
}
.evaluateWtapper .evaluateItem .imgList {/*
.evaluateWtapper .evaluateItem .imgList {/*
padding: 0 24rpx;
margin-top: 16rpx; */
}
.evaluateWtapper .evaluateItem .imgList .pictrue {
width: 102rpx;
height: 102rpx;
@@ -119,14 +120,14 @@
margin-bottom: 16rpx;
/* margin: 0 0 15rpx 15rpx; */
}
.evaluateWtapper .evaluateItem .imgList .pictrue image {
width: 100%;
height: 100%;
background-color: #f7f7f7;
border-radius: 14rpx;
}
.evaluateWtapper .evaluateItem .reply {
font-size: 26rpx;
color: #454545;
@@ -136,7 +137,7 @@
padding: 20rpx;
position: relative;
}
.evaluateWtapper .evaluateItem .reply::before {
content: "";
width: 0;