search.wxml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!--parents/pages/search/search.wxml-->
  2. <import src="../../../templates/nodata/nodata.wxml" />
  3. <import src="../../../templates/loading/loading.wxml" />
  4. <view class='container'>
  5. <template is='loading' wx:if='{{!isLoaded}}'></template>
  6. <view class='wrapper' wx:else>
  7. <view class='header {{content.length > 0 ? "header-active" : ""}}'>
  8. <view class='search-container'>
  9. <view class='search-wrapper'>
  10. <image class='search-icon' src='../../../assets/search.png'></image>
  11. <input class='search-input' type='text' value='{{content}}' placeholder='如:夏洛特的烦恼' placeholder-class='search-placeholder' confirm-type='search' bindconfirm='inputSearchCtl'></input>
  12. <image class='search-icon' wx:if='{{content.length > 0}}' src='../../../assets/error_gray.png' bindtap='clearSearchCtl'></image>
  13. </view>
  14. <!-- <view class='search-button {{content.length > 0 ? "search-button-active" : ""}}' bindtap='submitSearchCtl'>搜索</view> -->
  15. <view bindtap='returnBack' class='search-cancel'>取消</view>
  16. </view>
  17. </view>
  18. <view class='topic' wx:if='{{options.type ==3}}'>
  19. <image src='../../../assets/topic{{options.img_index}}.png' class='topic-img'></image>
  20. <view>{{options.theme_name}}阅读主题</view>
  21. </view>
  22. <view class='items' wx:if='{{options.type == 2}}'>
  23. <view class='item' bindtap='showItemCtl'>
  24. <text class='item-text'>{{items[itemIndex]}}</text>
  25. <image class='item-icon {{isShow ? "item-icon-active" : ""}}' src='../../../assets/arrow_blue.png'></image>
  26. </view>
  27. <view class='items-modal' wx:if='{{isShow}}' catchtouchmove='true'>
  28. <view class='items-modal-list'>
  29. <view class='items-modal-li' wx:for='{{items}}' wx:key='{{index}}' data-index='{{index}}' bindtap='selectItemCtl'>
  30. <view class='items-modal-text'>{{item}}</view>
  31. <image class='items-modal-icon' wx:if='{{itemIndex == index}}' src='../../../assets/true_blue.png'></image>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 历史记录 -->
  37. <view class='history' wx:if='{{contentList.length>0&&isRecord}}'>
  38. <view class='history-items'>
  39. <view>最近搜索</view>
  40. <image class='history-img' src='../../../assets/delete.png' bindtap='deleteTips'></image>
  41. </view>
  42. <view>
  43. <view class='history-item' wx:for='{{contentList}}' wx:key='index'>{{item}}</view>
  44. </view>
  45. </view>
  46. <!-- 无书籍 -->
  47. <view class='nodata' wx:if='{{list.length==0&&isType}}'>
  48. <image src='../../../assets/nodata.png' class='nodata-img'></image>
  49. <view>暂时还没有这本书,可以申请哦~</view>
  50. <view class='nodata-btn' data-url='parents/pages/apply_bookform/apply_bookform' bindtap='navigateTo'>填写申请书单</view>
  51. </view>
  52. <view class='list-items' wx:if='{{options.type == 1&&list.length>0}}' style='margin:0 40rpx;'>
  53. <view class='list-items-title'>搜索结果</view>
  54. <view class='list-item' wx:for='{{list}}' wx:key='index' data-url='parents/pages/book_detail/book_detail' data-zindex='3' data-paras='{{({bookInfoId: item.bookInfoId})}}' bindtap='navigateTo'>
  55. <view class='list-item-img'>
  56. <image src='{{item.localImage?baseImgUrl+item.localImage:"../../../assets/banner1.png"}}' class='list-item-img-items'></image>
  57. </view>
  58. <view class='list-item-content'>
  59. <view class='list-item-content-title'>{{item.title}}</view>
  60. <view class='list-item-content-tips'>{{item.summary}}</view>
  61. <view class='list-item-content-label'>
  62. <view class='list-item-content-label-one' wx:if='{{item.themeName}}'>{{item.themeName}}</view>
  63. <view class='list-item-content-label-two' wx:if='{{item.grade}}'>推荐{{item.grade}}</view>
  64. </view>
  65. <view>
  66. <image src='../../../assets/fire.png' class='list-item-content-fire' wx:for="{{item.heat}}" wx:key='index'></image>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class='list' wx:if='{{options.type == 2}}'>
  72. <view class='li' wx:for='{{list}}' wx:key='{{index}}'>
  73. <view class='book-container'>
  74. <view class='book-wrapper' data-url='parents/pages/book_detail/book_detail' data-zindex='3' data-paras='{{({isbn13: item.isbn13})}}' bindtap='navigateTo'>
  75. <view class='book-images'>
  76. <image class='book-image' mode='aspectFill' src='{{item.local_image ? baseImgUrl + item.local_image : "../../../assets/default_headicon.png"}}'></image>
  77. </view>
  78. <view class='book-content'>
  79. <view class='book-title'>{{item.title}}</view>
  80. <view class='book-text'>作者:{{item.author}}</view>
  81. <view class='book-context'>{{item.summary}}</view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- 好书推荐 -->
  88. <view class='list' wx:if='{{options.type==3}}'>
  89. <view class='li' wx:for='{{list}}' wx:key='{{index}}'>
  90. <view class='book-container'>
  91. <view class='book-wrapper' data-url='parents/pages/book_detail/book_detail' data-zindex='3' data-paras='{{({isbn13: item.isbn13})}}' bindtap='navigateTo'>
  92. <view class='book-images'>
  93. <image class='book-image' mode='aspectFill' src='{{item.local_image ? baseImgUrl + item.local_image : "../../../assets/default_headicon.png"}}'></image>
  94. </view>
  95. <view class='book-content'>
  96. <view class='book-title'>{{item.title}}</view>
  97. <view class='book-text'>作者:{{item.author}}</view>
  98. <view class='book-context'>{{item.summary}}</view>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. <template is='nodata' data='{{...nodataArray}}' wx:if='{{list.length==0&&options.type!=1}}'></template>
  105. <template is='nodata' data='{{...nodataArray}}' wx:if='{{options.type!=1&&borrowingList.length==0&&reservelist.length==0&&wishList.length==0}}'></template>
  106. </view>
  107. </view>