logistics-detail.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="container">
  3. <!-- 物流公司信息 -->
  4. <u-sticky>
  5. <u-alert :title="`物流公司:${logisticsInfo.company}`" type="warning"></u-alert>
  6. </u-sticky>
  7. <!-- 自定义物流轨迹时间轴 -->
  8. <scroll-view scroll-y class="timeline-container">
  9. <view v-for="(item, index) in logisticsInfo.traces" :key="index" class="timeline-item">
  10. <view class="timeline-icon">
  11. <u-icon name="map-fill" color="#19be6b" size="16" />
  12. </view>
  13. <view class="timeline-content">
  14. <text class="desc">{{ item.desc }}</text>
  15. <text class="time">{{ item.time }}</text>
  16. </view>
  17. <view v-if="index < logisticsInfo.traces.length - 1" class="timeline-line"></view>
  18. </view>
  19. </scroll-view>
  20. <!-- 底部操作按钮 -->
  21. <view class="fixed-bottom">
  22. <reject-button size="large" @reject="handleReject" />
  23. <approve-button size="large" @approve="handleApprove" />
  24. </view>
  25. </view>
  26. </template>
  27. <script setup>
  28. import { ref } from 'vue';
  29. import ApproveButton from './components/ApproveButton.vue';
  30. import RejectButton from './components/RejectButton.vue';
  31. // 物流信息数据
  32. const logisticsInfo = ref({
  33. company: '京东快递',
  34. traces: [
  35. {
  36. desc: '货物已交付京东快递',
  37. time: '2024/10/16 16:00:00'
  38. },
  39. {
  40. desc: '接收物任务分配给快递员王艳玲,联系电话 15123695401',
  41. time: '2024/10/16 16:00:00'
  42. },
  43. {
  44. desc: '快递员发起联系客户,呼叫方式:拨打电话。',
  45. time: '2024/10/16 16:00:00'
  46. },
  47. {
  48. desc: '京东快递已收取收件',
  49. time: '2024/10/16 16:00:00'
  50. },
  51. {
  52. desc: '您的快件已由【信阳师范小蜜蜂】揽收完成',
  53. time: '2024/10/16 16:00:00'
  54. },
  55. // ... 更多轨迹信息
  56. ]
  57. });
  58. // 处理驳回
  59. const handleReject = (reason) => {
  60. console.log('驳回原因:', reason);
  61. // 处理驳回逻辑
  62. };
  63. // 处理同意
  64. const handleApprove = () => {
  65. console.log('同意操作');
  66. // 处理同意逻辑
  67. };
  68. </script>
  69. <style lang="scss" scoped>
  70. .timeline-container {
  71. flex: 1;
  72. padding: 12px;
  73. background-color: #fff;
  74. }
  75. .timeline-item {
  76. display: flex;
  77. position: relative;
  78. padding: 20rpx 0;
  79. }
  80. .timeline-icon {
  81. width: 24px;
  82. height: 24px;
  83. background-color: #fff;
  84. border-radius: 50%;
  85. display: flex;
  86. align-items: center;
  87. justify-content: center;
  88. margin-right: 12px;
  89. flex-shrink: 0;
  90. }
  91. .timeline-content {
  92. flex: 1;
  93. .desc {
  94. font-size: 14px;
  95. color: #333;
  96. display: block;
  97. margin-bottom: 4px;
  98. }
  99. .time {
  100. font-size: 12px;
  101. color: #999;
  102. }
  103. }
  104. .timeline-line {
  105. position: absolute;
  106. width: 2px;
  107. height: 100%;
  108. background-color: #19be6b;
  109. top: 32px;
  110. bottom: 0;
  111. left: 11px;
  112. }
  113. </style>