|
@@ -3,6 +3,7 @@ const { openNewWin,imageUrlPrefix } = require('./promise.js');
|
|
|
const { bindTipsEvent } = require('./popupEdit.js');
|
|
|
|
|
|
function renderRecommendInfo(showNum,className,title,data, hasInfo, type, position) {
|
|
|
+ let showNumCopy = showNum || 5
|
|
|
const dataLen = data.length
|
|
|
const str = `<div class="recommendInfoWrapper ${className}">
|
|
|
<h4><i></i>${title}</h4>
|
|
@@ -13,8 +14,8 @@ function renderRecommendInfo(showNum,className,title,data, hasInfo, type, positi
|
|
|
</div>`
|
|
|
$('.recommendWrap').append(str)
|
|
|
let dataShort
|
|
|
- if(showNum&& dataLen > showNum) {
|
|
|
- dataShort = data.slice(0, showNum)
|
|
|
+ if(showNumCopy&& dataLen > showNumCopy) {
|
|
|
+ dataShort = data.slice(0, showNumCopy)
|
|
|
} else {
|
|
|
dataShort = data
|
|
|
}
|
|
@@ -54,7 +55,7 @@ function renderRecommendInfo(showNum,className,title,data, hasInfo, type, positi
|
|
|
const infoMsgName = $(this).attr('data-name')
|
|
|
openNewWin(`information.html?type=${type}&position=${position}&name=${infoMsgName}`)
|
|
|
})
|
|
|
- if(dataLen > showNum) {
|
|
|
+ if(dataLen > showNumCopy) {
|
|
|
slideToggle($("."+className+"box"), childrenNodeStrShort,childrenNodeStrLong)
|
|
|
}
|
|
|
}
|
|
@@ -67,7 +68,7 @@ function renderMultRecommendInfo(className,title,data, hasInfo, type, position)
|
|
|
$('.recommendWrap').append(str)
|
|
|
|
|
|
for(let i = 0; i < data.length; i++) {
|
|
|
- const showNum = data[i].showNum
|
|
|
+ const showNum = data[i].showNum || 5
|
|
|
const dataLen = data[i].data.length
|
|
|
let childrenNodeBoxStr = `<div class="labAndPacsBox ${data[i].className} clearfix"> </div>`
|
|
|
let childrenNodeStrShort = `<span class="labAndPacsTitle">${data[i].title}<i></i></span>`
|