From c6a8da068378588d1bbf01e44ee290307983a3fd Mon Sep 17 00:00:00 2001 From: lik Date: Fri, 6 Nov 2026 17:29:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(escort):=20=E5=8C=BB=E9=99=A2=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=9C=A8=E5=BC=B9=E7=AA=97=E5=86=85=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=EF=BC=8C=E9=81=BF=E5=85=8D=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=A2=AB=E8=A3=81=E5=88=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/hospital-select/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/hospital-select/index.js b/components/hospital-select/index.js index 94c20b7..aed81e8 100644 --- a/components/hospital-select/index.js +++ b/components/hospital-select/index.js @@ -33,6 +33,9 @@ Component({ placeholder: { type: String, value: '请选择就诊医院' }, disabled: { type: Boolean, value: false }, compact: { type: Boolean, value: false }, + // 默认由组件自己上滚页面;放在弹窗内的 scroll-view 时, + // 页面滚动无法带动弹窗内容,需置 false 交给页面做容器内滚动 + autoPageScroll: { type: Boolean, value: true }, // 展开面板上滚时,医院行锚定到距页面顶部的距离(rpx); // 传入上方行的总高度,可让「就诊人姓名」等上一行滚到页面顶部 scrollAnchorOffset: { type: Number, value: 0 }, @@ -72,6 +75,9 @@ Component({ } this.setData({ open: true, keyword: '', manualEntry: false }) this.refreshFiltered(this.data.options, '') + // 页面可监听 open 事件,在自定义滚动容器内做定位 + this.triggerEvent('open') + if (!this.data.autoPageScroll) return // 面板展开后若被页面底部遮挡,自动上滚页面,保证下拉列表完整可见 wx.nextTick(() => this.scrollPanelIntoView()) },