restoreLightNavigation 在浅色页面 onShow / onReady 时把系统导航文字重置为黑色, 避免沿用上一页或系统主题的白色状态;withDuplicateNameHints 为同名就诊人补充 生日与手机尾号提示,不改档案 ID、联系方式与订单快照。
15 lines
553 B
JavaScript
15 lines
553 B
JavaScript
// 只补充展示信息,不改动就诊人 ID、联系方式或订单快照。
|
|
function withDuplicateNameHints(profiles) {
|
|
const counts = profiles.reduce((result, profile) => {
|
|
result[profile.name] = (result[profile.name] || 0) + 1
|
|
return result
|
|
}, Object.create(null))
|
|
return profiles.map((profile) => ({
|
|
...profile,
|
|
nameHint: counts[profile.name] > 1
|
|
? [profile.birth, profile.mobile ? `尾号${profile.mobile.slice(-4)}` : ''].filter(Boolean).join(' · ')
|
|
: ''
|
|
}))
|
|
}
|
|
|
|
module.exports = { withDuplicateNameHints } |