Files
journal_com/jstmr/journal.js
wangjinlei 6e7ee3dd44 begin
2023-05-18 09:42:12 +08:00

1270 lines
60 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 bf_list() {
// 增加访问次数
$.ajax({
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
data: {'type': Jour_num},
success: function (result) {
if (result.code == 0) {
} else {
// ShowDanger("请求失败!");
}
},
error: function () {
// ShowDanger("error");
}
});
// 上侧话题列表数据
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getJournalTopic',
data: {
"journal_id": Jour_num
},
success: function (result) {
Jour_num = localStorage.Journals_num;
if (result.code == 0) {
// 话题列表
var arr_topic = result.data.topicList;
var wh_topicd = '';
var wh_number = 0;
var panduan = '';
var st_left_tit = "";
var st_left_con = "";
for (var i = 0; i < arr_topic.length; i++) {
if (arr_topic[i].position == "top") {
wh_number += 1;
wh_topicd = 'top'
var st_top_tit = "";
var st_top_con = "";
if (wh_number == '1') {
for (var j = 0; j < arr_topic[i].children.length; j++) {
if (j == 5) break;
var url_href = '';
if (arr_topic[i].children[j].is_final == '1') {
url_href = 'topic_list.html?J_num=' + Jour_num + '&t_id='
} else (
url_href = 'topic.html?J_num=' + Jour_num + '&t_id='
)
st_top_con += '<li><a target="_blank" href="' + url_href + arr_topic[i].children[j].journal_topic_id + '">' +
'<img src="' + imgtopicUrl + arr_topic[i].children[j].icon + '" alt="">' +
'<h3>' + arr_topic[i].children[j].title + '</h3></a></li>'
}
} else {
for (var j = 0; j < arr_topic[i].children.length; j++) {
if (j == 5) break;
var url_href = '';
if (arr_topic[i].children[j].is_final == '1') {
url_href = 'topic_list.html?J_num=' + Jour_num + '&t_id='
} else (
url_href = 'topic.html?J_num=' + Jour_num + '&t_id='
)
st_top_con += '<li><a target="_blank" href="' + url_href + arr_topic[i].children[j].journal_topic_id + '">' +
'<img src="' + imgtopicUrl + arr_topic[i].children[j].icon + '" alt="">' +
'<h3>' + arr_topic[i].children[j].title + '</h3></a></li>'
}
}
st_top_tit = '<div class="topics" style="padding: 0 0 5px 0;"><h4 class="rgb_color" style="font-size: 16px">' + arr_topic[i].title + '</h4>' +
// '<a target="_blank" href="topic.html?J_num=' + Jour_num + '&t_id=' + arr_topic[i].journal_topic_id + '" class="more" target="_blank">More</a>' +
'<ul>' + st_top_con + '</ul></div>' +
'<p style="height: 1px;width: 97%;background-color: #ebf2f6;margin: 5px auto 0 auto;"></p>'
if (wh_number == '1') {
$('.art_top_topic>div>div.topics').html('<ul>' + st_top_con + '</ul>');
} else {
$('.tmr_article>.bng_topic_bei>.art_main_con_topic>div').append(st_top_tit);
}
} else if (arr_topic[i].position == "left" && arr_topic[i].title == "Diseases") {
if (panduan != '1') {
panduan = '1';
for (var j = 0; j < arr_topic[i].children.length; j++) {
if (j == 5) break;
var url_href = '';
if (arr_topic[i].children[j].is_final == '1') {
url_href = 'topic_list.html?J_num=' + Jour_num + '&t_id='
} else (
url_href = 'topic.html?J_num=' + Jour_num + '&t_id='
)
st_left_con += '<li><a target="_blank" href="' + url_href + arr_topic[i].children[j].journal_topic_id + '">' +
'<img src="' + imgtopicUrl + arr_topic[i].children[j].icon + '"/></a>' +
'<h3 style="text-align: center"><a target="_blank" href="' + url_href + arr_topic[i].children[j].journal_topic_id + '">' + arr_topic[i].children[j].title + '</a></h3></li>'
}
st_left_tit = '<div class="topics" style="padding: 0 0 5px 0;"><h4 class="rgb_color" style="font-size: 16px">' + arr_topic[i].title + '</h4>' +
'<a target="_blank" href="topic.html?J_num=' + Jour_num + '&t_id=' + arr_topic[i].journal_topic_id + '" class="more" target="_blank">More</a><ul>' + st_left_con + '</ul></div>'
}
$('.tmr_article>.bng_topic_bei>.art_main_con_topic>div').append(st_left_tit);
}
}
$('.tmr_article>.bng_topic_bei>.art_main_con_topic>div h4').css('color', localStorage.Journals_color);
$('.tmr_article>.bng_topic_bei>.art_main_con_topic>div').children().eq(1).addClass('top_ics');
if (wh_number == '1') {
$('.art_main_con_topic').css('border-bottom', '0');
$('.wh_topicd').css('display', 'none')
}
if (Jour_num == '1') {
$('.art_top_topic').addClass('art_top_topic_tmr')
}
if (wh_topicd == '') {
$('.art_main_con_topic').css('display', 'none')
$('.wh_topicd').css('display', 'none')
}
if (localStorage.Journals_title == '经典中医研究') {
$('.more').html('更多');
}
} else {
// ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
});
// 中侧推广文章
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getJournalArticles',
data: {
"journal_id": Jour_num
},
success: function (result) {
if (result.code == 0) {
var atg = result.data.stage;
if (atg.stage_no == '0') {
var time_ = atg.issue_date + ', Volume ' + atg.stage_vol;
} else {
var time_ = atg.issue_date + ', Volume ' + atg.stage_vol + ' Issue ' + atg.stage_no;
}
if (atg.stage_no == '0') {
var act_year = '&nbsp;' + atg.stage_year + ',&nbsp;' + atg.stage_vol;
} else {
var act_year = '&nbsp;' + atg.stage_year + ',&nbsp;' + atg.stage_vol + '&nbsp;(' + atg.stage_no + ')';
}
var arr = result.data.articleList;
var str = "";
var sth = "";
var stj = "";
for (var i = 0; i < arr.length; i++) {
if (arr[i].doi == '') {
var doi_ = ''
} else {
var doi_ = 'https://doi.org/' + arr[i].doi
}
if (arr[i].npp == '') {
var npp_ = ''
} else {
var npp_ = ':&nbsp;' + arr[i].npp + '.&nbsp;&nbsp;'
}
if (arr[i].file_html == '') {
var html_ = ''
} else {
var html_ = '<img src="img/link_2.png" width="14" height="16"><a href="' + imgFileUrl + 'articleHTML/' + arr[i].file_html + '" target="_blank" class="txt_html" alt="' + arr[i].article_id + '">HTML</a>&nbsp;(&nbsp;<span style="color: red">' + arr[i].html_num + '</span>&nbsp;)&nbsp;&nbsp;&nbsp;'
}
if (arr[i].file_pdf == '') {
var pdf_ = ''
} else {
var pdf_ = '<img src="img/link_3.jpg" width="14" height="16"><a href="' + imgFileUrl + 'articlePDF/' + arr[i].file_pdf + '" target="_blank" class="txt_pdf" alt="' + arr[i].article_id + '">PDF</a>&nbsp;(&nbsp;<span style="color: red">' + arr[i].pdf_num + '</span>&nbsp;)'
}
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 ((Math.round(Date.parse(new Date()) / 1000) - arr[i].ctime) / 86400 >= 21) {
var tong_geogle_2_1 = '<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:5px 31px 0 0;font-weight: 600;display: inline-block;"> ' +
'Google Scholar</a>' //搜索引用次数
} else {
var tong_geogle_2_1 = '' //少于21天隐藏
}
if ((Math.round(Date.parse(new Date()) / 1000) - arr[i].ctime) / 86400 >= 21) {
var tong_geogle_2_2 = '<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:5px 37px 0 0;font-weight: 600;display: inline-block;"> ' +
'Google Scholar</a>' //搜索引用次数
} else {
var tong_geogle_2_2 = '' //少于21天隐藏
}
if (arr[i].article_id == '172') {
var mp4_ = '<a href="https://youtu.be/3eDbnHRkFKQ" target="_blank"><img src="img/link_5.png" width="50" height="16" style="margin-left: 10px"></a>'
} else {
var mp4_ = ''
}
if (arr[i].icon == '') {
var img_i = 'img/baiss.png'
} else {
var img_i = imgarticleUrl + arr[i].icon
}
if (arr[i].other_state == 0) {
var otStat = ''
} else if (arr[i].other_state == 1) {
var otStat = '<span class="otStat">Being questioned</span>'
} else if (arr[i].other_state == 2) {
var otStat = '<span class="otStat">Retracted</span>'
}
if (arr[i].article_id == '86' || arr[i].article_id == '176' || arr[i].article_id == '455' || arr[i].article_id == '400' || arr[i].article_id == '145' || arr[i].article_id == '116' || arr[i].article_id == '717' || arr[i].article_id == '632' || arr[i].article_id == '24') {
var person_img = '<img src="' + img_i + '" alt="" style="width: 120px">'
} else {
var person_img = '<img src="' + img_i + '" alt="">'
}
arr[i].abstract = arr[i].abstract.replace(new RegExp("0, 102, 204", "g"), "0,102,153")
var c_t_a = '<button class="txt_copy">Cite this article<ul class="export"><li id="txt_copy_' + i + '" class="Exc_1">>> Copy citation information</li><li class="Exc_2"><i class="fa fa-download"></i> Export citation to EndNote</li><li class="Exc_3"><i class="fa fa-download"></i> Export citation to RIS</li><li class="Exc_4"><i class="fa fa-download"></i> Export citation to BibTex</li><li class="Exc_5"><i class="fa fa-download"></i> Export citation to txt</li><div class="triangle"></div></ul></button>'
var link_ = '<img src="img/link_1.png" width="14" height="16"><a class="txt_zhaiyao" alt="' + arr[i].article_id + '">Abstract</a>&nbsp;(&nbsp;<span style="color: red">' + arr[i].abs_num + '</span>&nbsp;)&nbsp;&nbsp;&nbsp;' +
html_ + pdf_ + mp4_ + c_t_a + tong_geogle
+ '<p class="txt_content">' + arr[i].cite + '</p><div>' + arr[i].abstract + '</div>';
var lr_top = ''
for (var t = 0; t < arr[i].topic.length; t++) {
lr_top += '<a href="topic_list.html?J_num=' + Jour_num + '&t_id=' + arr[i].topic[t].journal_topic_id + '" target="_blank">' + arr[i].topic[t].title + '</a>'
}
if (arr[i].tradition_tag == '') {
var trad_tion = ''
} else {
var trad_tion = '<div><div><font>' + arr[i].tradition_tag + ': </font>' + arr[i].tradition + '</div></div>'
}
str += '<li><div class="dbt_header">' + arr[i].type + '<div class="url_top">' + lr_top + '</div></div>' +
'<a id="' + arr[i].article_id + '" target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" class="txt_biaoti">' + otStat + arr[i].title + '</a>' +
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
+ localStorage.getItem("Journals_title") + '.' + act_year + npp_ +
'<a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
'</div><div class="links_">' + link_ + '</div><div class="apwrap"><a onclick="imgbig(this)" class="imgdiv">' + person_img + '</a>' +
trad_tion + '<br clear="both"></div></li>'
}
$('.current_list>h4 span').html(time_);
$('.current_list>ul').html(str);
$('.links_ .txt_copy').css('background', localStorage.Journals_color);
$('.url_top a').css('margin-right', '0');
$(".current_list ul>li .apwrap>div>div>p").each(function () {
var maxwidth = 335;//显示多少字符
if ($(this).text().length > maxwidth) {
$(this).text($(this).text().substring(0, maxwidth));
$(this).text($(this).text().substring(0, maxwidth - $(this).text().split(" ").pop().length));
$(this).html($(this).html() + '...');
}
});
$(".current_list ul li.pai_two .apwrap>div>div>p").each(function () {
var maxwidth = 140;//显示多少字符
if ($(this).text().length > maxwidth) {
$(this).text($(this).text().substring(0, maxwidth));
$(this).text($(this).text().substring(0, maxwidth - $(this).text().split(" ").pop().length));
$(this).html($(this).html() + '...');
}
});
// 点击read more效果
// $('.current_list li .apwrap>div>b').click(function () {
// if($(this).html()=='read more <i class="fa fa-long-arrow-down"></i>'){
// $(this).siblings('div').css('display', 'block');
// $(this).html('read more <i class="fa fa-long-arrow-up"></i>');
// }else{
// $(this).siblings('div').css('display', '-webkit-box');
// $(this).html('read more <i class="fa fa-long-arrow-down"></i>')
// }
// })
// 点击Abstract显示隐藏
$('.current_list .txt_zhaiyao').click(function () {
$(this).nextAll('div').toggle();
if ($(this).nextAll('div').css("display") == 'block') {
var num = $(this).next().html();
$.ajax({
type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
data: {"article_id": $(this).attr('alt'), "type": 'abs'},
success: function (result) {
if (result.code == 0) {
num = num * 1 + 1 * 1
}
}
})
$.ajax({
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
data: {'type': Jour_num, 'is_detail': '1'},
success: function (result) {
}
});
$(this).next().html(num);
}
})
$('.current_list .txt_html').click(function () {
var num = $(this).next().html();
$.ajax({
type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
data: {"article_id": $(this).attr('alt'), "type": 'html'},
success: function (result) {
if (result.code == 0) {
num = num * 1 + 1 * 1
}
}
})
$.ajax({
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
data: {'type': Jour_num, 'is_detail': '1'},
success: function (result) {
}
});
$(this).next().html(num);
})
$('.current_list .txt_pdf').click(function () {
var num = $(this).next().html();
$.ajax({
type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
data: {"article_id": $(this).attr('alt'), "type": 'pdf'},
success: function (result) {
if (result.code == 0) {
num = num * 1 + 1 * 1
}
}
})
$.ajax({
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
data: {'type': Jour_num, 'is_detail': '1'},
success: function (result) {
}
});
$(this).next().html(num);
})
// 点击弹窗出现 复制和下载
$('.current_list .txt_content').css('display', 'none');
$('.current_list .export').css('display', 'none');
$(document).click(function (e) {
if (!$(e.target).is('.export') && !$(e.target).is('.txt_copy')) {
$('.export').hide();
}
})
$('.current_list .txt_copy').click(function () {
$('.export').css('display', 'none');
$(this).find('.export').fadeIn(200);
})
$('.current_list .Exc_1').click(function () {
var content_ = $(this).parents('.txt_copy').nextAll('.txt_content').text();
var clipboard = new Clipboard('#' + $(this).attr('id'), {
text: function () {
return content_;
}
})
clipboard.on('success', function (e) {
ShowSuccess("Citation information has been copied!");
});
})
$('.current_list .Exc_2').click(function () {
var ecx_id = $(this).parents('.links_').siblings('.txt_biaoti').attr('id')
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getArticleenw', async: false,
data: {"article_id": ecx_id},
success: function (result) {
var a = document.createElement('a');
a.href = result.data.url;
a.download = ''
a.click();
}
})
})
$('.current_list .Exc_3').click(function () {
var ecx_id = $(this).parents('.links_').siblings('.txt_biaoti').attr('id')
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getArticleRis', async: false,
data: {"article_id": ecx_id},
success: function (result) {
var a = document.createElement('a');
a.href = result.data.url;
a.download = ''
a.click();
}
})
})
$('.current_list .Exc_4').click(function () {
var ecx_id = $(this).parents('.links_').siblings('.txt_biaoti').attr('id')
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getArticlebib', async: false,
data: {"article_id": ecx_id},
success: function (result) {
var a = document.createElement('a');
a.href = result.data.url;
a.download = ''
a.click();
}
})
})
$('.current_list .Exc_5').click(function () {
var ecx_id = $(this).parents('.links_').siblings('.txt_biaoti').attr('id')
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getArticletext', async: false,
data: {"article_id": ecx_id},
success: function (result) {
var a = document.createElement('a');
a.href = result.data.url;
a.download = ''
a.click();
}
})
})
// 订阅期刊
$('.top .top_sea .b_Sub').css('color', localStorage.Journals_color)
$('.top .top_sea .search_for select').css('border-color', localStorage.Journals_color)
$('.top .dingyue input.yue_add').css('background-color', localStorage.Journals_color);
$('.top .dingyue p b').html(localStorage.Journals_title);
$('.top .jour_ts input.tishi_author').css('background-color', localStorage.Journals_color);
// 添加订阅按钮点击弹出
// $('.top .top_sea .b_Sub').click(function () {
// $("#mask").css("height",$(document).height());
// $("#mask").css("width",$(document).width());
// $("#mask").show();
// $(".dingyue").fadeIn();
// document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"});
// })
$(".top .dingyue .mb_close").click(function () {
$("#mask").hide();
$(".dingyue").fadeOut();
document.body.removeEventListener('touchmove', bodyScroll, false);
$("body").css({"position": "initial", "height": "auto"});
});
$(".top .dingyue input.yue_close").click(function () {
$("#mask").hide();
$(".dingyue").fadeOut();
document.body.removeEventListener('touchmove', bodyScroll, false);
$("body").css({"position": "initial", "height": "auto"});
});
$(".top .jour_ts input.tishi_author").click(function () {
$("#mask").hide();
$(".jour_ts").fadeOut();
document.body.removeEventListener('touchmove', bodyScroll, false);
$("body").css({"position": "initial", "height": "auto"});
});
function bodyScroll(event) {
event.preventDefault();
}
// 订阅提交
$(".yue_add").click(function () {
$(".spa").text('');
var add_mess = {};
add_mess.journal_id = localStorage.Journals_num;
add_mess.email = $('#emapl').val();
var S_Dan = '0';
var reg = /^[-.-_A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
if ($("#emapl").val() == "") {
$(".spa1").text('Please fill in E-mail');
S_Dan = '1';
} else if (!(reg.test($("#emapl").val()))) {
$(".spa1").text('Please fill in properly formatted E-mail');
S_Dan = '1';
}
if (S_Dan == '1') {
ShowDanger("Incomplete information");
} else {
$(".yue_add").addClass("disable");
$.ajax({
type: 'post', url: apiUrl + 'subscribe/Journal/addSubscribeJournal',
data: add_mess,
success: function (result) {
if (result.code == 0) {
$(".dingyue").fadeOut();
$(".dingyue input[type='text']").val('');
$(".yue_add").removeClass("disable");
$(".jour_ts").fadeIn();
} else {
ShowDanger(result.msg);
$(".yue_add").removeClass("disable");
}
},
error: function () {
ShowDanger("error");
$(".yue_add").removeClass("disable");
}
})
}
})
} else {
// ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
})
// 中下侧Online First文章
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getOnlineArticle',
data: {
"journal_id": Jour_num, 'pageIndex': '1', 'pageSize': '4'
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.articlelist;
var str = "";
for (var i = 0; i < arr.length; i++) {
if (i == 4) break;
if (arr[i].icon == '') {
var img_i = ''
} else {
var img_i = '<a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '"><img src="' + imgarticleUrl + arr[i].icon + '" alt=""></a>'
}
str += '<li style="margin-right: 0;">' + img_i +
'<h6><a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" ' +
'style="font-weight: bold;color: #444;">' + arr[i].title + '</a></h6>' +
'<div class="fo_fam">' + arr[i].abbr + '. | ' + arr[i].stage_year + '</div></li>'
}
$('.online_fr>a').attr('href', 'article_list.html?J_num=' + Jour_num + '&o_id=' + Jour_num);
$('.online_fr>ul').html(str + '<br clear="both">');
if (arr == '') {
$('.online_fr').css('display', 'none')
}
} else {
// ShowDanger("请求失败!");
$('.online_fr').css('display', 'none')
}
},
error: function () {
ShowDanger("error");
}
})
// 下侧分期列表数据
//$.ajax({
// type: 'post', url: apiUrl + 'api/Journal/getMainPageStages',
// data: {
// "journal_id": Jour_num
// },
// success: function (result) {
// if (result.code == 0) {
//
// // 分期信息
// if (result.data.topic_show_type == 1) {
// var arr_stage = result.data.stages;
// var str = "";
// for (var i = 0; i < 4; i++) {
//
// if (arr_stage[i].stage_no == '0') {
// var iss_ = ''
// } else {
// var iss_ = '<b> Issue. ' + arr_stage[i].stage_no + '</b>'
// }
// str += '<li><a target="_blank" href="article_list.html?J_num=' + Jour_num + '&y_id=' + arr_stage[i].journal_stage_id + '">' +
// '<img src="' +imgFileUrl+ arr_stage[i].stage_icon + '" alt="">' +
// '<p><b>' + arr_stage[i].stage_year + '</b><b>Vol. ' + arr_stage[i].stage_vol + '</b>'
// + iss_ + '<b>' + arr_stage[i].stage_pagename +' '+ arr_stage[i].stage_page + '</b></p></a></li>'
//
// }
// $('.alls_issue>div>ul').html(str);
// $('.alls_issue>a').attr('href', 'stages.html?J_num=' + Jour_num);
// }else{
// $('.alls_issue').css('display', 'none')
// }
//
// } else {
// ShowDanger("请求失败!");
// }
// },
// error: function () {
// ShowDanger("error");
// }
//})
// 下侧话题列表数据
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getTopicArticles',
data: {
"topic_id": 32,
"pageIndex": 1,
"pageSize": 10
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.articleList;
var str1 = "";
var str2_1 = "";
var str2_2 = "";
var str3 = "";
var str1_num = 0;
var str2_num_1 = 0;
var str2_num_2 = 0;
var str3_num = 0;
for (var i = 0; i < arr.length; i++) {
if (arr[i].stage_year == 2020 && str1_num < 1) {
str1_num = str1_num + 1
str1 += '<img src="' + imgarticleUrl + arr[i].icon + '" alt="">' +
'<div><span>' + arr[i].abbr + '. | ' + arr[i].stage_year + '</span>' +
'<a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '">' +
'<p>' + arr[i].title + '</p></a></div>'
} else if (arr[i].stage_year == 2020 && str2_num_1 < 1) {
str2_num_1 = str2_num_1 + 1
str2_1 += '<div><img src="' + imgarticleUrl + arr[i].icon + '" alt="">' +
'<span>' + arr[i].abbr + '. | ' + arr[i].stage_year + '</span>' +
'<a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '"><p>'
+ arr[i].title + '</p></a></div>'
} else if (arr[i].stage_year == 2020 && str2_num_2 < 1) {
str2_num_2 = str2_num_2 + 1
str2_2 += '<div><img src="' + imgarticleUrl + arr[i].icon + '" alt="">' +
'<span>' + arr[i].abbr + '. | ' + arr[i].stage_year + '</span>' +
'<a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '"><p>'
+ arr[i].title + '</p></a></div>'
} else if (arr[i].stage_year >= 2020 && str3_num < 3) {
str3_num = str3_num + 1
str3 += '<div><span>' + arr[i].abbr + '. | ' + arr[i].stage_year + '</span>' +
'<a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '"><p>'
+ arr[i].title + '</p></a></div>'
}
}
$('.hua_tpice .tpice_cancar .tpoce_con1').html(str1);
$('.hua_tpice .tpice_cancar .tpoce_con2').html(str2_1 + str2_2 + '<br clear="both">');
$('.hua_tpice .tpice_cancar .tpoce_con3').html(str3);
}
}
})
// $.ajax({
// type: 'post', url: apiUrl + 'api/Journal/getJournalTopic',
// data: {
// "journal_id": Jour_num
// },
// success: function (result) {
// if (result.code == 0) {
// // 话题列表
// var arr_topic = result.data.topicList;
//
// var panduan = ''
// for (var i = 0; i < arr_topic.length; i++) {
// if (arr_topic[i].position == "left") {
// if (panduan == '1') {
// break
// }
// panduan = '1';
// var st_left = "";
// $('.hua_tpice>h4').html('Alzheimer Disease');
// $('.hua_tpice>a').attr('href', 'topic_list.html?J_num=1&t_id=32');
// $('.hua_tpice .tpice_lies>a').attr('href', 'topic.html?J_num=' + Jour_num + '&t_id=' + arr_topic[i].journal_topic_id);
// for (var j = 0; j < arr_topic[i].children.length; j++) {
// if (arr_topic[i].children[j].title != 'Alzheimer Disease') {
// if (j == 4) break;
// var url_href = '';
// if (arr_topic[i].children[j].is_final == '1') {
// url_href = 'topic_list.html?J_num=' + Jour_num + '&t_id='
// } else (
// url_href = 'topic.html?J_num=' + Jour_num + '&t_id='
// )
// st_left += '<li><a target="_blank" href="' + url_href + arr_topic[i].children[j].journal_topic_id + '">' +
// '<img src="' + imgtopicUrl + arr_topic[i].children[j].icon + '"/></a>' +
// '<h6 style="text-align: center"><a target="_blank" href="' + url_href + arr_topic[i].children[j].journal_topic_id + '">' + arr_topic[i].children[j].title + '</a></h6></li>'
// }
// }
// $('.hua_tpice ul.tpice_lies').prepend(st_left);
//
// if (st_left == '') {
// $('.jour_sta_tp_left_more').css('display', 'none');
// }
// }
// }
// if (panduan == '') {
// $('.jour_hauti_pd').css('display', 'none');
// }
// } else {
// ShowDanger("请求失败!");
// }
// },
// error: function () {
// ShowDanger("error");
// }
// })
// TMR 中下侧News & conmment文章
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getNewsArticle',
data: {
"journal_id": Jour_num
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.articlelist;
var str = "";
var sgr = "";
var j = 0;
var q = 0;
for (var i = 0; i < arr.length; i++) {
if (arr[i].type == 'News') {
if (j < 2) {
j++;
str += '<li style="box-shadow: none;margin-right: 0">' +
'<a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '">' +
'<img src="' + imgarticleUrl + arr[i].icon + '" alt="" style="background: #fff;"></a>' +
'<h6><a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" ' +
'style="font-weight: bold;color: #444;">' + arr[i].title + '</a></h6>' +
'<div class="fo_fam">' + arr[i].abbr + '. | ' + arr[i].stage_year + '</div></li>'
}
} else if (arr[i].type == 'Comment') {
if (q < 2) {
q++;
sgr += '<li style="box-shadow: none;margin-right: 0;">' +
'<a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '">' +
'<img src="' + imgarticleUrl + arr[i].icon + '" alt="" style="background: #fff;"></a>' +
'<h6><a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" ' +
'style="font-weight: bold;color: #444;">' + arr[i].title + '</a></h6>' +
'<div class="fo_fam">' + arr[i].abbr + '. | ' + arr[i].stage_year + '</div></li>'
}
}
}
$('.ment_news>div>div:nth-child(1)>ul').html(str);
$('.ment_news>div>div:nth-child(1) h4 a.m_new').attr('href', 'article_list.html?J_num=' + Jour_num + '&new_id=1');
$('.ment_news>div>div:nth-child(2)>ul').html(sgr + '<br clear="both">');
$('.ment_news>div>div:nth-child(2) h4 a.m_con').attr('href', 'article_list.html?J_num=' + Jour_num + '&con_id=1');
} else {
// ShowDanger("请求失败!");
$('.ncon_fr_tmr').css('display', 'none')
}
},
error: function () {
ShowDanger("error");
}
})
// 中下侧Highlights文章
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getTopArticle',
data: {
"journal_id": Jour_num,
"pageIndex": '1',
"pageSize": '4'
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.articles;
var str = "";
for (var i = 0; i < arr.length; i++) {
if (arr[i].icon == '') {
var img_i = ''
} else {
var img_i = '<a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '"><img src="' + imgarticleUrl + arr[i].icon + '" alt=""></a>'
}
str += '<li style="box-shadow: none;margin-right: 0;">' +
'<a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '">' +
'<img src="' + imgarticleUrl + arr[i].icon + '" alt="" style="background: #fff;"></a>' +
'<h6><a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" ' +
'style="font-weight: bold;color: #444;">' + arr[i].title + '</a></h6>' +
'<div class="fo_fam">' + arr[i].abbr + '. | ' + arr[i].stage_year + '</div></li>'
}
$('.ncon_hl>a').attr('href', 'article_list.html?J_num=' + Jour_num + '&top_id=' + Jour_num);
$('.ncon_hl>ul').html(str + '<br clear="both">');
if (arr == '') {
$('.ncon_hl').css('display', 'none')
}
} else {
// ShowDanger("请求失败!");
$('.ncon_hl').css('display', 'none')
}
},
error: function () {
ShowDanger("error");
}
})
// TMR 中下侧Top cited / Top read / Top download文章切换
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getTopArt',
data: {
"journal_id": Jour_num,
"type": 'cited',
"pageIndex": '1',
"pageSize": '8'
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.articleList;
var str = "";
for (var i = 0; i < arr.length; i++) {
if (arr[i].icon == '') {
var img_i = 'img/baiss.png'
} else {
var img_i = imgarticleUrl + arr[i].icon
}
str += '<div><a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '"><img src="' + img_i + '" alt=""></a>' +
'<h6><a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '">' + arr[i].title + '</a></h6>' +
'<div class="fo_fam">' + arr[i].abbr + '. | ' + arr[i].stage_year + '</div></div>'
}
$('.ncon_tcrd_tmr>a').attr('href', 'article_list.html?J_num=' + Jour_num + '&cite_id=1');
$('.ncon_tcrd_tmr>ul').html('<div id="Marquee_x"><ul><li>' + str + '</li></ul></div>');
$('#Marquee_x').jcMarquee({'marquee': 'x', 'speed': 20});
$('.ncon_tcrd_tmr h4 span').click(function () {
var tnm_num = $(".ncon_tcrd_tmr h4 span").index(this) + 1;
$('.ncon_tcrd_tmr h4 span').css('font-weight', 'normal')
$(this).css('font-weight', '600')
if (tnm_num == '1') {
var tnm_type = 'cited';
$('.ncon_tcrd_tmr>a').attr('href', 'article_list.html?J_num=' + Jour_num + '&cite_id=1');
}
if (tnm_num == '2') {
var tnm_type = 'read';
$('.ncon_tcrd_tmr>a').attr('href', 'article_list.html?J_num=' + Jour_num + '&read_id=1');
}
if (tnm_num == '3') {
var tnm_type = 'download';
$('.ncon_tcrd_tmr>a').attr('href', 'article_list.html?J_num=' + Jour_num + '&down_id=1');
}
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getTopArt',
data: {
"journal_id": Jour_num,
"type": tnm_type,
"pageIndex": '1',
"pageSize": '8'
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.articleList;
var str = "";
for (var i = 0; i < arr.length; i++) {
if (arr[i].icon == '') {
var img_i = 'img/baiss.png'
} else {
var img_i = imgarticleUrl + arr[i].icon
}
str += '<div><a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '"><img src="' + img_i + '" alt=""></a>' +
'<h6><a target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '">' + arr[i].title + '</a></h6>' +
'<div class="fo_fam">' + arr[i].abbr + '. | ' + arr[i].stage_year + '</div></div>'
}
$('.ncon_tcrd_tmr>ul').html('<div id="Marquee_x"><ul><li>' + str + '</li></ul></div>');
$('#Marquee_x').jcMarquee({'marquee': 'x', 'speed': 20});
}
}
})
})
} else {
// ShowDanger("请求失败!");
$('.ncon_tcrd_tmr').css('display', 'none')
}
},
error: function () {
ShowDanger("error");
}
})
// 下侧Call for Paper文章
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getJournalCfp',
data: {
"journal_id": Jour_num
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.cfps;
var str = "";
for (var i = 0; i < arr.length; i++) {
if (i == 2) break;
str += '<li><div><span>' + arr[i].showtime + '</span><h6>' +
'<a target="_blank" href="notice.html?J_num=' + Jour_num + '&cfp_id=' + arr[i].journal_cfp_id + '">' + arr[i].title + '</a></h6>' +
'<div class="cfp_con fo_fam">' + arr[i].content + '</div></div>' +
'<a target="_blank" href="notice.html?J_num=' + Jour_num + '&cfp_id=' + arr[i].journal_cfp_id + '"><img src="' + imgcfpUrl + arr[i].icon + '" alt=""></a></li>'
}
$('.ncon_aper>a').attr('href', 'notice_list.html?J_num=' + Jour_num + '&paper_id=' + Jour_num);
$('.ncon_aper>ul').html(str + '<br clear="both">');
if (arr == '') {
$('.ncon_aper').css('display', 'none')
}
$(".ncon_aper ul .cfp_con").each(function () {
var maxwidth = 150;//显示多少字符
if ($(this).text().length > maxwidth) {
$(this).text($(this).text().substring(0, maxwidth));
$(this).text($(this).text().substring(0, maxwidth - $(this).text().split(" ").pop().length));
$(this).html($(this).html() + '...');
}
});
} else {
// ShowDanger("请求失败!");
$('.ncon_aper').css('display', 'none')
}
},
error: function () {
ShowDanger("error");
}
})
// 下面新增加社区内容
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getAllTopics',
data: {},
beforeSend: function () {
},
success: function (result) {
if (result.code == 0) {
var old_arry = result.data.topic;
var new_arry = result.data.topic;
new_arry = old_arry.map(o => {
return {id: o.base_topic_id, text: o.title}
})
for (var i = 0; i < old_arry.length; i++) {
new_arry[i].children = old_arry[i].children.map(o => {
return {id: o.base_topic_id, text: o.title}
})
}
$('#com_index').selectivity({
allowClear: true,
items: new_arry,
placeholder: 'Please choose topics'
})
$('.es_serch_btn').click(function () {
$('.es_serch_span').css('display', 'none')
if ($('#com_index').selectivity('val') == null) {
$('.es_serch_span').css('display', 'block')
ShowDanger("Request was aborted");
} else {
window.open("atr_wisdom.html?&wis_dom=" + $('#com_index').selectivity('val'));
}
})
// 期刊订阅提交
$(".uity_Sub").click(function () {
$(".spa_su").text('');
var add_mess = {};
add_mess.journal_id = localStorage.Journals_num;
add_mess.email = $(".uity_inp").val();
var S_Dan = '0';
var reg = /^[-.-_A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
if ($(".uity_inp").val() == "") {
$(".spa_su").text('Please fill in E-mail');
S_Dan = '1';
} else if (!(reg.test($(".uity_inp").val()))) {
$(".spa_su").text('Please fill in properly formatted E-mail');
S_Dan = '1';
}
if (S_Dan == '1') {
ShowDanger("Incomplete information");
} else {
$(".uity_Sub").addClass("disable");
$.ajax({
type: 'post', url: apiUrl + 'subscribe/Journal/addSubscribeJournal',
data: add_mess,
success: function (result) {
if (result.code == 0) {
$(".suity_for input[type='text']").val('');
$(".uity_Sub").removeClass("disable");
$(".jour_ts").fadeIn();
} else {
ShowDanger(result.msg);
$(".uity_Sub").removeClass("disable");
}
},
error: function () {
ShowDanger("error");
$(".yue_addw").removeClass("disable");
}
})
}
})
} else {
ShowDanger("请求失败!");
}
}
})
// 时间轴
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getJournalLine',
data: {
"journal_id": Jour_num
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.lines;
var str = "";
var shr = "";
var dis_ = 946656000000;
for (var i = 0; i < arr.length; i++) {
var disx_ = arr[i].dist * 86700000
dis_ = dis_ + disx_
str += '<li><a href="#0" data-date="' + formatTimeToDate2(dis_) + '">' + arr[i].time + '</a></li>'
if (i == arr.length - 1) {
shr += '<li data-date="' + formatTimeToDate2(dis_) + '">' +
'<img src="' + imglineUrl + arr[i].img + '" style="width: 80px;height: 100px;float: left">' +
'<div style="float: left;width: 580px;margin-left: 30px"><h2>' +
'<a href="article_list.html?J_num=' + Jour_num + '&time_id=' + arr[i].journal_line_id + '" target="_blank">>> ' + arr[i].title + '</a></h2>' +
'<p>' + arr[i].intro + '</p></div><br clear="both"></li>'
} else {
if (arr[i].time == arr[i + 1].time) {
shr += '<li data-date="' + formatTimeToDate2(dis_) + '">' +
'<img src="' + imglineUrl + arr[i].img + '" style="width: 80px;height: 100px;float: left">' +
'<div style="float: left;width: 580px;margin-left: 30px"><h2>' +
'<a href="article_list.html?J_num=' + Jour_num + '&time_id=' + arr[i].journal_line_id + '" target="_blank">>> ' + arr[i].title + '</a></h2>' +
'<p>' + arr[i].intro + '</p></div><br clear="both">' +
'<img src="' + imglineUrl + arr[i + 1].img + '" style="margin-top: 20px;width: 80px;height: 100px;float: left">' +
'<div style="float: left;width: 580px;margin-left: 30px;margin-top: 20px;"><h2>' +
'<a href="article_list.html?J_num=' + Jour_num + '&time_id=' + arr[i + 1].journal_line_id + '" target="_blank">>> ' + arr[i + 1].title + '</a></h2>' +
'<p>' + arr[i + 1].intro + '</p></div><br clear="both">' +
'</li>'
i = i + 1;
} else {
shr += '<li data-date="' + formatTimeToDate2(dis_) + '">' +
'<img src="' + imglineUrl + arr[i].img + '" style="width: 80px;height: 100px;float: left">' +
'<div style="float: left;width: 580px;margin-left: 30px"><h2>' +
'<a href="article_list.html?J_num=' + Jour_num + '&time_id=' + arr[i].journal_line_id + '" target="_blank">>> ' + arr[i].title + '</a></h2>' +
'<p>' + arr[i].intro + '</p></div><br clear="both"></li>'
}
}
}
$('.cd-horizontal-timeline').css('display', 'none')
// if(arr==''||arr==undefined){
// $('.cd-horizontal-timeline').css('display','none')
// $('.wh_timeline').css('display','none')
// }else{
// $('.events-wrapper ol').html(str);
// $('.events-wrapper ol li:nth-child(1) a').addClass('selected');
//
// $('.events-content ol').html(shr);
// $('.events-content ol li:nth-child(1)').addClass('selected');
//
// line_time();
// }
} else {
// ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
})
// 相关期刊,过往分期
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getJournal',
data: {
"journal_id": Jour_num
},
success: function (result) {
if (result.code == 0) {
var arr_stage = result.data.journalStage;
var str = "";
for (var i = 0; i < result.data.journalStage.length; i++) {
if (arr_stage[i].stage_no == '0') {
var iss_ = ''
} else {
var iss_ = '<b> Issue.' + arr_stage[i].stage_no + '</b>'
}
if (arr_stage[i].stage_icon == '') {
str += '<li><a target="_blank" href="article_list.html?J_num=' + Jour_num + '&y_id=' + arr_stage[i].journal_stage_id + '">' +
'<img src="img/baiss.png">' +
'<p style="display: block"><b>' + arr_stage[i].stage_year + '</b><b>Vol. ' + arr_stage[i].stage_vol + '</b>'
+ iss_ + '<b>' + arr_stage[i].stage_pagename + ' ' + arr_stage[i].stage_page + '</b></p></a></li>'
} else {
str += '<li><a target="_blank" href="article_list.html?J_num=' + Jour_num + '&y_id=' + arr_stage[i].journal_stage_id + '">' +
'<img src="' + imgFileUrl + arr_stage[i].stage_icon + '" alt="">' +
'<p><b>' + arr_stage[i].stage_year + '</b><b>Vol. ' + arr_stage[i].stage_vol + '</b>'
+ iss_ + '<b>' + arr_stage[i].stage_pagename + ' ' + arr_stage[i].stage_page + '</b></p></a></li>'
}
}
$('.alls_issue>div>ul').html(str);
$('.alls_issue>a').attr('href', 'stages.html?J_num=' + Jour_num);
//var arr = result.data.relats;
//var str = "";
//
//for (var i = 0; i < arr.length; i++) {
//
// str += '<li><a href="' + arr[i].usx + '" target="_blank">' +
// '<img src="' + imgjourUrl + arr[i].icon + '" alt=""></a></li>'
//
//}
//
//$('.Rel_ated>ul').html(str);
//if (arr == '') {
// $('.Rel_ated').css('display', 'none')
//}
//if (localStorage.Journals_title == '经典中医研究') {
// $('.Rel_ated>h4').html('相关期刊');
// $('.more').html('更多');
//}
} else {
// ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
})
// 底部浮动订阅
// var flag = true;
// $(window).on('scroll',function(){
// if(flag) {
// $('.footpanel').css('display','block');
// }
// flag = false
// })
$(".footpanel .ftp_close").click(function () {
$(".footpanel").hide();
});
$('.footpanel .ftp_paper .fpr_from a').attr('href', 'agree.html');
// 订阅提交
$(".yue_addfp").click(function () {
$(".spafp").text('');
var add_mess = {};
add_mess.journal_id = localStorage.Journals_num;
add_mess.email = $('#emapfp').val();
var S_Dan = '0';
var reg = /^[-.-_A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
if ($("#emapfp").val() == "") {
$(".spafp").text('Please fill in E-mail');
S_Dan = '1';
} else if (!(reg.test($("#emapfp").val()))) {
$(".spafp").text('Please fill in properly formatted E-mail');
S_Dan = '1';
} else if ($(".footpanel input:checkbox[name='ment']:checked").val() == undefined) {
$(".spafp").text('Please check the agreement');
S_Dan = '1'
}
if (S_Dan == '1') {
ShowDanger("Incomplete information");
} else {
$(".yue_add").addClass("disable");
$.ajax({
type: 'post', url: apiUrl + 'subscribe/Journal/addSubscribeJournal',
data: add_mess,
success: function (result) {
if (result.code == 0) {
$(".fpr_from input[type='text']").val('');
$(".yue_addfp").removeClass("disable");
$(".jour_ts").fadeIn();
} else {
ShowDanger(result.msg);
$(".yue_addfp").removeClass("disable");
}
},
error: function () {
ShowDanger("error");
$(".yue_addfp").removeClass("disable");
}
})
}
})
//搜索
$('.ment_sousuo_kuang .soukuang_btn').click(function () {
window.open("jour_search.html?J_num=" + Jour_num + "&se_ch=" + $(".ment_sousuo_kuang .soukuang_inp").val());
})
}