index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  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="scaleToFill"></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. import tools from "@/service/tools";
  117. export default {
  118. data() {
  119. return {
  120. BarH:0,
  121. bgckgroundBox:'transparent',
  122. bgckgroundSearch:'',
  123. bgckgroundType:'',
  124. navList:[
  125. {name:"外卖",img:require('@/static/img/index/index-wm.png'),type:2},
  126. {name:"代取",img:require('@/static/img/index/index-dq.png'),type:3},
  127. {name:"校友圈",img:require('@/static/img/index/index-xyq.png'),},
  128. {name:"团购",img:require('@/static/img/index/index-tg.png'),type:5},
  129. {name:"票务",img:require('@/static/img/index/index-pw.png'),type:4},
  130. {name:"干洗",img:require('@/static/img/index/index-gx.png'),},
  131. {name:"租凭",img:require('@/static/img/index/index-zp.png'),},
  132. {name:"二手市场",img:require('@/static/img/index/index-esss.png'),},
  133. {name:"回收",img:require('@/static/img/index/index-hs.png'),},
  134. {name:"实习岗位",img:require('@/static/img/index/index-sxgw.png'),},
  135. ],
  136. typeList:[
  137. {name:"全部",id:-1},
  138. {name:"奶茶甜点",id:0},
  139. {name:"快餐便当",id:1},
  140. {name:"火锅麻辣烫",id:2},
  141. {name:"龙虾汉堡",id:3},
  142. {name:"棋牌娱乐",id:4},
  143. ],
  144. type:-1,
  145. }
  146. },
  147. onPageScroll(e) {
  148. if(e.scrollTop>1){
  149. this.bgckgroundBox = '#fff';
  150. this.bgckgroundSearch = '#fff';
  151. if(e.scrollTop>500){
  152. this.bgckgroundType = '#fff';
  153. }else{
  154. this.bgckgroundType = '';
  155. }
  156. }else{
  157. this.bgckgroundBox = 'transparent';
  158. this.bgckgroundSearch = '';
  159. this.bgckgroundType = '';
  160. }
  161. },
  162. onReachBottom() {
  163. console.log('触底刷新');
  164. },
  165. created() {
  166. uni.getSystemInfo({
  167. success: (e) =>{
  168. let statusBarH = e.statusBarHeight + 10
  169. let custom = 0;
  170. custom = wx.getMenuButtonBoundingClientRect()
  171. let customBarH = custom.height;
  172. console.log(statusBarH);
  173. console.log(customBarH);
  174. this.BarH = statusBarH + customBarH;
  175. }
  176. })
  177. },
  178. mounted() {
  179. },
  180. methods: {
  181. toUrl(type){
  182. if(type === 1){
  183. // 去搜索
  184. uni.navigateTo({
  185. url:'/pages/index/search-record'
  186. })
  187. }else if(type === 2){
  188. // 去外卖
  189. uni.navigateTo({
  190. url:'/pages-takeout/takeout'
  191. })
  192. }else if(type === 3){
  193. // 去外卖
  194. uni.navigateTo({
  195. url:'/pages-takeout/replace-take'
  196. })
  197. }else if(type === 4){
  198. // 去票务
  199. uni.navigateTo({
  200. url:'/pages-buy/ticket'
  201. })
  202. }else if(type === 5){
  203. // 去团购
  204. uni.navigateTo({
  205. url:'/pages-buy/group'
  206. })
  207. }else{
  208. tools.error('暂未开放')
  209. }
  210. }
  211. },
  212. }
  213. </script>
  214. <style lang="scss" scoped>
  215. .index-box{
  216. position: relative;
  217. .bg-img{
  218. width: 100%;
  219. height: 1220rpx;
  220. position: absolute;
  221. top: 0;
  222. left: 0;
  223. z-index: -1;
  224. }
  225. .nav-icon{
  226. width: 32rpx;
  227. height: 32rpx;
  228. }
  229. .index-box-1{
  230. width: 100%;
  231. // height: 3000rpx;
  232. .swiper{
  233. width: 702rpx;
  234. height: 220rpx;
  235. border-radius: 20rpx;
  236. .swiper-item{
  237. width: 702rpx;
  238. height: 220rpx;
  239. border-radius: 20rpx;
  240. background-color: skyblue;
  241. }
  242. }
  243. .nav-list{
  244. padding: 0 22rpx;
  245. .nav-list-item{
  246. margin-right: 52rpx;
  247. margin-bottom: 16rpx;
  248. image{
  249. width: 88rpx;
  250. height: 88rpx;
  251. margin: 0 auto;
  252. }
  253. }
  254. .nav-list-item:nth-child(7){
  255. margin-right: 42rpx !important;
  256. }
  257. .nav-list-item:nth-child(8){
  258. margin-right: 46rpx !important;
  259. }
  260. .nav-list-item:nth-child(9){
  261. margin-right: 44rpx !important;
  262. }
  263. .nav-list-item:nth-child(5),.nav-list-item:nth-child(10){
  264. margin-right: 0;
  265. }
  266. }
  267. .msg-box{
  268. width: 100%;
  269. height: 66rpx;
  270. background: #F7F8FC;
  271. border-radius: 12rpx;
  272. padding: 0 14rpx ;
  273. .image-1{
  274. width: 72rpx;
  275. height: 32rpx;
  276. margin-right: 10rpx;
  277. }
  278. .image-2{
  279. width: 40rpx;
  280. height: 40rpx;
  281. margin-left: auto;
  282. }
  283. .box-1{
  284. width: 50rpx;
  285. height: 26rpx;
  286. border-radius: 2rpx;
  287. border: 2rpx solid #41ABF5;
  288. text-align: center;
  289. line-height: 26rpx;
  290. margin-right: 10rpx;
  291. }
  292. .tz-swiper{
  293. width: 444rpx;
  294. height: 66rpx;
  295. .tz-swiper-item{
  296. width: 444rpx;
  297. height: 66rpx;
  298. line-height: 66rpx;
  299. }
  300. }
  301. }
  302. .xsms-box{
  303. .image-title{
  304. width: 100%;
  305. height: 92rpx;
  306. }
  307. .xsms-box-list-f{
  308. width: 100%;
  309. height: 310rpx;
  310. background: linear-gradient( 180deg, #ABDEFE 4%, #C9EAFF 30%, #C9EAFF 100%);
  311. border-radius: 0rpx 0rpx 20rpx 20rpx;
  312. }
  313. .xsms-box-list{
  314. overflow-y: scroll;
  315. .xsms-box-list-item:last-child{
  316. margin-right: 0;
  317. }
  318. .xsms-box-list-item{
  319. width: 180rpx;
  320. height: 300rpx;
  321. background: #FFFFFF;
  322. border-radius: 8rpx;
  323. margin-right: 8rpx;
  324. position: relative;
  325. .xsms-box-list-item-img-1{
  326. width: 164rpx;
  327. height: 175rpx;
  328. border-radius: 9rpx;
  329. }
  330. .xsms-box-list-item-img-2{
  331. position: absolute;
  332. width: 62rpx;
  333. height: 36rpx;
  334. right: 0;
  335. bottom: 8rpx;
  336. }
  337. }
  338. }
  339. }
  340. .type-list-box{
  341. position: sticky;
  342. left: 0;
  343. // top: calc(var(BarH)px + 93rpx);
  344. top: calc(86px + 93rpx);
  345. padding: 0 24rpx 24rpx 24rpx;
  346. overflow-x: scroll;
  347. .type-item-box{
  348. margin-right: 16rpx;
  349. padding: 0 24rpx;
  350. // min-width: 300rpx;
  351. height: 56rpx;
  352. line-height: 56rpx;
  353. border-radius: 200rpx;
  354. text-align: center;
  355. font-size: 28rpx;
  356. }
  357. .type-item-box:last-child{
  358. margin-right: 0;
  359. }
  360. .s-type{
  361. color: #fff;
  362. font-weight: 600;
  363. background: linear-gradient( 280deg, #44B1F7 0%, #96D6F4 100%);
  364. }
  365. .n-type{
  366. color: #666;
  367. background-color: #fff;
  368. }
  369. }
  370. .goos-list-box{
  371. width: 100%;
  372. min-height: 428rpx;
  373. background: #FFFFFF;
  374. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51,51,51,0.1);
  375. border-radius: 20rpx;
  376. margin-bottom: 20rpx;
  377. .goods-items-list{
  378. width: 530rpx;
  379. overflow-y: scroll;
  380. .goods-items-list-box{
  381. width: 140rpx;
  382. margin-right: 16rpx;
  383. image{
  384. width: 140rpx;
  385. height: 140rpx;
  386. border-radius: 12rpx
  387. }
  388. }
  389. }
  390. .left-img{
  391. width: 100rpx;
  392. height: 100rpx;
  393. border-radius: 12rpx;
  394. margin-right: 16rpx;
  395. }
  396. .img-x{
  397. width: 24rpx;
  398. height: 24rpx;
  399. }
  400. .right-box-title{
  401. width: 438rpx;
  402. }
  403. .right-box-title-img{
  404. width: 32rpx;
  405. height: 32rpx;
  406. margin-left: auto;
  407. }
  408. .quan-list{
  409. .quan-list-1{
  410. width: 32rpx;
  411. height: 34rpx;
  412. background: #FB3D03;
  413. border-radius: 5rpx 0rpx 0rpx 5rpx;
  414. text-align: center;
  415. }
  416. .quan-list-2{
  417. box-sizing: border-box;
  418. padding: 0 2rpx;
  419. height: 34rpx;
  420. border-radius: 0 5rpx 5rpx 0;
  421. border: 1rpx solid #FB3D03;
  422. text-align: center;
  423. }
  424. }
  425. }
  426. }
  427. .index-search{
  428. position: sticky;
  429. left: 0;
  430. z-index: 100;
  431. padding: 0 24rpx 20rpx 24rpx;
  432. .index-search-box{
  433. width: 100%;
  434. height: 72rpx;
  435. padding: 0 6rpx 0 24rpx;
  436. border-radius: 200rpx;
  437. border: 2rpx solid #4FB3EF;
  438. .index-search-box-buttom{
  439. width: 120rpx;
  440. height: 60rpx;
  441. background: linear-gradient( 90deg, #57CAFF 0%, #41ABF5 100%);
  442. border-radius: 200rpx;
  443. margin-left: auto;
  444. line-height: 60rpx;
  445. text-align: center;
  446. }
  447. }
  448. }
  449. }
  450. </style>