takeout.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <view class="takeout-index iPhone-bottom flex-common-css box-border-box">
  3. <view class="bg-index"></view>
  4. <view class="">
  5. <Nav :leftShow='false' :customNav='true' :bgckgroundBox='bgckgroundBox'>
  6. <template>
  7. <view slot="custom" class="">
  8. <view class="align-items-center mb-28 s-input-f">
  9. <uni-icons type="left" size="20"></uni-icons>
  10. <view v-if="!isScroll" class="fs-40 ml-10 fw-600">外卖</view>
  11. <view v-else class="s-input s-input-c" :class="isScroll?'w-454':'w-100100'">
  12. <view class="input-icon s-left">
  13. <uni-icons type="search" size="22" color="#999"></uni-icons>
  14. </view>
  15. <input v-model="search" type="text" placeholder="请输入商家或者商品名称">
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. </Nav>
  21. </view>
  22. <scroll-view scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower" @scroll="scrollFun">
  23. <view class="">
  24. <view class="s-input box-border-box plr-24">
  25. <view class="input-icon">
  26. <uni-icons type="search" size="22" color="#999"></uni-icons>
  27. </view>
  28. <input v-model="search" type="text" placeholder="请输入商家或者商品名称">
  29. </view>
  30. <view class="box-border-box plr-24">
  31. <view class="shop-box mb-32 box-border-box p-16">
  32. <image class="shop-box-bg" src="@/static/img/takeout/bg.png" mode="scaleToFill"></image>
  33. <swiper class="swiper-tj" :circular='false'
  34. indicator-active-color='#FF7F00' indicator-color='#FDC583'
  35. :indicator-dots="false"
  36. :autoplay="true" :interval="3000" :duration="300">
  37. <swiper-item v-for="(item,i) in 4" :key="i">
  38. <view class="swiper-item display-flex">
  39. <image class="left-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
  40. <view class="right-box flex-1">
  41. <view class="align-items-center mb-8">
  42. <view class="right-box-title fs-32 fw-600 text-overflow-ellipsis-one">蜜雪冰城(重工页店)122332323232323232323232</view>
  43. <image class="right-box-title-img" src="@/static/img/toRight.png" mode=""></image>
  44. </view>
  45. <view class="align-items-center mb-12">
  46. <image class="img-x mr-12" src="@/static/img/my/wdpj.png" mode=""></image>
  47. <view class="fs-26 fw-600 fc-FF7F00 mr-12">4.5分</view>
  48. <view class="fc-6 fs-24 mr-12">| 预计38分钟 |</view>
  49. <view class="fc-6 fs-24 mr-12">855人购买</view>
  50. </view>
  51. <view class="align-items-center flex-wrap-wrap">
  52. <view class="quan-list display-flex mr-12 mb-12" v-for="(item,i) in 3" :key="i">
  53. <view class="quan-list-1 fs-24 fc-f">券</view>
  54. <view class="quan-list-2 fs-24 fc-FB3D03">10元</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </swiper-item>
  60. </swiper>
  61. </view>
  62. </view>
  63. <view class="box-border-box plr-24 nav-type-box-f" :class="isScroll?'nav-bg':''">
  64. <view class="nav-type-box" >
  65. <view class="nav-type-list">
  66. <image src="@/static/img/takeout/all.png" mode=""></image>
  67. <view class="fs-24 fw-400 text-align-center">全部</view>
  68. </view>
  69. <view class="nav-type-list" v-for="(item,i) in navList" :key="i">
  70. <image :src="item.img" mode=""></image>
  71. <view class="fs-24 fw-400">{{item.name}}</view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="box-border-box plr-24 mt-24">
  76. <view class="goos-list-box box-border-box p-24 display-flex" v-for="(item,i) in 10">
  77. <image class="left-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
  78. <view class="flex-1">
  79. <view class="align-items-center mb-8">
  80. <view class="right-box-title fs-32 fw-600 text-overflow-ellipsis-one">蜜雪冰城(重工页店)122332323232323232323232</view>
  81. <image class="right-box-title-img" src="@/static/img/toRight.png" mode=""></image>
  82. </view>
  83. <view class="align-items-center mb-8">
  84. <image class="img-x mr-12" src="@/static/img/my/wdpj.png" mode=""></image>
  85. <view class="fs-26 fw-600 fc-FF7F00 mr-12">4.5分</view>
  86. <view class="fc-6 fs-24 mr-12">| 预计38分钟 |</view>
  87. <view class="fc-6 fs-24 mr-12">855人购买</view>
  88. </view>
  89. <view class="align-items-center flex-wrap-wrap">
  90. <view class="quan-list display-flex mr-12 mb-12" v-for="(item,i) in 3" :key="i">
  91. <view class="quan-list-1 fs-24 fc-f">券</view>
  92. <view class="quan-list-2 fs-24 fc-FB3D03">10元</view>
  93. </view>
  94. </view>
  95. <view class="goods-items-list display-flex">
  96. <view class="goods-items-list-box" v-for="(info,i) in 10">
  97. <image class="mb-12" src="@/static/img/my/bg.png" mode=""></image>
  98. <view class="mb-8 fw-600 text-overflow-ellipsis-one fs-26">AAAAAAAAAAAAAA</view>
  99. <view class="">
  100. <span class="fs-24 fc-FB3D03">¥</span>
  101. <span class="fs-32 fc-FB3D03 fw-b">3.99</span>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </scroll-view>
  110. </view>
  111. </template>
  112. <script>
  113. export default {
  114. data(){
  115. return{
  116. search:'',
  117. isScroll:false,
  118. navList:[{name:"汉堡薯条",img:require('@/static/img/index/index-wm.png')},
  119. {name:"汉堡薯条",img:require('@/static/img/index/index-wm.png')},
  120. {name:"汉堡薯条",img:require('@/static/img/index/index-wm.png')},
  121. {name:"汉堡薯条",img:require('@/static/img/index/index-wm.png')},
  122. {name:"汉堡薯条",img:require('@/static/img/index/index-wm.png')},
  123. {name:"汉堡薯条",img:require('@/static/img/index/index-wm.png')},
  124. {name:"汉堡薯条",img:require('@/static/img/index/index-wm.png')},
  125. {name:"汉堡薯条",img:require('@/static/img/index/index-wm.png')},
  126. {name:"汉堡薯条",img:require('@/static/img/index/index-wm.png')},],
  127. }
  128. },
  129. onShow() {
  130. },
  131. methods:{
  132. scrollFun(e){
  133. if(e.target.scrollTop>50){
  134. this.isScroll = true;
  135. }else{
  136. this.isScroll = false;
  137. }
  138. },
  139. scrolltolower(){
  140. console.log('触底');
  141. },
  142. },
  143. }
  144. </script>
  145. <style scoped lang="scss">
  146. .takeout-index{
  147. position: relative;
  148. .s-input-f{
  149. position: relative;
  150. .s-input-c{
  151. position: absolute;
  152. top: -16rpx;
  153. left: 50rpx;
  154. }
  155. }
  156. .bg-index{
  157. width: 100%;
  158. height: 272rpx;
  159. position: absolute;
  160. top: 0;
  161. left: 0;
  162. background-image: linear-gradient(#E0F6FB,#F5F4F9);
  163. z-index: -1;
  164. }
  165. .w-100100{
  166. width: 100%;
  167. }
  168. .w-454{
  169. width: 454rpx;
  170. }
  171. .s-input{
  172. margin-bottom: 24rpx;
  173. height: 72rpx;
  174. box-sizing: border-box;
  175. position: relative;
  176. .s-left{
  177. left: 24rpx !important;
  178. }
  179. .input-icon{
  180. position: absolute;
  181. left: 44rpx;
  182. top: 16rpx;
  183. }
  184. input{
  185. font-size: 32rpx;
  186. width: 100%;
  187. height: 72rpx;
  188. background: #FFFFFF;
  189. border-radius: 200rpx;
  190. box-sizing: border-box;
  191. padding: 0 20rpx 0 78rpx;
  192. border: 1rpx solid #41ABF5;
  193. }
  194. }
  195. .shop-box{
  196. width: 100%;
  197. height: 242rpx;
  198. position: relative;
  199. .shop-box-bg{
  200. width: 100%;
  201. height: 242rpx;
  202. position: absolute;
  203. top: 0;
  204. left: 0;
  205. z-index: -1;
  206. }
  207. .swiper-tj{
  208. width: 100%;
  209. height: 172rpx;
  210. border-radius: 20rpx;
  211. .swiper-item{
  212. width: 100%;
  213. height: 100%;
  214. border-radius: 20rpx;
  215. background-color: #fff;
  216. box-sizing: border-box;
  217. padding: 16rpx;
  218. .left-img{
  219. width: 140rpx;
  220. height: 140rpx;
  221. border-radius: 14rpx
  222. }
  223. .right-box{
  224. }
  225. }
  226. }
  227. }
  228. .nav-bg{
  229. background-image: linear-gradient(#F0F4FA,#FFFFFF);
  230. padding: 24rpx !important;
  231. }
  232. .nav-type-box-f{
  233. position: sticky;
  234. top: 0;
  235. left: 0;
  236. .nav-type-box{
  237. width: 100%;
  238. height: 120rpx;
  239. display: flex;
  240. overflow: scroll;
  241. .nav-type-list{
  242. height: 120rpx;
  243. width: 96rpx !important;
  244. text-align: center;
  245. margin-right: 44rpx;
  246. image{
  247. display: block;
  248. width: 80rpx;
  249. height: 80rpx;
  250. margin: 0 8rpx 12rpx 8rpx;
  251. }
  252. }
  253. }
  254. }
  255. .goos-list-box{
  256. width: 100%;
  257. min-height: 428rpx;
  258. background: #FFFFFF;
  259. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51,51,51,0.1);
  260. border-radius: 20rpx;
  261. margin-bottom: 20rpx;
  262. .goods-items-list{
  263. width: 530rpx;
  264. overflow-y: scroll;
  265. .goods-items-list-box{
  266. width: 140rpx;
  267. margin-right: 16rpx;
  268. image{
  269. width: 140rpx;
  270. height: 140rpx;
  271. border-radius: 12rpx
  272. }
  273. }
  274. }
  275. }
  276. .left-img{
  277. width: 100rpx;
  278. height: 100rpx;
  279. border-radius: 12rpx;
  280. margin-right: 16rpx;
  281. }
  282. .img-x{
  283. width: 24rpx;
  284. height: 24rpx;
  285. }
  286. .right-box-title{
  287. width: 438rpx;
  288. }
  289. .right-box-title-img{
  290. width: 32rpx;
  291. height: 32rpx;
  292. margin-left: auto;
  293. }
  294. .quan-list{
  295. .quan-list-1{
  296. width: 32rpx;
  297. height: 34rpx;
  298. background: #FB3D03;
  299. border-radius: 5rpx 0rpx 0rpx 5rpx;
  300. text-align: center;
  301. }
  302. .quan-list-2{
  303. box-sizing: border-box;
  304. padding: 0 2rpx;
  305. height: 34rpx;
  306. border-radius: 0 5rpx 5rpx 0;
  307. border: 1rpx solid #FB3D03;
  308. text-align: center;
  309. }
  310. }
  311. }
  312. </style>