chore(family): 关爱对象行未填联系人时不再显示占位文案

This commit is contained in:
ozh 2026-09-17 11:58:25 +08:00
parent a1901b5611
commit 4b34910b4d
1 changed files with 2 additions and 2 deletions

View File

@ -17,10 +17,10 @@ import styles from './detail.module.scss'
// 成员显示名:家庭内昵称优先,未设置回落微信昵称 // 成员显示名:家庭内昵称优先,未设置回落微信昵称
const memberName = (m: HomeMember): string => m.nickName ?? m.userNickName ?? '成员' const memberName = (m: HomeMember): string => m.nickName ?? m.userNickName ?? '成员'
// 关爱对象联系人摘要:最多显示前 2 位姓名,其余以 +N 概括 // 关爱对象联系人摘要:最多显示前 2 位姓名,其余以 +N 概括;未填则不显示
const contactsSummary = (c: CareMember): string => { const contactsSummary = (c: CareMember): string => {
const list = c.contacts ?? [] const list = c.contacts ?? []
if (list.length === 0) return '未填联系人' if (list.length === 0) return ''
const head = list.slice(0, 2).map((ct) => ct.name).join('、') const head = list.slice(0, 2).map((ct) => ct.name).join('、')
const rest = list.length > 2 ? ` 等 ${list.length} 人` : '' const rest = list.length > 2 ? ` 等 ${list.length} 人` : ''
return `${head}${rest}` return `${head}${rest}`