search.wxml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!--为搜索页面-->
  2. <view class="search" style="background-color:#ffffff;">
  3. <view class="search-inside bg-color" style="display: flex; align-items: center;">
  4. <icon type="search" size="20"></icon>
  5. <input class="search-input" style="width: {{searchEnable ? 550 : 650}}rpx;" value="{{searchText}}" placeholder="搜索" confirm-type="search" bindinput="update" bindfocus="focus" bindconfirm="search"></input>
  6. </view>
  7. <view wx:if="{{searchEnable}}" class="cancel-button" bindtap="cancel">取消</view>
  8. </view>
  9. <scroll-view class="hot-block" scroll-y="true">
  10. <view class="hot-tag-block">
  11. <view class="hot-tag-title primary-color-fg">历史搜索</view>
  12. <view class="hot-tags secondary-text-color">
  13. <view class="hot-tag" wx:for="{{hotTagData}}" wx:key="tag" wx:for-item="item" data-search-tag="{{item.tag}}" bindtap="searchTag">{{item.tag}}</view>
  14. </view>
  15. </view>
  16. <view class="hot-tag-block">
  17. <view class="hot-tag-title primary-color-fg">热门搜索</view>
  18. <view class="hot-tags secondary-text-color">
  19. <view class="hot-tag" wx:for="{{hotTagData}}" wx:key="tag" wx:for-item="item" data-search-tag="{{item.tag}}" bindtap="searchTag">{{item.tag}}</view>
  20. </view>
  21. </view>
  22. <view class="hot-bar-block">
  23. <text class="hot-bar-title primary-color-bg text-primary-color">实时热点</text>
  24. <view class="hot-bar" wx:for="{{hotBarData}}" wx:key="rank" wx:for-item="item" data-activity-id="{{item.id}}" bindtap="viewActivity">
  25. <view>
  26. <text class="primary-color-fg" space="nbsp">{{item.rank}} </text><text class="secondary-text-color">{{item.title}} </text>
  27. </view>
  28. <image class="more" src="/images/more.png" mode="aspectFill"></image>
  29. </view>
  30. </view>
  31. </scroll-view>
  32. <scroll-view wx:if="{{searchEnable}}" class="search-block" scroll-y="true" bindtap="blur">
  33. <view class="result-bar" wx:for="{{searchResult}}" wx:key="_id">
  34. <itemCard item="{{item}}"/>
  35. </view>
  36. <view wx:if="{{searchText == '' && searchResult.length == 0}}" wx:for="{{searchHistory}}" wx:for-item="item" wx:key="*this" class="search-history" data-history="{{item}}" catchtap="searchAgain">
  37. <view>{{item}}</view>
  38. <view data-history="{{item}}" catchtap="removeHistory">×</view>
  39. </view>
  40. </scroll-view>