search.wxml 2.4 KB

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