search.vue 1.8 KB

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