Files
wxapp_companion/pages/order/orderEdit.wxml
T
2026-09-09 17:37:43 +08:00

152 lines
6.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--pages/order/orderEdit.wxml-->
<view class="page">
<!-- 未选择档案时的占位提示 -->
<view class="profile-brief profile-empty" wx:if="{{needPickProfile}}" bindtap="openProfilePicker">
<view class="profile-empty-main">
<text class="profile-empty-title">尚未选择健康档案</text>
<text class="profile-empty-sub">患者信息将取自所选档案</text>
</view>
<view class="profile-empty-btn">选择档案</view>
</view>
<!-- 健康档案简要信息 -->
<view class="profile-brief" wx:if="{{profileId || profileSummary}}">
<!-- 有关联档案:统一按档案ID加载(不读缓存,直接请求最新),患者信息以档案为准 -->
<patient-info
wx:if="{{profileId}}"
profile-id="{{profileId}}"
use-cache="{{false}}"
bindloaded="onProfileLoaded"
/>
<!-- 无关联档案(如订单未关联档案):使用订单快照 -->
<patient-info
wx:else
name="{{profileSummary.name}}"
sex-label="{{profileSummary.sexLabel}}"
age-text="{{profileSummary.ageText}}"
mobile="{{profileSummary.mobile}}"
location-text="{{profileSummary.locationText}}"
/>
<view class="brief-tags" wx:if="{{profileSummary.bloodType || profileSummary.height || profileSummary.weight}}">
<text wx:if="{{profileSummary.bloodType}}" class="brief-tag">血型 {{profileSummary.bloodType}}</text>
<text wx:if="{{profileSummary.height}}" class="brief-tag">身高 {{profileSummary.height}}cm</text>
<text wx:if="{{profileSummary.weight}}" class="brief-tag">体重 {{profileSummary.weight}}kg</text>
</view>
<text wx:if="{{profileSummary.remark}}" class="brief-remark">备注:{{profileSummary.remark}}</text>
</view>
<view class="form">
<!-- 就诊信息 -->
<view class="section">
<view class="section-title">就诊信息</view>
<view class="info-card">
<view class="field">
<text class="field-label">医院</text>
<input class="field-input" placeholder="请输入医院名称" value="{{form.hospital.name}}" data-key="hospital.name" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">科室</text>
<input class="field-input" placeholder="请输入科室" value="{{form.hospital.department}}" data-key="hospital.department" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">医生姓名</text>
<input class="field-input" placeholder="请输入医生姓名(选填)" value="{{form.hospital.doctor}}" data-key="hospital.doctor" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">就诊日期</text>
<picker class="field-picker" mode="date" value="{{form.schedule.date}}" start="{{today}}" bindchange="onDateChange">
<view class="field-value {{form.schedule.date ? '' : 'placeholder'}}">
{{form.schedule.date || '请选择就诊日期'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
<view class="field">
<text class="field-label">开始时间</text>
<picker class="field-picker" mode="time" value="{{form.schedule.startTime}}" bindchange="onTimeChange">
<view class="field-value {{form.schedule.startTime ? '' : 'placeholder'}}">
{{form.schedule.startTime || '请选择开始时间(选填)'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
</view>
</view>
<!-- 服务信息 -->
<view class="section">
<view class="section-title">服务信息</view>
<view class="info-card">
<view class="field">
<text class="field-label">服务名称</text>
<picker class="field-picker" mode="selector" range="{{serviceOptions}}" range-key="title" bindchange="onServiceChange">
<view class="field-value {{form.escort.serviceName ? '' : 'placeholder'}}">
{{form.escort.serviceName || '请选择服务'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
<view class="field">
<text class="field-label">费用(元)</text>
<input class="field-input" type="digit" placeholder="请输入服务费用" value="{{form.payment.totalFee}}" data-key="payment.totalFee" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">是否已支付</text>
<view class="field-switch">
<text class="switch-label {{form.payment.paid ? 'paid' : 'unpaid'}}">{{form.payment.paid ? '已支付' : '未支付'}}</text>
<switch checked="{{form.payment.paid}}" color="#17c3a5" bindchange="onPaidChange" />
</view>
</view>
<view class="field field-textarea">
<text class="field-label">备注</text>
<textarea class="field-area" placeholder="请输入备注信息(选填)" value="{{form.notes.patientNote}}" data-key="notes.patientNote" bindinput="onInput" />
</view>
</view>
</view>
<!-- 提交 -->
<view class="submit-btn" bindtap="onSubmit">{{isEdit ? '保存修改' : '提交订单'}}</view>
</view>
<!-- 健康档案选择弹层 -->
<view class="picker-mask" wx:if="{{showProfilePicker}}" bindtap="closeProfilePicker">
<view class="picker-sheet" catchtap="noop">
<view class="picker-head">
<text class="picker-title">选择健康档案</text>
<text class="picker-close" bindtap="closeProfilePicker">✕</text>
</view>
<view class="picker-search">
<input class="picker-search-input" placeholder="搜索姓名 / 手机号" value="{{profileKeyword}}" bindinput="onProfileSearch" />
</view>
<scroll-view scroll-y class="picker-list">
<view
class="picker-item"
wx:for="{{filteredProfiles}}"
wx:key="id"
data-id="{{item.id}}"
bindtap="onProfileSelect"
>
<view class="picker-avatar">
<text>{{item.name[0]}}</text>
</view>
<view class="picker-item-main">
<view class="picker-item-name-row">
<text class="picker-item-name">{{item.name}}</text>
<text class="picker-item-sub">{{item.sexLabel}}{{item.sexLabel ? ' · ' : ''}}{{item.ageText}}</text>
</view>
<text class="picker-item-mobile">{{item.mobile || '暂无电话'}}</text>
</view>
<text class="picker-arrow">›</text>
</view>
<view class="picker-empty" wx:if="{{filteredProfiles.length === 0}}">未找到匹配的档案</view>
</scroll-view>
</view>
</view>
</view>