search.wxml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <scroll-view class="container" style="height: 100%;">
  2. <view class="search-header">
  3. <view class="input-box">
  4. <image bindtap="gotoSearch" 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" />
  6. <!-- placeholder="{{defaultKeyword.keyword}}" -->
  7. <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>
  8. </view>
  9. <view class="right" bindtap="closeSearch">取消</view>
  10. </view>
  11. <view class="no-search" wx:if="{{ !searchStatus}}">
  12. <view class="serach-keywords search-history" wx:if="{{!keyword && historyKeyword.length}}">
  13. <view class="h">
  14. <text class="title">历史记录</text>
  15. <image class="icon" bindtap="clearHistory" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/del1-93f0a4add4.png"></image>
  16. </view>
  17. <view class="b">
  18. <view class="item" bindtap="onKeywordTap" data-keyword="{{item}}" wx:for="{{historyKeyword}}" hover-class="navigator-hover">{{item}}</view>
  19. </view>
  20. </view>
  21. <view class="serach-keywords search-hot" wx:if="{{!keyword}}">
  22. <view class="h">
  23. <text class="title">热门搜索</text>
  24. </view>
  25. <view class="b">
  26. <view class="item {{item.is_hot === 1 ? 'active' : ''}}" hover-class="navigator-hover" bindtap="onKeywordTap" data-keyword="{{item.keyword}}" wx:for="{{hotKeyword}}">{{item.keyword}}</view>
  27. </view>
  28. </view>
  29. <view class="shelper-list" wx:if="{{keyword}}">
  30. <view class="item" hover-class="navigator-hover" wx:for="{{helpKeyword}}" bindtap="onKeywordTap" data-keyword="{{item}}">{{item}}</view>
  31. </view>
  32. </view>
  33. <view class="search-result" wx:if="{{ searchStatus && goodsList.length}}">
  34. <view class="sort">
  35. <view class="sort-box">
  36. <view class="item {{currentSortType == 'default' ? 'active' : ''}}" bindtap="openSortFilter" id="defaultSort">
  37. <text class="txt">综合</text>
  38. </view>
  39. <view class="item by-price {{currentSortType == 'price' ? 'active' : ''}} {{currentSortOrder == 'asc' ? 'asc' : 'desc'}}" bindtap="openSortFilter" id="priceSort">
  40. <text class="txt">价格</text>
  41. </view>
  42. <view class="item {{currentSortType == 'category' ? 'active' : ''}}" bindtap="openSortFilter" id="categoryFilter">
  43. <text class="txt">分类</text>
  44. </view>
  45. </view>
  46. <view class="sort-box-category" wx-if="{{categoryFilter}}">
  47. <view class="item {{item.checked ? 'active' : ''}}" wx:for="{{filterCategory}}" wx:key="cate-{{item.id}}" data-category-index="{{index}}" bindtap="selectCategory">{{item.name}}</view>
  48. </view>
  49. </view>
  50. <view class="cate-item">
  51. <view class="b">
  52. <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">
  53. <image class="img" src="{{iitem.list_pic_url}}" background-size="cover"></image>
  54. <text class="name">{{iitem.name}}</text>
  55. <text class="price">¥{{iitem.retail_price}}</text>
  56. </navigator>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="search-result-empty" wx:if="{{!goodsList.length && searchStatus}}">
  61. <image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noSearchResult-7572a94f32.png"></image>
  62. <text class="text">您寻找的商品还未上架</text>
  63. </view>
  64. </scroll-view>