search-list.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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="fromData.search" type="text" placeholder="店铺名称或者商品名称">
  10. <view class="input-buttom fs-28 fc-f fw-500" @click="search()">搜索</view>
  11. </view>
  12. <scroll-view scroll-y="true" class="scroll-view-css seacrh-info box-border-box p-24" @scrolltolower="scrolltolower">
  13. <view class="goos-list-box box-border-box p-24 display-flex" v-for="(item,i) in list" :key="i" @click="toShop(item)">
  14. <image class="left-img" :src="item.shop_logo" mode="aspectFill"></image>
  15. <view class="flex-1">
  16. <view class="align-items-center mb-8">
  17. <view class="right-box-title fs-32 fw-600 text-overflow-ellipsis-one">{{item.shop_name}}</view>
  18. <image class="right-box-title-img" src="@/static/img/toRight.png" mode=""></image>
  19. </view>
  20. <view class="align-items-center mb-8">
  21. <image class="img-x mr-12" src="@/static/img/my/wdpj.png" mode=""></image>
  22. <view class="fs-26 fw-600 fc-FF7F00 mr-12">{{item.shop_score}}分</view>
  23. <view class="fc-6 fs-24 mr-12">| 预计{{item.delivery_time}}分钟 |</view>
  24. <view class="fc-6 fs-24 mr-12">{{item.shop_sales}}人购买</view>
  25. </view>
  26. <view class="align-items-center flex-wrap-wrap">
  27. <view class="quan-list display-flex mr-12 mb-12" v-for="(info1,index1) in item.coupon" :key="index1">
  28. <view class="quan-list-1 fs-24 fc-f">券</view>
  29. <view class="quan-list-2 fs-24 fc-FB3D03">{{info1.money}}元</view>
  30. </view>
  31. </view>
  32. <view class="goods-items-list display-flex">
  33. <view class="goods-items-list-box" v-for="(info2,index2) in item.goods" :key="index2">
  34. <image class="mb-12" :src="info2.goods_image" mode="aspectFill"></image>
  35. <view class="mb-8 fw-600 text-overflow-ellipsis-one fs-26">{{info2.goods_name}}</view>
  36. <view class="">
  37. <span class="fs-24 fc-FB3D03">¥</span>
  38. <span class="fs-32 fc-FB3D03 fw-b">{{info2.price}}</span>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </scroll-view>
  45. </view>
  46. </template>
  47. <script>
  48. import {getSearch} from '@/api/goods.js';
  49. export default {
  50. data(){
  51. return{
  52. fromData:{
  53. search:'',
  54. operate_id:'',
  55. page:1,
  56. },
  57. list:[],
  58. total:0,
  59. }
  60. },
  61. onLoad(e) {
  62. this.fromData.operate_id = uni.getStorageSync('operate_id');
  63. this.fromData.search = e.search
  64. this.fromData.page = 1;
  65. this.list = [];
  66. this.getList()
  67. },
  68. methods:{
  69. search(){
  70. this.fromData.page = 1;
  71. this.list = [];
  72. this.getList();
  73. },
  74. getList(){
  75. getSearch(this.fromData).then((res)=>{
  76. if(res.code === 1){
  77. this.list = [...this.list,...res.data.items];
  78. this.total = res.data.total;
  79. }
  80. })
  81. },
  82. scrolltolower(){
  83. if(this.list.length < this.total){
  84. this.fromData.page += 1;
  85. this.getList();
  86. }
  87. },
  88. toShop(item){
  89. uni.navigateTo({
  90. url:'/pages-takeout/shop?shop_id=' + item.shop_id
  91. })
  92. },
  93. },
  94. }
  95. </script>
  96. <style scoped lang="scss">
  97. .seacrh-record-index{
  98. position: relative;
  99. .seacrh-bg{
  100. position: absolute;
  101. top: 0;
  102. left: 0;
  103. width: 100%;
  104. height: 376rpx;
  105. filter: blur(80rpx);
  106. background-image: linear-gradient(to right, #C9F7FC,#F9F6E0,#F6F5F3);
  107. z-index: -1;
  108. }
  109. .s-input{
  110. margin-top: 24rpx;
  111. width: 100%;
  112. height: 72rpx;
  113. padding: 0 24rpx;
  114. box-sizing: border-box;
  115. position: relative;
  116. .input-icon{
  117. position: absolute;
  118. left: 48rpx;
  119. top: 20rpx;
  120. }
  121. input{
  122. font-size: 32rpx;
  123. width: 100%;
  124. height: 72rpx;
  125. background: #FFFFFF;
  126. border-radius: 200rpx;
  127. box-sizing: border-box;
  128. padding: 0 126rpx 0 78rpx;
  129. }
  130. .input-buttom{
  131. width: 120rpx;
  132. height: 60rpx;
  133. background: linear-gradient( 90deg, #57CAFF 0%, #41ABF5 100%);
  134. border-radius: 200rpx;
  135. text-align: center;
  136. line-height: 60rpx;
  137. position: absolute;
  138. right: 30rpx;
  139. top: 6rpx;
  140. }
  141. }
  142. .seacrh-info{
  143. margin-top: 20rpx;
  144. // border-radius: 24rpx 24rpx 0rpx 0rpx;
  145. }
  146. .goos-list-box{
  147. width: 100%;
  148. min-height: 100rpx;
  149. background: #FFFFFF;
  150. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51,51,51,0.1);
  151. border-radius: 20rpx;
  152. margin-bottom: 20rpx;
  153. .goods-items-list{
  154. width: 530rpx;
  155. overflow-y: scroll;
  156. .goods-items-list-box{
  157. width: 140rpx;
  158. margin-right: 16rpx;
  159. image{
  160. width: 140rpx;
  161. height: 140rpx;
  162. border-radius: 12rpx
  163. }
  164. }
  165. }
  166. .left-img{
  167. width: 100rpx;
  168. height: 100rpx;
  169. border-radius: 12rpx;
  170. margin-right: 16rpx;
  171. }
  172. .img-x{
  173. width: 24rpx;
  174. height: 24rpx;
  175. }
  176. .right-box-title{
  177. width: 438rpx;
  178. }
  179. .right-box-title-img{
  180. width: 32rpx;
  181. height: 32rpx;
  182. margin-left: auto;
  183. }
  184. .quan-list{
  185. .quan-list-1{
  186. width: 32rpx;
  187. height: 34rpx;
  188. background: #FB3D03;
  189. border-radius: 5rpx 0rpx 0rpx 5rpx;
  190. text-align: center;
  191. }
  192. .quan-list-2{
  193. box-sizing: border-box;
  194. padding: 0 2rpx;
  195. height: 34rpx;
  196. border-radius: 0 5rpx 5rpx 0;
  197. border: 1rpx solid #FB3D03;
  198. text-align: center;
  199. }
  200. }
  201. }
  202. }
  203. </style>