style(escort): 预约表单行标签加浅底tag,医院下拉补遮罩与收起入口
- 行标题统一 190rpx 浅橙底 tag,整列对齐 - 医院下拉展开时加全屏遮罩,点空白处收起 - 下拉面板改白底橙边,收起文案换箭头图标,列表加高到 6 行 - 各 picker 补下拉箭头,行分隔线改点分线,底部占位加高避开固定栏
This commit is contained in:
@@ -60,7 +60,7 @@ Component({
|
||||
methods: {
|
||||
refreshFiltered(options = this.data.options, keyword = this.data.keyword) {
|
||||
const filtered = filterHospitals(options, keyword)
|
||||
const visibleRows = Math.min(filtered.length, 4)
|
||||
const visibleRows = Math.min(filtered.length, 6)
|
||||
this.setData({
|
||||
filtered,
|
||||
optionsHeight: visibleRows * OPTION_HEIGHT,
|
||||
@@ -112,6 +112,9 @@ Component({
|
||||
this.setData({ open: false, keyword: '', optionsHeight: 0, manualEntry: false })
|
||||
},
|
||||
|
||||
// 遮罩占位:catchtouchmove 阻止穿透滚动页面
|
||||
noop() {},
|
||||
|
||||
onKeywordInput(e) {
|
||||
const keyword = e.detail.value
|
||||
this.setData({ keyword })
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<view class="hospital-select {{compact ? 'is-compact' : ''}} {{disabled ? 'is-disabled' : ''}}">
|
||||
<view class="hospital-select {{compact ? 'is-compact' : ''}} {{disabled ? 'is-disabled' : ''}} {{open ? 'is-open' : ''}}">
|
||||
<!-- 展开时的全屏遮罩:点击任意空白处收起,强化「可开可收」的下拉感知 -->
|
||||
<view class="hospital-mask" wx:if="{{open}}" bindtap="onClose" catchtouchmove="noop"></view>
|
||||
<view class="hospital-row">
|
||||
<text class="hospital-label">{{label}}</text>
|
||||
<view class="hospital-value" bindtap="onOpen">
|
||||
@@ -17,7 +19,9 @@
|
||||
confirm-type="search"
|
||||
bindinput="onKeywordInput"
|
||||
/>
|
||||
<text class="hospital-search-close" bindtap="onClose">收起</text>
|
||||
<view class="hospital-search-close" bindtap="onClose" aria-role="button" aria-label="收起医院列表">
|
||||
<view class="hospital-collapse-arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 填写其他医院:列表里没有的医院走这里 -->
|
||||
|
||||
@@ -1,10 +1,34 @@
|
||||
/* 医院选择:行结构与页面表单保持一致,展开面板作为行内下拉 */
|
||||
/* 展开时整组件抬到遮罩之上:遮罩盖住页面其余内容(含底部栏 100),面板仍可点 */
|
||||
.hospital-select.is-open {
|
||||
position: relative;
|
||||
z-index: 151;
|
||||
}
|
||||
|
||||
/* 展开遮罩:浅墨半透明,点击任意空白处收起;层级低于页面支付弹窗(200/201) */
|
||||
.hospital-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
background: rgba(43, 37, 33, 0.3);
|
||||
}
|
||||
|
||||
/* 展开时行与面板抬到遮罩之上(同属 .is-open 层叠上下文,仅内部比较) */
|
||||
.hospital-select.is-open .hospital-row,
|
||||
.hospital-select.is-open .hospital-panel {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.hospital-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 24rpx 0;
|
||||
border-bottom: 2rpx solid var(--line, #ECE3D6);
|
||||
border-bottom: 2rpx dotted var(--line-soft, #E9DECB);
|
||||
}
|
||||
|
||||
.is-compact .hospital-row {
|
||||
@@ -37,6 +61,16 @@
|
||||
margin-left: 24rpx;
|
||||
}
|
||||
|
||||
/* 行标题:浅橙底 tag,与页面表单 .order-label 同款(同宽对齐) */
|
||||
.hospital-label {
|
||||
box-sizing: border-box;
|
||||
min-width: 190rpx;
|
||||
padding: 8rpx 20rpx;
|
||||
text-align: center;
|
||||
background: var(--brand-soft, #FFF4E8);
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.hospital-value-text {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
@@ -124,13 +158,13 @@
|
||||
transform: rotate(-135deg);
|
||||
}
|
||||
|
||||
/* 展开面板:浅橙衬底 + 2rpx 浅橙描边托形,与白卡拉开边界(不用阴影) */
|
||||
/* 展开面板:白底 + 2rpx 浅橙描边托形,与白卡靠橙边区分(不用阴影) */
|
||||
.hospital-panel {
|
||||
margin: 12rpx 0 24rpx;
|
||||
padding: 0 20rpx 20rpx;
|
||||
border: 2rpx solid var(--brand-line, #FFE0C2);
|
||||
border-radius: 20rpx;
|
||||
background: var(--brand-soft, #FFF4E8);
|
||||
background: var(--white, #FFFFFF);
|
||||
}
|
||||
|
||||
.hospital-search {
|
||||
@@ -150,11 +184,22 @@
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
/* 收起按钮:上箭头图标(CSS 边框三角,不依赖字体图标),留足点击热区 */
|
||||
.hospital-search-close {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 16rpx;
|
||||
color: var(--muted, #6F655C);
|
||||
font-size: var(--fs-28, 28rpx);
|
||||
padding: 12rpx;
|
||||
}
|
||||
|
||||
.hospital-collapse-arrow {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
border-top: 4rpx solid var(--brand-ink, #9B4508);
|
||||
border-right: 4rpx solid var(--brand-ink, #9B4508);
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
|
||||
.hospital-search-close:active {
|
||||
@@ -178,7 +223,7 @@
|
||||
}
|
||||
|
||||
.hospital-option:active {
|
||||
background: var(--white, #FFFFFF);
|
||||
background: var(--brand-soft, #FFF4E8);
|
||||
}
|
||||
|
||||
.hospital-option-main {
|
||||
|
||||
Reference in New Issue
Block a user