许成详 6 gadus atpakaļ
vecāks
revīzija
ea45f813ec

+ 66
- 0
src/components/courseItem/index.vue Parādīt failu

@@ -0,0 +1,66 @@
1
+<template>
2
+  <div class="courseItem flex-h">
3
+    <div class="img">
4
+      <a>
5
+        <img :src="data.img" class="centerLabel cover" alt="">
6
+      </a>
7
+    </div>
8
+    <div class="flex-item flex-v">
9
+      <div class="flex-item">
10
+        <div class="content">
11
+          <div class="title flex-h">
12
+            <div class="flex-item">
13
+              <span>{{data.title}}</span>
14
+            </div>
15
+            <div v-if="data.getWay=='ticket'">
16
+              <span>{{data.defaultPrice}}</span><br>
17
+              <span>优惠券体验</span>
18
+            </div>
19
+          </div>
20
+          <span>时间:{{data.time}}</span>
21
+          <span>地点:{{data.address}}</span>
22
+        </div>
23
+      </div>
24
+      <ul v-if="data.getWay=='ticket'">
25
+        <li v-for="(item,index) in data.tag" :key="index">{{item}}</li>
26
+      </ul>
27
+      <div v-if="data.getWay=='free'" class="flex-h">
28
+        <div class="flex-item">
29
+          <i class="iconfont icon-kecheng"></i>
30
+          <span>团体课</span>  
31
+        </div>
32
+        <span>免费体验</span>
33
+      </div>
34
+    </div>
35
+  </div>
36
+</template>
37
+
38
+<script>
39
+
40
+export default {
41
+  name: '',
42
+  props: ['data'],
43
+  data () {
44
+    return {
45
+      
46
+    }
47
+  },
48
+  computed: {
49
+    
50
+  },
51
+  components: {
52
+    
53
+  },
54
+  created () {
55
+    
56
+  },
57
+  methods: {
58
+    
59
+  }
60
+}
61
+</script>
62
+
63
+<!-- Add "scoped" attribute to limit CSS to this component only -->
64
+<style lang="scss" scoped>
65
+@import "page.scss";
66
+</style>

+ 94
- 0
src/components/courseItem/page.scss Parādīt failu

@@ -0,0 +1,94 @@
1
+.courseItem{
2
+  .img{
3
+    width: .8rem;
4
+    position: relative;
5
+    overflow: hidden;
6
+    a{
7
+      width: 100%;
8
+      padding-bottom: 125%;
9
+      display: block;
10
+      background: #eee;
11
+      border-radius: .06rem;
12
+      position: relative;
13
+      overflow: hidden;
14
+    }
15
+  }
16
+  &>div.flex-item{
17
+    position: relative;
18
+    overflow: hidden;
19
+    margin-left: .15rem;
20
+    &>div.flex-item{
21
+      .title{
22
+        align-items: center;
23
+        &>.flex-item{
24
+          span{
25
+            width: 100%;
26
+            font-size: .15rem;
27
+            display: block;
28
+            white-space: nowrap;
29
+            text-overflow: ellipsis;
30
+            color: #323b45;
31
+          }
32
+          &+div{
33
+            text-align: right;
34
+            *{
35
+              display: inline-block;
36
+              line-height: .14rem;
37
+              font-size: .11rem;
38
+              color: #ff1414;
39
+            }
40
+            &>*:first-child{
41
+              text-decoration: line-through;
42
+              color: #ccc;
43
+            }
44
+          }
45
+        }
46
+      }
47
+      &>div.content{
48
+        &>span{
49
+          width: 100%;
50
+          display: block;
51
+          line-height: .16rem;
52
+          font-size: .11rem;
53
+          color: #565656;
54
+        }
55
+      }
56
+    }
57
+    &>ul{
58
+      white-space: nowrap;
59
+      font-size: 0;
60
+      li{
61
+        display: inline-block;
62
+        line-height: .2rem;
63
+        background: #f2f4f7;
64
+        color: #92a7c9;
65
+        font-size: .11rem;
66
+        margin-right: .05rem;
67
+        padding: 0 .05rem;
68
+        border-radius: .04rem;
69
+      }
70
+    }
71
+    &>div.flex-h{
72
+      div{
73
+        font-size: 0;
74
+        white-space: nowrap;
75
+        *{
76
+          font-size: .11rem;
77
+          vertical-align: middle;
78
+          line-height: .2rem;
79
+          display: inline-block;
80
+          margin-right: .05rem;
81
+          color: #fa2a00;
82
+        }
83
+        i{
84
+          font-size: .13rem;
85
+        }
86
+      }
87
+      &>span{
88
+        line-height: .2rem;
89
+        color: #fa2a00;
90
+        font-size: .11rem;
91
+      }
92
+    }
93
+  }
94
+}

+ 145
- 0
src/module/user/fiveA/index.vue Parādīt failu

@@ -0,0 +1,145 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <nav class="flex-h">
4
+      <a class="flex-item" v-for="(item,index) in 6" :key="index" :class="{'active':index==active}">导航{{index+1}}</a>
5
+    </nav>
6
+    <div class="flex-item">
7
+      <div>
8
+        <div v-for="(item,index) in 6" :key="index" v-if="index==active">
9
+          <div class="banner flex-h">
10
+            <div class="flex-item">
11
+              <swiper :options="swiperOption" ref="mySwiper">
12
+                <swiper-slide class="swiper-slide" v-for="(item,index) in 5" :key="index">{{index}}
13
+                  <!-- <img src="" class="cover" alt=""> -->
14
+                </swiper-slide>
15
+              </swiper>
16
+            </div>
17
+          </div>
18
+          <h5>结识更多朋友</h5>
19
+          <div class="courseList flex-h">
20
+            <ul class="flex-item">
21
+              <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in courseList" :key="index">
22
+                <courseItem :data="item"></courseItem>
23
+              </router-link>
24
+            </ul>
25
+          </div>
26
+          <router-link :to="{name:'',query:{}}" class="more">查看更多</router-link>
27
+          <div style="width:100%;height:.1rem;background:#f8f8f8;margin:0 auto;"></div>
28
+          <h5>资讯</h5>
29
+          <div class="newsList flex-h">
30
+            <ul class="flex-item">
31
+              <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in newsList" :key="index">
32
+                <newsItem :data="item"></newsItem>
33
+              </router-link>
34
+            </ul>
35
+          </div>
36
+        </div>
37
+      </div>
38
+    </div>
39
+  </div>
40
+</template>
41
+
42
+<script>
43
+import courseItem from '../../../components/courseItem/index'
44
+import newsItem from '../../../components/newsItem/index'
45
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
46
+import 'swiper/dist/css/swiper.css'
47
+
48
+export default {
49
+  name: '',
50
+  data () {
51
+    return {
52
+      active: 1,
53
+      swiperOption: {
54
+        observer: true,
55
+        loop: true,
56
+        autoplay: {
57
+          disableOnInteraction: false,
58
+        }
59
+      },
60
+      courseList: [{ // 课程列表
61
+        id:'',
62
+        title:'课程名称',
63
+        img:'',
64
+        time:'2018.04.04 18:30-20:00',
65
+        address:'南京南',
66
+        tag:['儿童教育','小小外交官'],
67
+        courseType:'团体课',
68
+        defaultPrice:'168/节',
69
+        getWay:'ticket'
70
+      },{
71
+        id:'',
72
+        title:'课程名称',
73
+        img:'',
74
+        time:'2018.04.04 18:30-20:00',
75
+        address:'南京南',
76
+        tag:['儿童教育','小小外交官'],
77
+        courseType:'团体课',
78
+        defaultPrice:'168/节',
79
+        getWay:'free'
80
+      },{
81
+        id:'',
82
+        title:'课程名称',
83
+        img:'',
84
+        time:'2018.04.04 18:30-20:00',
85
+        address:'南京南',
86
+        tag:['儿童教育','小小外交官'],
87
+        courseType:'团体课',
88
+        defaultPrice:'168/节',
89
+        getWay:'free'
90
+      }],
91
+      newsList: [{ // 资讯列表
92
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
93
+        time: '2018年5月25日',
94
+        img: '',
95
+        id: ''
96
+      }, {
97
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
98
+        time: '2018年5月25日',
99
+        img: '',
100
+        id: ''
101
+      }, {
102
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
103
+        time: '2018年5月25日',
104
+        img: '',
105
+        id: ''
106
+      }, {
107
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
108
+        time: '2018年5月25日',
109
+        img: '',
110
+        id: ''
111
+      }, {
112
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
113
+        time: '2018年5月25日',
114
+        img: '',
115
+        id: ''
116
+      }]
117
+    }
118
+  },
119
+  computed: {
120
+    MySwiper () {
121
+      return this.$refs.mySwiper.swiper
122
+    },
123
+    MySwiperMsg () {
124
+      return this.$refs.MySwiperMsg.swiper
125
+    },
126
+  },
127
+  components: {
128
+    newsItem,
129
+    swiper,
130
+    swiperSlide,
131
+    courseItem,
132
+  },
133
+  created () {
134
+
135
+  },
136
+  methods: {
137
+
138
+  }
139
+}
140
+</script>
141
+
142
+<!-- Add "scoped" attribute to limit CSS to this component only -->
143
+<style lang="scss" scoped>
144
+@import "page.scss";
145
+</style>

+ 107
- 0
src/module/user/fiveA/page.scss Parādīt failu

@@ -0,0 +1,107 @@
1
+.mainPage{
2
+  background: #fff;
3
+  &>nav{
4
+    white-space: nowrap;
5
+    overflow-x: scroll;
6
+    -webkit-overflow-scrolling: touch;
7
+    font-size: 0;
8
+    padding: .09rem 0;
9
+    background: #fff;
10
+    z-index: 100;
11
+    position: relative;
12
+    a{
13
+      line-height: .32rem;
14
+      text-align: center;
15
+      position: relative;
16
+      &.active::after{
17
+        content: '';
18
+        width: 50%;
19
+        height: .02rem;
20
+        display: block;
21
+        position: absolute;
22
+        left: 50%;
23
+        bottom: 0;
24
+        transform: translateX(-50%);
25
+        -webkit-transform: translateX(-50%);
26
+        background: #fc6243;
27
+      }
28
+    }
29
+  }
30
+  &>div.flex-item{
31
+    position: relative;
32
+    &>div{
33
+      width: 100%;
34
+      position: absolute;
35
+      left: 0;
36
+      top: 0;
37
+      bottom: 0;
38
+      overflow: hidden;
39
+      &>div{
40
+        width: 100%;
41
+        height: 100%;
42
+        position: relative;
43
+        overflow-y: scroll;
44
+        -webkit-overflow-scrolling: touch;
45
+        transform: translateZ(0);
46
+        -webkit-transform: translateZ(0);
47
+        .banner{
48
+          margin: .2rem auto 0;
49
+          overflow: visible;
50
+          &>div{
51
+            margin: 0 .2rem;
52
+            position: relative;
53
+            overflow: hidden;
54
+            border-radius: .12rem;
55
+            padding-bottom: 46%;
56
+            background: #eee;
57
+            box-shadow: 0 0 .2rem .01rem rgba(0, 0, 0, .1);
58
+            &>div{
59
+              width: 100%;
60
+              position: absolute;
61
+              left: 0;
62
+              top: 0;
63
+              bottom: 0;
64
+              overflow: hidden;
65
+            }
66
+          }
67
+        }
68
+        h5{
69
+          width: 100%;
70
+          display: block;
71
+          line-height: .26rem;
72
+          font-size: .14rem;
73
+          text-indent: .2rem;
74
+          margin: .2rem auto 0;
75
+        }
76
+        .courseList{
77
+          &>ul{
78
+            margin: 0 .2rem;
79
+            &>li{
80
+              padding: .15rem 0;
81
+              border-bottom: .01rem solid #eee;
82
+            }
83
+          }
84
+        }
85
+        .more{
86
+          width: 100%;
87
+          display: block;
88
+          text-align: center;
89
+          font-size: .12rem;
90
+          line-height: .4rem;
91
+        }
92
+      }
93
+      .newsList{
94
+        &>ul{
95
+          margin: 0 .2rem;
96
+          &>li{
97
+            padding: .15rem 0;
98
+            border-top: .01rem solid #eee;
99
+            &:first-child{
100
+              border-top: none;
101
+            }
102
+          }
103
+        }
104
+      }
105
+    }
106
+  }
107
+}

+ 5
- 6
src/module/user/mainPage/indexPage/index.vue Parādīt failu

@@ -1,12 +1,10 @@
1 1
 <template>
2 2
   <div class="mainPage">
3 3
     <div class="topBanner">
4
-      <!-- <img src="" class="centerLabel cover" alt=""> -->
5 4
       <swiper :options="swiperOption" ref="mySwiper">
6 5
         <swiper-slide class="swiper-slide" v-for="(item,index) in 5" :key="index">
7
-          {{index}}
6
+          <img src="" class="cover" alt="">
8 7
         </swiper-slide>
9
-        <div class="swiper-pagination"  slot="pagination"></div>
10 8
       </swiper>
11 9
     </div>
12 10
     <div class="pageTitle flex-h">
@@ -16,9 +14,10 @@
16 14
     </div>
17 15
     <div class="flex-h">
18 16
       <nav class="pageNav flex-item">
19
-        <router-link :to="{name:'',query:{}}" v-for="(item,index) in 5" :key="index">
17
+        <router-link :to="{name:'fiveA',query:{}}" v-for="(item,index) in 5" :key="index">
20 18
           <a>
21
-            <!-- <img src="" class="centerLabel cover" alt=""> -->
19
+            <img src="" class="centerLabel cover" alt="">
20
+            <em>标题</em>
22 21
           </a>
23 22
           <span>备注内容</span>
24 23
         </router-link>
@@ -48,7 +47,7 @@
48 47
     <div class="flex-h">
49 48
       <ul class="projectList flex-item">
50 49
         <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in 3" :key="index">
51
-          <!-- <img src="" class="centerLabel cover" alt=""> -->
50
+          <img src="" class="centerLabel cover" alt="">
52 51
         </router-link>
53 52
       </ul>
54 53
     </div>

+ 15
- 0
src/module/user/mainPage/indexPage/page.scss Parādīt failu

@@ -76,6 +76,21 @@
76 76
         background: #eee;
77 77
         margin: 0 auto;
78 78
         border-radius: 100%;
79
+        img{
80
+          z-index: 1;
81
+        }
82
+        em{
83
+          width: 100%;
84
+          display: block;
85
+          position: absolute;
86
+          left: 0;
87
+          bottom: 0;
88
+          line-height: .3rem;
89
+          font-size: .11rem;
90
+          text-align: center;
91
+          color: #fff;
92
+          z-index: 2;
93
+        }
79 94
       }
80 95
       span{
81 96
         width: 70%;

+ 9
- 3
src/module/user/router.js Parādīt failu

@@ -3,6 +3,7 @@ import Router from 'vue-router'
3 3
 
4 4
 import mainPage from './mainPage/index' // 主页
5 5
 import indexPage from './mainPage/indexPage/index' // 首页
6
+import fiveA from './fiveA/index' // 5A
6 7
 import coffeeIndex from './mainPage/coffeeIndex/index' // 城咖啡
7 8
 import userCenter from './mainPage/userCenter/index' // 个人中心
8 9
 
@@ -13,22 +14,27 @@ const router = new Router({
13 14
     path: '/mainPage',
14 15
     name: 'mainPage',
15 16
     component: mainPage,
16
-    children: [{
17
+    children: [{ // 首页
17 18
       path: 'indexPage',
18 19
       name: 'indexPage',
19 20
       component: indexPage,
20 21
       children: []
21
-    },{
22
+    },{ // 城咖啡
22 23
       path: 'coffeeIndex',
23 24
       name: 'coffeeIndex',
24 25
       component: coffeeIndex,
25 26
       children: []
26
-    },{
27
+    },{ // 个人中心
27 28
       path: 'userCenter',
28 29
       name: 'userCenter',
29 30
       component: userCenter,
30 31
       children: []
31 32
     }]
33
+  },{ // 5A
34
+    path: '/fiveA',
35
+    name: 'fiveA',
36
+    component: fiveA,
37
+    children: []
32 38
   }],
33 39
   linkActiveClass: 'active',
34 40
 })