学员端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
1.9 KiB

1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="pad">
  4. <view class="type">
  5. <view class="h1">驾照类型</view>
  6. <view class="tagFlex">
  7. <view class="tab" v-for="(item,index) in tagList" :class="{active: driverTypeArr.indexOf(item.id)!=-1}" @click="driverTypeClick(item)">{{ item.text }}</view>
  8. </view>
  9. </view>
  10. <view class="region">
  11. <view class="h1">区域</view>
  12. </view>
  13. <view class="btn_row">
  14. <view class="btn border" @click="reSetFn">重置</view>
  15. <view class="btn">确定</view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. tagList: [
  25. {text: '名称', id: 1},
  26. {text: '名称', id: 2},
  27. {text: '名称', id: 3},
  28. ],
  29. driverTypeArr: []
  30. }
  31. },
  32. methods: {
  33. driverTypeClick(item) {
  34. let index = this.driverTypeArr.indexOf(item.id)
  35. if( index==-1) {
  36. this.driverTypeArr.push(item.id)
  37. }else {
  38. this.driverTypeArr.splice(index,1)
  39. }
  40. console.log(index)
  41. console.log(this.driverTypeArr)
  42. },
  43. reSetFn() {
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .h1 {
  50. line-height: 100rpx;
  51. }
  52. .btn_row {
  53. position: fixed;
  54. bottom: 50rpx;
  55. left: 0;
  56. display: flex;
  57. justify-content: space-between;
  58. width: 100%;
  59. padding: 0 28rpx;
  60. .btn {
  61. width: 48.8%;
  62. height: 72rpx;
  63. background: #1989FA;
  64. border-radius: 8rpx;
  65. font-size: 28rpx;
  66. color: #fff;
  67. text-align: center;
  68. line-height: 72rpx;
  69. &.border {
  70. background: rgba(25,137,250,0.1);
  71. border: 2rpx solid #1989FA;
  72. color: $themC;
  73. }
  74. }
  75. }
  76. .tagFlex {
  77. display: flex;
  78. flex-wrap: wrap;
  79. .tab {
  80. padding: 10rpx 24rpx;
  81. margin: 12rpx 20rpx;
  82. height: 60rpx;
  83. background: #FFFFFF;
  84. border-radius: 8rpx;
  85. font-size: 28rpx;
  86. color: #686B73;
  87. &.active {
  88. background: rgba(25,137,250,0.1);
  89. border-radius: 8rpx;
  90. border: 2rpx solid #1989FA;
  91. font-size: 28rpx;
  92. color: $themC;
  93. }
  94. }
  95. }
  96. </style>