search.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. import { onLoad } from '@dcloudio/uni-app'
  20. const props = defineProps({
  21. typeList: Array,
  22. timeList: Array,
  23. result_state: Number
  24. })
  25. const typeValue = ref(0)
  26. const timeValue = ref(0)
  27. const conveyData = defineEmits(['handLeConveyData'])
  28. onLoad(() => {
  29. typeValue.value = props.result_state
  30. })
  31. const onnodeclick = () => {
  32. conveyData('handLeConveyData', {
  33. typeIndex: typeValue.value,
  34. timeIndex: timeValue.value
  35. })
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .search {
  40. display: flex;
  41. justify-content: space-around;
  42. align-items: center;
  43. margin-bottom: 20rpx;
  44. height: 100rpx;
  45. font-size: 28rpx;
  46. background-color: #fff;
  47. .search-type {
  48. flex: 1;
  49. display: flex;
  50. justify-content: space-evenly;
  51. .search-type-img {
  52. margin-top: -5rpx;
  53. width: 17rpx;
  54. height: 12rpx;
  55. img {
  56. width: 100%;
  57. height: 100%;
  58. }
  59. }
  60. }
  61. .search-time {
  62. flex: 1;
  63. display: flex;
  64. justify-content: space-evenly;
  65. .search-time-img {
  66. margin-top: -5rpx;
  67. width: 17rpx;
  68. height: 12rpx;
  69. img {
  70. width: 100%;
  71. height: 100%;
  72. }
  73. }
  74. }
  75. }
  76. </style>