0.6.0.3
This commit is contained in:
+37
-3
@@ -1002,11 +1002,45 @@ function renderSpousesCards(
|
||||
return renderPersonCard(spouses[0], getMemberName, baseUrl, false)
|
||||
}
|
||||
|
||||
// 多配偶,上下排列
|
||||
// 多配偶,上下排列,每个配偶都有头像
|
||||
let html = '<div class="spouses-container">'
|
||||
spouses.forEach((spouse, index) => {
|
||||
html += `<div><span class="spouse-label-tag">配偶${index + 1}</span></div>`
|
||||
html += renderPersonCard(spouse, getMemberName, baseUrl, false)
|
||||
const isDead = !!spouse.deathDate
|
||||
const statusText = isDead ? '已故' : '在世'
|
||||
const statusClass = isDead ? 'status-deceased' : 'status-living'
|
||||
const avatarUrl = getFullImageUrl(spouse.avatarUrl, baseUrl)
|
||||
const genderText = spouse.gender === 'MALE' ? '男' : spouse.gender === 'FEMALE' ? '女' : ''
|
||||
|
||||
html += `
|
||||
<div class="spouse-item" style="border: 1px dashed #d4c4a8; padding: 8px; background: #fefcf8; ${index > 0 ? 'margin-top: 8px;' : ''}">
|
||||
<div style="display: flex; align-items: flex-start; gap: 10px;">
|
||||
<!-- 配偶头像 -->
|
||||
${avatarUrl
|
||||
? `<img style="width: 50px; height: 50px; border: 2px solid #8b4513; object-fit: cover; flex-shrink: 0;" src="${avatarUrl}" alt="${spouse.fullName}" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';" /><div style="width: 50px; height: 50px; border: 2px solid #d4c4a8; background: #f0e6d3; display: none; align-items: center; justify-content: center; color: #8b4513; font-size: 18pt; flex-shrink: 0;">${spouse.gender === 'MALE' ? '👤' : '👩'}</div>`
|
||||
: `<div style="width: 50px; height: 50px; border: 2px solid #d4c4a8; background: #f0e6d3; display: flex; align-items: center; justify-content: center; color: #8b4513; font-size: 18pt; flex-shrink: 0;">${spouse.gender === 'MALE' ? '👤' : '👩'}</div>`
|
||||
}
|
||||
<!-- 配偶信息 -->
|
||||
<div style="flex: 1; min-width: 0;">
|
||||
<div style="display: flex; align-items: center; gap: 8px; margin-bottom: 4px;">
|
||||
<span style="font-size: 9pt; color: #8b4513; background: #f5f0e6; padding: 1px 6px; border-radius: 3px;">配偶${index + 1}</span>
|
||||
<span style="font-size: 14pt; font-weight: bold; color: #8b4513;">${spouse.fullName || '未知'}</span>
|
||||
<span class="status-badge ${statusClass}" style="font-size: 8pt;">${statusText}</span>
|
||||
</div>
|
||||
<div style="font-size: 9pt; color: #666;">
|
||||
${genderText ? `<span>${genderText}</span>` : ''}
|
||||
${spouse.birthDate ? `<span style="margin-left: 8px;">生于 ${formatDate(spouse.birthDate)}</span>` : ''}
|
||||
${spouse.deathDate ? `<span style="margin-left: 8px;">卒于 ${formatDate(spouse.deathDate)}</span>` : ''}
|
||||
</div>
|
||||
${spouse.ancestralHome || spouse.occupation ? `
|
||||
<div style="font-size: 9pt; color: #666; margin-top: 2px;">
|
||||
${spouse.ancestralHome ? `<span>籍贯: ${spouse.ancestralHome}</span>` : ''}
|
||||
${spouse.occupation ? `<span style="margin-left: 8px;">职业: ${spouse.occupation}</span>` : ''}
|
||||
</div>
|
||||
` : ''}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
html += '</div>'
|
||||
return html
|
||||
|
||||
Reference in New Issue
Block a user