index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="page-wrap">
  3. <view class="tabs-panel">
  4. <view :class="{ item: true, active: tabActive === item.value }" v-for="(item, index) in tabList" :key="index" @click="tabActive = item.value">
  5. {{ item.label }}
  6. </view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. tabActive: 1,
  15. tabList: [
  16. {
  17. label: '全部订单',
  18. value: 1
  19. },
  20. {
  21. label: '未生效',
  22. value: 2
  23. },
  24. {
  25. label: '未生效',
  26. value: 3
  27. },
  28. {
  29. label: '已完成',
  30. value: 4
  31. }
  32. ]
  33. };
  34. },
  35. methods: {}
  36. };
  37. </script>
  38. <style lang="scss" scoped>
  39. .page-wrap {
  40. padding-top: 82.42rpx;
  41. }
  42. .tabs-panel {
  43. position: fixed;
  44. left: 0;
  45. top: 0;
  46. right: 0;
  47. height: 82.42rpx;
  48. background: #fff;
  49. display: flex;
  50. z-index: 1;
  51. &::before,
  52. &::after {
  53. content: '';
  54. position: absolute;
  55. left: 0;
  56. right: 0;
  57. height: 1rpx;
  58. background: #e0e0e0;
  59. }
  60. &::before {
  61. top: 0;
  62. }
  63. &::after {
  64. bottom: 0;
  65. }
  66. .item {
  67. flex: 1;
  68. text-align: center;
  69. font-size: 27.47rpx;
  70. color: #999;
  71. line-height: 82.42rpx;
  72. position: relative;
  73. & + .item::before {
  74. content: '';
  75. position: absolute;
  76. left: 0;
  77. top: 0;
  78. bottom: 0;
  79. width: 1rpx;
  80. background: #e0e0e0;
  81. }
  82. }
  83. .active {
  84. color: #00bcd2;
  85. &::after {
  86. content: '';
  87. position: absolute;
  88. left: 0%;
  89. right: 0%;
  90. bottom: 0%;
  91. height: 5.49rpx;
  92. background: #00bcd2;
  93. z-index: 1;
  94. }
  95. }
  96. }
  97. </style>