LogisticsTimeline.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view scroll-y class="timeline-container">
  3. <view v-for="(item, index) in list" :key="index" class="timeline-item">
  4. <view class="timeline-icon">
  5. <u-icon name="map-fill" color="#19be6b" size="16" />
  6. </view>
  7. <view class="timeline-content">
  8. <text class="title">{{ item.title }}</text>
  9. <text class="desc">{{ item.description }}</text>
  10. <text class="time">{{ item.time }}</text>
  11. </view>
  12. <view v-if="index < list.length - 1" class="timeline-line"></view>
  13. </view>
  14. </view>
  15. </template>
  16. <script setup>
  17. const props = defineProps({
  18. list: {
  19. type: Array,
  20. default: []
  21. }
  22. });
  23. </script>
  24. <style lang="scss" scoped>
  25. .timeline-container {
  26. flex: 1;
  27. padding: 12px;
  28. background-color: #fff;
  29. }
  30. .timeline-item {
  31. display: flex;
  32. position: relative;
  33. padding: 20rpx 0;
  34. }
  35. .timeline-icon {
  36. width: 24px;
  37. height: 24px;
  38. background-color: #fff;
  39. border-radius: 50%;
  40. display: flex;
  41. align-items: center;
  42. justify-content: center;
  43. margin-right: 12px;
  44. flex-shrink: 0;
  45. }
  46. .timeline-content {
  47. flex: 1;
  48. .title {
  49. font-weight: bold;
  50. font-size: 14px;
  51. }
  52. .desc {
  53. font-size: 14px;
  54. color: #333;
  55. display: block;
  56. margin-bottom: 4px;
  57. }
  58. .time {
  59. font-size: 12px;
  60. color: #999;
  61. }
  62. }
  63. .timeline-line {
  64. position: absolute;
  65. width: 2px;
  66. height: 100%;
  67. background-color: #19be6b;
  68. top: 32px;
  69. bottom: 0;
  70. left: 11px;
  71. }
  72. </style>