feat(booking): 新增浅色导航恢复与就诊人重名提示工具

restoreLightNavigation 在浅色页面 onShow / onReady 时把系统导航文字重置为黑色,
避免沿用上一页或系统主题的白色状态;withDuplicateNameHints 为同名就诊人补充
生日与手机尾号提示,不改档案 ID、联系方式与订单快照。
This commit is contained in:
lik
2026-11-16 19:30:25 +08:00
parent af666567c1
commit 0b4c752885
2 changed files with 26 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
// 只补充展示信息,不改动就诊人 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 }
+11
View File
@@ -0,0 +1,11 @@
// 浅色页面每次展示时恢复深色系统文字,防止沿用前一页面/系统主题状态。
function restoreLightNavigation() {
wx.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#FAF8F5',
animation: { duration: 0, timingFunc: 'linear' },
fail(error) { console.warn('设置导航栏颜色失败', error) }
})
}
module.exports = { restoreLightNavigation }