search.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view>
  3. <u-navbar back-text="搜索" back-icon-size="28" back-icon-color="#ffffff"
  4. :background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
  5. <!-- 搜索框 -->
  6. <view class="search">
  7. <view class="search-box">
  8. <view class="option">
  9. <nxsearch :selectList="selectList" button="inside" @search="doSearch" @confirm="doSearc" v-model="searchQuery.keyword" placeholder="输入关键字找工作" />
  10. </view>
  11. </view>
  12. </view>
  13. <!-- 搜索历史 -->
  14. <view class="search-history">
  15. <view class="top">
  16. <view class="title">
  17. 搜索历史
  18. </view>
  19. <view class="clear">
  20. 清空历史
  21. </view>
  22. </view>
  23. <view class="history">
  24. <view class="tag">
  25. 打杂
  26. </view>
  27. <view class="tag">
  28. 地推
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import nxsearch from "../../components/nx-search.vue"
  36. export default {
  37. components: {
  38. nxsearch
  39. },
  40. data() {
  41. return {
  42. keyword: '',
  43. searchQuery: {
  44. keyword: '',
  45. selectIndex: 0
  46. },
  47. selectList: [{
  48. id: 1,
  49. name: '找工作'
  50. },
  51. {
  52. id: 2,
  53. name: '找公司'
  54. },
  55. ],
  56. }
  57. },
  58. methods: {
  59. // 执行搜索
  60. doSearch(searchQuery) {
  61. console.log('searchQuery', searchQuery);
  62. },
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. // 搜索框
  68. .search {
  69. padding: 16rpx 32rpx;
  70. .search-box {
  71. border-radius: 50px;
  72. // background-color: rgba(243, 246, 249, 1);
  73. height: 72rpx;
  74. line-height: 72rpx;
  75. }
  76. }
  77. // 搜索历史
  78. .search-history{
  79. padding: 0 32rpx;
  80. margin-top: 40rpx;
  81. .top{
  82. display: flex;
  83. justify-content: space-between;
  84. align-items: center;
  85. .title{
  86. color: #101010;
  87. }
  88. .clear{
  89. color: rgba(169, 169, 169, 1);
  90. font-size: 24rpx;
  91. }
  92. }
  93. .history{
  94. display: flex;
  95. margin-top: 16rpx;
  96. .tag{
  97. width: 144rpx;
  98. height: 56rpx;
  99. line-height: 56rpx;
  100. border-radius: 4px;
  101. background-color: rgba(241, 244, 247, 1);
  102. color: rgba(88, 88, 88, 1);
  103. font-size: 12px;
  104. text-align: center;
  105. font-family: Arial;
  106. margin-right: 16rpx;
  107. }
  108. }
  109. }
  110. </style>