diff --git a/js/scientist/index.js b/js/scientist/index.js index b08a100..62c6dc5 100644 --- a/js/scientist/index.js +++ b/js/scientist/index.js @@ -31,9 +31,10 @@ function commonInit() { } -function commonGetItemHtml(doc,maxwidth) { +function commonGetItemHtml(doc, maxwidth) { - var data = doc.data; + var data = doc.data;var journal_id=doc.data.journal_id?doc.data.journal_id:Jour_num; + console.log('journal_id at line 36:', journal_id) var i = doc.i; var img_i = doc.img_i; var c_t_a = doc.c_t_a; @@ -70,7 +71,7 @@ function commonGetItemHtml(doc,maxwidth) { baseInfo.html_ = 'HTML ( ' + data.html_num + ' )  ' } } else { - baseInfo.html_ = 'HTML ( ' +data.html_num + ' )  ' + baseInfo.html_ = 'HTML ( ' + data.html_num + ' )  ' } // if (data.mains == '') { // if (data.file_html == '') { @@ -124,7 +125,7 @@ function commonGetItemHtml(doc,maxwidth) { if (data.tradition_tag == '' || data.tradition_tag == null) { - var maxwidth = maxwidth?maxwidth:800;//显示多少字符 + var maxwidth = maxwidth ? maxwidth : 800;//显示多少字符 if (data.abstract.length > maxwidth) { var abstNew = data.abstract.replace(/<.*?>/ig, "") abstNew = abstNew.substring(0, maxwidth) diff --git a/jstmr/journal.js b/jstmr/journal.js index cd50678..ef002af 100644 --- a/jstmr/journal.js +++ b/jstmr/journal.js @@ -39,9 +39,9 @@ function bf_list() { wh_topicd = 'top' var st_top_tit = ""; var st_top_con = ""; - var forLength = arr_topic[i].title == "Diseases"?10:5 + var forLength = arr_topic[i].title == "Diseases" ? 10 : 5 if (wh_number == '1') { - + for (var j = 0; j < arr_topic[i].children.length; j++) { if (j == forLength) break; @@ -229,7 +229,7 @@ function bf_list() { var mp4_ = '' } if (arr[i].icon == '') { - var img_i = 'img/baiss.png' + var img_i = '' } else { var img_i = imgarticleUrl + arr[i].icon } @@ -247,9 +247,13 @@ function bf_list() { var person_img1 = '' } else { var person_img = '' - - var person_img1 = '
' - + if (img_i && img_i != '') { + var person_img1 = '
' + + } else { + var person_img1 = '
' + } + } @@ -273,17 +277,17 @@ function bf_list() { } else { var traditionText = arr[i].tradition; var maxTradHeight = 220; // 设置最大高度 - + trad_tion = `
${arr[i].tradition_tag}: ${traditionText}
`; - + setTimeout(() => { let traditionElement = document.querySelector('.tradition-text:last-of-type'); if (traditionElement.scrollHeight > maxTradHeight) { let words = traditionText.split(" "); let truncatedText = ""; - + for (let j = 0; j < words.length; j++) { truncatedText += words[j] + " "; traditionElement.innerText = truncatedText + "..."; @@ -296,7 +300,7 @@ function bf_list() { } }, 100); // 确保 DOM 渲染完成 } - + str += '
  • ' + arr[i].type + '
    ' + lr_top + '
    ' + '' + otStat + arr[i].title + '' +