Files
wxapp_escort/pages/escort/itemorder.wxml
T
lik 2ba45b515d feat(escort): 新增立即预约页并接入首页主按钮
首页「立即预约」此前跳到服务列表,用户仍需再选一次服务才能下单,
路径偏长。新增 pages/escort/itemorder 作为统一下单页:进来即可选陪诊项目、
选就诊人(姓名/电话由档案只读带入,避免手填出错)、填医院与时间后提交。

提交时按服务配置处理班次(固定班次走选择器,弹性时段走时间选择器),
需要寄件的跑腿类服务额外要求填写收货地址,并用同一幂等键保证重试不重复下单。
2026-11-04 22:18:24 +08:00

134 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/escort/itemorder.wxml-->
<view class="page-bg">
<view class="container" wx:if="{{service.id}}">
<view class="page-header">
<view class="header-accent"></view>
<text class="header-title">立即预约</text>
<text class="header-subtitle">选择陪诊项目,填写信息后即可提交预约</text>
</view>
<view class="booking-form">
<!-- 陪诊项目:切换后同步更新服务的预约规则 -->
<view class="service-picker-row">
<text class="order-label">陪诊项目</text>
<picker class="service-picker" mode="selector" range="{{serviceOptions}}" value="{{serviceIndex}}"
disabled="{{submitting}}" bindchange="onServiceChange">
<view class="order-service-info">
<view class="order-service-mark">
<t-icon name="{{serviceIcon}}" size="48rpx" color="#9B4508" />
</view>
<view class="order-service-text">
<text class="order-service-title">{{service.title}}</text>
<text class="order-service-price">¥{{service.price}}/次</text>
</view>
<view class="service-picker-arrow">
<t-icon name="chevron-down" size="40rpx" color="#9B4508" />
</view>
</view>
</picker>
</view>
<!-- 选择就诊人:订单必须关联健康档案,就诊人信息全部由此带入 -->
<view class="order-row column">
<text class="order-label">选择就诊人</text>
<scroll-view class="patient-scroll" scroll-x wx:if="{{profiles.length > 0}}">
<view class="patient-chips">
<view class="patient-chip {{selectedProfileId === item._id ? 'active' : ''}}" wx:for="{{profiles}}" wx:key="_id"
data-id="{{item._id}}" bindtap="onSelectProfile">
<text class="patient-chip-name">{{item.name}}</text>
<text class="patient-chip-phone">{{item.mobile}}</text>
</view>
<view class="patient-chip patient-chip-add" bindtap="goToAddProfile">
<text class="patient-chip-name">+ 添加就诊人</text>
</view>
</view>
</scroll-view>
<view class="add-profile-tip" wx:else bindtap="goToAddProfile">
<text class="add-profile-tip-text">还没有就诊人,去添加后可一键带入</text>
<t-icon name="chevron-right" size="24rpx" color="#9B4508" />
</view>
</view>
<!-- 就诊人姓名/电话只读,与所选档案严格一致 -->
<view class="order-row">
<text class="order-label">就诊人姓名</text>
<text class="order-value {{patientName ? '' : 'placeholder'}}">{{patientName || '请先选择就诊人'}}</text>
</view>
<view class="order-row">
<text class="order-label">联系电话</text>
<text class="order-value {{patientPhone ? '' : 'placeholder'}}">{{patientPhone || '请先选择就诊人'}}</text>
</view>
<view class="order-row">
<text class="order-label">就诊省份</text>
<picker class="order-picker" mode="selector" range="{{provinces}}" value="{{provinceIndex}}" bindchange="onProvinceChange">
<view class="picker-value {{province ? '' : 'placeholder'}}">{{province || '请选择省份'}}</view>
</picker>
</view>
<view class="order-row">
<text class="order-label">就诊医院</text>
<input class="order-input" value="{{hospital}}" placeholder="请输入就诊医院" placeholder-class="input-placeholder" bindinput="onHospitalChange" />
</view>
<view class="order-row">
<text class="order-label">陪诊师性别</text>
<picker class="order-picker" mode="selector" range="{{genderOptions}}" value="{{genderIndex}}" bindchange="onGenderChange">
<view class="picker-value {{gender ? '' : 'placeholder'}}">{{gender || '请选择性别要求'}}</view>
</picker>
</view>
<view class="order-row">
<text class="order-label">预约日期</text>
<picker class="order-picker" mode="date" value="{{appointmentDate}}" start="{{minAppointmentDate}}" bindchange="onDateChange">
<view class="picker-value {{appointmentDate ? '' : 'placeholder'}}">{{appointmentDate || '请选择预约日期'}}</view>
</picker>
</view>
<view class="order-row">
<text class="order-label">预约时间</text>
<picker wx:if="{{fixedTime}}" class="order-picker" mode="selector" range="{{timeOptions}}" value="{{sessionIndex}}" bindchange="onTimeChange">
<view class="picker-value {{appointmentTime ? '' : 'placeholder'}}">
{{appointmentTime ? timeOptions[sessionIndex] : '请选择服务班次'}}
</view>
</picker>
<picker wx:else class="order-picker" mode="time" value="{{appointmentTime}}" start="{{timeStart}}" end="{{timeEnd}}" bindchange="onTimeChange">
<view class="picker-value {{appointmentTime ? '' : 'placeholder'}}">{{appointmentTime || '请选择预约时间'}}</view>
</picker>
</view>
<!-- 收货地址仅对快递/跑腿服务展示,随订单保存快照 -->
<view class="order-row column" wx:if="{{requiresAddress}}">
<text class="order-label">收货地址</text>
<textarea class="order-textarea" value="{{shippingAddress}}" placeholder="请输入省市区、街道门牌等完整收货地址" maxlength="200" placeholder-class="input-placeholder" bindinput="onShippingAddressChange" />
<text class="address-tip">收货人与联系电话使用所选就诊人信息</text>
</view>
<view class="order-row column">
<text class="order-label">备注说明</text>
<textarea class="order-textarea" value="{{remark}}" placeholder="请输入其他需求或备注信息" maxlength="200" placeholder-class="input-placeholder" bindinput="onRemarkChange" />
<text class="textarea-count">{{remark.length}}/200</text>
</view>
</view>
<view class="bottom-placeholder"></view>
<view class="bottom-bar">
<view class="bottom-price">
<text class="bottom-price-label">合计</text>
<text class="price-sym">¥</text>
<text class="bottom-price-value">{{totalPrice}}</text>
</view>
<button class="submit-btn" bindtap="submitOrder" disabled="{{submitting}}" loading="{{submitting}}">{{submitting ? '提交中' : '提交预约'}}</button>
</view>
</view>
<view class="page-state" wx:if="{{pageLoading}}">
<t-loading theme="circular" size="40rpx" text="加载中..." />
</view>
<view class="page-state" wx:if="{{!pageLoading && pageError}}">
<text class="page-state-text">{{pageError}}</text>
<button class="page-retry" bindtap="retryLoad">重新加载</button>
</view>
</view>