index.wxml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <view class="search-page">
  2. <t-search
  3. t-class-input-container="t-class__input-container"
  4. t-class-input="t-search__input"
  5. value="{{searchValue}}"
  6. leftIcon=""
  7. placeholder="iPhone12pro"
  8. bind:submit="handleSubmit"
  9. focus
  10. >
  11. <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
  12. </t-search>
  13. <view class="search-wrap">
  14. <view class="history-wrap">
  15. <view class="search-header">
  16. <text class="search-title">历史搜索</text>
  17. <text class="search-clear" bind:tap="handleClearHistory">清除</text>
  18. </view>
  19. <view class="search-content">
  20. <view
  21. class="search-item"
  22. hover-class="hover-history-item"
  23. wx:for="{{historyWords}}"
  24. bind:tap="handleHistoryTap"
  25. bindlongpress="deleteCurr"
  26. data-index="{{index}}"
  27. wx:key="*this"
  28. >
  29. {{item}}
  30. </view>
  31. </view>
  32. </view>
  33. <view class="popular-wrap">
  34. <view class="search-header">
  35. <text class="search-title">热门搜索</text>
  36. </view>
  37. <view class="search-content">
  38. <view
  39. class="search-item"
  40. hover-class="hover-history-item"
  41. wx:for="{{popularWords}}"
  42. bind:tap="handleHistoryTap"
  43. data-index="{{index}}"
  44. wx:key="*this"
  45. >
  46. {{item}}
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <t-dialog
  52. visible="{{dialogShow}}"
  53. content="{{dialog.message}}"
  54. bindconfirm="confirm"
  55. bind:close="close"
  56. confirm-btn="确定"
  57. cancel-btn="{{dialog.showCancelButton ? '取消' : null}}"
  58. t-class-confirm="dialog__button-confirm"
  59. t-class-cancel="dialog__button-cancel"
  60. />
  61. </view>