取消收藏等

This commit is contained in:
chenyang
2022-07-24 09:04:15 +08:00
parent e878ba145b
commit 344072efc7
3 changed files with 33 additions and 10 deletions
+1 -1
View File
@@ -152,7 +152,7 @@
const container = $('#pagination_div')
/**计算页数*/
if (count <= 0) {
container.empty()
container.html(`<p class="text-center">无数据</p>`)
return
}
+21 -2
View File
@@ -35,6 +35,7 @@
this.jm = null
this.coop_mind_id = null
this.coop_mind_log_id = null
/**是否通过分享链接访问*/
this.from_share = null
}
// prototype
@@ -144,8 +145,6 @@
/**收藏或者取消收藏*/
star: function () {
const coop_mind_id = this.coop_mind_id
console.log(`this.from_share:${this.from_share}`)
// ajax start
$.ajax({
type: "post",
@@ -159,8 +158,27 @@
async: false
});
// ajax end
},
/**取消收藏*/
un_star: function () {
const coop_mind_id = this.coop_mind_id
// ajax start
$.ajax({
type: "delete",
url: "star",
headers: {"X-CSRFToken": $.cookie("csrftoken")},
data: {'coop_mind_id': coop_mind_id},
dataType: "json",
success: function (resp) {
common_alert(resp.msg)
},
async: false
});
// ajax end
}
}
/***/
$(function () {
const xxObj = new fetch()
xxObj.loadMind()
@@ -173,6 +191,7 @@
<div style="position: absolute;top: 0px;z-index: 1000;cursor: pointer;" onclick="xxObj.collapse_all()"><span data-feather="folder-minus"></span><span class="un_selected">折叠</span></div>
<div style="position: absolute;top: 0px;left:80px;z-index: 1000;cursor: pointer;" onclick="xxObj.expand_all()"><span data-feather="folder-plus"></span><span class="un_selected">展开</span></div>
<div style="position: absolute;top: 0px;left:160px;z-index: 1000;cursor: pointer;" onclick="xxObj.star()"><span data-feather="star"></span><span class="un_selected">收藏</span></div>
<div style="position: absolute;top: 0px;left:240px;z-index: 1000;cursor: pointer;" onclick="xxObj.un_star()"><span data-feather="arrow-up-circle"></span><span class="un_selected">取消收藏</span></div>
<h3 id="h1" style="text-align: center;max-height: 40px;"></h3>
<div id="jsmind_container"></div>
</body>