search.wxml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!-- 公用 用于页面顶部搜索框 -->
  2. <template name="search">
  3. <view
  4. class="search_space"
  5. style="height:{{topsearchheight}}rpx;top:{{headerheight}}rpx;"
  6. ></view>
  7. <view
  8. style="height:{{topsearchheight}}rpx;top:{{headerheight}}rpx;"
  9. class="search {{searchshow?'search_focus':''}}"
  10. >
  11. <view
  12. class="search_input_b"
  13. >
  14. </view>
  15. <view class="search_input_ani">
  16. <image
  17. style="display: {{(searchshow||keylist.length==0)?'block':'none'}}"
  18. class="search_input_ic"
  19. src="../../img/search.png"
  20. />
  21. <view
  22. bindtap='searchFocus'
  23. style="display: {{searchshow?'none':'inline-block'}}"
  24. class="search_input_holder">
  25. <view
  26. style="display: {{keylist.length>0&&!searchshow?'flex':'none'}}"
  27. class="search_input_keys">
  28. <block
  29. wx:for="{{keylist}}"
  30. wx:key="{{item}}">
  31. <view
  32. class="key_list_i"
  33. wx:if="{{index<4}}"
  34. >
  35. <view class="key_list_iw">{{item}}</view>
  36. <view
  37. data-index="{{index}}"
  38. catchtap="deletekey"
  39. class="key_list_d"><image src="../../img/close2.png"/></view>
  40. </view>
  41. </block>
  42. </view>
  43. <view
  44. style="display: {{keylist.length==0?'inline-block':'none'}}"
  45. class="search_input_holderw">
  46. 搜索
  47. </view>
  48. </view>
  49. <input
  50. style="display: {{searchshow?'block':'none'}}"
  51. class="search_input"
  52. placeholder-class="search_input_holder"
  53. placeholder="搜索"
  54. confirm-type="search"
  55. bindblur="inputBlur"
  56. bindconfirm="inputConfirm"
  57. focus='{{searchfocus}}'
  58. value='{{keys}}'
  59. />
  60. <view
  61. class='cancel_search'
  62. bindtap='cancelSearch'
  63. >
  64. 取消
  65. </view>
  66. </view>
  67. <!-- <view
  68. class="input_supernatant"
  69. style="display:{{searchshow?'none':'block'}}"
  70. >
  71. <view
  72. class="inputbind_focus"
  73. bindtap='searchFocus'
  74. >
  75. </view>
  76. </view> -->
  77. <view
  78. class="hot_search"
  79. style="min-height:{{windowh-206}}px"
  80. >
  81. <view class="hot_search_t">
  82. 热门搜索
  83. </view>
  84. <view class="hot_search_w">
  85. <block wx:for="{{brandrecommend}}" wx:key="brand_id">
  86. <view bindtap="tapHot" class="hot_search_i" data-val = "{{item.brand_name}}">
  87. {{item.brand_name}}
  88. </view>
  89. <!-- <view bindtap="tapHot" class="hot_search_i" data-val = "劳斯莱斯">
  90. 劳斯莱斯
  91. </view>
  92. <view bindtap="tapHot" class="hot_search_i" data-val = "宾利">
  93. 宾利
  94. </view>
  95. <view bindtap="tapHot" class="hot_search_i" data-val = "法拉利">
  96. 法拉利
  97. </view>
  98. <view bindtap="tapHot" class="hot_search_i" data-val = "兰博基尼">
  99. 兰博基尼
  100. </view>
  101. <view bindtap="tapHot" class="hot_search_i" data-val = "布加迪">
  102. 布加迪
  103. </view> -->
  104. </block>
  105. </view>
  106. </view>
  107. </view>
  108. </template>