search.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 conveyData = defineEmits(["handLeConveyData"])
  30. const bindPickerChange = (e, type) => {
  31. if (type === 1) {
  32. typeIndex.value = e.detail.value
  33. } else {
  34. timeIndex.value = e.detail.value
  35. }
  36. conveyData("handLeConveyData", {
  37. typeIndex: typeIndex.value,
  38. timeIndex: timeIndex.value,
  39. })
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .search {
  44. display: flex;
  45. justify-content: space-around;
  46. align-items: center;
  47. margin-bottom: 20rpx;
  48. height: 100rpx;
  49. font-size: 28rpx;
  50. background-color: #fff;
  51. .search-type {
  52. flex: 1;
  53. display: flex;
  54. justify-content: space-evenly;
  55. .search-type-img {
  56. margin-top: -5rpx;
  57. width: 17rpx;
  58. height: 12rpx;
  59. img {
  60. width: 100%;
  61. height: 100%;
  62. }
  63. }
  64. }
  65. .search-time {
  66. flex: 1;
  67. display: flex;
  68. justify-content: space-evenly;
  69. .search-time-img {
  70. margin-top: -5rpx;
  71. width: 17rpx;
  72. height: 12rpx;
  73. img {
  74. width: 100%;
  75. height: 100%;
  76. }
  77. }
  78. }
  79. }
  80. </style>