Files
journal_com/js/scientist/scientist_cite.js
2024-09-23 13:19:35 +08:00

152 lines
5.8 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function initCite() {
var cite_ID = getQueryString('cite_id'); //Top cited
// Top cited点进去的文章列表
if (cite_ID != null) {
var urlList = {
list: 'api/Main/getAllCiteArticles'
}
// cited
commonInit()
var cited_tcp = {};
cited_tcp.page = 1;
cited_tcp.limit = 10;
cited_tcp.type = 'cite';
var totalPage;//总页码
var totalRecords;//总数据条数
var pageNo = cited_tcp.pageIndex;//当前页码
$.ajax({
type: 'post', url: apiUrl + urlList.list,
data: cited_tcp,
success: function (result) {
if (result.code == 0) {
$('.wenz_list>h4').html('Top cited');
totalPage = result.data.count % cited_tcp.limit == 0 ? (result.data.count / cited_tcp.limit) : (Math.ceil(result.data.count / cited_tcp.limit));
totalRecords = result.data.count;
$('.wenz_list .tioashu').html(result.data.count);
initArticle(result.data.list)
//生成分页
//有些参数是可选的比如lang若不传有默认值
kkpager.generPageHtml({
pno: pageNo,
//总页码
total: totalPage,
//总数据条数
totalRecords: totalRecords,
mode: 'click',//默认值是link可选link或者click
click: function (n) {
this.selectPage(n);
//除了第一页写逻辑跳转
cited_tcp.page = n;
$.ajax({
type: 'post', url: apiUrl + urlList.list,
data: cited_tcp,
success: function (result) {
if (result.code == 0) {
$('.goup-container').click();
totalRecords = result.data.count;
$('.wenz_list .tioashu').html(result.data.count);
$('.wenz_list>h4').html('Top cited');
initArticle(result.data.list)
} 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 = "";
for (var i = 0; i < arr.length; i++) {
if (arr[i].icon == '') {
continue
}
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: '' })
str += `
<li>
<div class="dbt_header">${arr[i].type}${baseInfo.pub_date}</div><a id="${arr[i].article_id}" target="_blank"
href="article.html?J_num=${arr[i].journal_id}&a_id=${arr[i].article_id}"
class="txt_biaoti">${baseInfo.otStat}${arr[i].title}</a>
<div class="authorList">${arr[i].authortitle}<br>
${arr[i].journal_title}.&nbsp;${arr[i].stage_year},&nbsp;${arr[i].stage_vol}${baseInfo.stage_}${baseInfo.npp_}<a
target="_blank" href="https://doi.org/${arr[i].doi}">${baseInfo.doi_}</a>
</div>
<div class="links_">${baseInfo.link_}</div>
<div class="apwrap"><a onclick="imgbig(this)" class="imgdiv">${baseInfo.person_img}</a>${baseInfo.trad_tion}<br
clear="both"></div>
</li>
`
}
$('.wenz_list>ul').html(str);
$('.links_ .txt_copy').css('background', localStorage.Journals_color);
commonHandleClickHtml()
}
}
}