index.vue 12 KB

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