search.wxml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <scroll-view class="container" style="height: 100%;">
  2. <view class="search-header">
  3. <view class="input-box">
  4. <image class="icon" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/search2-2fb94833aa.png"></image>
  5. <input name="input" class="keywrod" focus="true" value="{{keyword}}" confirm-type="search" bindinput="inputChange" bindfocus="inputFocus" bindconfirm="onKeywordConfirm" confirm-type="search" placeholder="{{defaultKeyword.keyword}}" />
  6. <image class="del" wx:if="{{keyword}}" bindtap="clearKeyword" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/clearIpt-f71b83e3c2.png"></image>
  7. </view>
  8. <view class="right" bindtap="closeSearch">取消</view>
  9. </view>
  10. <view class="no-search" wx:if="{{ !searchStatus}}">
  11. <view class="serach-keywords search-history" wx:if="{{!keyword && historyKeyword.length}}">
  12. <view class="h">
  13. <text class="title">历史记录</text>
  14. <image class="icon" bindtap="clearHistory" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/del1-93f0a4add4.png"></image>
  15. </view>
  16. <view class="b">
  17. <view class="item" bindtap="onKeywordTap" data-keyword="{{item}}" wx:for="{{historyKeyword}}" hover-class="navigator-hover">{{item}}</view>
  18. </view>
  19. </view>
  20. <view class="serach-keywords search-hot" wx:if="{{!keyword}}">
  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}}">{{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}}" 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 by-price {{currentSortType == 'price' ? 'active' : ''}} {{currentSortOrder == 'asc' ? 'asc' : 'desc'}}" bindtap="openSortFilter" id="priceSort">
  39. <text class="txt">价格</text>
  40. </view>
  41. <view class="item {{currentSortType == 'category' ? 'active' : ''}}" bindtap="openSortFilter" id="categoryFilter">
  42. <text class="txt">分类</text>
  43. </view>
  44. </view>
  45. <view class="sort-box-category" wx-if="{{categoryFilter}}">
  46. <view class="item {{item.checked ? 'active' : ''}}" wx:for="{{filterCategory}}" wx:key="cate-{{item.id}}" data-category-index="{{index}}" bindtap="selectCategory">{{item.name}}</view>
  47. </view>
  48. </view>
  49. <view class="cate-item">
  50. <view class="b">
  51. <navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:for-item="iitem" wx:for-index="iindex">
  52. <image class="img" src="{{iitem.list_pic_url}}" background-size="cover"></image>
  53. <text class="name">{{iitem.name}}</text>
  54. <text class="price">¥{{iitem.retail_price}}</text>
  55. </navigator>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="search-result-empty" wx:if="{{!goodsList.length && searchStatus}}">
  60. <image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noSearchResult-7572a94f32.png"></image>
  61. <text class="text">您寻找的商品还未上架</text>
  62. </view>
  63. </scroll-view>