function initArticleN() {
// 话题点进去的文章列表
// Top cited / Top read / Top download点进去的文章列表
var J_ID = getQueryString('J_num'); //期刊
var n_ID = getQueryString('n_id'); //话题
if (n_ID != null) {
commonInit()
localStorage.setItem("Journals_num", n_ID);
$('.art_main_con').append('
')
$('.wenz_list').append('all total
')
var urlList = {
list: 'api/Journal/getNewsArticleNew'
}
var high_top = {};
high_top.journal_id = n_ID;
high_top.page = 1;
high_top.limit = 10;
var totalPage;//总页码
var totalRecords;//总数据条数
var pageNo = high_top.page;//当前页码
$.ajax({
type: 'post', url: apiUrl + urlList.list,
data: high_top,
success: function (result) {
if (result.code == 0) {
$('.wenz_list>h4').html('News & Comment');
totalPage = result.data.count % high_top.limit == 0 ? (result.data.count / high_top.limit) : (Math.ceil(result.data.count / high_top.limit));
totalRecords = result.data.count;
$('.wenz_list .tioashu').html(result.data.count);
var arr = result.data.articlelist;
initArticle(arr)
//生成分页
//有些参数是可选的,比如lang,若不传有默认值
kkpager.generPageHtml({
pno: pageNo,
//总页码
total: totalPage,
//总数据条数
totalRecords: totalRecords,
mode: 'click',//默认值是link,可选link或者click
click: function (n) {
this.selectPage(n);
//除了第一页写逻辑跳转
high_top.page = n;
$.ajax({
type: 'post', url: apiUrl + urlList.list,
data: high_top,
success: function (result) {
if (result.code == 0) {
$('.goup-container').click();
totalRecords = result.data.count;
$('.wenz_list .tioashu').html(result.data.count);
initArticle(result.data.articlelist)
} else {
ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error!");
}
})
return false;
}, lang: {
firstPageText: 'First page',
firstPageTipText: 'First page',
lastPageText: 'Last page',
lastPageTipText: 'Last page',
prePageText: 'Previous page',
prePageTipText: 'Previous page',
nextPageText: 'Next page',
nextPageTipText: 'Next page',
totalPageBeforeText: '',
totalPageAfterText: '',
currPageBeforeText: 'on page ',
currPageAfterText: '',
totalInfoSplitStr: ' of ',
totalRecordsBeforeText: '',
totalRecordsAfterText: '',
gopageBeforeText: ' Go to page',
gopageButtonOkText: 'Go',
gopageAfterText: 'page',
buttonTipBeforeText: '第',
buttonTipAfterText: '页'
}
});
} else {
ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error!");
}
})
function initArticle(arr) {
var str = "";
var str = "";
var sgr = "";
var n_ = "0";
var c_ = "0";
for (var i = 0; i < arr.length; i++) {
if (arr[i].type == 'News') {
n_ = '1';
if ((Math.round(Date.parse(new Date()) / 1000) - arr[i].ctime) / 86400 >= 21) {
var tong_geogle = ' ' +
'Google Scholar' //搜索引用次数
} else {
var tong_geogle = '' //少于21天隐藏
}
if (arr[i].icon == '') {
var img_i = 'img/baiss.png'
} else {
var img_i = imgarticleUrl + arr[i].icon
}
var baseInfo = commonGetItemHtml({ data: arr[i], i: i, img_i: img_i, c_t_a: 'different', tong_geogle: tong_geogle })
str += `
${baseInfo.otStat}${arr[i].title}
${arr[i].authortitle} ${localStorage.getItem("Journals_title")}. ${arr[i].stage_year}, ${arr[i].stage_vol}${baseInfo.stage_}${baseInfo.npp_}
${baseInfo.doi_}
${baseInfo.link_}
`
}
else if (arr[i].type == 'Comment') {
c_ = '1';
if ((Math.round(Date.parse(new Date()) / 1000) - arr[i].ctime) / 86400 >= 21) {
var tong_geogle = ' ' +
'Google Scholar' //搜索引用次数
} else {
var tong_geogle = '' //少于21天隐藏
}
if (arr[i].icon == '') {
var img_i = 'img/baiss.png'
} else {
var img_i = imgarticleUrl + arr[i].icon
}
var baseInfo = commonGetItemHtml({ data: arr[i], i: i, img_i: img_i, c_t_a: 'different', tong_geogle: tong_geogle })
sgr += `
${baseInfo.otStat}${arr[i].title}
${arr[i].authortitle} ${localStorage.getItem("Journals_title")}. ${arr[i].stage_year}, ${arr[i].stage_vol}${baseInfo.stage_}${baseInfo.npp_}
${baseInfo.doi_}
${baseInfo.link_}
`
}
}
if (n_ == "0") {
str = ''
} else {
str = 'News
' + ''
}
if (c_ == "0") {
sgr = ''
} else {
sgr = '
Comment
'
}
$('.wenz_list').html(str + sgr);
$('.links_ .txt_copy').css('background', localStorage.Journals_color);
commonHandleClickHtml()
}
}
}