first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
(function(){
var LikeData = localStorage.getItem("like") == null
? []
: JSON.parse(localStorage.getItem("like"));
function renderLike () {
if(LikeData.length == 0) {
$(".list-theme1").append("<p class='error'>没有收藏</p>")
} else {
LikeData.forEach(val => {
$(".list-theme1").append(`<a href="#" class="list-item">
<div class="list-img">
<img src="${val.albums[0]}">
</div>
<div class="list-mes">
<h3 class="list-title">${val.title}</h3>
</div>
</a>`)
});
}
}
function BindTagaClick() {
$("article a").on('click', function() {
localStorage.setItem("info", JSON.stringify(LikeData[$(this).index()]))
location.href="info.html"
});
var $as = $('#J_ActionSheet'), index = null;
$(".list-theme1 .list-item").on({
touchstart: function(e){
index = $(this).index()
setTimeout(function(){
$as.actionSheet('open');
},500);
}
});
$('.delete-like').on("click",function() {
LikeData.splice(index,1);
localStorage.setItem("like", JSON.stringify(LikeData));
$("article a").eq(index).remove();
$as.actionSheet('close');
if(LikeData.length == 0) {
$(".list-theme1").append("<p class='error'>没有收藏</p>")
}
})
$("#J_Cancel").on("click",function() {
$as.actionSheet('close');
})
}
renderLike()
BindTagaClick()
})()