search-list.vue 6.1 KB

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