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

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

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

Loading…
Cancel
Save