search.wxml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. <search-bar bindsearch="search" value="{{ keyword }}" />
  19. <view class="search-history" wx:if="{{!showResult}}">
  20. <view class="history-header">
  21. <text>历史搜索</text>
  22. <icon icon="search_clear" class="fr" bindtap="clearHistory"></icon>
  23. </view>
  24. <view class="history-list">
  25. <view class="history-item" wx:for="{{history}}" wx:key="index" data-keyword="{{ item }}" bindtap="searchHistory">{{ item }}</view>
  26. </view>
  27. </view>
  28. <view class="search-result" wx:else>
  29. <view class="search-tip">“{{ keyword }}”搜索结果({{ resultList.length }})</view>
  30. <view class="result-list">
  31. <view class="result-item" wx:for="{{resultList}}" wx:key="{{index}}" data-index="{{index}}" bindtap="toResultDetail">
  32. <view class="image" style="background-image: url({{item.img}})"></view>
  33. <view class="result-name">{{ item.name }}</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <no-more-bar wx:if="{{ showResult }}" />