search.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="search">
  3. <picker style="width: 50%;" @change="bindPickerChange($event,1)" :value="typeIndex" :range="typeList">
  4. <view class="search-type">
  5. {{typeList[typeIndex]}}
  6. <div class="search-type-img">
  7. <img src="../static/bottom.png">
  8. </div>
  9. </view>
  10. </picker>
  11. <picker style="width: 50%;" @change="bindPickerChange($event,2)" :value="timeIndex" :range="timeList">
  12. <view class="search-time">
  13. {{timeList[timeIndex]}}
  14. <div class="search-time-img">
  15. <img src="../static/bottom.png">
  16. </div>
  17. </view>
  18. </picker>
  19. </view>
  20. </template>
  21. <script setup>
  22. import {
  23. ref
  24. } from "vue"
  25. const typeList = ref(['全部', '预约成功', '已通行', '已取消', '候补中'])
  26. const typeIndex = ref(0)
  27. const timeList = ref(['当月', '当日'])
  28. const timeIndex = ref(0)
  29. const bindPickerChange = (e, type) => {
  30. if (type === 1) {
  31. typeIndex.value = e.detail.value
  32. } else {
  33. timeIndex.value = e.detail.value
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .search {
  39. display: flex;
  40. justify-content: space-around;
  41. align-items: center;
  42. margin-bottom: 20rpx;
  43. height: 100rpx;
  44. font-size: 28rpx;
  45. background-color: #fff;
  46. .search-type {
  47. flex: 1;
  48. display: flex;
  49. justify-content: space-evenly;
  50. .search-type-img {
  51. margin-top: -5rpx;
  52. width: 17rpx;
  53. height: 12rpx;
  54. img {
  55. width: 100%;
  56. height: 100%;
  57. }
  58. }
  59. }
  60. .search-time {
  61. flex: 1;
  62. display: flex;
  63. justify-content: space-evenly;
  64. .search-time-img {
  65. margin-top: -5rpx;
  66. width: 17rpx;
  67. height: 12rpx;
  68. img {
  69. width: 100%;
  70. height: 100%;
  71. }
  72. }
  73. }
  74. }
  75. </style>