'
str+=value.title
str+='
'
if(value.read_num){
str+='
阅读'+value.read_num+'
'
}
if(value.send_time&&value.send_time!=0){
const date = new Date(value.send_time * 1000); // 转换为毫秒
// 获取日期和时间部分
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以加1
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
// 格式化输出
const formattedDate = year+'-'+month+'-'+day+' '+hours+':'+minutes;
str+='
'+formattedDate+'
'
}else{
let publishDate = value.publish_date
if(publishDate){
const formattedDate = publishDate.slice(0, 4) + '-' + publishDate.slice(4, 6) + '-' + publishDate.slice(6);
str+='
'+formattedDate+'
'
}
}
str+='
'
str+='
'
}
str+=''
})
}
}
}
if(str){
$('.zixun-wrap').append(str)
}else{
$('.zixun-wrap').hide()
}
}
window.addEventListener("scroll",function(){
//console.log(window.scrollY);
var div = document.getElementById('flex-wrap');
var scrollPosition = window.scrollY; // 获取当前滚动距离
if (scrollPosition >= 100) {
let index = scrollPosition>300?1:scrollPosition/300
div.style.backgroundColor = 'rgb(188, 211, 253'+index+')'; // 滚动到 100px 后变为指定颜色
} else {
div.style.backgroundColor = 'transparent'; // 滚动回顶部时恢复透明
}
},true);
// 打开筛选
function openShaixuan(){
let top = "";
let height="";
top = document.querySelector(".moban_checkbox").getClientRects()[0].top;
height = document.querySelector("body").getClientRects()[0].height
console.log(top)
document.querySelector(".shaixuan_mask").style.top = top+10+"px"
document.querySelector(".shaixuan_mask").style.height = height+"px"
$(".shaixuan_mask").show();
$(".open_shaixuan").hide();
$(".close_shaixuan").show();
let tabs = document.getElementsByClassName("moban-card-tab");
for(let i=0;i