186 lines
7.2 KiB
Plaintext
186 lines
7.2 KiB
Plaintext
<!--pages/order/index.wxml-->
|
|
<view class="page">
|
|
<!-- 顶部标题 -->
|
|
<view class="header">
|
|
<view class="header-content">
|
|
<text class="header-title">{{currentScope === 'pool' ? '接单大厅' : '我的订单'}}</text>
|
|
<text class="header-sub">共 {{stats.total}} {{currentScope === 'pool' ? '个未分配订单' : '个订单'}}</text>
|
|
</view>
|
|
<view class="header-add" wx:if="{{isAdmin}}" bindtap="onAddOrder">新增预约</view>
|
|
</view>
|
|
|
|
<!-- 订单分栏:未分配订单 / 我的订单 -->
|
|
<view class="scope-bar">
|
|
<view
|
|
class="scope-tab {{currentScope === 'pool' ? 'active' : ''}}"
|
|
data-scope="pool"
|
|
bindtap="onScopeChange"
|
|
>未分配订单</view>
|
|
<view
|
|
class="scope-tab {{currentScope === 'mine' ? 'active' : ''}}"
|
|
data-scope="mine"
|
|
bindtap="onScopeChange"
|
|
>我的订单</view>
|
|
</view>
|
|
|
|
<!-- 状态筛选:仅「我的订单」可用,通过下拉选择,不再占用页面 tab -->
|
|
<view class="filter-bar" wx:if="{{currentScope === 'mine'}}">
|
|
<text class="filter-label">订单状态</text>
|
|
<picker
|
|
mode="selector"
|
|
range="{{statusFilterLabels}}"
|
|
value="{{statusIndex}}"
|
|
bindchange="onStatusPick"
|
|
>
|
|
<view class="status-pill">
|
|
<text>{{statusFilterLabels[statusIndex]}}</text>
|
|
<t-icon name="chevron-down" size="24rpx" color="#A3988B" />
|
|
</view>
|
|
</picker>
|
|
</view>
|
|
|
|
<!-- 订单列表 -->
|
|
<view class="list-area">
|
|
<scroll-view
|
|
scroll-y
|
|
class="list-scroll"
|
|
refresher-enabled
|
|
refresher-triggered="{{isRefreshing}}"
|
|
bindrefresherrefresh="onPullDownRefresh"
|
|
bindscrolltolower="onReachBottom"
|
|
>
|
|
<!-- 加载中 -->
|
|
<view class="loading-box" wx:if="{{isLoading && orderList.length === 0}}">
|
|
<t-loading theme="spinner" size="40rpx" text="加载中..." t-class-text="loading-text" />
|
|
</view>
|
|
|
|
<!-- 空状态 -->
|
|
<view class="empty-box" wx:elif="{{!isLoading && orderList.length === 0}}">
|
|
<t-empty icon="file" description="{{currentScope === 'pool' ? '暂无可接订单' : '暂无订单'}}" t-class-description="empty-text">
|
|
<view slot="action">
|
|
<view class="empty-btn" bindtap="onReload">刷新</view>
|
|
</view>
|
|
</t-empty>
|
|
</view>
|
|
|
|
<!-- 卡片列表 -->
|
|
<view class="card-list" wx:else>
|
|
<view
|
|
class="order-card"
|
|
wx:for="{{orderList}}"
|
|
wx:key="_id"
|
|
data-id="{{item._id}}"
|
|
bindtap="onOrderDetail"
|
|
>
|
|
<!-- 卡片头部 -->
|
|
<view class="card-top">
|
|
<view class="card-tags">
|
|
<text class="order-tag tag-pool" wx:if="{{item.isPoolOrder}}">未分配</text>
|
|
<text class="order-tag tag-shared" wx:if="{{item.sharedToMe}}">共享给我</text>
|
|
</view>
|
|
<view class="status-badge status-{{item.displayStatus}}">
|
|
<text>{{item.statusText}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 患者信息 -->
|
|
<view class="card-main">
|
|
<view class="patient-line">
|
|
<view class="patient-avatar">
|
|
<text class="avatar-char">{{item.patientFirstChar}}</text>
|
|
</view>
|
|
<view class="patient-meta">
|
|
<view class="patient-name-row">
|
|
<text class="patient-name">{{item.patient.name || '未知患者'}}</text>
|
|
<text class="patient-sex {{item.patient.sex}}">{{item.patient.sex === 'male' ? '男' : item.patient.sex === 'female' ? '女' : ''}}</text>
|
|
<text class="patient-age" wx:if="{{item.patientAgeText}}">{{item.patientAgeText}}</text>
|
|
</view>
|
|
<text class="patient-phone">{{item.patient.mobile || '暂无电话'}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="divider"></view>
|
|
|
|
<!-- 就诊信息 -->
|
|
<view class="info-line">
|
|
<text class="line-label">医院</text>
|
|
<text class="line-value">{{item.hospital.name || '未知医院'}}{{item.hospital.department ? ' · ' + item.hospital.department : ''}}</text>
|
|
</view>
|
|
<view class="info-line" wx:if="{{item.escort.serviceName}}">
|
|
<text class="line-label">服务</text>
|
|
<text class="line-value">{{item.escort.serviceName}}</text>
|
|
</view>
|
|
<view class="info-line">
|
|
<text class="line-label">时间</text>
|
|
<text class="line-value">{{item.schedule.dateText}} {{item.schedule.startTime || ''}}</text>
|
|
</view>
|
|
<view class="info-line" wx:if="{{item.attendant.name}}">
|
|
<text class="line-label">陪诊</text>
|
|
<text class="line-value">{{item.attendant.name}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 卡片底部 -->
|
|
<view class="card-bottom">
|
|
<view class="fee-area">
|
|
<text class="fee-label">费用</text>
|
|
<text class="fee-amount">¥{{item.payment.totalFee || 0}}</text>
|
|
</view>
|
|
<view class="action-area">
|
|
<view
|
|
class="action-btn btn-ghost"
|
|
wx:if="{{item.displayStatus === 'pending' && item.canOperate}}"
|
|
data-id="{{item._id}}"
|
|
data-action="cancel"
|
|
catchtap="onOrderAction"
|
|
>取消</view>
|
|
<view
|
|
class="action-btn btn-solid"
|
|
wx:if="{{item.canAccept}}"
|
|
data-id="{{item._id}}"
|
|
data-action="accept"
|
|
catchtap="onOrderAction"
|
|
>接单</view>
|
|
<view
|
|
class="action-btn btn-solid"
|
|
wx:if="{{item.displayStatus === 'pending' && item.canOperate}}"
|
|
data-id="{{item._id}}"
|
|
data-action="confirm"
|
|
catchtap="onOrderAction"
|
|
>确认</view>
|
|
<view
|
|
class="action-btn btn-solid"
|
|
wx:if="{{item.displayStatus === 'confirmed' && item.canOperate}}"
|
|
data-id="{{item._id}}"
|
|
data-action="start"
|
|
catchtap="onOrderAction"
|
|
>开始服务</view>
|
|
<view
|
|
class="action-btn btn-solid"
|
|
wx:if="{{item.displayStatus === 'in_progress' && item.canOperate}}"
|
|
data-id="{{item._id}}"
|
|
data-action="complete"
|
|
catchtap="onOrderAction"
|
|
>完成</view>
|
|
<!-- 待取消订单:列表内可直接同意取消 -->
|
|
<view
|
|
class="action-btn btn-solid"
|
|
wx:if="{{item.displayStatus === 'cancel_requested' && item.canOperate}}"
|
|
data-id="{{item._id}}"
|
|
data-action="cancel"
|
|
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>
|