search-list.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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. goFeedback() {
  125. // 问题反馈
  126. uni.navigateTo({
  127. url: '/pages-my/feedback'
  128. })
  129. },
  130. search() {
  131. this.fromData.page = 1;
  132. this.list = [];
  133. this.getList();
  134. },
  135. getList() {
  136. getSearch(this.fromData).then((res) => {
  137. if (res.code === 1) {
  138. this.list = [...this.list, ...res.data.items];
  139. this.total = res.data.total;
  140. }
  141. })
  142. },
  143. scrolltolower() {
  144. if (this.list.length < this.total) {
  145. this.fromData.page += 1;
  146. this.getList();
  147. }
  148. },
  149. toShop(item) {
  150. const operate_id = uni.getStorageSync('operate_id')
  151. shopInfo({
  152. operate_id: operate_id,
  153. shop_id: item.shop_id
  154. }).then((res) => {
  155. if (res.code == 1) {
  156. uni.navigateTo({
  157. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  158. })
  159. } else {
  160. tools.error(res.msg)
  161. }
  162. })
  163. },
  164. },
  165. }
  166. </script>
  167. <style scoped lang="scss">
  168. .list-but {
  169. width: 140rpx;
  170. height: 48rpx;
  171. line-height: 48rpx;
  172. border-radius: 24rpx;
  173. }
  174. .sj-fff {
  175. width: 0;
  176. height: 0;
  177. border-top: 8rpx solid transparent;
  178. border-right: 8rpx solid transparent;
  179. border-left: 8rpx solid #fff;
  180. border-bottom: 8rpx solid transparent;
  181. }
  182. .seacrh-record-index {
  183. position: relative;
  184. .seacrh-bg {
  185. position: absolute;
  186. top: 0;
  187. left: 0;
  188. width: 100%;
  189. height: 376rpx;
  190. filter: blur(80rpx);
  191. background-image: linear-gradient(to right, #C9F7FC, #F9F6E0, #F6F5F3);
  192. z-index: -1;
  193. }
  194. .s-input {
  195. margin-top: 24rpx;
  196. width: 100%;
  197. height: 72rpx;
  198. padding: 0 24rpx;
  199. box-sizing: border-box;
  200. position: relative;
  201. .input-icon {
  202. position: absolute;
  203. left: 48rpx;
  204. top: 20rpx;
  205. }
  206. input {
  207. font-size: 32rpx;
  208. width: 100%;
  209. height: 72rpx;
  210. background: #FFFFFF;
  211. border-radius: 200rpx;
  212. box-sizing: border-box;
  213. padding: 0 126rpx 0 78rpx;
  214. }
  215. .input-buttom {
  216. width: 120rpx;
  217. height: 60rpx;
  218. background: linear-gradient(90deg, #57CAFF 0%, #41ABF5 100%);
  219. border-radius: 200rpx;
  220. text-align: center;
  221. line-height: 60rpx;
  222. position: absolute;
  223. right: 30rpx;
  224. top: 6rpx;
  225. }
  226. }
  227. .seacrh-info {
  228. margin-top: 20rpx;
  229. // border-radius: 24rpx 24rpx 0rpx 0rpx;
  230. }
  231. .goos-list-box {
  232. width: 100%;
  233. min-height: 100rpx;
  234. padding: 28rpx 30rpx 35rpx;
  235. background: #FFFFFF;
  236. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51, 51, 51, 0.1);
  237. border-radius: 20rpx;
  238. margin-bottom: 20rpx;
  239. .goods-items-list {
  240. width: 100%;
  241. overflow-y: scroll;
  242. .goods-items-list-box {
  243. width: 33.3%;
  244. margin-right: 13rpx;
  245. position: relative;
  246. .label-box {
  247. position: absolute;
  248. left: 0;
  249. top: 0;
  250. width: 66rpx;
  251. height: 31rpx;
  252. line-height: 31rpx;
  253. border-radius: 10rpx 2rpx 10rpx 2rpx;
  254. }
  255. image {
  256. width: 201rpx;
  257. height: 200rpx;
  258. border-radius: 10rpx
  259. }
  260. }
  261. }
  262. .left-img-box {
  263. width: 120rpx;
  264. height: 120rpx;
  265. position: relative;
  266. .left-img {
  267. width: 120rpx;
  268. height: 120rpx;
  269. border-radius: 12rpx;
  270. }
  271. .status-box {
  272. position: absolute;
  273. bottom: 0;
  274. left: 0;
  275. width: 100%;
  276. padding: 4rpx 0;
  277. text-align: center;
  278. background: rgba(0, 0, 0, 0.5);
  279. font-size: 17rpx;
  280. border-radius: 0 0 12rpx 12rpx;
  281. }
  282. }
  283. .img-x {
  284. width: 16rpx;
  285. height: 16rpx;
  286. }
  287. .right-box-title {
  288. width: 438rpx;
  289. }
  290. .right-box-title-img {
  291. width: 32rpx;
  292. height: 32rpx;
  293. margin-left: auto;
  294. }
  295. .quan-list {
  296. min-width: 88rpx;
  297. height: 28rpx;
  298. line-height: 28rpx;
  299. .quan-list-1 {
  300. width: 38rpx;
  301. height: 28rpx;
  302. }
  303. }
  304. }
  305. }
  306. </style>