search.wxml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <scroll-view class="container" style="height: 100%;">
  2. <!-- 输入框 -->
  3. <view class="search-header">
  4. <view class="input-box">
  5. <image class="icon" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/search2-2fb94833aa.png"></image>
  6. <input name="input" class="keywrod" focus="true" value="{{keyword}}" confirm-type="search" bindinput="inputChange" bindfocus="inputFocus" bindconfirm="onKeywordConfirm" confirm-type="search" placeholder="{{defaultKeyword}}" />
  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. <!-- 热门关键字,历史搜索,搜索辅助 -->
  12. <view class="no-search" wx:if="{{ !searchStatus}}">
  13. <view class="serach-keywords search-history" wx:if="{{!keyword && historyKeyword.length}}">
  14. <view class="h">
  15. <text class="title">历史记录</text>
  16. <image class="icon" bindtap="clearHistory" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/del1-93f0a4add4.png"></image>
  17. </view>
  18. <view class="b">
  19. <view class="item" bindtap="onKeywordTap" data-keyword="{{item}}" wx:for="{{historyKeyword}}" hover-class="navigator-hover">{{item}}</view>
  20. </view>
  21. </view>
  22. <view class="serach-keywords search-hot" wx:if="{{!keyword}}">
  23. <view class="h">
  24. <text class="title">热门搜索</text>
  25. </view>
  26. <view class="b">
  27. <view class="item active" hover-class="navigator-hover" bindtap="onKeywordTap" data-keyword="{{item}}" wx:for="{{hotKeyword}}">{{item}}</view>
  28. </view>
  29. </view>
  30. <view class="shelper-list" wx:if="{{keyword}}">
  31. <view class="item" hover-class="navigator-hover" wx:for="{{helpKeyword}}" bindtap="onKeywordTap" data-keyword="{{item[0]}}">{{item[0]}}</view>
  32. </view>
  33. </view>
  34. <!-- 搜索结果 -->
  35. <view class="search-result" wx:if="{{ searchStatus && goodsList.length}}">
  36. <view class="result-item">
  37. <view class="b">
  38. <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">
  39. <image class="img" src="{{iitem.primaryPicUrl}}" background-size="cover"></image>
  40. <text class="name">{{iitem.name}}</text>
  41. <text class="price">¥{{iitem.price}}</text>
  42. </navigator>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 搜索结果为空 -->
  47. <view class="search-result-empty" wx:if="{{!goodsList.length && searchStatus}}">
  48. <image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noSearchResult-7572a94f32.png"></image>
  49. <text class="text">没有您寻找的商品</text>
  50. </view>
  51. </scroll-view>