From 0b4c752885d10a16268f055d3b2b48f928952c66 Mon Sep 17 00:00:00 2001 From: lik Date: Mon, 16 Nov 2026 19:30:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(booking):=20=E6=96=B0=E5=A2=9E=E6=B5=85?= =?UTF-8?q?=E8=89=B2=E5=AF=BC=E8=88=AA=E6=81=A2=E5=A4=8D=E4=B8=8E=E5=B0=B1?= =?UTF-8?q?=E8=AF=8A=E4=BA=BA=E9=87=8D=E5=90=8D=E6=8F=90=E7=A4=BA=E5=B7=A5?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit restoreLightNavigation 在浅色页面 onShow / onReady 时把系统导航文字重置为黑色, 避免沿用上一页或系统主题的白色状态;withDuplicateNameHints 为同名就诊人补充 生日与手机尾号提示,不改档案 ID、联系方式与订单快照。 --- utils/booking-profiles.js | 15 +++++++++++++++ utils/navigation.js | 11 +++++++++++ 2 files changed, 26 insertions(+) create mode 100644 utils/booking-profiles.js create mode 100644 utils/navigation.js diff --git a/utils/booking-profiles.js b/utils/booking-profiles.js new file mode 100644 index 0000000..ba67396 --- /dev/null +++ b/utils/booking-profiles.js @@ -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 } \ No newline at end of file diff --git a/utils/navigation.js b/utils/navigation.js new file mode 100644 index 0000000..915b36e --- /dev/null +++ b/utils/navigation.js @@ -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 } \ No newline at end of file