search.wxml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <view class="page">
  2. <!-- <view class="search-w">
  3. <view class="search-left" bindtap="showSelect">
  4. <text>{{ searchTypes[activeIndex].text }}</text>
  5. <icon class="icon" icon="scene_tit_arrow" size="12" />
  6. <view class="select-w" catchtap="hideSelect" wx:if="{{ selectShowStatus }}">
  7. <view class="mask"></view>
  8. <view class="select">
  9. <view class="options {{ activeIndex === index ? 'active' : ''}}" wx:for="{{searchTypes}}" wx:key="{{index}}" data-index="{{ index }}" bindtap="changeSearchType">{{ item.text }}</view>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="search-right">
  14. <icon icon="home_search" size="15" />
  15. <input placeholder="请输入关键字" value="{{ keyword }}" confirm-type="search" bindconfirm="search" ></input>
  16. </view>
  17. </view> -->
  18. <view class="search-bar-w">
  19. <search-bar bindsearch="search" value="{{ keyword }}" bindinput="handleInput" />
  20. <view class="search-result-tips" wx:if="{{searchTips.length > 0}}">
  21. <view wx:for="{{searchTips}}" wx:key="{{index}}" data-item="{{item}}" bindtap="handleTipClick">{{ item }}</view>
  22. </view>
  23. </view>
  24. <view class="search-history" wx:if="{{!showResult}}">
  25. <view class="history-header">
  26. <text>历史搜索</text>
  27. <icon icon="search_clear" class="fr" bindtap="clearHistory"></icon>
  28. </view>
  29. <view class="history-list">
  30. <view class="history-item" wx:for="{{history}}" wx:key="index" data-keyword="{{ item }}" bindtap="searchHistory">{{ item }}</view>
  31. </view>
  32. </view>
  33. <view class="search-result" wx:else>
  34. <view class="search-tip">“{{ keyword }}”搜索结果({{ resultList.length }})</view>
  35. <view class="result-list">
  36. <view class="result-item" wx:for="{{resultList}}" wx:key="{{index}}" data-index="{{index}}" bindtap="toResultDetail">
  37. <view class="image" style="background-image: url({{item.img}})"></view>
  38. <view class="result-name">{{ item.name }}</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <no-more-bar wx:if="{{ showResult }}" />