Files
journal_com/journalIndex/js/side.js
2025-07-10 18:02:33 +08:00

643 lines
30 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.
// 左边引进去
// 底部
$('.footer').load('./footer.html')
// 期刊基础、外链、分期、话题信息加载
function side_list() {
// 左侧期刊列表数据
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getJournal',
data: {
"journal_id": Jour_num
},
success: function (result) {
if (result.code == 0) {
if (Jour_num == 1 && $('.FreeapplicationBox')) {
$('.FreeapplicationBox').css('display', 'inline-block');
} else {
$('.FreeapplicationBox').css('display', 'none');
}
// 期刊基础信息
var arr_jour = result.data.journal; localStorage.setItem("Journals_title", arr_jour.title);
localStorage.setItem("Journals_issn", arr_jour.issn);
localStorage.setItem("Journals_color", arr_jour.system_color);
localStorage.setItem("Journals_usx", arr_jour.usx);
initNotices()
$('h4.rgb_color').css('color', arr_jour.system_color);
$('.home_logo>span').css('color', arr_jour.system_color);
$('.whitebg h4').css('color', arr_jour.system_color);
$('.whitebg h4 a').css('color', arr_jour.system_color);
$('.guest_ .rgb_color').css('color', arr_jour.system_color);
$('.jour_notice>a').css('color', arr_jour.system_color)
$('.footer').css('background', arr_jour.system_color);
$('.article .art_main .new_art h4, .article .art_main .high_light h4, .news_ment h4, .art_main_con_topic h4').css('color', arr_jour.system_color);
// $('.art_top_topic .topics').css('background-color', arr_jour.system_color);
$('#top_bar').css('background-color', arr_jour.system_color);
$('.rgb_color_background').css('background-color', arr_jour.system_color);
$('.article .art_side .btn_system').css('background', arr_jour.system_color);
$('.article .art_side .press-button-tmr a').css('background', arr_jour.system_color);
$('.guest_content .gue_system a').css('background', arr_jour.system_color);
$('.guest_content .gue_author a').css('background', arr_jour.system_color);
$('.jour_ht_dy .topic_dingyue .topic_add').css('color', arr_jour.system_color);
$('.jour_ht_dy .topic_ts .mainbox input[type="submit"]').css('background-color', arr_jour.system_color);
$('.top .top_sea .search_for input[type="text"]').css('border-color', arr_jour.system_color)
$('.top .top_sea .search_for input[type="button"]').css('border-color', arr_jour.system_color)
$('.top .top_sea .search_for input[type="button"]').css('background-color', arr_jour.system_color)
$('.top .top_sea>a').css('color', arr_jour.system_color)
$('.jour_awaite > a').css('color', arr_jour.system_color)
$('.hunt_for .hunt_inp').css('border-color', arr_jour.system_color)
$('.hunt_for .hunt_btn').css('background-color', arr_jour.system_color)
$('.mb_aform input.combox-box').css('border-color', arr_jour.system_color)
$('.mb_aform input[type="submit"]').css('background-color', arr_jour.system_color)
$('.mb_aform input[type="submit"]').css('border-color', arr_jour.system_color)
$('.mb_aform input[type="text"]').css('border-color', arr_jour.system_color)
$('.jour_ption input[type="submit"]').css('background-color', arr_jour.system_color)
$('.jour_ption input[type="submit"]').css('border-color', arr_jour.system_color)
$('.ncon_SCom .rgb_color').css('color', arr_jour.system_color)
$('.footer .daohang .dh_by input[type="submit"]').css('background-color', arr_jour.system_color)
$('.footpanel').css('background-color', arr_jour.system_color + 'cc')
$('.footpanel .yue_addfp').css('background-color', arr_jour.system_color)
$('.press-button a').css('background-color', arr_jour.system_color)
$('.All_Issues').css('color', arr_jour.system_color);
// 左侧期刊搜索
$('.hunt_for .hunt_btn').click(function () {
window.open("jour_search.html?J_num=" + Jour_num + "&se_ch=" + $(".hunt_for .hunt_inp").val());
})
// $(".contbu_submit select[name='journal']").html('<option value="'+arr_jour.issn+'">'+arr_jour.title+'</option>');
// $(".contbu_submit select[name='journal'] option[value='"+arr_jour.issn+"']").prop("selected", true);
$('.top_sea .a_search').attr('href', 'preprint.html?J_num=' + Jour_num);
//$('.top .top_sea').append('<a class="b_Sub" href="draw_up.html?issn=' + arr_jour.issn + '" target="_blank"><i class="fa fa-envelope"></i>Subscribe</a>')//订阅
$('.b_Sub').css('color', arr_jour.system_color);
$('.b_Sub').attr('href', 'draw_up.html?issn=' + arr_jour.issn);
$('.dingyue p b').html(arr_jour.title);//订阅
$('.footpanel .ftp_paper .fpr_text b').html(arr_jour.title);//底栏订阅
$('.nav_ban h1 a').html(arr_jour.title);
$('.nav_ban>h1>a').attr('href', '/' + arr_jour.usx);
$('.ncon_SCom > div > div:nth-child(4) > p> b').html(arr_jour.title)
// $('.Join_Team').css('display', 'none');
// $('.Tmr_lian_jie').css('display', 'block');
// tmr单独
$('.nav_ban h2').html('<img src="../img/h2_tit.png" style="margin-top: 26px;"/>');
const pathname = window.location.pathname.split("/").pop();
// 2. 判断是否为 for_author.html
$('.sharethis_tmr').css('display', 'none');
$('.art_top_topic').css('padding-top', '0');
$('.line_sbil').css('display', 'block');
$('.share_tmrtb').css('display', 'block');
$('.jour_ht_dy_tmr').html(' ');
$('.jour_ht_dy_tmr').css('display', 'none');
$('.jour_correlate').css('margin-top', '-10px');
$('.jour_correlate>h4').css('padding-top', '10px');
$('.topic_add').addClass('topic_add_tmr');
$('.tmr_style_new').addClass('overall_tmr');
$('.nav_ban h2').css('display', 'inline-block')
$('.Gue_special').css('display', 'none')
if (Jour_num == 1 || Jour_num == 25) {
$('#kezuoBLine').css('display', 'block');
$('#kezuoB').css('display', 'block');
}
$('.Gue_special').css('display', 'block')
console.log($('.Gue_special').length)
// if (Jour_num == 1) {
// $('.Join_Bord2').css('display', 'block')
// }
$('.Join_Bord').attr('href', 'z_f6-1.html?J_num=' + Jour_num);
//$('.edit_board_tmr>a').attr('href', 'notice.html?J_num=' + Jour_num + '&footer_id=' + arr_jour.board_url);
// 相关期刊
var corr = result.data.relats;
$('.jour_correlate>a').attr('href', '/' + corr[0].usx);
$('.jour_correlate>a>img').attr('src', imgjourUrl + corr[0].icon)
// 感谢图片
$('.jour_awaite').before('<div class="thank_img" style="text-align: center">' +
'<a href="thank_list.html?J_num=1" target="_blank">' +
'<img src="img/tha_nk.png" alt="" style="width: 235px;margin-top: 20px;"></a>' +
'<div style="height: 1px;background-color: #ddd;width: 235px;margin: 15px auto 0 auto;"></div></div>');
} else {
ShowDanger("请求失败!");
}
},
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 == 0) {
// var arr_stage = result.data.stages;
// var sty = "";
// for (var i = 0; i < arr_stage.length; i++) {
// if (arr_stage[i].stage_no == '0') {
// var iss_ = ''
// } else {
// var iss_ = ' Issue.' + arr_stage[i].stage_no
// }
// sty += '<li><a target="_blank" href="article_list.html?J_num=' + Jour_num + '&y_id=' + arr_stage[i].journal_stage_id + '">' +
// '' + arr_stage[i].stage_year + ' Vol.' + arr_stage[i].stage_vol + iss_ + '&nbsp;' + arr_stage[i].stage_pagename + arr_stage[i].stage_page + '</a></li>'
//
// }
// $('.jour_stage .jour_sta_wail').html(sty);
// $('.All_Issues').attr('href', 'stages.html?J_num=' + Jour_num);
// }else{
// $('.jour_stage').css('display', 'none')
// $('.jour_stage_bot').css('display', 'none')
// }
//
// } else {
// ShowDanger("请求失败!");
// }
// },
// error: function () {
// ShowDanger("error");
// }
//})
// 左侧话题列表数据
//$.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") {
// panduan = '1';
// var st_left = "";
// $('.jour_sta_tp_left_title').html(arr_topic[i].title);
// $('.jour_sta_tp_left_more').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 (j == 3) 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><span>' + arr_topic[i].children[j].title + '</span>' +
// '<a target="_blank" href="' + url_href + arr_topic[i].children[j].journal_topic_id + '"><img src="' + imgtopicUrl + arr_topic[i].children[j].icon + '" ' +
// 'style="width: 240px;height: 150px;border-bottom: 1px solid #ddd;margin: 5px 0 10px 0"></a></li>'
// }
// $('.jour_sta_tp_left').html(st_left);
// if (st_left == '') {
// $('.jour_sta_tp_left_more').css('display', 'none');
// }
// }
// }
// if (panduan == '') {
// $('.jour_hauti_pd').css('display', 'none');
// $('.jour_hauti_bot').css('display', 'none');
// }
// } else {
// ShowDanger("请求失败!");
// }
// },
// error: function () {
// ShowDanger("error");
// }
//})
// 左侧话题订阅下拉
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getTopicForSubscribe',
data: {
"journal_id": Jour_num
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.topics;
var data_3 = [];
for (var i = 0; i < arr.length; i++) {
data_3.push({
id: arr[i].journal_topic_id,
text: arr[i].title
});
}
$("#combox3").combox({
id: "id",
name: "text",
data: data_3,
valueChange: function (data) {
// debugger
//返回datafilterDataselectData
}
})
var cb3 = $("#combox3").data('combox');
// 订阅提交
$(".jour_ht_dy .topic_add").click(function () {
$(".spa").text('');
var add_mess = {};
add_mess.email = $('#emajl').val();
add_mess.topic_ids = [];
var ar_mes = cb3.options.selectData
for (var i = 0; i < ar_mes.length; i++) {
add_mess.topic_ids.push(ar_mes[i]['id']);
}
var S_Dan = '0';
var reg = /^[-.-_A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
if (Jour_num == '22') {
if (cb3.options.selectData == "") {
$(".spa1").text('请选择话题');
S_Dan = '1';
} else if ($("#emajl").val() == "") {
$(".spa1").text('填写邮箱');
S_Dan = '1';
} else if (!reg.test($("#emajl").val())) {
$(".spa1").text('填写正确格式的邮箱');
S_Dan = '1';
}
} else {
if (cb3.options.selectData == "") {
$(".spa1").text('Please choose topic');
S_Dan = '1';
} else if ($("#emajl").val() == "") {
$(".spa1").text('Please fill in E-mail');
S_Dan = '1';
} else if (!reg.test($("#emajl").val())) {
$(".spa1").text('Please fill in properly formatted E-mail');
S_Dan = '1';
}
}
if (S_Dan == '1') {
ShowDanger("Incomplete information");
} else {
$(".topic_add").addClass("disable");
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/addSubscribeTopics',
data: add_mess,
success: function (result) {
if (result.code == 0) {
// $(".topic_dingyue input[type='text']").val('');
$(".topic_add").removeClass("disable");
$(".jour_ts").fadeIn();
$(".jour_ts input.tishi_author").click(function () {
$(".jour_ts").fadeOut();
});
// $("#mask").css("height",$(document).height());
// $("#mask").css("width",$(document).width());
// $("#mask").show();
// document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"});
} else {
ShowDanger(result.msg);
$(".topic_add").removeClass("disable");
}
},
error: function () {
ShowDanger("error");
$(".topic_add").removeClass("disable");
}
})
}
})
} else {
ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
});
// 左侧话题订阅下拉(新)
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getTopicForSubscribe',
data: {
"journal_id": Jour_num
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.topics;
var data_2 = [];
for (var i = 0; i < arr.length; i++) {
data_2.push({
id: arr[i].journal_topic_id,
text: arr[i].title
});
}
$("#combox2").combox({
id: "id",
name: "text",
data: data_2,
valueChange: function (data) {
// debugger
//返回datafilterDataselectData
}
})
var cb2 = $("#combox2").data('combox');
// 订阅期刊(提交新的)
$(".yue_addk").click(function () {
$(".spa198").text('');
var add_mess = {};
add_mess.email = $('#emaplk').val();
add_mess.topic_ids = [];
var ar_mes = cb2.options.selectData
for (var i = 0; i < ar_mes.length; i++) {
add_mess.topic_ids.push(ar_mes[i]['id']);
}
var S_Dan = '0';
var reg = /^[-.-_A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
if (cb2.options.selectData == "") {
$(".spa198").text('Please choose topic');
S_Dan = '1';
} else if ($("#emaplk").val() == "") {
$(".spa198").text('Please fill in E-mail');
S_Dan = '1';
} else if (!(reg.test($("#emaplk").val()))) {
$(".spa198").text('Please fill in properly formatted E-mail');
S_Dan = '1';
}
if (S_Dan == '1') {
ShowDanger("Incomplete information");
} else {
$(".yue_addk").addClass("disable");
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/addSubscribeTopics',
data: add_mess,
success: function (result) {
if (result.code == 0) {
// $(".jour_ption input[type='text']").val('');
$(".yue_addk").removeClass("disable");
$(".jour_ts").fadeIn();
$(".jour_ts input.tishi_author").click(function () {
$(".jour_ts").fadeOut();
});
} else {
ShowDanger(result.msg);
$(".yue_addk").removeClass("disable");
}
},
error: function () {
ShowDanger("error");
$(".yue_addk").removeClass("disable");
}
})
}
})
} else {
ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
});
// 左侧消息列表数据
// 左侧待审稿件列表数据
// $.ajax({
// type: 'post', url: apiUrl + 'special/Article/getReviewerArticlesForJournal',
// data: {
// "issn": '2413-3973'
// },
// success: function (result) {
// if (result.code == 0) {
//
// // 消息列表
// var arr = result.data.articles;
// var str = '';
//
// for (var i = 0; i < arr.length; i++) {
// str += '<li><a target="_blank" href="https://submission.tmrjournals.com/peerewer">' + arr[i].title + '</a>' +
// '<font style="color: #888">Type: </font>' +
// '<font style="color: #006699">' + pan_type(arr[i].type) +'</font></li>'
// }
// $('.jour_awaite ul').html(str);
// $('.jour_awaite .more').attr('href', 'https://submission.tmrjournals.com/peerewer');
//
// if (str == '') {
// $('.jour_awaite').css('display', 'none');
// }
//
// } else {
// ShowDanger("请求失败!");
// }
// },
// error: function () {
// ShowDanger("error");
// }
// })
}
function initNotices(){
var Journals_color=localStorage.getItem('Journals_color')
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getNotices',
data: {
"journal_id": Jour_num
},
success: function (result) {
if (result.code == 0) {
// 消息列表
var arr = result.data.notices;
var str = '';
for (var i = 0; i < arr.length; i++) {
if (i == 2) break;
str += `<li><font style="color:${Journals_color} ">»&nbsp;${formatTimeToDate4(arr[i].ctime * 1000)}</font><br/>
<a target="_blank" href="notice.html?J_num=${Jour_num }&notice_id=${arr[i].journal_notices_id}">${arr[i].title}</a></li>`
}
var jourNoticeStr = `
<div class="jour_notice">
<p style="color: rgb(0, 102, 153);font-size:16px;" class="jour_notice_title_name">Announcements</p>
<ul>
${str}
</ul>
<a href="/notice_list.html?J_num=${Jour_num}&amp;n_id=${Jour_num}" class="more jour_sta_tp_left_more" target="_blank"
style="color: rgb(0, 102, 153);position: relative;top:10px;left:0;margin-left:0;font-weight:600;">More <i class="fa fa-long-arrow-right"></i></a>
<div class="bor_sty_col" style="left: 272px"></div>
<div class="bor_sty_col" style="left: 547px"></div>
<div class="bor_sty_col" style="left: 821px"></div>
</div>
`
if (result.data.notices.length > 0) {
$('.ncon_SCom .Scientist_Community_box').html(jourNoticeStr);
}else{
$('.ncon_SCom .Scientist_Community_box').html(`<img src="/img/unity_1.png" alt="" style="width: 150px;margin: -15px 0 0 40px">
<a href="/rev_ver.html" target="_blank" class="rgb_color">Scientist<br>Community</a>
<div class="bor_sty_col" style="left: 272px"></div>
<div class="bor_sty_col" style="left: 547px"></div>
<div class="bor_sty_col" style="left: 821px"></div>`);
}
// 时间轴
// $.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 dis_ = '20';
//
// for (var i = 0; i < arr.length; i++) {
// if (i == arr.length - 1) {
// if (i == 0) {
// dis_ = '20'
// } else {
// dis_ = parseInt(dis_) + parseInt(arr[i].dist * 150);
// }
// str += '<li style="margin-top: ' + dis_ + 'px"><h4 class="f30">' + arr[i].time + '</h4>' +
// '<a href="article_list.html?J_num=' + Jour_num + '&time_id=' + arr[i].journal_line_id + '" target="_blank">' +
// '<h3 class="span">' + arr[i].title + '</h3></a>' +
// '<img src="' + imglineUrl + arr[i].img + '" style="width: 60px;height: 80px;margin-top: 10px"></li>'
// } else {
// if (arr[i].time == arr[i + 1].time) {
// if (i == 0) {
// dis_ = '20'
// } else {
// dis_ = parseInt(dis_) + parseInt(arr[i].dist * 150);
// }
// str += '<li style="margin-top: ' + dis_ + 'px"><h4 class="f30">' + arr[i].time + '</h4>' +
// '<a href="article_list.html?J_num=' + Jour_num + '&time_id=' + arr[i].journal_line_id + '" target="_blank">' +
// '<h3 class="span">' + arr[i].title + '</h3></a>' +
// '<img src="' + imglineUrl + arr[i].img + '" style="width: 60px;height: 80px;margin-top: 10px">' +
// '<a href="article_list.html?J_num=' + Jour_num + '&time_id=' + arr[i + 1].journal_line_id + '" target="_blank">' +
// '<h3 class="span">' + arr[i + 1].title + '</h3></a>' +
// '<img src="' + imglineUrl + arr[i + 1].img + '" style="width: 60px;height: 80px;margin-top: 10px"></li>'
// i = i + 1;
// } else {
// if (i == 0) {
// dis_ = '20'
// } else {
// dis_ = parseInt(dis_) + parseInt(arr[i].dist * 150);
// }
// str += '<li style="margin-top: ' + dis_ + 'px"><h4 class="f30">' + arr[i].time + '</h4>' +
// '<a href="article_list.html?J_num=' + Jour_num + '&time_id=' + arr[i].journal_line_id + '" target="_blank">' +
// '<h3 class="span">' + arr[i].title + '</h3></a>' +
// '<img src="' + imglineUrl + arr[i].img + '" style="width: 60px;height: 80px;margin-top: 10px"></li>'
// }
// }
//
// }
//
// $('.overall_tmr .tmr_side_book ul').html(str);
//
// $(".book_click").bind('click', function () {
// if ($(".book_click").html() == 'more <i class="fa fa-long-arrow-up"></i>') {
// $('.about3 ul').css('height','1370px');
// $('.book_click').html('more <i class="fa fa-long-arrow-down"></i>');
// } else {
// $('.about3 ul').css('height','2090px');
// $('.book_click').html('more <i class="fa fa-long-arrow-up"></i>');
// }
// });
//
//
// if (window.location.pathname.indexOf("journals") <= 0) {
// $('.tmr_side_map').css('display','none');
// $('.tmr_side_book').css('display','none');
// }
//
//
//
//
// } else {
// // ShowDanger("请求失败!");
// }
// },
// error: function () {
// ShowDanger("error");
// }
// })
} else {
ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
})
}