提交tmr底部文章空白
This commit is contained in:
@@ -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_ = '<img src="img/link_2.png" width="14" height="16"><a href="' + imgFileUrl + 'articleHTML/' + data.file_html + '" target="_blank" class="txt_html" alt="' + data.article_id + '">HTML</a> ( <span style="color: red">' + data.html_num + '</span> ) '
|
||||
}
|
||||
} else {
|
||||
baseInfo.html_ = '<img src="img/link_2.png" width="14" height="16"><a href="article.html?J_num=' + Jour_num + '&a_id=' + data.article_id + '&s_htm=1" target="_blank" class="txt_html" alt="' + data.article_id + '">HTML</a> ( <span style="color: red">' +data.html_num + '</span> ) '
|
||||
baseInfo.html_ = '<img src="img/link_2.png" width="14" height="16"><a href="article.html?J_num=' + journal_id + '&a_id=' + data.article_id + '&s_htm=1" target="_blank" class="txt_html" alt="' + data.article_id + '">HTML</a> ( <span style="color: red">' + data.html_num + '</span> ) '
|
||||
}
|
||||
// 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)
|
||||
|
||||
@@ -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 = '<img src="' + img_i + '" alt="" style="width: 120px">'
|
||||
} else {
|
||||
var person_img = '<img src="' + img_i + '" alt="" style="height:300px;object-fit: cover;">'
|
||||
|
||||
var person_img1 = '<div style="height: 240px;background-image: url('+img_i+');background-size:cover;background-position:top;background-repeat:no-repeat;"></div>'
|
||||
|
||||
if (img_i && img_i != '') {
|
||||
var person_img1 = '<div style="height: 240px;background-image: url(' + img_i + ');background-size:cover;background-position:top;background-repeat:no-repeat;"></div>'
|
||||
|
||||
} else {
|
||||
var person_img1 = '<div style="height: auto;background-image: url(' + img_i + ');background-size:cover;background-position:top;background-repeat:no-repeat;"></div>'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -273,17 +277,17 @@ function bf_list() {
|
||||
} else {
|
||||
var traditionText = arr[i].tradition;
|
||||
var maxTradHeight = 220; // 设置最大高度
|
||||
|
||||
|
||||
trad_tion = `<div class="tradition-box" style="width:100%;height:auto;line-height:20px;overflow:hidden;">
|
||||
<div class="tradition-text">${arr[i].tradition_tag}: ${traditionText}</div>
|
||||
</div>`;
|
||||
|
||||
|
||||
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 += '<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>' +
|
||||
|
||||
Reference in New Issue
Block a user