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

93 lines
4.0 KiB
JavaScript
Raw 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 initArticleCon() {
// Comment点进去的文章列表
var J_ID = getQueryString('J_num'); //期刊
var con_ID = getQueryString('con_id');
if (con_ID != null) {
commonInit()
localStorage.setItem("Journals_num", con_ID);
var urlList = {
list: 'api/Journal/getNewsArticle'
}
$.ajax({
type: 'post', url: apiUrl + urlList.list,
data: {"journal_id": con_ID},
success: function (result) {
if (result.code == 0) {
if (Jour_num == 1) {
$('.wenz_list>h4').after('<p style="margin-bottom: 15px;padding: 10px 20px;background-color: #fff">We welcome influential scientists to write a field of vision commentary on recent perspectives of seminal articles, hot topic articles, or the latest articles in the research field, to keep readers at the forefront of research and increase the impact of their clinical research. Seminal (classic) articles are papers that included in the Web of Science and reflecting the articles quality and their impact on the field. Hot topic articles are papers that included in the Web of Science and reflecting their representation of cutting-edge trends in scientific research. Comments are typically no longer than 1,500 words and include up to 25 references.</p>');
}
$('.wenz_list>h4').html('Comment');
var arr = result.data.articlelist;
initArticle(arr)
//生成分页
//有些参数是可选的比如lang若不传有默认值
} else {
ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
})
function initArticle(arr) {
var str = "";
for (var i = 0; i < arr.length; i++) {
if ((Math.round(Date.parse(new Date()) / 1000) - arr[i].ctime) / 86400 >= 21) {
var tong_geogle = '<a href = "https://scholar.google.com/scholar?&q=' + arr[i].title.replace('<i>', '').replace('</i>', '').replace(new RegExp('"', "g"), '') + '"' +
'target = "_blank" style="color: ' + localStorage.Journals_color + ';margin-left: 10px;font-weight: 600;"> ' +
'Google Scholar</a>' //搜索引用次数
} 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: '', tong_geogle: tong_geogle })
if (arr[i].type == 'Comment') {
str += ` <li>
<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"><span class="fo_fam">${arr[i].authortitle} </span><br> ${localStorage.getItem("Journals_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>
<div><h3>${arr[i].tradition_tag}</h3>
<p>${baseInfo.trad_tion}</p></div><br
clear="both"></div>
</li>`
}
}
$('.wenz_list>ul').html(str);
$('.links_ .txt_copy').css('background', localStorage.Journals_color);
commonHandleClickHtml()
}
}
}