From 458e16339fb5c724cb2d4538863d8bacbda3c255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Sat, 9 May 2026 10:02:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=B2=A1=E6=9C=89=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=20News=20&=20Comment=20=20=E6=9A=82=E6=97=B6=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=8E=89=E6=8E=A5=E5=8F=A3=20api/Main/getNewsArticles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/scientist.js | 148 ++++++++++++++++++++++++------------------------ js/search.js | 86 ++++++++++++++++------------ 2 files changed, 124 insertions(+), 110 deletions(-) diff --git a/js/scientist.js b/js/scientist.js index 3fc215b..1e9752f 100644 --- a/js/scientist.js +++ b/js/scientist.js @@ -7,12 +7,12 @@ $('.footer').load('footer_in.html') // 首页内容 function scien_list() { -   + } // 首页中侧内容 -function sy_index() { +function sy_index() { Jour_num = '1'; localStorage.setItem("Journals_title", 'Traditional Medicine Research.'); @@ -162,34 +162,34 @@ function sy_index() { '' + arr[i].abbr + '. | ' + arr[i].journal_short + '' + '

' + arr[i].title + '

' - } + } // else if (i <= 5) { // str3_num = str3_num + 1 // str3 += '
' + arr[i].abbr + ' | ' + arr[i].journal_short + '

' // + arr[i].title + '

' // } } -$('.sy_npar div.tpoce_con3').css({ - 'margin-top':'10px' -}) -$('.npar_one .tpoce_con2').css({ - 'margin':'30px 0px 0 15px', - 'width':'755px', - 'height':'580px', - 'display':'grid', - 'grid-template-columns':'repeat(3, 1fr)', - 'gap':'15px', -}) + $('.sy_npar div.tpoce_con3').css({ + 'margin-top': '10px' + }) + $('.npar_one .tpoce_con2').css({ + 'margin': '30px 0px 0 15px', + 'width': '755px', + 'height': '580px', + 'display': 'grid', + 'grid-template-columns': 'repeat(3, 1fr)', + 'gap': '15px', + }) $('.sy_npar>div>a').attr('href', 'artihom_list_pid.html?J_num=' + Jour_num + '&p_id=' + Jour_num); $('.sy_npar .tpoce_con1').html(str1); $('.sy_npar .tpoce_con2').html(str2_1 + str2_2 + '
'); $('.sy_npar div.tpoce_con2 > div').css({ - 'width':'100%' + 'width': '100%' }) $('.sy_npar div.tpoce_con2 > div img').css({ - 'height':'140px' + 'height': '140px' }) // $('.sy_npar .tpoce_con3').html(str3); if (arr == '') { @@ -249,73 +249,73 @@ $('.npar_one .tpoce_con2').css({ } }) - + // 暂时注释掉接口调用 api/Main/getNewsArticles 2026/05/09 // 中下侧News & Comment文章 - $.ajax({ - type: 'post', url: apiUrl + 'api/Main/getNewsArticles', - data: { - "type": 'News' - }, - success: function (result) { - if (result.code == 0) { + // $.ajax({ + // type: 'post', url: apiUrl + 'api/Main/getNewsArticles', + // data: { + // "type": 'News' + // }, + // success: function (result) { + // if (result.code == 0) { - var arr = result.data.articles; - var str = ""; - var j = 0; - for (var i = 0; i < arr.length; i++) { - if (j == 2) break; - str += '
  • ' + - '
    ' + arr[i].title + '
    ' + - '
    ' + arr[i].abbr + ' | ' + arr[i].stage_year + ' | ' + arr[i].journal_short + '
  • ' - j += 1; - } + // var arr = result.data.articles; + // var str = ""; + // var j = 0; + // for (var i = 0; i < arr.length; i++) { + // if (j == 2) break; + // str += '
  • ' + + // '
    ' + arr[i].title + '
    ' + + // '
    ' + arr[i].abbr + ' | ' + arr[i].stage_year + ' | ' + arr[i].journal_short + '
  • ' + // j += 1; + // } - $('.sy_nct>div>div>a').attr('href', 'artihom_list_newid.html?J_num=' + Jour_num + '&new_id=' + Jour_num); - $('.sy_nct>div>div:nth-child(1)>ul').html(str); + // $('.sy_nct>div>div>a').attr('href', 'artihom_list_newid.html?J_num=' + Jour_num + '&new_id=' + Jour_num); + // $('.sy_nct>div>div:nth-child(1)>ul').html(str); - } else { - // ShowDanger("请求失败!"); - $('.sy_nct').css('display', 'none') - } - }, - error: function () { - ShowDanger("error!"); - } - }) + // } else { + // // ShowDanger("请求失败!"); + // $('.sy_nct').css('display', 'none') + // } + // }, + // error: function () { + // ShowDanger("error!"); + // } + // }) - $.ajax({ - type: 'post', url: apiUrl + 'api/Main/getNewsArticles', - data: { - "type": 'Comment' - }, - success: function (result) { - if (result.code == 0) { + // $.ajax({ + // type: 'post', url: apiUrl + 'api/Main/getNewsArticles', + // data: { + // "type": 'Comment' + // }, + // success: function (result) { + // if (result.code == 0) { - var arr = result.data.articles; - var str = ""; - var j = 0; - for (var i = 0; i < arr.length; i++) { - if (j == 2) break; - str += '
  • ' + - '
    ' + arr[i].title + '
    ' + - '
    ' + arr[i].abbr + ' | ' + arr[i].stage_year + ' | ' + arr[i].journal_short + '
  • ' - j += 1; - } + // var arr = result.data.articles; + // var str = ""; + // var j = 0; + // for (var i = 0; i < arr.length; i++) { + // if (j == 2) break; + // str += '
  • ' + + // '
    ' + arr[i].title + '
    ' + + // '
    ' + arr[i].abbr + ' | ' + arr[i].stage_year + ' | ' + arr[i].journal_short + '
  • ' + // j += 1; + // } - $('.sy_nct>div>div>a').attr('href', 'artihom_list_conid.html?J_num=' + Jour_num + '&con_id=' + Jour_num); - $('.sy_nct>div>div:nth-child(2)>ul').html(str); - - } else { - // ShowDanger("请求失败!"); - $('.sy_nct').css('display', 'none') - } - }, - error: function () { - ShowDanger("error!"); - } - }) + // $('.sy_nct>div>div>a').attr('href', 'artihom_list_conid.html?J_num=' + Jour_num + '&con_id=' + Jour_num); + // $('.sy_nct>div>div:nth-child(2)>ul').html(str); + // } else { + // // ShowDanger("请求失败!"); + // $('.sy_nct').css('display', 'none') + // } + // }, + // error: function () { + // ShowDanger("error!"); + // } + // }) + // 暂时注释掉接口调用 2026/05/09 // 中下侧News & Comment文章 // $.ajax({ // type: 'post', url: apiUrl + 'api/Main/getNewsArticles', diff --git a/js/search.js b/js/search.js index fb5b78d..5046618 100644 --- a/js/search.js +++ b/js/search.js @@ -54,6 +54,20 @@ function scout_home() { // 期刊列表搜索 function scout_jour() { + const style = document.createElement('style'); + style.innerHTML = `.article{ + box-sizing: border-box; + + } + .footer .daohang ul{ + width: 26% !important; + + } + .footer .daohang ul:nth-child(4) { + width: 12% !important; + } + ` + document.head.appendChild(style); // 获取地址栏信息 function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); @@ -169,7 +183,7 @@ function scout_jour() { if (arr[i].tradition_tag == '' || arr[i].tradition_tag == null) { var maxwidth = 500;//显示多少字符 if (arr[i].abstract.length > maxwidth) { - var abstNew= arr[i].abstract.replace(/<.*?>/ig,"") + var abstNew = arr[i].abstract.replace(/<.*?>/ig, "") abstNew = abstNew.substring(0, maxwidth) abstNew = abstNew.substring(0, maxwidth - abstNew.split(" ").pop().length) var trad_tion = '
    ' + abstNew + '...
    ' @@ -191,7 +205,7 @@ function scout_jour() { + localStorage.getItem("Journals_title") + '. ' + arr[i].stage.stage_year + ', ' + arr[i].stage.stage_vol + stage_ + npp_ + '' + doi_ + '' + '
    ' - + trad_tion +'
    ' + + trad_tion + '
    ' } $('.wenz_list>ul').html(str); $('.links_ .txt_copy').css('background', localStorage.Journals_color); @@ -203,7 +217,7 @@ function scout_jour() { var num = $(this).next().html(); $.ajax({ type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false, - data: {"article_id": $(this).attr('alt'), "type": 'abs'}, + data: { "article_id": $(this).attr('alt'), "type": 'abs' }, success: function (result) { if (result.code == 0) { num = num * 1 + 1 * 1 @@ -212,7 +226,7 @@ function scout_jour() { }) $.ajax({ type: 'post', url: apiUrl + 'super/Publish/addVisitNum', - data: {'type': Jour_num, 'is_detail': '1'}, + data: { 'type': Jour_num, 'is_detail': '1' }, success: function (result) { } }); @@ -222,7 +236,7 @@ function scout_jour() { var num = $(this).next().html(); $.ajax({ type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false, - data: {"article_id": $(this).attr('alt'), "type": 'html'}, + data: { "article_id": $(this).attr('alt'), "type": 'html' }, success: function (result) { if (result.code == 0) { num = num * 1 + 1 * 1 @@ -231,7 +245,7 @@ function scout_jour() { }) $.ajax({ type: 'post', url: apiUrl + 'super/Publish/addVisitNum', - data: {'type': Jour_num, 'is_detail': '1'}, + data: { 'type': Jour_num, 'is_detail': '1' }, success: function (result) { } }); @@ -241,7 +255,7 @@ function scout_jour() { var num = $(this).next().html(); $.ajax({ type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false, - data: {"article_id": $(this).attr('alt'), "type": 'pdf'}, + data: { "article_id": $(this).attr('alt'), "type": 'pdf' }, success: function (result) { if (result.code == 0) { num = num * 1 + 1 * 1 @@ -250,7 +264,7 @@ function scout_jour() { }) $.ajax({ type: 'post', url: apiUrl + 'super/Publish/addVisitNum', - data: {'type': Jour_num, 'is_detail': '1'}, + data: { 'type': Jour_num, 'is_detail': '1' }, success: function (result) { } }); @@ -284,7 +298,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -297,7 +311,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -310,7 +324,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -323,7 +337,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -437,7 +451,7 @@ function scout_jour() { if (arr[i].tradition_tag == '' || arr[i].tradition_tag == null) { var maxwidth = 500;//显示多少字符 if (arr[i].abstract.length > maxwidth) { - var abstNew= arr[i].abstract.replace(/<.*?>/ig,"") + var abstNew = arr[i].abstract.replace(/<.*?>/ig, "") abstNew = abstNew.substring(0, maxwidth) abstNew = abstNew.substring(0, maxwidth - abstNew.split(" ").pop().length) var trad_tion = '
    ' + abstNew + '...
    ' @@ -459,7 +473,7 @@ function scout_jour() { + localStorage.getItem("Journals_title") + '. ' + arr[i].stage.stage_year + ', ' + arr[i].stage.stage_vol + stage_ + npp_ + '' + doi_ + '' + '
    ' - + trad_tion +'
    ' + + trad_tion + '
    ' } $('.wenz_list>ul').html(str); $('.goup-container').click(); @@ -474,7 +488,7 @@ function scout_jour() { type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false, - data: {"article_id": $(this).attr('alt'), "type": 'abs'}, + data: { "article_id": $(this).attr('alt'), "type": 'abs' }, success: function (result) { if (result.code == 0) { num = num * 1 + 1 * 1 @@ -483,7 +497,7 @@ function scout_jour() { }) $.ajax({ type: 'post', url: apiUrl + 'super/Publish/addVisitNum', - data: {'type': Jour_num, 'is_detail': '1'}, + data: { 'type': Jour_num, 'is_detail': '1' }, success: function (result) { } }); @@ -494,7 +508,7 @@ function scout_jour() { var num = $(this).next().html(); $.ajax({ type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false, - data: {"article_id": $(this).attr('alt'), "type": 'html'}, + data: { "article_id": $(this).attr('alt'), "type": 'html' }, success: function (result) { if (result.code == 0) { num = num * 1 + 1 * 1 @@ -503,7 +517,7 @@ function scout_jour() { }) $.ajax({ type: 'post', url: apiUrl + 'super/Publish/addVisitNum', - data: {'type': Jour_num, 'is_detail': '1'}, + data: { 'type': Jour_num, 'is_detail': '1' }, success: function (result) { } }); @@ -513,7 +527,7 @@ function scout_jour() { var num = $(this).next().html(); $.ajax({ type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false, - data: {"article_id": $(this).attr('alt'), "type": 'pdf'}, + data: { "article_id": $(this).attr('alt'), "type": 'pdf' }, success: function (result) { if (result.code == 0) { num = num * 1 + 1 * 1 @@ -522,7 +536,7 @@ function scout_jour() { }) $.ajax({ type: 'post', url: apiUrl + 'super/Publish/addVisitNum', - data: {'type': Jour_num, 'is_detail': '1'}, + data: { 'type': Jour_num, 'is_detail': '1' }, success: function (result) { } }); @@ -556,7 +570,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -569,7 +583,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -582,7 +596,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -595,7 +609,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -745,7 +759,7 @@ function scout_jour() { if (arr[i].tradition_tag == '' || arr[i].tradition_tag == null) { var maxwidth = 500;//显示多少字符 if (arr[i].abstract.length > maxwidth) { - var abstNew= arr[i].abstract.replace(/<.*?>/ig,"") + var abstNew = arr[i].abstract.replace(/<.*?>/ig, "") abstNew = abstNew.substring(0, maxwidth) abstNew = abstNew.substring(0, maxwidth - abstNew.split(" ").pop().length) var trad_tion = '
    ' + abstNew + '...
    ' @@ -767,7 +781,7 @@ function scout_jour() { + localStorage.getItem("Journals_title") + '. ' + arr[i].stage.stage_year + ', ' + arr[i].stage.stage_vol + stage_ + npp_ + '' + doi_ + '' + '
    ' + person_img + '' - + trad_tion +'
    ' + + trad_tion + '
    ' } $('.wenz_list>ul').html(str); $('.goup-container').click(); @@ -782,7 +796,7 @@ function scout_jour() { type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false, - data: {"article_id": $(this).attr('alt'), "type": 'abs'}, + data: { "article_id": $(this).attr('alt'), "type": 'abs' }, success: function (result) { if (result.code == 0) { num = num * 1 + 1 * 1 @@ -791,7 +805,7 @@ function scout_jour() { }) $.ajax({ type: 'post', url: apiUrl + 'super/Publish/addVisitNum', - data: {'type': Jour_num, 'is_detail': '1'}, + data: { 'type': Jour_num, 'is_detail': '1' }, success: function (result) { } }); @@ -802,7 +816,7 @@ function scout_jour() { var num = $(this).next().html(); $.ajax({ type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false, - data: {"article_id": $(this).attr('alt'), "type": 'html'}, + data: { "article_id": $(this).attr('alt'), "type": 'html' }, success: function (result) { if (result.code == 0) { num = num * 1 + 1 * 1 @@ -811,7 +825,7 @@ function scout_jour() { }) $.ajax({ type: 'post', url: apiUrl + 'super/Publish/addVisitNum', - data: {'type': Jour_num, 'is_detail': '1'}, + data: { 'type': Jour_num, 'is_detail': '1' }, success: function (result) { } }); @@ -821,7 +835,7 @@ function scout_jour() { var num = $(this).next().html(); $.ajax({ type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false, - data: {"article_id": $(this).attr('alt'), "type": 'pdf'}, + data: { "article_id": $(this).attr('alt'), "type": 'pdf' }, success: function (result) { if (result.code == 0) { num = num * 1 + 1 * 1 @@ -830,7 +844,7 @@ function scout_jour() { }) $.ajax({ type: 'post', url: apiUrl + 'super/Publish/addVisitNum', - data: {'type': Jour_num, 'is_detail': '1'}, + data: { 'type': Jour_num, 'is_detail': '1' }, success: function (result) { } }); @@ -864,7 +878,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -877,7 +891,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -890,7 +904,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url; @@ -903,7 +917,7 @@ function scout_jour() { 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}, + data: { "article_id": ecx_id }, success: function (result) { var a = document.createElement('a'); a.href = result.data.url;