修改后管评论

feature/comment-0615-ch
ch 2 years ago
parent 35efab79eb
commit f2d1efac7c

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-15 17:55:43
* @LastEditors: ch
* @LastEditTime: 2022-06-17 18:13:27
* @LastEditTime: 2022-06-23 17:21:28
* @Description: file content
*/
import request from '@/utils/request.js';
@ -20,7 +20,7 @@ export const commentDetail = ({ id }) =>
method: 'get',
});
//获取评论列表
//评论
export const commentAdd = (data) =>
request({
url: '/mall/comment/admin/comment',

@ -54,6 +54,22 @@
<p class="comment--ctx">{{ detailData.followComment.commentContent }}</p>
</template>
</div>
<div class="title">
<b>商家回复</b>
</div>
<ul class="reply" v-if="detailData.merchantComment">
<li class="reply--item">
<div class="reply--title">
{{ detailData.merchantComment.userName }}
<span>({{ detailData.merchantComment.createTime }}) 回复 </span>
</div>
<p class="reply--ctx">{{ detailData.merchantComment.commentContent }}</p>
</li>
</ul>
<div class="reply__emtpy" v-else></div>
<div class="title">
<b>全部回复{{ detailData.answerCommentList?.length || 0 }}</b>
</div>
@ -174,11 +190,8 @@
state.isSubmit = true;
let data = {
commentContent: state.commentContent,
commentType: 3,
parentId: state.reply.id || detailData.value.id,
parentId: detailData.value.id,
originId: detailData.value.id,
userId: store.state.auth.userInfo.userId,
userType: 1,
};
// ID userName
const res = await store.dispatch('comment/add', data);
@ -188,8 +201,6 @@
detailData.value.answerCommentList.push({
...res,
isShow: true,
parentUserName: state.reply.userName,
userName: store.state.auth.userInfo.userName,
});
};
</script>

Loading…
Cancel
Save