search-record.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="seacrh-record-index iPhone-bottom flex-common-css box-border-box">
  3. <view class="seacrh-bg"></view>
  4. <Nav title='搜索' bgckgroundBox='transparent'></Nav>
  5. <view class="s-input">
  6. <view class="input-icon">
  7. <uni-icons type="search" size="18" color="#999"></uni-icons>
  8. </view>
  9. <input v-model="search" type="text" placeholder="店铺名称或者商品名称">
  10. <view class="input-buttom fs-28 fc-f fw-500" @click="toList()">搜索</view>
  11. </view>
  12. <view class="scroll-view-css bgc-f seacrh-info box-border-box p-32">
  13. <view class="flex-justify-space mb-32" v-if="list.length > 0">
  14. <view class="fs-32 fw-600 fc-3">搜索历史</view>
  15. <view class="align-items-center">
  16. <view @click="isOpen=!isOpen" class="">{{isOpen?'收起':'展开'}}</view>
  17. <view @click="isOpen=!isOpen" :class="isOpen?'down':'up'">
  18. <uni-icons type="right" size="14" color="#999"></uni-icons>
  19. </view>
  20. <view class="view-x"></view>
  21. <uni-icons @click="list = []" type="trash" size="18" color="#999"></uni-icons>
  22. </view>
  23. </view>
  24. <view :class="!isOpen?'hide-h':''" class="flex-wrap-wrap mb-50" v-if="list.length > 0">
  25. <view class="fs-28 list-item text-overflow-ellipsis-one" @click="toList(item.name)" v-for="(item,i) in list" :key="i">{{item.name}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data(){
  33. return{
  34. search:'',
  35. isOpen:false,
  36. list:[{name:'土猪',},{name:'土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪',},{name:'土猪',},
  37. {name:'土猪',},{name:'土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪',},{name:'土猪',},
  38. {name:'土猪',},{name:'土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪',},{name:'土猪',},
  39. {name:'土猪',},{name:'土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪',},{name:'土猪',},],
  40. }
  41. },
  42. onShow() {
  43. },
  44. methods:{
  45. toList(name){
  46. let search = '';
  47. if(name){
  48. search = name;
  49. }else{
  50. search = this.search;
  51. }
  52. uni.navigateTo({
  53. url:"pages/index/search-list?search=" + search
  54. })
  55. },
  56. },
  57. }
  58. </script>
  59. <style scoped lang="scss">
  60. .seacrh-record-index{
  61. position: relative;
  62. .hide-h{
  63. height: 232rpx !important;
  64. overflow: hidden !important;
  65. }
  66. .down{
  67. transform: rotate(-90deg);
  68. transition: all 0.5s;
  69. }
  70. .up{
  71. transform: rotate(90deg);
  72. transition: all 0.5s;
  73. }
  74. .view-x{
  75. width: 2rpx;
  76. height: 20rpx;
  77. background-color: #eee;
  78. margin: 0 24rpx;
  79. }
  80. .find-item{
  81. width: 48%;
  82. text-align: left;
  83. }
  84. .list-item{
  85. max-height: 688rpx;
  86. min-width: 10rpx;
  87. height: 56rpx;
  88. line-height: 56rpx;
  89. background: #F7F8FC;
  90. border-radius: 200rpx;
  91. margin: 0 8rpx 32rpx 0;
  92. box-sizing: border-box;
  93. padding: 0 24rpx;
  94. }
  95. .seacrh-bg{
  96. position: absolute;
  97. top: 0;
  98. left: 0;
  99. width: 100%;
  100. height: 376rpx;
  101. background-image: linear-gradient(to right, #C9F7FC,#F9F6E0,#F6F5F3);
  102. z-index: -1;
  103. }
  104. .s-input{
  105. margin-top: 24rpx;
  106. width: 100%;
  107. height: 72rpx;
  108. padding: 0 24rpx;
  109. box-sizing: border-box;
  110. position: relative;
  111. .input-icon{
  112. position: absolute;
  113. left: 48rpx;
  114. top: 20rpx;
  115. }
  116. input{
  117. font-size: 32rpx;
  118. width: 100%;
  119. height: 72rpx;
  120. background: #FFFFFF;
  121. border-radius: 200rpx;
  122. box-sizing: border-box;
  123. padding: 0 126rpx 0 78rpx;
  124. }
  125. .input-buttom{
  126. width: 120rpx;
  127. height: 60rpx;
  128. background: linear-gradient( 90deg, #57CAFF 0%, #41ABF5 100%);
  129. border-radius: 200rpx;
  130. text-align: center;
  131. line-height: 60rpx;
  132. position: absolute;
  133. right: 30rpx;
  134. top: 6rpx;
  135. }
  136. }
  137. .seacrh-info{
  138. margin-top: 20rpx;
  139. border-radius: 24rpx 24rpx 0rpx 0rpx;
  140. }
  141. }
  142. </style>