search.wxml 1.8 KB

1234567891011121314151617181920212223242526272829303132
  1. <!--为搜索页面-->
  2. <view class="search block-background-color">
  3. <view class="search-inside" style="display: flex; align-items: center;">
  4. <icon type="search"></icon>
  5. <input class="search-input primary-text-color" 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 secondary-text-color" bindtap="cancel">取消</view>
  8. </view>
  9. <scroll-view class="hot-block" scroll-y="true">
  10. <view class="hot-tag-block block-background-color">
  11. <view class="hot-tag-title default-primary-color-font">热门搜索</view>
  12. <view class="hot-tags">
  13. <view class="hot-tag light-primary-color" 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-bar-block">
  17. <view class="hot-bar-title default-primary-color-font">实时热点</view>
  18. <view class="hot-bar block-background-color" wx:for="{{hotBarData}}" wx:key="rank" wx:for-item="item" data-activity-id="{{item.id}}" bindtap="viewActivity">{{item.rank}}. {{item.title}}</view>
  19. </view>
  20. </scroll-view>
  21. <scroll-view wx:if="{{searchEnable}}" class="search-block" scroll-y="true" bindtap="blur">
  22. <view class="result-bar" wx:for="{{searchResult}}" wx:key="_id">
  23. <itemCard item="{{item}}"/>
  24. </view>
  25. <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">
  26. <view>{{item}}</view>
  27. <view data-history="{{item}}" catchtap="removeHistory">×</view>
  28. </view>
  29. </scroll-view>