Merge branch 'feature/comment-0620-ch' into msb_test

fix/0701-ch
ch 2 years ago
commit 6cc4720315

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-21 18:19:13
* @LastEditors: ch
* @LastEditTime: 2022-06-30 11:53:04
* @LastEditTime: 2022-06-30 14:37:57
* @Description: file content
-->
<template>
@ -16,6 +16,15 @@
<view class="reply-title">全部评论( {{detail.replyCount}})</view>
<view class="reply">
<template v-if="detail.replyCount">
<view class="reply--item" v-if="detail.merchantComment" @click="handleAnswer(detail.merchantComment)">
<view class="reply--title">
<text>
{{detail.merchantComment.userName}}
</text>
<text>{{detail.merchantComment.createTime}}</text>
</view>
<view class="reply--ctx">{{detail.merchantComment.commentContent}}</view>
</view>
<view class="reply--item" v-for="item in detail.answerCommentList" :key="item.id" @click="handleAnswer(item)">
<view class="reply--title">
<text>
@ -98,12 +107,12 @@ export default {
this.isLike = result.isLike || false;
this.detail.usefulCount = this.detail.usefulCount || 0;
this.detail.replyCount = this.detail.replyCount || 0;
if(result.merchantComment){
this.detail.answerCommentList.unshift({
...result.merchantComment,
parentId : result.id
})
}
// if(result.merchantComment){
// this.detail.answerCommentList.unshift({
// ...result.merchantComment,
// parentId : result.id
// })
// }
}
},
async handleSubmit(){
@ -115,7 +124,7 @@ export default {
}
const {error, result} = await ApiPostComment(data);
if(!HandleApiError(error)){
this.detail.answerCommentList.push({
this.detail.answerCommentList.unshift({
...result,
userName : this.$store.state.userInfo.nickname,
parentUserName: this.answer ? this.answer.userName : ''

Loading…
Cancel
Save