search.wxml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <scroll-view class="container" style="height: 100%;">
  2. <view class="search-header">
  3. <view class="input-box">
  4. <van-icon name="search"/>
  5. <input name="input" class="keywrod" focus="true" value="{{keyword}}" confirm-type="search" bindinput="inputChange" bindfocus="inputFocus" bindconfirm="onKeywordConfirm" placeholder="{{defaultKeyword.keyword}}" />
  6. <van-icon class="del" wx:if="{{keyword}}" bindtap="clearKeyword" name="cross" />
  7. </view>
  8. <view class="right" bindtap="closeSearch">取消</view>
  9. </view>
  10. <view class="no-search" wx:if="{{ !searchStatus}}">
  11. <!-- <view class="search-keywords search-history" wx:if="{{!keyword && historyKeyword.length}}">
  12. <view class="h">
  13. <text class="title">历史记录</text>
  14. <van-icon bindtap="clearHistory" name="delete" class="icon"/>
  15. </view>
  16. <view class="b">
  17. <view class="item" bindtap="onKeywordTap" data-keyword="{{item.keyword}}" wx:for="{{historyKeyword}}" wx:key="keyword" hover-class="navigator-hover">{{item.keyword}}</view>
  18. </view>
  19. </view> -->
  20. <view class="search-keywords search-hot" wx:if="{{!keyword && hotKeyword.length}}">
  21. <view class="h">
  22. <text class="title">热门搜索</text>
  23. </view>
  24. <view class="b">
  25. <view class="item {{item.is_hot === 1 ? 'active' : ''}}" hover-class="navigator-hover" bindtap="onKeywordTap" data-keyword="{{item.keyword}}" wx:for="{{hotKeyword}}" wx:key="id">{{item.keyword}}</view>
  26. </view>
  27. </view>
  28. <view class="shelper-list" wx:if="{{keyword}}">
  29. <view class="item" hover-class="navigator-hover" wx:for="{{helpKeyword}}" wx:key="id" bindtap="onKeywordTap" data-keyword="{{item}}">{{item}}</view>
  30. </view>
  31. </view>
  32. <view class="search-result" wx:if="{{ searchStatus && goodsList.length}}">
  33. <view class="sort">
  34. <view class="sort-box">
  35. <view class="item {{currentSortType == 'default' ? 'active' : ''}}" bindtap="openSortFilter" id="defaultSort">
  36. <text class="txt">综合</text>
  37. </view>
  38. <view class="item {{currentSortType == 'price' ? 'active' : ''}}" bindtap="openSortFilter" id="priceSort">
  39. <text class="txt">价格</text>
  40. <van-icon name="arrow-up" wx:if="{{ currentSortType == 'price' && currentSortOrder == 'asc' }}" />
  41. <van-icon name="arrow-down" wx:elif="{{ currentSortType == 'price' && currentSortOrder == 'desc'}}" />
  42. </view>
  43. <view class="item {{currentSortType == 'category' ? 'active' : ''}}" bindtap="openSortFilter" id="categoryFilter">
  44. <text class="txt">分类</text>
  45. </view>
  46. </view>
  47. <view class="sort-box-category" wx-if="{{categoryFilter}}">
  48. <view class="item {{item.checked ? 'active' : ''}}" wx:for="{{filterCategory}}" wx:key="id" data-category-index="{{index}}" bindtap="selectCategory">{{item.name}}</view>
  49. </view>
  50. </view>
  51. <view class="cate-item">
  52. <view class="b">
  53. <navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:key="id" wx:for-item="iitem" wx:for-index="iindex">
  54. <image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
  55. <text class="name">{{iitem.name}}</text>
  56. <!-- <view class="price">
  57. <view class="retailPrice">¥{{iitem.retailPrice}}</view>
  58. <view class="memberPrice">¥{{iitem.memberPrice}}</view>
  59. <view class="member-price-tag">会员价</view>
  60. </view> -->
  61. <!-- <view class="price"><text>¥{{iitem.retailPrice}}</text>
  62. <text class="counterPrice sub-color">¥{{iitem.counterPrice}}</text>
  63. </view> -->
  64. </navigator>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="search-result-empty" wx:if="{{!goodsList.length && searchStatus}}">
  69. <text class="text">您寻找的商品还未上架</text>
  70. </view>
  71. </scroll-view>