index.vue 12 KB

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