order-detail.wxml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <!--order-detail.wxml-->
  2. <wxs module="utils">
  3. module.exports = {
  4. getStatusClass: function(status) {
  5. if (status === '配送中') return 'delivering';
  6. if (status === '已完成') return 'completed';
  7. if (status === '待支付') return 'pending';
  8. if (status === 'delivering') return 'delivering';
  9. if (status === 'completed') return 'completed';
  10. if (status === 'pending') return 'pending';
  11. return '';
  12. },
  13. getStatusText: function(status) {
  14. if (status === 'delivering') return '配送中';
  15. if (status === 'completed') return '已完成';
  16. if (status === 'pending') return '待支付';
  17. return status;
  18. }
  19. }
  20. </wxs>
  21. <view class="container">
  22. <!-- 自定义导航栏 -->
  23. <view class="custom-navbar">
  24. <view class="navbar-content">
  25. <view class="back-btn" bindtap="goBack">
  26. <text class="back-icon">‹</text>
  27. </view>
  28. <view class="navbar-title">
  29. <text>订单详情</text>
  30. </view>
  31. <view class="navbar-right"></view>
  32. </view>
  33. </view>
  34. <!-- 订单基本信息 -->
  35. <view class="order-info-section">
  36. <view class="section-title">
  37. <text>订单信息</text>
  38. </view>
  39. <view class="info-card">
  40. <view class="info-row">
  41. <text class="info-label">订单编号:</text>
  42. <text class="info-value">{{order.id}}</text>
  43. </view>
  44. <view class="info-row">
  45. <text class="info-label">医院:</text>
  46. <text class="info-value">{{order.hospital}}</text>
  47. </view>
  48. <view class="info-row">
  49. <text class="info-label">下单时间:</text>
  50. <text class="info-value">{{order.date}}</text>
  51. </view>
  52. <view class="info-row" wx:if="{{order.deliveryAddress}}">
  53. <text class="info-label">送货地址:</text>
  54. <text class="info-value address">{{order.deliveryAddress}}</text>
  55. </view>
  56. <view class="info-row">
  57. <text class="info-label">订单状态:</text>
  58. <text class="info-value status {{utils.getStatusClass(order.status)}}">{{utils.getStatusText(order.status)}}</text>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 药品信息 -->
  63. <view class="medicines-section">
  64. <view class="section-title">
  65. <text>药品信息</text>
  66. </view>
  67. <view class="medicine-list">
  68. <view class="medicine-item" wx:for="{{order.medicines}}" wx:key="*this">
  69. <view class="medicine-icon">
  70. <text>💊</text>
  71. </view>
  72. <view class="medicine-info">
  73. <text class="medicine-name">{{item}}</text>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <!-- 价格信息 -->
  79. <view class="price-section">
  80. <view class="section-title">
  81. <text>价格信息</text>
  82. </view>
  83. <view class="price-card">
  84. <view class="price-row">
  85. <text class="price-label">药品总价:</text>
  86. <text class="price-value">¥{{order.totalPrice}}</text>
  87. </view>
  88. <view class="price-row total">
  89. <text class="price-label">实付金额:</text>
  90. <text class="price-value final">¥{{order.totalPrice}}</text>
  91. </view>
  92. </view>
  93. </view>
  94. <!-- 无人机配送轨迹 -->
  95. <view class="tracking-section" wx:if="{{order.droneTracking}}">
  96. <view class="section-title">
  97. <text>无人机配送轨迹</text>
  98. </view>
  99. <view class="tracking-card">
  100. <view class="tracking-status">
  101. <text class="status-text">当前状态:{{order.droneTracking.status}}</text>
  102. </view>
  103. <view class="tracking-steps">
  104. <view class="step-item" wx:for="{{order.droneTracking.steps}}" wx:key="*this">
  105. <view class="step-icon {{item === '配送中' || item === '已送达' ? 'active' : ''}}">
  106. <text>{{item === '配送中' || item === '已送达' ? '✓' : '○'}}</text>
  107. </view>
  108. <text class="step-text">{{item}}</text>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 地图显示 -->
  113. <view class="map-section" wx:if="{{order.mapTracking}}">
  114. 1
  115. <view class="map-container">
  116. <map
  117. id="deliveryMap"
  118. class="delivery-map"
  119. latitude="{{mapCenter.latitude}}"
  120. longitude="{{mapCenter.longitude}}"
  121. scale="{{mapScale}}"
  122. markers="{{order.mapTracking.markers}}"
  123. polyline="{{order.mapTracking.polyline}}"
  124. show-location="{{true}}"
  125. enable-3D="{{true}}"
  126. show-compass="{{true}}"
  127. enable-overlooking="{{true}}"
  128. enable-zoom="{{true}}"
  129. enable-scroll="{{true}}"
  130. enable-rotate="{{true}}"
  131. >
  132. </map>
  133. </view>
  134. <view class="map-legend">
  135. <view class="legend-item">
  136. <view class="legend-icon hospital"></view>
  137. <text class="legend-text">医院位置</text>
  138. </view>
  139. <view class="legend-item">
  140. <view class="legend-icon drone"></view>
  141. <text class="legend-text">无人机位置</text>
  142. </view>
  143. <view class="legend-item">
  144. <view class="legend-icon route"></view>
  145. <text class="legend-text">配送路线</text>
  146. </view>
  147. </view>
  148. </view>
  149. </view>
  150. <!-- 操作按钮 -->
  151. <view class="action-section">
  152. <button class="action-btn primary" bindtap="contactSupport" wx:if="{{order.status === 'delivering'}}">
  153. <text>联系客服</text>
  154. </button>
  155. <button class="action-btn secondary" bindtap="reorder" wx:if="{{order.status === 'completed'}}">
  156. <text>再次购买</text>
  157. </button>
  158. <button class="action-btn danger" bindtap="deleteOrder">
  159. <text>删除订单</text>
  160. </button>
  161. </view>
  162. </view>