flow.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div class="flow-container">
  3. <div class="flow">
  4. <div class="item" v-for="(item,index) in dataList" :key="index">
  5. <div class="top">
  6. <div :class="[item.active?'line':'dash-line',index===0?'item--hidden':'']"></div>
  7. <div :class="[item.active?'solid':'outline']">
  8. <span :class="{'sort--active':item.active,'sort':true}">{{index+1}}</span>
  9. </div>
  10. <div :class="[item.active?'line':'dash-line',index===dataList.length-1?'item--hidden':'']"></div>
  11. </div>
  12. <span :class="{'bottom--active':item.active,'bottom':true}">
  13. {{item.label}}
  14. </span>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. name: "flow",
  22. props: {
  23. dataList: {
  24. type: Array,
  25. default: []
  26. }
  27. },
  28. data() {
  29. return {}
  30. }
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. $line-width1: 53px;
  35. $line-width2: 20px;
  36. .flow-container {
  37. display: flex;
  38. justify-content: center;
  39. width: 100%;
  40. height: 147px;
  41. box-shadow: 0px -0.5px 0px 0px rgba(0, 0, 0, 0.04) inset;
  42. .flow {
  43. display: flex;
  44. align-items: center;
  45. .item {
  46. display: flex;
  47. flex-direction: column;
  48. align-items: center;
  49. &--hidden {
  50. visibility: hidden;
  51. }
  52. .top {
  53. display: flex;
  54. align-items: center;
  55. .line {
  56. width: $line-width1;
  57. @media(max-width: 768px) {
  58. width: $line-width2;
  59. }
  60. height: 1px;
  61. border: 1px solid #308eff;
  62. }
  63. .dash-line {
  64. width: $line-width1;
  65. @media(max-width: 768px) {
  66. width: $line-width2;
  67. }
  68. height: 1px;
  69. border: 0.5px dashed #dedede;
  70. }
  71. .solid {
  72. display: flex;
  73. justify-content: center;
  74. align-items: center;
  75. width: 28px;
  76. height: 28px;
  77. background: #308eff;
  78. border-radius: 50%;
  79. }
  80. .sort {
  81. font-size: 15px;
  82. font-family: PingFangSC, PingFangSC-Semibold, sans-serif;
  83. font-weight: 600;
  84. color: #666666;
  85. line-height: 21px;
  86. &--active {
  87. color: #ffffff;
  88. }
  89. }
  90. .outline {
  91. display: flex;
  92. justify-content: center;
  93. align-items: center;
  94. width: 28px;
  95. height: 28px;
  96. background: #ffffff;
  97. border: 1px solid #dedede;
  98. border-radius: 50%;
  99. }
  100. }
  101. .bottom {
  102. margin-top: 5px;
  103. font-size: 13px;
  104. font-family: PingFangSC, PingFangSC-Semibold, sans-serif;
  105. font-weight: 600;
  106. color: #666666;
  107. line-height: 21px;
  108. &--active {
  109. color: #222222;
  110. }
  111. }
  112. }
  113. }
  114. }
  115. </style>