order-detail.wxml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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">
  53. <text class="info-label">订单状态:</text>
  54. <text class="info-value status {{utils.getStatusClass(order.status)}}">{{utils.getStatusText(order.status)}}</text>
  55. </view>
  56. </view>
  57. </view>
  58. <!-- 药品信息 -->
  59. <view class="medicines-section">
  60. <view class="section-title">
  61. <text>药品信息</text>
  62. </view>
  63. <view class="medicine-list">
  64. <view class="medicine-item" wx:for="{{order.medicines}}" wx:key="*this">
  65. <view class="medicine-icon">
  66. <text>💊</text>
  67. </view>
  68. <view class="medicine-info">
  69. <text class="medicine-name">{{item}}</text>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 价格信息 -->
  75. <view class="price-section">
  76. <view class="section-title">
  77. <text>价格信息</text>
  78. </view>
  79. <view class="price-card">
  80. <view class="price-row">
  81. <text class="price-label">药品总价:</text>
  82. <text class="price-value">¥{{order.totalPrice}}</text>
  83. </view>
  84. <view class="price-row total">
  85. <text class="price-label">实付金额:</text>
  86. <text class="price-value final">¥{{order.totalPrice}}</text>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 无人机配送轨迹 -->
  91. <view class="tracking-section" wx:if="{{order.droneTracking}}">
  92. <view class="section-title">
  93. <text>无人机配送轨迹</text>
  94. </view>
  95. <view class="tracking-card">
  96. <view class="tracking-status">
  97. <text class="status-text">当前状态:{{order.droneTracking.status}}</text>
  98. </view>
  99. <view class="tracking-steps">
  100. <view class="step-item" wx:for="{{order.droneTracking.steps}}" wx:key="*this">
  101. <view class="step-icon {{item === '配送中' || item === '已送达' ? 'active' : ''}}">
  102. <text>{{item === '配送中' || item === '已送达' ? '✓' : '○'}}</text>
  103. </view>
  104. <text class="step-text">{{item}}</text>
  105. </view>
  106. </view>
  107. </view>
  108. <!-- 地图显示 -->
  109. <view class="map-section" wx:if="{{order.mapTracking}}">
  110. 1
  111. <view class="map-container">
  112. <map
  113. id="deliveryMap"
  114. class="delivery-map"
  115. latitude="{{mapCenter.latitude}}"
  116. longitude="{{mapCenter.longitude}}"
  117. scale="{{mapScale}}"
  118. markers="{{order.mapTracking.markers}}"
  119. polyline="{{order.mapTracking.polyline}}"
  120. show-location="{{true}}"
  121. enable-3D="{{true}}"
  122. show-compass="{{true}}"
  123. enable-overlooking="{{true}}"
  124. enable-zoom="{{true}}"
  125. enable-scroll="{{true}}"
  126. enable-rotate="{{true}}"
  127. >
  128. </map>
  129. </view>
  130. <view class="map-legend">
  131. <view class="legend-item">
  132. <view class="legend-icon hospital"></view>
  133. <text class="legend-text">医院位置</text>
  134. </view>
  135. <view class="legend-item">
  136. <view class="legend-icon drone"></view>
  137. <text class="legend-text">无人机位置</text>
  138. </view>
  139. <view class="legend-item">
  140. <view class="legend-icon route"></view>
  141. <text class="legend-text">配送路线</text>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <!-- 操作按钮 -->
  147. <view class="action-section">
  148. <button class="action-btn primary" bindtap="contactSupport" wx:if="{{order.status === 'delivering'}}">
  149. <text>联系客服</text>
  150. </button>
  151. <button class="action-btn secondary" bindtap="reorder" wx:if="{{order.status === 'completed'}}">
  152. <text>再次购买</text>
  153. </button>
  154. <button class="action-btn danger" bindtap="deleteOrder">
  155. <text>删除订单</text>
  156. </button>
  157. </view>
  158. </view>