提交评论功能

This commit is contained in:
2024-05-06 12:35:09 +08:00
parent 645aafcadb
commit e48d34c52c
10 changed files with 215 additions and 8 deletions
+19 -3
View File
@@ -106,6 +106,7 @@
if (page_tag === 'b9b101e') {
sub_btn = `<a class="dropdown-item" href="javascript:void(0);" onclick="window.open('2_d?id=${item.id}&s_p=b9b101e')">协同脑图</a>
<a class="dropdown-item" href="javascript:void(0);" onclick="mind.open_bianji(${item.id})">协同编辑</a>
<a class="dropdown-item" href="javascript:void(0);" onclick="mind.open_pinglun(${item.id})">评论</a>
<a class="dropdown-item" href="javascript:void(0);" onclick="mind.del_mind(${item.id},'card_${uuid}')">删除</a>`
@@ -144,9 +145,9 @@
});
},
/**显示分享链接*/
show_share_url: function (u, h) {
const url = `s_2_d?u=${u}&h=${h}`
$('#share_mind_modal .modal-body').html(`分享成功,请复制以下链接进行分享:<div>${window.location.protocol}//${window.location.host}/${url}</div>`)
show_share_url: function (u) {
const url = `2_pinglun?id=${u}`
$('#share_mind_modal .modal-body').html(`评论链接生成成功,请打开下面链接进行评论:<div>${window.location.protocol}//${window.location.host}/${url}</div>`)
$('#share_mind_modal_a').click()
},
/**分页组件*/
@@ -233,6 +234,20 @@
async: false
});
},
open_pinglun: function (mind_id) {
const me = this
$.ajax({
type: "post",
url: "pinglun",
headers: {"X-CSRFToken": $.cookie("csrftoken")},
data: {'id': mind_id},
dataType: "json",
success: function (resp) {
me.show_share_url(mind_id)
},
async: false
});
},
/**取消分享*/
share_cancel: function (mind_id) {
const me = this
@@ -671,6 +686,7 @@
<!-- 右侧内容 end-->
</div>
</div>
<!--导航 和 内容 end-->
</body>
<script src="/static/js/mind/modal.js"></script>