微信小店联盟带货小程序

index.wxml 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!--pages/search/index.wxml-->
  2. <view class="container">
  3. <!-- 搜索框 -->
  4. <view class="search-header">
  5. <view class="search-box">
  6. <icon type="search" size="16" color="#8C8C8C"/>
  7. <input
  8. class="search-input"
  9. placeholder="搜索商品"
  10. value="{{keyword}}"
  11. focus="{{true}}"
  12. confirm-type="search"
  13. bindinput="onInput"
  14. bindconfirm="onSearch"
  15. />
  16. <icon
  17. wx:if="{{keyword}}"
  18. type="clear"
  19. size="16"
  20. color="#8C8C8C"
  21. bindtap="clearKeyword"
  22. />
  23. </view>
  24. <text class="cancel-btn" bindtap="onCancel">取消</text>
  25. </view>
  26. <!-- 搜索内容区域 -->
  27. <scroll-view
  28. class="search-content"
  29. scroll-y="{{true}}"
  30. enable-flex
  31. >
  32. <!-- 热门搜索 -->
  33. <view class="search-section" wx:if="{{!keyword}}">
  34. <view class="section-header">
  35. <text class="section-title">热门搜索</text>
  36. </view>
  37. <view class="hot-search">
  38. <text
  39. class="hot-item {{index < 3 ? 'hot' : ''}}"
  40. wx:for="{{hotSearches}}"
  41. wx:key="*this"
  42. bindtap="onTagClick"
  43. data-keyword="{{item}}"
  44. >{{item}}</text>
  45. </view>
  46. </view>
  47. <!-- 搜索历史 -->
  48. <view class="search-section" wx:if="{{!keyword && searchHistory.length > 0}}">
  49. <view class="section-header">
  50. <text class="section-title">搜索历史</text>
  51. <text class="clear-history" bindtap="clearHistory">
  52. <text class="iconfont icon-delete"></text>
  53. 清空历史
  54. </text>
  55. </view>
  56. <view class="history-list">
  57. <view
  58. class="history-item"
  59. wx:for="{{searchHistory}}"
  60. wx:key="*this"
  61. bindtap="onTagClick"
  62. data-keyword="{{item}}"
  63. >
  64. <text class="iconfont icon-time"></text>
  65. <text class="history-text">{{item}}</text>
  66. </view>
  67. </view>
  68. </view>
  69. <!-- 搜索建议 -->
  70. <view class="search-suggestions" wx:if="{{keyword && suggestions.length > 0}}">
  71. <view
  72. class="suggestion-item"
  73. wx:for="{{suggestions}}"
  74. wx:key="*this"
  75. bindtap="onTagClick"
  76. data-keyword="{{item}}"
  77. >
  78. <text class="iconfont icon-search"></text>
  79. <text>{{item}}</text>
  80. </view>
  81. </view>
  82. </scroll-view>
  83. </view>