This commit is contained in:
lik
2026-05-30 21:09:24 +08:00
parent 212c94224b
commit 010cf160a0
1075 changed files with 67487 additions and 1 deletions

176
pages/order/index.wxml Normal file
View File

@@ -0,0 +1,176 @@
<!--pages/order/index.wxml-->
<view class="order-page">
<!-- 状态筛选标签 -->
<view class="filter-section">
<scroll-view class="filter-scroll" scroll-x enhanced show-scrollbar="{{false}}">
<view class="filter-list">
<view
class="filter-item {{currentStatus === item.value ? 'active' : ''}}"
wx:for="{{statusFilters}}"
wx:key="value"
data-status="{{item.value}}"
bindtap="onStatusChange"
>
<text class="filter-text">{{item.label}}</text>
<view class="filter-badge" wx:if="{{item.count > 0}}">{{item.count}}</view>
</view>
</view>
</scroll-view>
</view>
<!-- 订单列表 -->
<view class="order-list">
<scroll-view
scroll-y
class="order-scroll"
refresher-enabled
refresher-triggered="{{isRefreshing}}"
bindrefresherrefresh="onPullDownRefresh"
bindscrolltolower="onReachBottom"
>
<!-- 加载中 -->
<view class="loading-container" wx:if="{{isLoading && orderList.length === 0}}">
<t-loading theme="spinner" size="40rpx" text="加载中..." t-class-text="loading-text" />
</view>
<!-- 空状态 -->
<view class="empty-container" wx:elif="{{!isLoading && orderList.length === 0}}">
<t-empty icon="file" description="暂无订单数据" t-class-description="empty-text">
<view slot="action">
<view class="empty-action" bindtap="loadOrderList">刷新试试</view>
</view>
</t-empty>
</view>
<!-- 订单卡片列表 -->
<view class="order-cards" wx:else>
<view
class="order-card {{item.status}}"
wx:for="{{orderList}}"
wx:key="_id"
data-id="{{item._id}}"
bindtap="onOrderDetail"
>
<!-- 卡片头部 -->
<view class="card-header">
<view class="order-id">
<t-icon name="file" size="28rpx" color="#6b7aff" />
<text class="order-id-text">订单 {{item.orderNo || item._id}}</text>
</view>
<view class="status-tag {{item.status}}">
<text>{{item.statusText}}</text>
</view>
</view>
<!-- 患者信息 -->
<view class="card-body">
<view class="patient-row">
<view class="patient-info">
<view class="patient-avatar">
<text class="avatar-text">{{item.patient.name ? item.patient.name[0] : '患'}}</text>
</view>
<view class="patient-detail">
<view class="patient-name-row">
<text class="patient-name">{{item.patient.name || '未知患者'}}</text>
<text class="patient-gender {{item.patient.sex}}">{{item.patient.sex === 'male' ? '男' : item.patient.sex === 'female' ? '女' : '未知'}}</text>
<text class="patient-age" wx:if="{{item.patient.age}}">{{item.patient.age}}岁</text>
</view>
<text class="patient-phone">{{item.patient.mobile || '暂无电话'}}</text>
</view>
</view>
</view>
<view class="info-divider"></view>
<!-- 医院信息 -->
<view class="hospital-row">
<view class="info-item">
<t-icon name="location" size="26rpx" color="#8b9bff" />
<view class="info-content">
<text class="hospital-name">{{item.hospital.name || '未知医院'}}</text>
<text class="department-name" wx:if="{{item.hospital.department}}">{{item.hospital.department}}</text>
</view>
</view>
</view>
<!-- 陪诊服务 -->
<view class="service-row" wx:if="{{item.escort.serviceName}}">
<view class="info-item">
<t-icon name="service" size="26rpx" color="#8b9bff" />
<text class="service-name">{{item.escort.serviceName}}</text>
</view>
</view>
<!-- 预约时间 -->
<view class="time-row">
<view class="info-item">
<t-icon name="time" size="26rpx" color="#8b9bff" />
<text class="time-text">{{item.schedule.dateText}} {{item.schedule.startTime || ''}}</text>
</view>
</view>
<!-- 陪诊员信息 -->
<view class="attendant-row" wx:if="{{item.attendant.name}}">
<view class="info-item">
<t-icon name="user" size="26rpx" color="#8b9bff" />
<text class="attendant-name">陪诊员:{{item.attendant.name}}</text>
</view>
</view>
</view>
<!-- 卡片底部 -->
<view class="card-footer">
<view class="fee-section">
<text class="fee-label">服务费用</text>
<text class="fee-value">¥{{item.payment.totalFee || 0}}</text>
</view>
<view class="action-buttons">
<view
class="btn btn-secondary"
wx:if="{{item.status === 'pending'}}"
data-id="{{item._id}}"
data-action="cancel"
catchtap="onOrderAction"
>取消</view>
<view
class="btn btn-primary"
wx:if="{{item.status === 'pending'}}"
data-id="{{item._id}}"
data-action="confirm"
catchtap="onOrderAction"
>确认</view>
<view
class="btn btn-primary"
wx:if="{{item.status === 'confirmed'}}"
data-id="{{item._id}}"
data-action="start"
catchtap="onOrderAction"
>开始服务</view>
<view
class="btn btn-primary"
wx:if="{{item.status === 'in_progress'}}"
data-id="{{item._id}}"
data-action="complete"
catchtap="onOrderAction"
>完成</view>
<view
class="btn btn-secondary"
wx:if="{{item.status === 'completed' || item.status === 'cancelled'}}"
data-id="{{item._id}}"
data-action="detail"
catchtap="onOrderAction"
>查看详情</view>
</view>
</view>
</view>
<!-- 加载更多 -->
<view class="load-more">
<t-loading wx:if="{{isLoadingMore}}" theme="spinner" size="32rpx" text="加载中..." t-class-text="loading-text" />
<text class="no-more" wx:elif="{{!hasMore}}">没有更多了</text>
</view>
</view>
</scroll-view>
</view>
</view>