效果图
## 一级评论效果

## 二级评论效果
一级评论以及二级评论初步实现

二级评论中返回到前端 显示的js代码
spring boot 框架+thymeleaf渲染+ajax实现
前端 production.html
/*回复商品按钮(一级评论)*/
<input type="hidden" id="production_id" th:value="${productiondto.id}">
<textarea class="form-control comment" rows="6" id="comment_content"></textarea>
<button type="button" class="btn btn-success btn-comment" onclick="post()">回复</button>
/*显示二级评论按钮*/
<span class="comment-func-second" th:data-id="${comment.id}"
onclick="secondComment(this)">
/*二级评论提交按钮*/
<button type="button" class="btn btn-success pull-right btn-seccond"
th:data-id="${comment.id}" onclick="postsecond(this)">提交
</button>
前端 JavaScript :
一级评论用POST
二级评论用GET
function commitComment(targetId, content, type) {
$.ajax({
type: "POST",
url: "/comment",
contentType: 'application/json',
data: JSON.stringify({
"parentId": targetId,
"content": content,
"type": type
}),
success: function (ret) {
console.log(ret);
if(ret.code == 2120){
window.location.reload()