search2.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="search">
  3. <uni-data-picker v-slot:default v-model="typeValue" :localdata="typeList" popup-title="请选择预约状态" @nodeclick="onnodeclick">
  4. <view class="search-type">
  5. {{ typeList[typeValue].text }}
  6. <view class="search-type-img"><img src="../static/bottom.png" /></view>
  7. </view>
  8. </uni-data-picker>
  9. <uni-data-picker v-slot:default v-model="timeValue" :localdata="timeList" popup-title="请选择预约时间" @nodeclick="onnodeclick">
  10. <view class="search-time">
  11. {{ timeList[timeValue].text }}
  12. <view class="search-time-img"><img src="../static/bottom.png" /></view>
  13. </view>
  14. </uni-data-picker>
  15. </view>
  16. </template>
  17. <script setup>
  18. import { ref } from 'vue'
  19. const props = defineProps({
  20. typeList: Array,
  21. timeList: Array
  22. })
  23. const typeValue = ref(0)
  24. const timeValue = ref(0)
  25. const conveyData = defineEmits(['handLeConveyData'])
  26. const onnodeclick = () => {
  27. conveyData('handLeConveyData', {
  28. typeIndex: typeValue.value,
  29. timeIndex: timeValue.value
  30. })
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. .search {
  35. display: flex;
  36. justify-content: space-around;
  37. align-items: center;
  38. margin-bottom: 20rpx;
  39. height: 100rpx;
  40. font-size: 28rpx;
  41. background-color: #fff;
  42. .search-type {
  43. flex: 1;
  44. display: flex;
  45. justify-content: space-evenly;
  46. .search-type-img {
  47. margin-top: -5rpx;
  48. width: 17rpx;
  49. height: 12rpx;
  50. img {
  51. width: 100%;
  52. height: 100%;
  53. }
  54. }
  55. }
  56. .search-time {
  57. flex: 1;
  58. display: flex;
  59. justify-content: space-evenly;
  60. .search-time-img {
  61. margin-top: -5rpx;
  62. width: 17rpx;
  63. height: 12rpx;
  64. img {
  65. width: 100%;
  66. height: 100%;
  67. }
  68. }
  69. }
  70. }
  71. </style>