search-list.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. <EnBlank :customSrc='true' v-if="list<= 0">
  15. <template v-slot:blankImg>
  16. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  17. </template>
  18. </EnBlank>
  19. <view class="" v-else>
  20. <view class="goos-list-box box-border-box" v-for="(item,i) in list" :key='i' @click="toShop(item)">
  21. <view class="display-flex p-b-20 mb-26 b-b-EFF2F5">
  22. <view class="left-img-box mr-24">
  23. <image class="left-img" :src="item.shop_logo" mode="aspectFill"></image>
  24. <view class="status-box fc-f" v-if="item.status != 1">
  25. 休息中
  26. </view>
  27. </view>
  28. <view class="flex-1">
  29. <view class="align-items-center mb-8">
  30. <view class="right-box-title fs-28 fw-600 text-overflow-ellipsis-one">
  31. {{item.shop_name}}
  32. </view>
  33. <image class="right-box-title-img" src="@/static/img/toRight.png" mode="">
  34. </image>
  35. </view>
  36. <view class="align-items-center mb-12">
  37. <image class="img-x mr-8" src="@/static/img/my/wdpj.png" mode=""></image>
  38. <view class="fs-24 fw-600 fc-FF7F00 mr-12">{{item.shop_score}}</view>
  39. <view class="fc-0 fs-24 mr-12">预计{{item.delivery_time}}分钟 |</view>
  40. <view class="fc-0 fs-24 mr-12">{{item.shop_sales}}人购买</view>
  41. </view>
  42. <view class="align-items-center flex-wrap-wrap">
  43. <view class="quan-list b-F5541E box-border-box bgc-f align-items-center b-rad-5 mr-10"
  44. v-for="(info1,index1) in item.coupon" :key="index1">
  45. <image class="quan-list-1" src="@/static/img/index/q.png" mode=""></image>
  46. <view class="quan-list-2 fs-24 fc-F5531E">{{info1.money}}元</view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="goods-items-list display-flex">
  52. <view class="goods-items-list-box" v-for="(info2,index2) in item.goods" :key="index2">
  53. <view v-show="info2.label === 3" class="label-box text-align-center bgc-F5811E fs-24 fc-f">
  54. 推荐</view>
  55. <view v-show="info2.label === 2" class="label-box text-align-center bgc-FF5555 fs-24 fc-f">
  56. 新品</view>
  57. <view v-show="info2.label === 1" class="label-box text-align-center bgc-48D3C5 fs-24 fc-f">
  58. 折扣</view>
  59. <view v-show="info2.label === 4" class="label-box text-align-center bgc-4db8ff fs-24 fc-f">
  60. 招牌</view>
  61. <image class="mb-18" :src="info2.goods_image" mode="aspectFill"></image>
  62. <view class="mb-12 fw-600 text-overflow-ellipsis-one fs-24">{{info2.goods_name}}
  63. </view>
  64. <view class="">
  65. <span class="fs-24 fc-FD5D05 fw-b">¥</span>
  66. <span class="fs-32 fc-FD5D05 fw-b">{{info2.price}}</span>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="pt-40 flex-direction align-items-center" v-if="list.length === total">
  72. <view class="fs-32 fc-0 fw-b">
  73. 小主都到这里了
  74. </view>
  75. <view class="fs-32 fc-0 fw-b mb-26">
  76. 还没有找到满意的店铺吗?
  77. </view>
  78. <view class="fs-24 fc-0 mb-32">
  79. 可以提交你意见与反馈哟。我们一定尽快努力达成!
  80. </view>
  81. <view class="list-but align-items-center flex-justify-center bgc-5CC2FF" @click="goFeedback">
  82. <view class="fs-28 fc-f mr-10">
  83. 去提交
  84. </view>
  85. <view class="sj-fff"></view>
  86. </view>
  87. </view>
  88. </view>
  89. </scroll-view>
  90. </view>
  91. </template>
  92. <script>
  93. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  94. import {
  95. getSearch
  96. } from '@/api/goods.js';
  97. import {
  98. shopInfo
  99. } from "@/api/shop.js"
  100. import tools from "@/service/tools";
  101. export default {
  102. components: {
  103. EnBlank
  104. },
  105. data() {
  106. return {
  107. fromData: {
  108. search: '',
  109. operate_id: '',
  110. page: 1,
  111. },
  112. list: [],
  113. total: 0,
  114. }
  115. },
  116. onLoad(e) {
  117. this.fromData.operate_id = uni.getStorageSync('operate_id');
  118. this.fromData.search = e.search
  119. this.fromData.page = 1;
  120. this.list = [];
  121. this.getList()
  122. },
  123. methods: {
  124. search() {
  125. this.fromData.page = 1;
  126. this.list = [];
  127. this.getList();
  128. },
  129. getList() {
  130. getSearch(this.fromData).then((res) => {
  131. if (res.code === 1) {
  132. this.list = [...this.list, ...res.data.items];
  133. this.total = res.data.total;
  134. }
  135. })
  136. },
  137. scrolltolower() {
  138. if (this.list.length < this.total) {
  139. this.fromData.page += 1;
  140. this.getList();
  141. }
  142. },
  143. toShop(item) {
  144. const operate_id = uni.getStorageSync('operate_id')
  145. shopInfo({
  146. operate_id: operate_id,
  147. shop_id: item.shop_id
  148. }).then((res) => {
  149. if (res.code == 1) {
  150. uni.navigateTo({
  151. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  152. })
  153. } else {
  154. tools.error(res.msg)
  155. }
  156. })
  157. },
  158. },
  159. }
  160. </script>
  161. <style scoped lang="scss">
  162. .list-but {
  163. width: 140rpx;
  164. height: 48rpx;
  165. line-height: 48rpx;
  166. border-radius: 24rpx;
  167. }
  168. .sj-fff {
  169. width: 0;
  170. height: 0;
  171. border-top: 8rpx solid transparent;
  172. border-right: 8rpx solid transparent;
  173. border-left: 8rpx solid #fff;
  174. border-bottom: 8rpx solid transparent;
  175. }
  176. .seacrh-record-index {
  177. position: relative;
  178. .seacrh-bg {
  179. position: absolute;
  180. top: 0;
  181. left: 0;
  182. width: 100%;
  183. height: 376rpx;
  184. filter: blur(80rpx);
  185. background-image: linear-gradient(to right, #C9F7FC, #F9F6E0, #F6F5F3);
  186. z-index: -1;
  187. }
  188. .s-input {
  189. margin-top: 24rpx;
  190. width: 100%;
  191. height: 72rpx;
  192. padding: 0 24rpx;
  193. box-sizing: border-box;
  194. position: relative;
  195. .input-icon {
  196. position: absolute;
  197. left: 48rpx;
  198. top: 20rpx;
  199. }
  200. input {
  201. font-size: 32rpx;
  202. width: 100%;
  203. height: 72rpx;
  204. background: #FFFFFF;
  205. border-radius: 200rpx;
  206. box-sizing: border-box;
  207. padding: 0 126rpx 0 78rpx;
  208. }
  209. .input-buttom {
  210. width: 120rpx;
  211. height: 60rpx;
  212. background: linear-gradient(90deg, #57CAFF 0%, #41ABF5 100%);
  213. border-radius: 200rpx;
  214. text-align: center;
  215. line-height: 60rpx;
  216. position: absolute;
  217. right: 30rpx;
  218. top: 6rpx;
  219. }
  220. }
  221. .seacrh-info {
  222. margin-top: 20rpx;
  223. // border-radius: 24rpx 24rpx 0rpx 0rpx;
  224. }
  225. .goos-list-box {
  226. width: 100%;
  227. min-height: 100rpx;
  228. padding: 28rpx 30rpx 35rpx;
  229. background: #FFFFFF;
  230. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51, 51, 51, 0.1);
  231. border-radius: 20rpx;
  232. margin-bottom: 20rpx;
  233. .goods-items-list {
  234. width: 100%;
  235. overflow-y: scroll;
  236. .goods-items-list-box {
  237. width: 33.3%;
  238. margin-right: 13rpx;
  239. position: relative;
  240. .label-box {
  241. position: absolute;
  242. left: 0;
  243. top: 0;
  244. width: 66rpx;
  245. height: 31rpx;
  246. line-height: 31rpx;
  247. border-radius: 10rpx 2rpx 10rpx 2rpx;
  248. }
  249. image {
  250. width: 201rpx;
  251. height: 200rpx;
  252. border-radius: 10rpx
  253. }
  254. }
  255. }
  256. .left-img-box {
  257. width: 120rpx;
  258. height: 120rpx;
  259. position: relative;
  260. .left-img {
  261. width: 120rpx;
  262. height: 120rpx;
  263. border-radius: 12rpx;
  264. }
  265. .status-box {
  266. position: absolute;
  267. bottom: 0;
  268. left: 0;
  269. width: 100%;
  270. padding: 4rpx 0;
  271. text-align: center;
  272. background: rgba(0, 0, 0, 0.5);
  273. font-size: 17rpx;
  274. border-radius: 0 0 12rpx 12rpx;
  275. }
  276. }
  277. .img-x {
  278. width: 16rpx;
  279. height: 16rpx;
  280. }
  281. .right-box-title {
  282. width: 438rpx;
  283. }
  284. .right-box-title-img {
  285. width: 32rpx;
  286. height: 32rpx;
  287. margin-left: auto;
  288. }
  289. .quan-list {
  290. min-width: 88rpx;
  291. height: 28rpx;
  292. line-height: 28rpx;
  293. .quan-list-1 {
  294. width: 38rpx;
  295. height: 28rpx;
  296. }
  297. }
  298. }
  299. }
  300. </style>