feat(hospital-select): 重构医院选择组件与相关样式
- 移除列表/手填切换模式,改为「其他医院」常驻入口内联手填 - 选项行高按放大后的字号重算,搜索框不再自动聚焦 - 服务详情、预约表单与相关页面同步 hospitalCustom 状态 - 统一就诊人添加按钮、个人档案、首页与培训页字号样式
This commit is contained in:
@@ -1,41 +1,43 @@
|
||||
<view class="hospital-select {{compact ? 'is-compact' : ''}} {{disabled ? 'is-disabled' : ''}}">
|
||||
<view class="hospital-row">
|
||||
<view class="hospital-label-wrap">
|
||||
<text class="hospital-label">{{label}}</text>
|
||||
<text class="hospital-mode" catchtap="onToggleManual">{{manual ? '从列表选择' : '手动输入'}}</text>
|
||||
</view>
|
||||
|
||||
<input
|
||||
wx:if="{{manual}}"
|
||||
class="hospital-input"
|
||||
value="{{value}}"
|
||||
placeholder="{{placeholder}}"
|
||||
placeholder-class="hospital-placeholder"
|
||||
disabled="{{disabled}}"
|
||||
bindinput="onManualInput"
|
||||
/>
|
||||
<view wx:else class="hospital-value" bindtap="onOpen">
|
||||
<text class="hospital-label">{{label}}</text>
|
||||
<view class="hospital-value" bindtap="onOpen">
|
||||
<text class="hospital-value-text {{value ? '' : 'is-placeholder'}}">{{value || placeholder}}</text>
|
||||
<view class="hospital-chevron {{open ? 'is-open' : ''}}"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="hospital-panel" wx:if="{{open && !manual}}">
|
||||
<view class="hospital-panel" wx:if="{{open}}">
|
||||
<view class="hospital-search">
|
||||
<input
|
||||
class="hospital-search-input"
|
||||
value="{{keyword}}"
|
||||
placeholder="{{searchPlaceholder}}"
|
||||
placeholder-class="hospital-placeholder"
|
||||
focus="{{open}}"
|
||||
confirm-type="search"
|
||||
bindinput="onKeywordInput"
|
||||
/>
|
||||
<text class="hospital-search-close" bindtap="onClose">收起</text>
|
||||
</view>
|
||||
|
||||
<!-- 填写其他医院:列表里没有的医院走这里 -->
|
||||
<view wx:if="{{manualEntry}}" class="hospital-manual-panel">
|
||||
<input
|
||||
class="hospital-manual-input"
|
||||
value="{{manualName}}"
|
||||
placeholder="请输入医院名称"
|
||||
placeholder-class="hospital-placeholder"
|
||||
focus="{{manualEntry}}"
|
||||
confirm-type="done"
|
||||
bindinput="onManualNameInput"
|
||||
bindconfirm="onConfirmManual"
|
||||
/>
|
||||
<text class="hospital-manual-confirm" catchtap="onConfirmManual">确定</text>
|
||||
<text class="hospital-manual-cancel" catchtap="onCancelManual">返回列表</text>
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
wx:if="{{filtered.length > 0}}"
|
||||
wx:elif="{{filtered.length > 0}}"
|
||||
class="hospital-options"
|
||||
scroll-y
|
||||
style="height: {{optionsHeight}}rpx;"
|
||||
@@ -57,12 +59,11 @@
|
||||
|
||||
<view wx:else class="hospital-empty">
|
||||
<text class="hospital-empty-text">{{keyword ? '没有找到匹配的医院' : '暂无可选医院'}}</text>
|
||||
<text class="hospital-use-input" wx:if="{{keyword}}" bindtap="onUseKeyword">使用「{{keyword}}」</text>
|
||||
<text class="hospital-use-input" wx:else bindtap="onToggleManual">手动输入</text>
|
||||
</view>
|
||||
|
||||
<view class="hospital-panel-footer" wx:if="{{keyword && filtered.length > 0}}">
|
||||
<text class="hospital-use-input" bindtap="onUseKeyword">没有找到?使用「{{keyword}}」</text>
|
||||
<!-- 其他医院:常驻入口,不用先搜出空结果才找得到 -->
|
||||
<view wx:if="{{!manualEntry}}" class="hospital-other" bindtap="onStartManual">
|
||||
<text class="hospital-other-text">其他医院(列表里没有?手动填写名称)</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user