search.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="">
  3. <view class="search-box">
  4. <view class="search-input-box">
  5. <svg t="1733904658291" class="search-icon" viewBox="0 0 1024 1024" version="1.1"
  6. xmlns="http://www.w3.org/2000/svg" p-id="5981" xmlns:xlink="http://www.w3.org/1999/xlink">
  7. <path
  8. d="M174.545 465.455c0-18.619 16.291-34.91 34.91-34.91s34.909 16.291 34.909 34.91c0 121.018 100.072 221.09 221.09 221.09 18.619 0 34.91 16.291 34.91 34.91s-16.291 34.909-34.91 34.909c-160.581 0-290.909-130.328-290.909-290.91z m290.91 360.727c200.145 0 360.727-160.582 360.727-360.727S665.6 104.727 465.455 104.727 104.727 265.31 104.727 465.455 265.31 826.182 465.455 826.182z m323.49-76.8L961.164 921.6c13.963 13.964 13.963 34.91 0 48.873-13.964 13.963-34.91 13.963-48.873 0L737.745 795.927c-74.472 60.51-169.89 97.746-272.29 97.746C228.073 896 34.909 702.836 34.909 465.455S228.073 34.909 465.455 34.909 896 228.073 896 465.455c0 109.381-39.564 209.454-107.055 283.927z"
  9. p-id="5982">
  10. </path>
  11. </svg>
  12. <input confirm-type="search" ref="searchInputRef" class="search-input" :auto-blur="true" type="text"
  13. placeholder="请输入关键字" v-model="keyword" @focus="onSearchFocus()" @blur="onSearchBlur()"
  14. @confirm="getMapList" />
  15. </view>
  16. <view class="search-select">
  17. <view class="select-item" @click.stop="$refs.cityRef.open()" >
  18. <text class="item-text">{{codeLabel || '办理区域'}}</text>
  19. <u-icon name="arrow-down-fill" color="#101010" size="16"></u-icon>
  20. </view>
  21. <view class="select-item">
  22. <text class="item-text">位置类型</text>
  23. <u-icon name="arrow-down-fill" color="#101010" size="16"></u-icon>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 选择地址 -->
  28. <city ref="cityRef" @cityName="e => codeLabel = e" @onConfirm="onSearchFocus"/>
  29. </view>
  30. </template>
  31. <script>
  32. import { getMapList_Api } from "@/api/map.js"
  33. export default {
  34. data() {
  35. return {
  36. keyword: undefined,
  37. code:'',
  38. codeLabel:'河北省/石家庄市/长安区 河北省/石家庄市/长安区'
  39. }
  40. },
  41. methods: {
  42. onSearchFocus() {
  43. //
  44. },
  45. getMapList() {
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. $radius_ : 20rpx;
  52. $heig_: 80rpx;
  53. .search-box {
  54. padding: 20rpx 20rpx 0;
  55. position: fixed;
  56. left: 0;
  57. top: 0;
  58. right: 0;
  59. z-index: 999;
  60. .search-input-box {
  61. width: 100%;
  62. height: $heig_;
  63. background-color: #fff;
  64. border-radius: $radius_ $radius_ 0 0;
  65. display: flex;
  66. align-items: center;
  67. padding: 0 10px;
  68. color: #020202;
  69. .search-icon {
  70. width:45rpx;
  71. height:45rpx;
  72. path {
  73. fill: #020202;
  74. }
  75. }
  76. .search-input{
  77. padding-left: 10px;
  78. }
  79. }
  80. .search-select {
  81. border-top: 1rpx solid #E8E8E8;
  82. width: 100%;
  83. height: $heig_;
  84. background-color: #fff;
  85. border-radius: 0 0 $radius_ $radius_ ;
  86. display: flex;
  87. justify-content: space-between;
  88. align-items: center;
  89. .select-item {
  90. width: 50%;
  91. display: flex;
  92. justify-content: center;
  93. align-items: center;
  94. font-size: 30rpx;
  95. .item-text {
  96. display: inline-block;
  97. padding-right: 6rpx;
  98. overflow: hidden;
  99. }
  100. }
  101. }
  102. }
  103. </style>