|
@@ -13,7 +13,9 @@ if(is8Ie) {
|
|
|
}
|
|
|
|
|
|
//推荐诊断等单种类型的
|
|
|
-function renderRecommendInfo(icon, className,title,data, hasInfo, type, position) {
|
|
|
+function renderRecommendInfo(showNum, icon, className,title,data, hasInfo, type, position) {
|
|
|
+ let showNumCopy = showNum || 5
|
|
|
+ const dataLen = data.length
|
|
|
const str = `<div class="recommendInfoWrapper ${className} clearfix">
|
|
|
<h4><img src=${icon} title="${title}" class="icon">${title}:</h4>
|
|
|
<div class="recommendInfoBox">
|
|
@@ -22,29 +24,47 @@ function renderRecommendInfo(icon, className,title,data, hasInfo, type, position
|
|
|
</div>
|
|
|
</div>`
|
|
|
$('.push').append(str)
|
|
|
- let childrenNodeStr = ''
|
|
|
+ let dataShort
|
|
|
+ if(showNumCopy&& dataLen > showNumCopy) {
|
|
|
+ dataShort = data.slice(0, showNumCopy)
|
|
|
+ } else {
|
|
|
+ dataShort = data
|
|
|
+ }
|
|
|
+ let childrenNodeStrShort = ''
|
|
|
+ let childrenNodeStrLong = ''
|
|
|
if(hasInfo) {
|
|
|
+ for (let i = 0; i < dataShort.length; i++) {
|
|
|
+ childrenNodeStrShort += `<span class="recommendInfoItem recommendInfoItemHasInfo">
|
|
|
+ ${data[i].name}
|
|
|
+ <span title="点击i图标可查看详细说明" class="infoMsg" data-name=${data[i].name}></span>
|
|
|
+ </span>`
|
|
|
+ }
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
- childrenNodeStr += `<span class="recommendInfoItem recommendInfoItemHasInfo">
|
|
|
+ childrenNodeStrLong += `<span class="recommendInfoItem recommendInfoItemHasInfo">
|
|
|
${data[i].name}
|
|
|
<span title="点击i图标可查看详细说明" class="infoMsg" data-name=${data[i].name}></span>
|
|
|
</span>`
|
|
|
}
|
|
|
} else {
|
|
|
+ for (let i = 0; i < dataShort.length; i++) {
|
|
|
+ childrenNodeStrShort += `<span class="recommendInfoItem" data-name="${data[i].name}">
|
|
|
+ ${data[i].name}
|
|
|
+ </span>`
|
|
|
+ }
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
- childrenNodeStr += `<span class="recommendInfoItem" data-name="${data[i].name}">
|
|
|
+ childrenNodeStrLong += `<span class="recommendInfoItem" data-name="${data[i].name}">
|
|
|
${data[i].name}
|
|
|
</span>`
|
|
|
}
|
|
|
}
|
|
|
- if(!childrenNodeStr) {
|
|
|
- childrenNodeStr = '<span class ="recommendNull">暂无推荐</span>'
|
|
|
+ if(!childrenNodeStrShort) {
|
|
|
+ childrenNodeStrShort = '<span class ="recommendNull">暂无推荐</span>'
|
|
|
}
|
|
|
- $('.'+className + 'box').append(childrenNodeStr)
|
|
|
+ $('.'+className + 'box').append(childrenNodeStrShort)
|
|
|
let childrenNodeStrAll = `<div class="${className+'boxAll'} itemAllBox">
|
|
|
<h4>${title}:</h4>
|
|
|
<div class="itemAll">
|
|
|
- ${childrenNodeStr}
|
|
|
+ ${childrenNodeStrLong}
|
|
|
</div>
|
|
|
<span class="slideup"><img src="${collapseImg}"></span>
|
|
|
</div>`
|
|
@@ -58,26 +78,37 @@ function renderRecommendInfo(icon, className,title,data, hasInfo, type, position
|
|
|
const infoMsgName = $(this).attr('data-name')
|
|
|
openNewWin(`information.html?type=${type}&position=${position}&name=${infoMsgName}`)
|
|
|
})
|
|
|
- slideToggle("."+className+"box")
|
|
|
+ slideToggle("."+className+"box", showNumCopy, dataLen)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//化验和辅检等多种类型
|
|
|
-function renderMultRecommendInfo(icon, className,title,data, hasInfo, type, position) {
|
|
|
+function renderMultRecommendInfo(labsAndPacMode,icon, className,title,data, hasInfo, type, position) {
|
|
|
const str = `<div class="recommendInfoWrapper ${className} clearfix">
|
|
|
- <h4><img src=${icon} title="${title}" class="icon">${title}:</h4>
|
|
|
- <div class="recommendInfoBox ${className + 'box'}"></div>
|
|
|
+ <h4 class ="${+labsAndPacMode === 1 ? 'showTopTitle':'showRightTitle'}"><img src=${icon} title="${title}" class="icon">${title}:</h4>
|
|
|
+ <div class="recommendInfoBox ${className + 'box'} ${+labsAndPacMode === 1 ? 'showTopInfo':'showRightInfo'}"></div>
|
|
|
</div>`
|
|
|
$('.push').append(str)
|
|
|
-
|
|
|
+ let hanContentNum = 0
|
|
|
for(let i = 0; i < data.length; i++) {
|
|
|
+ const showNum = data[i].showNum || 5
|
|
|
+ const dataLen = data[i].data.length
|
|
|
let childrenNodeBoxStr = `<div class="labAndPacsWrapper ${data[i].className+'wrapper'}">
|
|
|
<div class="labAndPacsBox ${data[i].className+'box'} clearfix">
|
|
|
</div>
|
|
|
</div>`
|
|
|
- let childrenNodeStr = `<span class="labAndPacsTitle">${data[i].title}<i></i></span>`
|
|
|
+ let childrenNodeStr = `<span class="labAndPacsTitle ${+labsAndPacMode === 1 ? 'topSmallTitle':'rightSmallTitle'}"">${data[i].title}<i></i></span>`
|
|
|
let childrenNodeItemStrAll = '' //更多展开框中的字符串
|
|
|
+ let dataShort
|
|
|
+ if(showNum&& dataLen > showNum) {
|
|
|
+ dataShort = data[i].data.slice(0, showNum)
|
|
|
+ } else {
|
|
|
+ dataShort = data[i].data
|
|
|
+ }
|
|
|
+ for(let j = 0; j < dataShort.length; j++) {
|
|
|
+ childrenNodeStr += `<span class="labAndPacsItem">${dataShort[j].name}</span>`
|
|
|
+ }
|
|
|
for(let j = 0; j < data[i].data.length; j++) {
|
|
|
- childrenNodeStr += `<span class="labAndPacsItem">${data[i].data[j].name}</span>`
|
|
|
childrenNodeItemStrAll += `<span class="labAndPacsItem">${data[i].data[j].name}</span>`
|
|
|
}
|
|
|
if(data[i].data.length == 0) {
|
|
@@ -94,15 +125,15 @@ function renderMultRecommendInfo(icon, className,title,data, hasInfo, type, posi
|
|
|
</div>`
|
|
|
|
|
|
$('.push').append(childrenNodeStrAll)
|
|
|
- slideToggle("."+data[i].className+"box")
|
|
|
+ slideToggle("."+data[i].className+"box", showNum, dataLen)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function renderTreat(icon, className,title, data) {
|
|
|
- $('.infoTabBox').append(`<span class="infoTab treatTab" data-box="${className}">${title}</span>`)
|
|
|
+ $('.infoTabBox').append(`<span class="infoTab treatTab boldFont" data-box="${className}">${title}</span>`)
|
|
|
const str = `<div class="informationBox recommendInfoWrapper ${className} clearfix">
|
|
|
- <span class="diagName">${msg.diseaseName?msg.diseaseName:''}</span>
|
|
|
+ <span class="diagName boldFont">${msg.diseaseName?msg.diseaseName:''}</span>
|
|
|
<div class="recommendInfoBox clearfix ${className + 'box'}"></div>
|
|
|
</div>`
|
|
|
$('.infomationBox').append(str)
|
|
@@ -112,7 +143,7 @@ function renderTreat(icon, className,title, data) {
|
|
|
renderTreatDrug('drugTreatment', '药物治疗', treatmentList, className+'box')
|
|
|
}
|
|
|
function renderKnowledgeInfo(icon, className,title, data) {
|
|
|
- $('.infoTabBox').append(`<span class="infoTab tipsTab" data-box="${className}">${title}</span>`)
|
|
|
+ $('.infoTabBox').append(`<span class="infoTab tipsTab boldFont" data-box="${className}">${title}</span>`)
|
|
|
const str = `<div class="informationBox staticWin recommendInfoWrapper ${className} clearfix">
|
|
|
<p class="diagName">${data}</p>
|
|
|
</div>`
|
|
@@ -122,7 +153,7 @@ function renderKnowledgeInfo(icon, className,title, data) {
|
|
|
})
|
|
|
}
|
|
|
function renderScaleInfo(icon, className,title, data) {
|
|
|
- $('.infoTabBox').append(`<span class="infoTab tipsTab" data-box="${className}">${title}</span>`)
|
|
|
+ $('.infoTabBox').append(`<span class="infoTab tipsTab boldFont" data-box="${className}">${title}</span>`)
|
|
|
const str = `<div class="informationBox staticWin recommendInfoWrapper ${className} clearfix">
|
|
|
<p class="diagName">${data}</p>
|
|
|
</div>`
|
|
@@ -225,46 +256,61 @@ function renderTreatDrug(className,title,data, parentNode) {
|
|
|
}
|
|
|
|
|
|
function renderTipsInfo(icon, className,title,data) {
|
|
|
-
|
|
|
- $('.infoTabBox').append(`<span class="infoTab tipsTab" data-box="${className}">${title}</span>`)
|
|
|
+ $('.infoTabBox').append(`<span class="infoTab tipsTab boldFont" data-box="${className}">${title}</span>`)
|
|
|
let str
|
|
|
- if(!data.name) {
|
|
|
+ if(data.length === 0) {
|
|
|
str = `<div class="informationBox tipsInfoWrapper ${className} clearfix">
|
|
|
<p class="diagName recommendNull">暂无数据</p>
|
|
|
<div class="tipsInfoBox clearfix ${className + 'box'}"></div>
|
|
|
</div>`
|
|
|
} else {
|
|
|
str = `<div class="informationBox tipsInfoWrapper ${className} clearfix">
|
|
|
- <p class="diagName">${data.name} <span class="moreInfo" data-name="${data.name}">详情</span></p>
|
|
|
- <p class="tipsTitle">诊断依据:</p>
|
|
|
- <div class="tipsInfoBox clearfix ${className + 'box'}"></div>
|
|
|
+ <div class="tipsInfoBox clearfix ${className + 'box'}">
|
|
|
+ </div>
|
|
|
</div>`
|
|
|
}
|
|
|
|
|
|
$('.infomationBox').append(str)
|
|
|
- if(data.name) {
|
|
|
- renderTipsInfoText('','诊断依据',data.details,className + 'box')
|
|
|
+ for(let i = 0; i < data.length; i++) {
|
|
|
+ renderTipsInfoText('','诊断依据',data[i],className + 'box')
|
|
|
}
|
|
|
+ // if(data.name) {
|
|
|
+ // renderTipsInfoText('','诊断依据',data.details,className + 'box')
|
|
|
+ // }
|
|
|
+ if(data.length > 1) {
|
|
|
+ $('.tipsInfoItem').each(function(i, obj){
|
|
|
+ var lineHeight = parseInt($(this).css("line-height"));
|
|
|
+ var height = parseInt($(this).height());
|
|
|
+ if((height / lineHeight) >3 ){
|
|
|
+ $(this).addClass("hasMore")
|
|
|
+ $(this).css("height","60px");
|
|
|
+ }else{
|
|
|
+ $(this).removeClass("hasMore");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
function renderTipsInfoText(className,title,data, parentNode) {
|
|
|
- let childrenNodeBoxStr = ``
|
|
|
- if(data.length === 0) {
|
|
|
+ let childrenNodeBoxStr = `<p class="diagName boldFont">${data.name} <span class="moreInfo" data-name="${data.name}" data-type="${data.type}">详情</span></p>`
|
|
|
+ if(data.details.length === 0) {
|
|
|
childrenNodeBoxStr += `<p class="recommendNull">暂无数据</p>
|
|
|
-
|
|
|
`
|
|
|
} else {
|
|
|
- for(let i = 0; i < data.length; i++) {
|
|
|
- childrenNodeBoxStr += `<p>${data[i].title}</p>
|
|
|
- ${data[i].content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)}
|
|
|
+ for(let i = 0; i < data.details.length; i++) {
|
|
|
+ childrenNodeBoxStr += `<div class="tipsInfoItem">
|
|
|
+ <p class="tipsInfoItemTitle">${data.details[i].title}</p>
|
|
|
+ ${data.details[i].content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)}
|
|
|
+ </div>
|
|
|
`
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$('.' + parentNode).append(childrenNodeBoxStr)
|
|
|
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function renderRecommendConditTips(icon, className,title,data) {
|
|
@@ -337,11 +383,11 @@ function renderRecommendConditTips(icon, className,title,data) {
|
|
|
})
|
|
|
bindTipsEvent()
|
|
|
}
|
|
|
-function slideToggle(className){//展开收起
|
|
|
+function slideToggle(className, showNum, dataLen){//展开收起
|
|
|
const domName = $(className)
|
|
|
const domNameBoxAll = $(className+'All')
|
|
|
setTimeout(() => {
|
|
|
- if(domName.height() > 20){
|
|
|
+ if(showNum < dataLen){
|
|
|
domName.append(`<span class="slideDown"><img src="${showImg}"></span>`)
|
|
|
}
|
|
|
});
|
|
@@ -354,6 +400,7 @@ function slideToggle(className){//展开收起
|
|
|
$(domNameBoxAll).css('display', 'none')
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
//打开免责申明
|
|
|
$(".disclaimer .logo").on("click",function() {
|
|
|
openNewWin("disclaimer.html");
|