index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  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="[{'top': (BarH + 38) + 'px','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. this.BarH = statusBarH + customBarH;
  171. }
  172. })
  173. },
  174. mounted() {
  175. },
  176. methods: {
  177. },
  178. }
  179. </script>
  180. <style lang="scss" scoped>
  181. .index-box{
  182. position: relative;
  183. .bg-img{
  184. width: 100%;
  185. height: 1220rpx;
  186. position: absolute;
  187. top: 0;
  188. left: 0;
  189. z-index: -1;
  190. }
  191. .nav-icon{
  192. width: 32rpx;
  193. height: 32rpx;
  194. }
  195. .index-box-1{
  196. width: 100%;
  197. // height: 3000rpx;
  198. .swiper{
  199. width: 702rpx;
  200. height: 220rpx;
  201. border-radius: 20rpx;
  202. .swiper-item{
  203. width: 702rpx;
  204. height: 220rpx;
  205. border-radius: 20rpx;
  206. background-color: skyblue;
  207. }
  208. }
  209. .nav-list{
  210. padding: 0 22rpx;
  211. .nav-list-item{
  212. margin-right: 52rpx;
  213. margin-bottom: 16rpx;
  214. image{
  215. width: 88rpx;
  216. height: 88rpx;
  217. margin: 0 auto;
  218. }
  219. }
  220. .nav-list-item:nth-child(7){
  221. margin-right: 42rpx !important;
  222. }
  223. .nav-list-item:nth-child(8){
  224. margin-right: 46rpx !important;
  225. }
  226. .nav-list-item:nth-child(9){
  227. margin-right: 44rpx !important;
  228. }
  229. .nav-list-item:nth-child(5),.nav-list-item:nth-child(10){
  230. margin-right: 0;
  231. }
  232. }
  233. .msg-box{
  234. width: 100%;
  235. height: 66rpx;
  236. background: #F7F8FC;
  237. border-radius: 12rpx;
  238. padding: 0 14rpx ;
  239. .image-1{
  240. width: 72rpx;
  241. height: 32rpx;
  242. margin-right: 10rpx;
  243. }
  244. .image-2{
  245. width: 40rpx;
  246. height: 40rpx;
  247. margin-left: auto;
  248. }
  249. .box-1{
  250. width: 50rpx;
  251. height: 26rpx;
  252. border-radius: 2rpx;
  253. border: 2rpx solid #41ABF5;
  254. text-align: center;
  255. line-height: 26rpx;
  256. margin-right: 10rpx;
  257. }
  258. .tz-swiper{
  259. width: 444rpx;
  260. height: 66rpx;
  261. .tz-swiper-item{
  262. width: 444rpx;
  263. height: 66rpx;
  264. line-height: 66rpx;
  265. }
  266. }
  267. }
  268. .xsms-box{
  269. .image-title{
  270. width: 100%;
  271. height: 92rpx;
  272. }
  273. .xsms-box-list-f{
  274. width: 100%;
  275. height: 310rpx;
  276. background: linear-gradient( 180deg, #ABDEFE 4%, #C9EAFF 30%, #C9EAFF 100%);
  277. border-radius: 0rpx 0rpx 20rpx 20rpx;
  278. }
  279. .xsms-box-list{
  280. overflow-y: scroll;
  281. .xsms-box-list-item:last-child{
  282. margin-right: 0;
  283. }
  284. .xsms-box-list-item{
  285. width: 180rpx;
  286. height: 300rpx;
  287. background: #FFFFFF;
  288. border-radius: 8rpx;
  289. margin-right: 8rpx;
  290. position: relative;
  291. .xsms-box-list-item-img-1{
  292. width: 164rpx;
  293. height: 175rpx;
  294. border-radius: 9rpx;
  295. }
  296. .xsms-box-list-item-img-2{
  297. position: absolute;
  298. width: 62rpx;
  299. height: 36rpx;
  300. right: 0;
  301. bottom: 8rpx;
  302. }
  303. }
  304. }
  305. }
  306. .type-list-box{
  307. position: sticky;
  308. left: 0;
  309. padding: 0 24rpx 24rpx 24rpx;
  310. overflow-x: scroll;
  311. .type-item-box{
  312. margin-right: 16rpx;
  313. padding: 0 24rpx;
  314. // min-width: 300rpx;
  315. height: 56rpx;
  316. line-height: 56rpx;
  317. border-radius: 200rpx;
  318. text-align: center;
  319. font-size: 28rpx;
  320. }
  321. .type-item-box:last-child{
  322. margin-right: 0;
  323. }
  324. .s-type{
  325. color: #fff;
  326. font-weight: 600;
  327. background: linear-gradient( 280deg, #44B1F7 0%, #96D6F4 100%);
  328. }
  329. .n-type{
  330. color: #666;
  331. background-color: #fff;
  332. }
  333. }
  334. .goos-list-box{
  335. width: 100%;
  336. min-height: 428rpx;
  337. background: #FFFFFF;
  338. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51,51,51,0.1);
  339. border-radius: 20rpx;
  340. margin-bottom: 20rpx;
  341. .goods-items-list{
  342. width: 530rpx;
  343. overflow-y: scroll;
  344. .goods-items-list-box{
  345. width: 140rpx;
  346. margin-right: 16rpx;
  347. image{
  348. width: 140rpx;
  349. height: 140rpx;
  350. border-radius: 12rpx
  351. }
  352. }
  353. }
  354. .left-img{
  355. width: 100rpx;
  356. height: 100rpx;
  357. border-radius: 12rpx;
  358. margin-right: 16rpx;
  359. }
  360. .img-x{
  361. width: 24rpx;
  362. height: 24rpx;
  363. }
  364. .right-box-title{
  365. width: 438rpx;
  366. }
  367. .right-box-title-img{
  368. width: 32rpx;
  369. height: 32rpx;
  370. margin-left: auto;
  371. }
  372. .quan-list{
  373. .quan-list-1{
  374. width: 32rpx;
  375. height: 34rpx;
  376. background: #FB3D03;
  377. border-radius: 5rpx 0rpx 0rpx 5rpx;
  378. text-align: center;
  379. }
  380. .quan-list-2{
  381. box-sizing: border-box;
  382. padding: 0 2rpx;
  383. height: 34rpx;
  384. border-radius: 0 5rpx 5rpx 0;
  385. border: 1rpx solid #FB3D03;
  386. text-align: center;
  387. }
  388. }
  389. }
  390. }
  391. .index-search{
  392. position: sticky;
  393. left: 0;
  394. z-index: 100;
  395. padding: 0 24rpx 20rpx 24rpx;
  396. .index-search-box{
  397. width: 100%;
  398. height: 72rpx;
  399. padding: 0 6rpx 0 24rpx;
  400. border-radius: 200rpx;
  401. border: 2rpx solid #4FB3EF;
  402. .index-search-box-buttom{
  403. width: 120rpx;
  404. height: 60rpx;
  405. background: linear-gradient( 90deg, #57CAFF 0%, #41ABF5 100%);
  406. border-radius: 200rpx;
  407. margin-left: auto;
  408. line-height: 60rpx;
  409. text-align: center;
  410. }
  411. }
  412. }
  413. }
  414. </style>