|
@@ -225,46 +225,61 @@ function renderTreatDrug(className,title,data, parentNode) {
|
|
}
|
|
}
|
|
|
|
|
|
function renderTipsInfo(icon, className,title,data) {
|
|
function renderTipsInfo(icon, className,title,data) {
|
|
-
|
|
|
|
$('.infoTabBox').append(`<span class="infoTab tipsTab" data-box="${className}">${title}</span>`)
|
|
$('.infoTabBox').append(`<span class="infoTab tipsTab" data-box="${className}">${title}</span>`)
|
|
let str
|
|
let str
|
|
- if(!data.name) {
|
|
|
|
|
|
+ if(data.length === 0) {
|
|
str = `<div class="informationBox tipsInfoWrapper ${className} clearfix">
|
|
str = `<div class="informationBox tipsInfoWrapper ${className} clearfix">
|
|
<p class="diagName recommendNull">暂无数据</p>
|
|
<p class="diagName recommendNull">暂无数据</p>
|
|
<div class="tipsInfoBox clearfix ${className + 'box'}"></div>
|
|
<div class="tipsInfoBox clearfix ${className + 'box'}"></div>
|
|
</div>`
|
|
</div>`
|
|
} else {
|
|
} else {
|
|
str = `<div class="informationBox tipsInfoWrapper ${className} clearfix">
|
|
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>`
|
|
</div>`
|
|
}
|
|
}
|
|
|
|
|
|
$('.infomationBox').append(str)
|
|
$('.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) {
|
|
function renderTipsInfoText(className,title,data, parentNode) {
|
|
- let childrenNodeBoxStr = ``
|
|
|
|
- if(data.length === 0) {
|
|
|
|
|
|
+ let childrenNodeBoxStr = `<p class="diagName">${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>
|
|
childrenNodeBoxStr += `<p class="recommendNull">暂无数据</p>
|
|
-
|
|
|
|
`
|
|
`
|
|
} else {
|
|
} 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)
|
|
$('.' + parentNode).append(childrenNodeBoxStr)
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function renderRecommendConditTips(icon, className,title,data) {
|
|
function renderRecommendConditTips(icon, className,title,data) {
|