修改评论数量

feature/comment-0620-ch
ch 2 years ago
parent a75e6b163c
commit 6892041093

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-06-21 16:01:19 * @Date: 2022-06-21 16:01:19
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-28 21:11:53 * @LastEditTime: 2022-06-29 10:20:40
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -14,7 +14,7 @@
</view> </view>
<view class="thumb--item" @click="$Router.push(`/goodsCommentDetail?id=${commentDetail.id}`)"> <view class="thumb--item" @click="$Router.push(`/goodsCommentDetail?id=${commentDetail.id}`)">
<u-icon name="chat"></u-icon> <u-icon name="chat"></u-icon>
<text>{{answerCount}}</text> <text>{{commentDetail.replyCount}}</text>
</view> </view>
</view> </view>
</template> </template>
@ -35,12 +35,6 @@ export default {
usefulCount : 0 usefulCount : 0
} }
}, },
computed : {
answerCount (){
const arr = this.commentDetail.answerCommentList || [];
return arr.length;
}
},
watch :{ watch :{
commentDetail (){ commentDetail (){
this.isLike = this.commentDetail.isLike; this.isLike = this.commentDetail.isLike;

@ -15,9 +15,9 @@
<!-- <u-icon slot="btns" name="shopping-cart" size="30" color="#FF875B"></u-icon> --> <!-- <u-icon slot="btns" name="shopping-cart" size="30" color="#FF875B"></u-icon> -->
<!-- </BsCommentGoodsInfo> --> <!-- </BsCommentGoodsInfo> -->
</view> </view>
<view class="reply-title">全部评论( {{answerCount}})</view> <view class="reply-title">全部评论( {{detail.replyCount}})</view>
<view class="reply"> <view class="reply">
<template v-if="answerCount"> <template v-if="detail.replyCount">
<view class="reply--item" v-for="item in detail.answerCommentList" :key="item.id" @click="handleAnswer(item)"> <view class="reply--item" v-for="item in detail.answerCommentList" :key="item.id" @click="handleAnswer(item)">
<view class="reply--title"> <view class="reply--title">
<text> <text>
@ -81,9 +81,6 @@ export default {
computed:{ computed:{
placeholder(){ placeholder(){
return this.answer ? `回复:${this.answer.userName}` : '说点什么吧?' return this.answer ? `回复:${this.answer.userName}` : '说点什么吧?'
},
answerCount(){
return this.detail.answerCommentList ? this.detail.answerCommentList.length : 0
} }
}, },
onShow(){ onShow(){

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-06-22 15:15:22 * @Date: 2022-06-22 15:15:22
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-28 20:32:35 * @LastEditTime: 2022-06-29 10:20:34
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -36,7 +36,7 @@
</view> </view>
<view class="thumb--item" @click="$Router.replace(`/goodsCommentDetail?id=${data.id}`)"> <view class="thumb--item" @click="$Router.replace(`/goodsCommentDetail?id=${data.id}`)">
<u-icon color="#fff" name="chat"></u-icon> <u-icon color="#fff" name="chat"></u-icon>
<text>{{answerCount}}</text> <text>{{data.replyCount}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -61,10 +61,6 @@ export default {
imgs(){ imgs(){
const arr = this.data.pictureUrl || []; const arr = this.data.pictureUrl || [];
return arr.split(',') return arr.split(',')
},
answerCount (){
const arr = this.data.answerCommentList || []
return arr.length;
} }
}, },
onShow(){ onShow(){

Loading…
Cancel
Save