lxh-steps.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="lxh-steps">
  3. <view class="lxh-steps-top">
  4. <view class="item" v-for="(item, index) in options"
  5. :style="{flex: index === 0 ? 'none' : 1}"
  6. :class="{active: active === index, over: active > index}"
  7. :key="index">
  8. <view class="line" v-if="index !== 0"></view>
  9. <view class="content">
  10. <view class="content-top">
  11. <image v-if="active > index"
  12. src="../../static/creatingSituations/steps-over.png"></image>
  13. <view v-else>{{ index + 1 }}</view>
  14. </view>
  15. <text>{{ item.title }}</text>
  16. </view>
  17. </view>
  18. </view>
  19. <component class="lxh-steps-content"
  20. v-bind:is="options[active].component"></component>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. props: ['options', 'active']
  26. }
  27. </script>
  28. <style lang="less">
  29. .lxh-steps {
  30. display: flex;
  31. flex-direction: column;
  32. flex: 1;
  33. .lxh-steps-top {
  34. display: flex;
  35. flex-direction: row;
  36. justify-content: space-between;
  37. align-items: center;
  38. margin: 37.5rpx 25rpx 50rpx 25rpx;
  39. .item {
  40. display: flex;
  41. flex: 1;
  42. flex-direction: row;
  43. justify-content: flex-end;
  44. font-size: 17.5rpx;
  45. line-height: 26.25rpx;
  46. color: #B8BFCC;
  47. .content {
  48. display: flex;
  49. flex-direction: column;
  50. justify-content: center;
  51. align-items: center;
  52. margin: 0 18.75rpx;
  53. min-width: 37.5rpx;
  54. text {
  55. white-space: nowrap;
  56. }
  57. .content-top {
  58. margin-bottom: 10rpx;
  59. width: 37.5rpx;
  60. height: 37.5rpx;
  61. line-height: 37.5rpx;
  62. text-align: center;
  63. view {
  64. border-radius: 50%;
  65. color: #fff;
  66. background-color: #B8BECC;
  67. }
  68. image {
  69. width: 100%;
  70. height: 100%;
  71. }
  72. }
  73. }
  74. .line {
  75. margin-top: 18.12rpx;
  76. height: 1.25rpx;
  77. width: 100%;
  78. background-color: #B8BECC;
  79. }
  80. &.active {
  81. color: #3377FF;
  82. .content .content-top view {
  83. background-color: #3377FF;
  84. }
  85. .line {
  86. background-color: #3377FF;
  87. }
  88. }
  89. &.over {
  90. color: #292C33;
  91. .line {
  92. background-color: #3377FF;
  93. }
  94. }
  95. }
  96. }
  97. .lxh-steps-content {
  98. width: 100%;
  99. height: 100%;
  100. }
  101. }
  102. </style>