Files
journal_com/js/commonHomePage.js
2025-11-03 14:55:33 +08:00

354 lines
12 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 commonHomePage() {
const style = document.createElement('style');
style.innerHTML = `
// .sy_fr,.sy_tcrd,ncon_SCom{
// background-color: #fff !important;
// }
// .exten_sion{
// background-color: #e7f4ff;
// }
// body{
// background-color: #e7f4ff;
// }
#index_top{
margin-bottom: 0 !important;
}
.exten_sion{
background-color: #e7f4ff5c !important;
width: 100% !important;
margin: 0 !important;
padding-bottom:40px !important;
padding-top:40px !important;
}
.es_jour{
width: 1300px !important;
margin-left: 0 !important;
}
.qk_img {
width: 135px;
height: 175px;
display: inline-block;
}
.qk_img img{
width:100%;
height:100%;
}
.jour_base_info_center{
width: 30%;
display:flex;
justify-content: space-between;
align-items: flex-start;
padding-top: 10px;
padding-bottom: 10px;
}
.jour_base_info_center:nth-child(1){
width: 36%;
}
.jour_base_info_center:nth-child(4){
width: 36%;
}
.jour_base_info_center:nth-child(7){
width: 36%;
}
.jour_base_info_center:nth-child(3){
width: 33%;
}
.jour_base_info_center:nth-child(6){
width: 33%;
}
.jour_base_info_center:nth-child(9){
width: 33%;
}
.jour_base_info_center:nth-child(8){
width: 63.5%;
}
.jour_base_info_title{
color: #222;
font-weight: bold;
font-size: 17px;
font-family: "Helvetica Neue", Helvetica, Georgia, sans-serif;
margin-left:-0.5px;
}
.jour_base_info_center_right{
width:calc(100% - 145px);
}
#common-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: none;
z-index: 100;
}
/* 弹窗主体 */
#common-popup {
width: 600px;
min-height: 400px;
height: auto;
background: white;
border-radius: 8px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: -1;
opacity: 0;
transition: opacity 0.3s;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}
/* 关闭按钮 */
.common-close-btn {
position: absolute;
right: 15px;
top: 10px;
font-size: 24px;
cursor: pointer;
color: #999;
}
.common-close-btn:hover {
color: #333;
}
.nav ul a:nth-child(1) li {
width: 225px !important;
}
.nav ul a:nth-child(2) li {
width: 110px !important;
}
.nav ul a:nth-child(3) li {
width: 195px !important;
}
.nav ul a:nth-child(4) li {
width: 110px !important;
}
.nav ul a:nth-child(5) li {
width: 90px !important;
}
.newManuscript p{
margin: 0 0 27px 15px !important;
}
.ncon_SCom .newManuscript{
padding-top:45px !important;
}
.newManuscript #com_index .selectivity-single-select{
height: 28px !important;
background: #fff !important;
border: 1px solid #ccc !important;
border-radius: 5px !important;
box-sizing: border-box !important;
}
.newManuscript .selectivity-single-result-container{
top: 0px !important;
line-height: 24px !important;
}
.newManuscript .selectivity-caret{
top: 3px !important;
}
.newManuscript .es_serch_btn{
padding-top: 15px;
margin-left: 108px;
display: inline-block;
color: #004a90;
font-weight: 600;
cursor: pointer;
}
`
document.head.appendChild(style);
// var SubmissionStr = ` <a target="_blank" href="https://submission.tmrjournals.com/" style="">
// <li class="rgb_color"><i class="fa fa-upload" style="font-size: 16px;font-weight: bold;color:#FFF"></i>
// Submission System</li>
// </a>`
// $('#index_top .nav .clear').prepend(SubmissionStr);
$.ajax({
type: 'get', url: apiUrl + 'api/Journal/getJournalList',
data: {},
success: function (result) {
if (result.code == 0) {
var arr = result.data.journalList;
var str = "";
for (let i = 0; i < arr.length; i++) {
var apcStr = ``;
if ([1, 25, 11, 17].includes(Number(arr[i].journal_id))) {
apcStr = arr[i].apc
} else {
apcStr = arr[i].apc + `<span style="color:#006699;font-weight: bold;margin-left:6px">( 20252026 )</span>`;
}
// 获取当前期刊独有的journalAbs数据假设通过journal_id关联
var arr_Abc = arr[i].journalAbs ? arr[i].journalAbs.filter(e => e.is_show == 1) : [];
var CiteScore = ''
var ImpactFactor = ''
var Published = ''
switch (Number(arr[i].journal_id)) {
//tmr
case 1:
ImpactFactor = '1.3'
Published = '2016'
CiteScore = '2.1'
break;
//bmec
case 25:
Published = '2022'
CiteScore = '1.5'
break;
//mdm
case 11:
CiteScore = '0.3'
break;
case 2:
Published = '2018'
break;
case 8:
Published = '2019'
break;
case 4:
Published = '2020'
break;
case 17:
Published = '2017'
break;
case 14:
CiteScore = 'Coming soon'
Published = '2018'
break;
case 11:
Published = '2018'
break;
case 18:
Published = '2017'
break;
}
// <p class="jour_base_info_issn" style="margin-top: 4px;font-size: 13px;">
// <b>ISSN:</b>
// ${arr[i].issn}</p>
//
if (arr[i].title != 'tmRxiv') {
str += `
<div class="jour_base_info_center" data-journal-usx="${arr[i].usx}" data-journal-id="${arr[i].journal_id}"
data-journal-color="${arr[i].system_color}"
data-journal-abs='${JSON.stringify(arr_Abc)}'>
<div class="jour_base_info_center_left">
<a href="/${arr[i].usx}" class="qk_img" target="_blank">
<img src="${imgjourUrl + arr[i].icon}" alt="">
</a>
</div>
<div class="jour_base_info_center_right" >
<div class="jour_base_info_center_right_con">
<p class="jour_base_info_title" style="cursor: pointer;letter-spacing: -0.5px;">${arr[i].title}</p>
<p style="margin-top: 4px;font-size: 13px;">
<b>Editor-in-Chief: </b>
<span class="mes_edit"
style="display: inline-block;vertical-align: top;">${arr[i].editorinchief}</span>
</p>
<p style="margin-top: 4px;font-size: 13px;">
<b>Acceptance: </b>${arr[i].acceptance}</p>
<p style="margin-top: 4px;font-size: 13px;"> <b>Final Decision: </b>${arr[i].finaldecision}</p>
<p style="${CiteScore ? '' : 'display:none'};margin-top: 4px;font-size: 13px;"><b>CiteScore: </b> <span style="color: #006699">${CiteScore}</span></p>
<p style="${ImpactFactor ? '' : 'display:none'};margin-top: 4px;font-size: 13px;"><b>Impact Factor: </b> <span style="color: #006699">${ImpactFactor}</span></p>
<p style="${apcStr ? '' : 'display:none'};margin-top: 4px;font-size: 13px;"><b>APC: </b> <span class="mes_APC">${apcStr}</span></p>
<p style="${arr_Abc && arr_Abc.length > 0 ? '' : ''}margin-top: 4px;font-size: 13px;"><b class="wl_click" style="cursor: pointer;">Indexing</b> </p>
</div>
</div>
</div>
`
}
}
$('.es_jour').html(`
<div style="width: 100%;display: flex;justify-content: space-between;align-items: flex-start;flex-wrap: wrap;"> ${str}
</div>
`);
// 绑定点击事件
$(document).on('click', '.wl_click', function (e) {
e.preventDefault();
// 获取当前点击元素所在的期刊容器
const $journalItem = $(this).closest('.jour_base_info_center');
// 从数据属性中获取参数
const journalColor = $journalItem.data('journal-color');
// 将JSON字符串解析回数组
const journalAbc = $journalItem.data('journal-abs');
// 使用当前期刊独有的journalAbs数据
var Abstractingcontent = `<ul style="margin-top:10px;">
${journalAbc.map((item, i) => {
return `<li style="font-weight:700;font-size:14px;">
<span style="display:inline-block">»&nbsp;</span>
<a target="_blank" href="${item.url}" style="font-weight:700;display:inline-block">${item.title}</a>
</li>`;
}).join('')}
</ul>`;
document.querySelector('#common-popup .common-popup-content').classList.add('whitebg');
showPopup(`<span style="font-weight:bold;color:${journalColor}">Indexing</span>`, Abstractingcontent);
});
$(document).on('click', '.jour_base_info_title', function (e) {
e.preventDefault();
// 获取当前点击元素所在的期刊容器
const $journalItem = $(this).closest('.jour_base_info_center');
// 从数据属性中获取参数
const journalUsx = $journalItem.data('journal-usx');
window.open(`/${journalUsx}`);
});
} else {
ShowDanger("请求失败!");
}
}
})
}
function showPopup(title, content) {
$('#common-popup .common-popup-title').html(title)
$('#common-popup .common-popup-content').html(content)
document.getElementById('common-overlay').style.display = 'block';
document.getElementById('common-popup').style.opacity = '1';
document.getElementById('common-popup').style.zIndex = '101';
// 5秒后自动关闭
// setTimeout(closePopup, 5000);
}
function closePopup() {
document.getElementById('common-popup').style.opacity = '0';
document.getElementById('common-popup').style.zIndex = '-1';
setTimeout(function () {
document.getElementById('common-overlay').style.display = 'none';
$('#common-popup .common-popup-title').html('')
$('#common-popup .common-popup-content').html('')
}, 50);
}