search.wxml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. <!-- 选择框 -->
  7. <!-- <view class="select-w" catchtap="hideSelect" wx:if="{{ selectShowStatus }}">
  8. <view class="mask"></view>
  9. <view class="select">
  10. <view class="options {{ activeIndex === index ? 'active' : ''}}" wx:for="{{searchTypes}}" wx:key="{{index}}" data-index="{{ index }}" bindtap="changeSearchType">{{ item.text }}</view>
  11. </view>
  12. </view> -->
  13. </view>
  14. <view class="search-right">
  15. <icon icon="home_search" size="15" />
  16. <input placeholder="请输入关键字" value="{{ keyword }}" confirm-type="search" bindconfirm="search" ></input>
  17. </view>
  18. </view>
  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 }}" />