index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <template>
  2. <view class="index-box">
  3. <image class="bg-img" src="@/static/img/index/index-bg.png" mode="aspectFit"></image>
  4. <view class="">
  5. <Nav :leftShow='false' :customNav='true' :bgckgroundBox='bgckgroundBox'>
  6. <template>
  7. <view slot="custom" class="align-items-center">
  8. <uni-icons type="location-filled" size="20"></uni-icons>
  9. <view class="fs-32 fw-600 ml-10">重庆邮电大学...</view>
  10. <image class="nav-icon ml-10" src="@/static/img/index/index-right.png" mode="aspectFit"></image>
  11. </view>
  12. </template>
  13. </Nav>
  14. </view>
  15. <!-- 搜索 -->
  16. <view class="index-search box-border-box" @click="toUrl(1)"
  17. :style="[{'top': BarH + 'px','background':bgckgroundSearch}]">
  18. <view class="index-search-box box-border-box align-items-center">
  19. <uni-icons type="search" size="20" color="#000"></uni-icons>
  20. <view class="fs-28 fc-9 ml-10">搜索店铺名称或者商品名称</view>
  21. <view class="fs-28 fc-f index-search-box-buttom">搜索</view>
  22. </view>
  23. </view>
  24. <view class="index-box-1 ">
  25. <!-- 轮播 -->
  26. <view class="box-border-box plr-24">
  27. <swiper class="swiper mb-32 " circular indicator-dots indicator-active-color="#4FB3EF" :autoplay="true" :interval="3000" :duration="500">
  28. <swiper-item v-for="(item,i) in 3" :key="i">
  29. <view class="swiper-item">A</view>
  30. </swiper-item>
  31. </swiper>
  32. </view>
  33. <!-- 导航 -->
  34. <view class="box-border-box plr-24">
  35. <view class="nav-list flex-wrap-wrap box-border-box mb-22">
  36. <view class="nav-list-item" v-for="(item,i) in navList" :key="i" @click="toUrl(item.type)">
  37. <image :src="item.img" mode="aspectFit"></image>
  38. <view class="fs-26 fc-3 text-align-center">{{item.name}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 通知 -->
  43. <view class="box-border-box plr-24">
  44. <view class="msg-box align-items-center box-border-box mb-32">
  45. <image class="image-1" src="@/static/img/index/index-tz.png" mode="scaleToFill"></image>
  46. <view class="box-1 fs-20 fc-41ABF5">公告</view>
  47. <swiper class="tz-swiper" :vertical="true" circular :autoplay="true" :interval="3000" :duration="500">
  48. <swiper-item v-for="(item,i) in 3" :key="i">
  49. <view class="tz-swiper-item">AAAAAAAAAAAAAAAAAAAAA</view>
  50. </swiper-item>
  51. </swiper>
  52. <image class="image-2" src="@/static/img/toRight.png" mode="scaleToFill"></image>
  53. </view>
  54. </view>
  55. <!-- 限时秒杀 -->
  56. <view class="box-border-box plr-24">
  57. <view class="xsms-box mb-32">
  58. <image class="image-title" src="@/static/img/index/index-xsms.png" mode="scaleToFill"></image>
  59. <view class="xsms-box-list-f box-border-box plr-12">
  60. <view class="xsms-box-list display-flex ">
  61. <view class="xsms-box-list-item box-border-box p-8" v-for="(item,i) in 10" :key="i">
  62. <image class="xsms-box-list-item-img-1 mb-4" src="../../static/img/my/bg.png" mode="scaleToFill"></image>
  63. <view class="text-overflow-ellipsis-one fs-26 mb-4">AAAAAAAAAAAAAAAAAAAAAA</view>
  64. <view class="mb-4">
  65. <span class="fs-20 fw-b fc-FB3D03">¥</span><span class="fs-32 fw-b fc-FB3D03">29.99</span>
  66. </view>
  67. <view class="fs-20 fc-9 text-line-through">¥3300</view>
  68. <image class="xsms-box-list-item-img-2" src="@/static/img/index/index-q.png" mode="scaleToFill"></image>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 类型选择 -->
  75. <view class="type-list-box display-flex" :style="[{'background':bgckgroundType}]">
  76. <view class="type-item-box view-nowrap" :class="type==item.id?'s-type':'n-type'" v-for="(item,i) in typeList" :key="i">{{item.name}}</view>
  77. </view>
  78. <!-- 商品列表 -->
  79. <view class="box-border-box plr-24">
  80. <view class="goos-list-box box-border-box p-24 display-flex" v-for="(item,i) in 10">
  81. <image class="left-img" src="../../static/img/my/bg.png" mode="scaleToFill"></image>
  82. <view class="flex-1">
  83. <view class="align-items-center mb-8">
  84. <view class="right-box-title fs-32 fw-600 text-overflow-ellipsis-one">蜜雪冰城(重工页店)122332323232323232323232</view>
  85. <image class="right-box-title-img" src="@/static/img/toRight.png" mode=""></image>
  86. </view>
  87. <view class="align-items-center mb-8">
  88. <image class="img-x mr-12" src="@/static/img/my/wdpj.png" mode=""></image>
  89. <view class="fs-26 fw-600 fc-FF7F00 mr-12">4.5分</view>
  90. <view class="fc-6 fs-24 mr-12">| 预计38分钟 |</view>
  91. <view class="fc-6 fs-24 mr-12">855人购买</view>
  92. </view>
  93. <view class="align-items-center flex-wrap-wrap">
  94. <view class="quan-list display-flex mr-12 mb-12" v-for="(item,i) in 3" :key="i">
  95. <view class="quan-list-1 fs-24 fc-f">券</view>
  96. <view class="quan-list-2 fs-24 fc-FB3D03">10元</view>
  97. </view>
  98. </view>
  99. <view class="goods-items-list display-flex">
  100. <view class="goods-items-list-box" v-for="(info,i) in 10">
  101. <image class="mb-12" src="@/static/img/my/bg.png" mode=""></image>
  102. <view class="mb-8 fw-600 text-overflow-ellipsis-one fs-26">AAAAAAAAAAAAAA</view>
  103. <view class="">
  104. <span class="fs-24 fc-FB3D03">¥</span>
  105. <span class="fs-32 fc-FB3D03 fw-b">3.99</span>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </template>
  115. <script>
  116. export default {
  117. data() {
  118. return {
  119. BarH:0,
  120. bgckgroundBox:'transparent',
  121. bgckgroundSearch:'',
  122. bgckgroundType:'',
  123. navList:[
  124. {name:"外卖",img:require('@/static/img/index/index-wm.png'),type:2},
  125. {name:"代取",img:require('@/static/img/index/index-dq.png'),type:3},
  126. {name:"校友圈",img:require('@/static/img/index/index-xyq.png'),},
  127. {name:"团购",img:require('@/static/img/index/index-tg.png'),},
  128. {name:"票务",img:require('@/static/img/index/index-pw.png'),},
  129. {name:"干洗",img:require('@/static/img/index/index-gx.png'),},
  130. {name:"租凭",img:require('@/static/img/index/index-zp.png'),},
  131. {name:"二手市场",img:require('@/static/img/index/index-esss.png'),},
  132. {name:"回收",img:require('@/static/img/index/index-hs.png'),},
  133. {name:"实习岗位",img:require('@/static/img/index/index-sxgw.png'),},
  134. ],
  135. typeList:[
  136. {name:"全部",id:-1},
  137. {name:"奶茶甜点",id:0},
  138. {name:"快餐便当",id:1},
  139. {name:"火锅麻辣烫",id:2},
  140. {name:"龙虾汉堡",id:3},
  141. {name:"棋牌娱乐",id:4},
  142. ],
  143. type:-1,
  144. }
  145. },
  146. onPageScroll(e) {
  147. if(e.scrollTop>1){
  148. this.bgckgroundBox = '#fff';
  149. this.bgckgroundSearch = '#fff';
  150. if(e.scrollTop>500){
  151. this.bgckgroundType = '#fff';
  152. }else{
  153. this.bgckgroundType = '';
  154. }
  155. }else{
  156. this.bgckgroundBox = 'transparent';
  157. this.bgckgroundSearch = '';
  158. this.bgckgroundType = '';
  159. }
  160. },
  161. onReachBottom() {
  162. console.log('触底刷新');
  163. },
  164. created() {
  165. uni.getSystemInfo({
  166. success: (e) =>{
  167. let statusBarH = e.statusBarHeight + 10
  168. let custom = 0;
  169. custom = wx.getMenuButtonBoundingClientRect()
  170. let customBarH = custom.height;
  171. console.log(statusBarH);
  172. console.log(customBarH);
  173. this.BarH = statusBarH + customBarH;
  174. }
  175. })
  176. },
  177. mounted() {
  178. },
  179. methods: {
  180. toUrl(type){
  181. if(type === 1){
  182. // 去搜索
  183. uni.navigateTo({
  184. url:'/pages/index/search-record'
  185. })
  186. }else if(type === 2){
  187. // 去外卖
  188. uni.navigateTo({
  189. url:'/pages-takeout/takeout'
  190. })
  191. }else if(type === 3){
  192. // 去外卖
  193. uni.navigateTo({
  194. url:'/pages-takeout/replace-take'
  195. })
  196. }
  197. }
  198. },
  199. }
  200. </script>
  201. <style lang="scss" scoped>
  202. .index-box{
  203. position: relative;
  204. .bg-img{
  205. width: 100%;
  206. height: 1220rpx;
  207. position: absolute;
  208. top: 0;
  209. left: 0;
  210. z-index: -1;
  211. }
  212. .nav-icon{
  213. width: 32rpx;
  214. height: 32rpx;
  215. }
  216. .index-box-1{
  217. width: 100%;
  218. // height: 3000rpx;
  219. .swiper{
  220. width: 702rpx;
  221. height: 220rpx;
  222. border-radius: 20rpx;
  223. .swiper-item{
  224. width: 702rpx;
  225. height: 220rpx;
  226. border-radius: 20rpx;
  227. background-color: skyblue;
  228. }
  229. }
  230. .nav-list{
  231. padding: 0 22rpx;
  232. .nav-list-item{
  233. margin-right: 52rpx;
  234. margin-bottom: 16rpx;
  235. image{
  236. width: 88rpx;
  237. height: 88rpx;
  238. margin: 0 auto;
  239. }
  240. }
  241. .nav-list-item:nth-child(7){
  242. margin-right: 42rpx !important;
  243. }
  244. .nav-list-item:nth-child(8){
  245. margin-right: 46rpx !important;
  246. }
  247. .nav-list-item:nth-child(9){
  248. margin-right: 44rpx !important;
  249. }
  250. .nav-list-item:nth-child(5),.nav-list-item:nth-child(10){
  251. margin-right: 0;
  252. }
  253. }
  254. .msg-box{
  255. width: 100%;
  256. height: 66rpx;
  257. background: #F7F8FC;
  258. border-radius: 12rpx;
  259. padding: 0 14rpx ;
  260. .image-1{
  261. width: 72rpx;
  262. height: 32rpx;
  263. margin-right: 10rpx;
  264. }
  265. .image-2{
  266. width: 40rpx;
  267. height: 40rpx;
  268. margin-left: auto;
  269. }
  270. .box-1{
  271. width: 50rpx;
  272. height: 26rpx;
  273. border-radius: 2rpx;
  274. border: 2rpx solid #41ABF5;
  275. text-align: center;
  276. line-height: 26rpx;
  277. margin-right: 10rpx;
  278. }
  279. .tz-swiper{
  280. width: 444rpx;
  281. height: 66rpx;
  282. .tz-swiper-item{
  283. width: 444rpx;
  284. height: 66rpx;
  285. line-height: 66rpx;
  286. }
  287. }
  288. }
  289. .xsms-box{
  290. .image-title{
  291. width: 100%;
  292. height: 92rpx;
  293. }
  294. .xsms-box-list-f{
  295. width: 100%;
  296. height: 310rpx;
  297. background: linear-gradient( 180deg, #ABDEFE 4%, #C9EAFF 30%, #C9EAFF 100%);
  298. border-radius: 0rpx 0rpx 20rpx 20rpx;
  299. }
  300. .xsms-box-list{
  301. overflow-y: scroll;
  302. .xsms-box-list-item:last-child{
  303. margin-right: 0;
  304. }
  305. .xsms-box-list-item{
  306. width: 180rpx;
  307. height: 300rpx;
  308. background: #FFFFFF;
  309. border-radius: 8rpx;
  310. margin-right: 8rpx;
  311. position: relative;
  312. .xsms-box-list-item-img-1{
  313. width: 164rpx;
  314. height: 175rpx;
  315. border-radius: 9rpx;
  316. }
  317. .xsms-box-list-item-img-2{
  318. position: absolute;
  319. width: 62rpx;
  320. height: 36rpx;
  321. right: 0;
  322. bottom: 8rpx;
  323. }
  324. }
  325. }
  326. }
  327. .type-list-box{
  328. position: sticky;
  329. left: 0;
  330. // top: calc(var(BarH)px + 93rpx);
  331. top: calc(86px + 93rpx);
  332. padding: 0 24rpx 24rpx 24rpx;
  333. overflow-x: scroll;
  334. .type-item-box{
  335. margin-right: 16rpx;
  336. padding: 0 24rpx;
  337. // min-width: 300rpx;
  338. height: 56rpx;
  339. line-height: 56rpx;
  340. border-radius: 200rpx;
  341. text-align: center;
  342. font-size: 28rpx;
  343. }
  344. .type-item-box:last-child{
  345. margin-right: 0;
  346. }
  347. .s-type{
  348. color: #fff;
  349. font-weight: 600;
  350. background: linear-gradient( 280deg, #44B1F7 0%, #96D6F4 100%);
  351. }
  352. .n-type{
  353. color: #666;
  354. background-color: #fff;
  355. }
  356. }
  357. .goos-list-box{
  358. width: 100%;
  359. min-height: 428rpx;
  360. background: #FFFFFF;
  361. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51,51,51,0.1);
  362. border-radius: 20rpx;
  363. margin-bottom: 20rpx;
  364. .goods-items-list{
  365. width: 530rpx;
  366. overflow-y: scroll;
  367. .goods-items-list-box{
  368. width: 140rpx;
  369. margin-right: 16rpx;
  370. image{
  371. width: 140rpx;
  372. height: 140rpx;
  373. border-radius: 12rpx
  374. }
  375. }
  376. }
  377. .left-img{
  378. width: 100rpx;
  379. height: 100rpx;
  380. border-radius: 12rpx;
  381. margin-right: 16rpx;
  382. }
  383. .img-x{
  384. width: 24rpx;
  385. height: 24rpx;
  386. }
  387. .right-box-title{
  388. width: 438rpx;
  389. }
  390. .right-box-title-img{
  391. width: 32rpx;
  392. height: 32rpx;
  393. margin-left: auto;
  394. }
  395. .quan-list{
  396. .quan-list-1{
  397. width: 32rpx;
  398. height: 34rpx;
  399. background: #FB3D03;
  400. border-radius: 5rpx 0rpx 0rpx 5rpx;
  401. text-align: center;
  402. }
  403. .quan-list-2{
  404. box-sizing: border-box;
  405. padding: 0 2rpx;
  406. height: 34rpx;
  407. border-radius: 0 5rpx 5rpx 0;
  408. border: 1rpx solid #FB3D03;
  409. text-align: center;
  410. }
  411. }
  412. }
  413. }
  414. .index-search{
  415. position: sticky;
  416. left: 0;
  417. z-index: 100;
  418. padding: 0 24rpx 20rpx 24rpx;
  419. .index-search-box{
  420. width: 100%;
  421. height: 72rpx;
  422. padding: 0 6rpx 0 24rpx;
  423. border-radius: 200rpx;
  424. border: 2rpx solid #4FB3EF;
  425. .index-search-box-buttom{
  426. width: 120rpx;
  427. height: 60rpx;
  428. background: linear-gradient( 90deg, #57CAFF 0%, #41ABF5 100%);
  429. border-radius: 200rpx;
  430. margin-left: auto;
  431. line-height: 60rpx;
  432. text-align: center;
  433. }
  434. }
  435. }
  436. }
  437. </style>