作者 吴孟雨

首页导航

@@ -5,6 +5,17 @@ const app = getApp() @@ -5,6 +5,17 @@ const app = getApp()
5 Page({ 5 Page({
6 data: { 6 data: {
7 slide: [{image: '../../images/banner.png'}, {image: '../../images/banner.png'}], 7 slide: [{image: '../../images/banner.png'}, {image: '../../images/banner.png'}],
  8 + images: [{src:'../../images/duantu@2x.png',text:'短途郊游'},
  9 + {src:'../../images/changtu@2x.png',text:'长途旅游'},
  10 + {src:'../../images/finecanting@2x.png',text:'Fine Dining 餐厅'},
  11 + {src:'../../images/huwai@2x.png',text:'户外运动'},
  12 + {src:'../../images/juhui@2x.png',text:'聚会'},
  13 + {src:'../../images/yinyuejie@2x.png',text:'音乐节'},
  14 + {src:'../../images/dianying@2x.png',text:'电影'},
  15 + {src:'../../images/qingshe@2x.png',text:'轻奢餐厅'},
  16 + {src:'../../images/zhanlan@2x.png',text:'展览'},
  17 + {src:'../../images/wutaiju@2x.png',text:'舞台剧'},
  18 + ],
8 motto: 'Hello World', 19 motto: 'Hello World',
9 userInfo: {}, 20 userInfo: {},
10 hasUserInfo: false, 21 hasUserInfo: false,
1 <!--index.wxml--> 1 <!--index.wxml-->
2 <view class="container"> 2 <view class="container">
3 - <view class="head">  
4 - <view class="position">  
5 - <view class="left">  
6 - <view class="iconfont icon-location"></view>  
7 - <text>北京</text>  
8 - <view class="iconfont icon-arrow-down"></view>  
9 - </view>  
10 - <input type="text"/> 3 + <view class="head">
  4 + <view class="position">
  5 + <view class="left">
  6 + <view class="iconfont icon-location"></view>
  7 + <text>北京</text>
  8 + <view class="iconfont icon-arrow-down"></view>
  9 + </view>
  10 + <view class="right">
  11 + <input type="text"/>
  12 + <view class="iconfont icon-arrow-down"></view>
  13 + </view>
  14 + </view>
  15 + <swiper indicator-dots="{{true}}"
  16 + autoplay="{{true}}" interval="3000" duration="1000">
  17 + <block wx:for="{{slide}}" wx:key="index">
  18 + <navigator url="{{item.url}}" hover-class="navigator-hover">
  19 + <swiper-item>
  20 + <image src="{{item.image}}" class="slide-image"/>
  21 + </swiper-item>
  22 + </navigator>
  23 + </block>
  24 + </swiper>
  25 + </view>
  26 +
  27 + <view class="padding-box">
  28 + <view class="navigator-box">
  29 + <view class="img-box" wx:for="{{images}}" wx:key="index">
  30 + <image src="{{item.src}}"></image>
  31 + <view class="text">{{item.text}}</view>
  32 + </view>
  33 + </view>
11 </view> 34 </view>
12 - <swiper indicator-dots="{{true}}"  
13 - autoplay="{{true}}" interval="3000" duration="1000">  
14 - <block wx:for="{{slide}}" wx:key="index">  
15 - <navigator url="{{item.url}}" hover-class="navigator-hover">  
16 - <swiper-item>  
17 - <image src="{{item.image}}" class="slide-image"/>  
18 - </swiper-item>  
19 - </navigator>  
20 - </block>  
21 - </swiper>  
22 - </view>  
23 </view> 35 </view>
@@ -31,14 +31,23 @@ @@ -31,14 +31,23 @@
31 color: #ffffff; 31 color: #ffffff;
32 font-size: 28rpx; 32 font-size: 28rpx;
33 } 33 }
  34 +.position .right {
  35 + width: 478rpx;
  36 + height: 52rpx;
  37 + background-color: rgba(255,255,255,0.35);
  38 + display: flex;
  39 + align-items: center;
  40 + justify-content: space-between;
  41 + border-radius: 10rpx;
  42 + padding: 0 20rpx;
  43 + -webkit-box-sizing: border-box;
  44 + -moz-box-sizing: border-box;
  45 + box-sizing: border-box;
  46 +}
34 .position input { 47 .position input {
35 - width: 478rpx;  
36 - height: 52rpx;  
37 - border-radius: 10rpx;  
38 color: #ffffff; 48 color: #ffffff;
39 padding-left: 20rpx; 49 padding-left: 20rpx;
40 font-size: 28rpx; 50 font-size: 28rpx;
41 - background-color: rgba(255,255,255,0.3);  
42 } 51 }
43 swiper { 52 swiper {
44 width: 100%; 53 width: 100%;
@@ -48,4 +57,73 @@ swiper { @@ -48,4 +57,73 @@ swiper {
48 .slide-image { 57 .slide-image {
49 width: 100%; 58 width: 100%;
50 height: 100%; 59 height: 100%;
  60 +}
  61 +.padding-box {
  62 + width: 100%;
  63 + height: 272rpx;
  64 + padding: 0 22rpx;
  65 + -webkit-box-sizing: border-box;
  66 + -moz-box-sizing: border-box;
  67 + box-sizing: border-box;
  68 + position: relative;
  69 + top: -22rpx;
  70 +}
  71 +.navigator-box {
  72 + width: 100%;
  73 + height: 272rpx;
  74 + display: flex;
  75 + align-items: center;
  76 + flex-wrap: wrap;
  77 + justify-content: space-between;
  78 + align-content:stretch;
  79 + background-color: #fff;
  80 + border-radius: 10rpx;
  81 + padding: 20rpx 46rpx;
  82 + -webkit-box-sizing: border-box;
  83 + -moz-box-sizing: border-box;
  84 + box-sizing: border-box;
  85 + box-shadow: 2rpx 8rpx 38rpx rgba(89, 89, 89, 0.14);
  86 +}
  87 +.navigator-box .img-box {
  88 + /*display: flex;*/
  89 + /*flex-direction: column;*/
  90 + /*align-items: center;*/
  91 + /*justify-content: center;*/
  92 + /*margin-right: 24rpx;*/
  93 + display: inline-block;
  94 + width: 18%;
  95 + height: 48%;
  96 + margin: 0 auto 8rpx auto;
  97 + /*border: 1px solid #000;*/
  98 + text-align: center;
  99 +}
  100 +.navigator-box .img-box:nth-child(3) {
  101 + width: 24%;
  102 +}
  103 +.navigator-box .img-box:nth-child(5),.navigator-box .img-box:nth-child(10) {
  104 + /*margin-right: 0;*/
  105 +}
  106 +.navigator-box .img-box:nth-child(6) {
  107 + width: 11%;
  108 +}
  109 +.navigator-box .img-box:nth-child(7) {
  110 + width: 12%;
  111 +}
  112 +.navigator-box .img-box:nth-child(8) {
  113 + width: 16%;
  114 +}
  115 +.navigator-box .img-box:nth-child(9) {
  116 + width: 12%;
  117 +}
  118 +.navigator-box .img-box:nth-child(10) {
  119 + width: 12%;
  120 +}
  121 +.img-box image {
  122 + width: 60rpx;
  123 + height: 60rpx;
  124 + margin-bottom: 10rpx;
  125 +}
  126 +.img-box .text {
  127 + font-size: 18rpx;
  128 + color: #333333;
51 } 129 }