index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div class="step-container">
  3. <div v-for="(item, index) in stepData.items" :key="index" class="step">
  4. <div class="step-content">
  5. <div class="step-item">
  6. <div v-if="stepData.active > index" class="complete-tag"></div>
  7. <div v-else-if="stepData.active == index" class="active-tag">{{ index + 1 }}</div>
  8. <div v-else-if="stepData.active < index" class="tag">{{ index + 1 }}</div>
  9. <div class="step-title">{{ item.title }}</div>
  10. </div>
  11. <div class="step-time">{{ item.description }}</div>
  12. </div>
  13. <div v-if="index !== stepData.items.length - 1" class="step-line" />
  14. </div>
  15. </div>
  16. </template>
  17. <script lang="ts" setup>
  18. const props = defineProps({
  19. stepData: []
  20. });
  21. </script>
  22. <style lang="scss" scoped>
  23. .step-container {
  24. display: flex;
  25. width: 100%;
  26. .step {
  27. display: flex;
  28. align-items: center;
  29. flex: 1;
  30. height: 67px;
  31. &:last-child {
  32. width: 121px;
  33. flex: unset;
  34. }
  35. .step-content {
  36. display: flex;
  37. flex-direction: column;
  38. position: relative;
  39. .step-item {
  40. display: flex;
  41. align-items: center;
  42. .step-title {
  43. white-space: nowrap;
  44. }
  45. }
  46. .step-time {
  47. position: absolute;
  48. top: 30px;
  49. left: 20px;
  50. font-size: 14px;
  51. color: rgba(0, 0, 0, 0.65);
  52. width: 100%;
  53. }
  54. }
  55. }
  56. .step-line {
  57. width: calc(100% - 100px);
  58. height: 1px;
  59. margin: 0 15px 0 33px;
  60. background-image: linear-gradient(90deg, #00fce7 5%, #2c81ff 100%);
  61. }
  62. .tag {
  63. color: rgba(0, 0, 0, 0.25);
  64. border: 1px solid rgba(0, 0, 0, 0.25);
  65. border-radius: 50%;
  66. width: 32px;
  67. height: 32px;
  68. display: flex;
  69. justify-content: center;
  70. align-items: center;
  71. font-family: HelveticaNeue;
  72. margin-right: 8px;
  73. }
  74. .complete-tag {
  75. color: #fff;
  76. border: 1px solid #1890FF;
  77. border-radius: 50%;
  78. width: 32px;
  79. height: 32px;
  80. display: flex;
  81. justify-content: center;
  82. align-items: center;
  83. font-family: HelveticaNeue;
  84. margin-right: 8px;
  85. position: relative;
  86. background: url('@/assets/images/check.png') no-repeat;
  87. background-size: 100% 100%;
  88. }
  89. .active-tag {
  90. color: #fff;
  91. width: 32px;
  92. height: 32px;
  93. background: url('@/assets/images/circle.png') no-repeat;
  94. background-size: 100% 100%;
  95. display: flex;
  96. justify-content: center;
  97. align-items: center;
  98. font-family: HelveticaNeue;
  99. margin-right: 8px;
  100. }
  101. }
  102. </style>