|
|
@@ -0,0 +1,87 @@
|
|
|
+<wxs module="utils">
|
|
|
+module.exports = {
|
|
|
+ getStatusClass: function(status) {
|
|
|
+ if (status === '配送中') return 'delivering';
|
|
|
+ if (status === '已完成') return 'completed';
|
|
|
+ if (status === '待支付') return 'pending';
|
|
|
+ if (status === 'delivering') return 'delivering';
|
|
|
+ if (status === 'completed') return 'completed';
|
|
|
+ if (status === 'pending') return 'pending';
|
|
|
+ return '';
|
|
|
+ },
|
|
|
+ getStatusText: function(status) {
|
|
|
+ if (status === 'delivering') return '配送中';
|
|
|
+ if (status === 'completed') return '已完成';
|
|
|
+ if (status === 'pending') return '待支付';
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+}
|
|
|
+</wxs>
|
|
|
+<view class="container">
|
|
|
+
|
|
|
+
|
|
|
+ <view class="tabs-container">
|
|
|
+ <view class="tabs">
|
|
|
+ <view
|
|
|
+ class="tab-item {{activeTab === item.key ? 'active' : ''}}"
|
|
|
+ wx:for="{{tabs}}"
|
|
|
+ wx:key="key"
|
|
|
+ bindtap="switchTab"
|
|
|
+ data-tab="{{item.key}}"
|
|
|
+ >
|
|
|
+ <text>{{item.label}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="orders-container">
|
|
|
+ <view class="empty-state" wx:if="{{orders.length === 0}}">
|
|
|
+ <view class="empty-icon">
|
|
|
+ <text>📦</text>
|
|
|
+ </view>
|
|
|
+ <text class="empty-text">暂无订单</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="order-list" wx:else>
|
|
|
+ <view
|
|
|
+ class="order-card"
|
|
|
+ wx:for="{{orders}}"
|
|
|
+ wx:key="id"
|
|
|
+ bindtap="viewOrderDetail"
|
|
|
+ data-order="{{item}}"
|
|
|
+ >
|
|
|
+ <view class="order-header">
|
|
|
+ <view class="order-id">
|
|
|
+ <text class="label">订单编号:</text>
|
|
|
+ <text class="value">{{item.id}}</text>
|
|
|
+ </view>
|
|
|
+ <text class="order-status {{utils.getStatusClass(item.status)}}">{{utils.getStatusText(item.status)}}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="order-body">
|
|
|
+ <view class="hospital-info">
|
|
|
+ <text class="hospital-name">{{item.hospital}}</text>
|
|
|
+ <text class="order-date">{{item.date}}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="medicines-info">
|
|
|
+ <text class="medicines-label">药品:</text>
|
|
|
+ <text class="medicines-text">{{item.medicines.join('、')}}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="address-info" wx:if="{{item.deliveryAddress}}">
|
|
|
+ <text class="address-label">地址:</text>
|
|
|
+ <text class="address-text">{{item.deliveryAddress}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="order-footer">
|
|
|
+ <text class="total-price">¥{{item.totalPrice}}</text>
|
|
|
+ <view class="arrow-icon">
|
|
|
+ <text>›</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</view>
|