MStep.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div class="mStep">
  3. <div class="step">
  4. <div class="step-item" v-for="(item, index) in imgUrlList" :key="index">
  5. <svg-icon v-if="number >= item.index" :iconClass="item.active" key="oneImg"></svg-icon>
  6. <svg-icon v-else :iconClass="item.default" key="oneImg"></svg-icon>
  7. <p :class="[number >= item.index ? item.activeClass : '']" >{{ item.text }}</p>
  8. </div>
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. import SvgIcon from './SvgIcon'
  14. export default {
  15. name: "mStep",
  16. components: { SvgIcon },
  17. props: {
  18. number: {
  19. type: Number,
  20. default: 1
  21. } // 标题名称
  22. },
  23. data() {
  24. return {
  25. imgUrlList: [
  26. {
  27. index: 1,
  28. default: "",
  29. active: "icon_account_active",
  30. activeClass: "active",
  31. text: "账号"
  32. }, {
  33. index: 1.5,
  34. default: "icon_right_arrow",
  35. active: "icon_right_arrow_active",
  36. activeClass: "active",
  37. text: ""
  38. }, {
  39. index: 2,
  40. default: "icon_baseInfo",
  41. active: "icon_baseInfo_active",
  42. activeClass: "active",
  43. text: "基本信息"
  44. }, {
  45. index: 2.5,
  46. default: "icon_right_arrow",
  47. active: "icon_right_arrow_active",
  48. activeClass: "active",
  49. text: ""
  50. }, {
  51. index: 3,
  52. default: "icon_level",
  53. active: "icon_level_active",
  54. activeClass: "active",
  55. text: "考级信息"
  56. }, {
  57. index: 3.5,
  58. default: "icon_right_arrow",
  59. active: "icon_right_arrow_active",
  60. activeClass: "active",
  61. text: ""
  62. }, {
  63. index: 4,
  64. default: "icon_payment",
  65. active: "icon_payment_active",
  66. activeClass: "active",
  67. text: "支付"
  68. }
  69. ]
  70. };
  71. },
  72. methods: {}
  73. };
  74. </script>
  75. <style lang="less" scoped>
  76. @import url("../assets/commonLess/variable");
  77. .mStep {
  78. padding-bottom: 0.15rem;
  79. background-color: #ffffff;
  80. margin-top: .12rem;
  81. }
  82. .step {
  83. display: flex;
  84. flex-wrap: wrap;
  85. justify-content: center;
  86. padding-top: 0.2rem;
  87. .step-item {
  88. font-size: 0;
  89. &:nth-of-type(odd) img {
  90. width: 0.56rem;
  91. }
  92. &:nth-of-type(even) img {
  93. width: 0.2rem;
  94. padding: 0.15rem 0.25rem 0;
  95. }
  96. &:nth-of-type(odd) svg {
  97. width: 0.56rem;
  98. height: .56rem;
  99. }
  100. &:nth-of-type(even) svg {
  101. width: 0.18rem;
  102. height: 0.18rem;
  103. padding: 0.2rem 0.1rem 0;
  104. }
  105. p {
  106. padding-top: 0.03rem;
  107. font-size: 0.14rem;
  108. color: #808080;
  109. text-align: center;
  110. &.active {
  111. color: var(--main-color);
  112. }
  113. }
  114. }
  115. }
  116. </style>