瀏覽代碼

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/wechat into dev

yuantianjiao 6 年之前
父節點
當前提交
f7852b6a44

+ 1166
- 1149
package-lock.json
文件差異過大導致無法顯示
查看文件


+ 2
- 0
package.json 查看文件

@@ -11,8 +11,10 @@
11 11
   "dependencies": {
12 12
     "node-sass": "^4.9.3",
13 13
     "sass-loader": "^7.1.0",
14
+    "swiper": "^4.3.5",
14 15
     "vant": "^1.1.16",
15 16
     "vue": "^2.0.1",
17
+    "vue-awesome-swiper": "^3.1.3",
16 18
     "vue-router": "^3.0.1",
17 19
     "vuex": "^3.0.1"
18 20
   },

+ 45
- 0
src/components/newsItem/index.vue 查看文件

@@ -0,0 +1,45 @@
1
+<template>
2
+  <div class="newsItem flex-h">
3
+    <div class="img">
4
+      <a><img :src="data.img" class="centerLabel cover" alt=""></a>
5
+    </div>
6
+    <div class="flex-item flex-v">
7
+      <div class="flex-item">
8
+        <div>
9
+          <span>{{data.title}}</span>
10
+        </div>
11
+      </div>
12
+      <span>{{data.time}}</span>
13
+    </div>
14
+  </div>
15
+</template>
16
+
17
+<script>
18
+
19
+export default {
20
+  name: '',
21
+  props: ['data'],
22
+  data () {
23
+    return {
24
+      
25
+    }
26
+  },
27
+  computed: {
28
+    
29
+  },
30
+  components: {
31
+    
32
+  },
33
+  created () {
34
+    
35
+  },
36
+  methods: {
37
+    
38
+  }
39
+}
40
+</script>
41
+
42
+<!-- Add "scoped" attribute to limit CSS to this component only -->
43
+<style lang="scss" scoped>
44
+@import "page.scss";
45
+</style>

+ 46
- 0
src/components/newsItem/page.scss 查看文件

@@ -0,0 +1,46 @@
1
+.newsItem{
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  padding: .15rem 0;
6
+  .img{
7
+    width: .86rem;
8
+    position: relative;
9
+    overflow: hidden;
10
+    margin-right: .1rem;
11
+    a{
12
+      width: 100%;
13
+      display: block;
14
+      padding-bottom: 60%;
15
+      background: #eee;
16
+      border-radius: .04rem;
17
+      position: relative;
18
+      overflow: hidden;
19
+    }
20
+  }
21
+  &>div.flex-item{
22
+    div{
23
+      div{
24
+        width: 100%;
25
+        position: relative;
26
+        overflow: hidden;
27
+        span{
28
+          width: 100%;
29
+          line-height: .18rem;
30
+          font-size: .14rem;
31
+          display: block;
32
+          overflow: hidden;
33
+          white-space: nowrap;
34
+          text-overflow: ellipsis;
35
+        }
36
+      }
37
+    }
38
+    &>span{
39
+      width: 100%;
40
+      line-height: .14rem;
41
+      font-size: .1rem;
42
+      display: block;
43
+      color: #b0b0b0;
44
+    }
45
+  }
46
+}

+ 118
- 4
src/module/user/mainPage/indexPage/index.vue 查看文件

@@ -1,23 +1,137 @@
1 1
 <template>
2 2
   <div class="mainPage">
3
-    首页
3
+    <div class="topBanner">
4
+      <!-- <img src="" class="centerLabel cover" alt=""> -->
5
+      <swiper :options="swiperOption" ref="mySwiper">
6
+        <swiper-slide class="swiper-slide" v-for="(item,index) in 5" :key="index">
7
+          {{index}}
8
+        </swiper-slide>
9
+        <div class="swiper-pagination"  slot="pagination"></div>
10
+      </swiper>
11
+    </div>
12
+    <div class="pageTitle flex-h">
13
+      <h5 class="flex-item">
14
+        <span>银城5A全龄生活体验平台</span>
15
+      </h5>
16
+    </div>
17
+    <div class="flex-h">
18
+      <nav class="pageNav flex-item">
19
+        <router-link :to="{name:'',query:{}}" v-for="(item,index) in 5" :key="index">
20
+          <a>
21
+            <!-- <img src="" class="centerLabel cover" alt=""> -->
22
+          </a>
23
+          <span>备注内容</span>
24
+        </router-link>
25
+      </nav>
26
+    </div>
27
+    <div class="MsgBanner">
28
+      <div class="flex-h">
29
+        <i class="iconfont icon-xiaoxi"></i>
30
+        <span>最新消息:</span>
31
+        <div class="flex-item">
32
+          <div>
33
+            <swiper :options="swiperOptionMsg" ref="mySwiperMsg">
34
+              <swiper-slide class="swiper-slide" v-for="(item,index) in 5" :key="index">
35
+                <router-link :to="{name:'',query:{}}">这是一条消息</router-link>
36
+              </swiper-slide>
37
+              <div class="swiper-pagination"  slot="pagination"></div>
38
+            </swiper>
39
+          </div>
40
+        </div>
41
+      </div>
42
+    </div>
43
+    <div class="pageTitle flex-h">
44
+      <h5 class="flex-item">
45
+        <span>售楼处项目专题</span>
46
+      </h5>
47
+    </div>
48
+    <div class="flex-h">
49
+      <ul class="projectList flex-item">
50
+        <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in 3" :key="index">
51
+          <!-- <img src="" class="centerLabel cover" alt=""> -->
52
+        </router-link>
53
+      </ul>
54
+    </div>
55
+    <div style="width:100%;height:.1rem;background:#f8f8f8;margin:.25rem auto 0;"></div>
56
+    <div class="pageTitle flex-h">
57
+      <h5 class="flex-item">
58
+        <span>活动资讯</span>
59
+      </h5>
60
+    </div>
61
+    <div class="flex-h">
62
+      <ul class="newsList flex-item">
63
+        <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in newsList" :key="index">
64
+          <newsItem :data="item"></newsItem>
65
+        </router-link>
66
+      </ul>
67
+    </div>
4 68
   </div>
5 69
 </template>
6 70
 
7 71
 <script>
72
+import newsItem from '../../../../components/newsItem/index'
73
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
74
+import 'swiper/dist/css/swiper.css'
8 75
 
9 76
 export default {
10 77
   name: '',
11 78
   data () {
12 79
     return {
13
-      
80
+      swiperOption: {
81
+          observer:true,
82
+          loop : true,
83
+          autoplay: {
84
+            disableOnInteraction: false,
85
+          }
86
+      },
87
+      swiperOptionMsg: {
88
+          observer:true,
89
+          direction : 'vertical',
90
+          loop : true,
91
+          autoplay: {
92
+            disableOnInteraction: false,
93
+          }
94
+      },
95
+      newsList: [{ // 资讯列表
96
+        title:'我是标题我是标题我是标题我是标题我是标题我是标题',
97
+        time:'2018年5月25日',
98
+        img:'',
99
+        id:''
100
+      },{
101
+        title:'我是标题我是标题我是标题我是标题我是标题我是标题',
102
+        time:'2018年5月25日',
103
+        img:'',
104
+        id:''
105
+      },{
106
+        title:'我是标题我是标题我是标题我是标题我是标题我是标题',
107
+        time:'2018年5月25日',
108
+        img:'',
109
+        id:''
110
+      },{
111
+        title:'我是标题我是标题我是标题我是标题我是标题我是标题',
112
+        time:'2018年5月25日',
113
+        img:'',
114
+        id:''
115
+      },{
116
+        title:'我是标题我是标题我是标题我是标题我是标题我是标题',
117
+        time:'2018年5月25日',
118
+        img:'',
119
+        id:''
120
+      }]
14 121
     }
15 122
   },
16 123
   computed: {
17
-    
124
+    MySwiper() {
125
+      return this.$refs.mySwiper.swiper
126
+    },
127
+    MySwiperMsg() {
128
+      return this.$refs.MySwiperMsg.swiper
129
+    },
18 130
   },
19 131
   components: {
20
-    
132
+    newsItem,
133
+    swiper,
134
+    swiperSlide,
21 135
   },
22 136
   created () {
23 137
     

+ 166
- 0
src/module/user/mainPage/indexPage/page.scss 查看文件

@@ -0,0 +1,166 @@
1
+.mainPage{
2
+  overflow-y: scroll;
3
+  -webkit-overflow-scrolling: touch;
4
+  transform: translateZ(0);
5
+  -webkit-transform: translateZ(0);
6
+  background: #fff;
7
+  &>*:last-child{
8
+    margin-bottom: .2rem;
9
+  }
10
+  .topBanner{
11
+    width: 100%;
12
+    height: 0;
13
+    position: relative;
14
+    overflow: hidden;
15
+    padding-bottom: 54%;
16
+    background: #eee;
17
+    &>div{
18
+      width: 100%;
19
+      position: absolute;
20
+      left: 0;
21
+      bottom: 0;
22
+      top: 0;
23
+    }
24
+  }
25
+  .pageTitle{
26
+    margin: .18rem auto 0;
27
+    position: relative;
28
+    overflow: hidden;
29
+    h5{
30
+      &::after{
31
+        content: '';
32
+        width: 100%;
33
+        height: .01rem;
34
+        background: #eee;
35
+        position: absolute;
36
+        left: 0;
37
+        top: 50%;
38
+        transform: translateY(-50%);
39
+        -webkit-transform: translateY(-50%);
40
+        z-index: 1;
41
+      }
42
+      width: 100%;
43
+      display: block; 
44
+      text-align: center;
45
+      position: relative;
46
+      overflow: hidden;
47
+      margin: 0 .2rem;
48
+      span{
49
+        display: inline-block; 
50
+        line-height: .26rem;
51
+        font-size: .14rem;
52
+        font-weight: normal;
53
+        background: #fff;
54
+        position: relative;
55
+        z-index: 2;
56
+        padding: 0 .15rem;
57
+      }
58
+    }
59
+  }
60
+  .pageNav{
61
+    margin: 0 .1rem;
62
+    font-size: 0;
63
+    &>a{
64
+      width: 20%;
65
+      display: inline-block;
66
+      position: relative;
67
+      overflow: hidden;
68
+      margin-top: .15rem;
69
+      vertical-align: top;
70
+      a{
71
+        width: 70%;
72
+        display: block;
73
+        padding-bottom: 70%;
74
+        position: relative;
75
+        overflow: hidden;
76
+        background: #eee;
77
+        margin: 0 auto;
78
+        border-radius: 100%;
79
+      }
80
+      span{
81
+        width: 70%;
82
+        display: block;
83
+        margin: .1rem auto 0;
84
+        line-height: .16rem;
85
+        font-size: .1rem;
86
+        text-align: center;
87
+        color: #666;
88
+      }
89
+    }
90
+  }
91
+  .MsgBanner{
92
+    width: 100%;
93
+    height: .44rem;
94
+    position: relative;
95
+    overflow: hidden;
96
+    background: #f8f8f8;
97
+    margin: .25rem auto 0;
98
+    &>div{
99
+      width: 100%;
100
+      position: absolute;
101
+      left: 0;
102
+      top: 0;
103
+      bottom: 0;
104
+      align-items: center;
105
+      &>i,
106
+      &>span{
107
+        color: #f05a3f;
108
+        font-size: .12rem;
109
+        margin-left: .08rem;
110
+      }
111
+      &>i{
112
+        font-size: .16rem;
113
+        margin-left: .3rem;
114
+      }
115
+      &>div{
116
+        margin-left: .1rem;
117
+        height: 100%;
118
+        margin-right: .2rem;
119
+        &>div{
120
+          width: 100%;
121
+          height: 100%;
122
+          position: relative;
123
+          overflow: hidden;
124
+          &>div{
125
+            width: 100%;
126
+            height: 100%;
127
+            a{
128
+              width: 100%;
129
+              display: inline-block;
130
+              overflow: hidden;
131
+              white-space: nowrap;
132
+              text-overflow: ellipsis;
133
+              line-height: .44rem;
134
+              color: #f05a3f;
135
+            }
136
+          }
137
+        }
138
+      }
139
+    }
140
+  }
141
+  .projectList{
142
+    margin: .1rem .1rem 0;
143
+    li{
144
+      width: 100%;
145
+      position: relative;
146
+      height: 0;
147
+      padding-bottom: 30%;
148
+      background: #eee;
149
+      overflow: hidden;
150
+      margin: .08rem auto 0;
151
+    }
152
+  }
153
+  .newsList{
154
+    margin: .15rem .2rem .2rem;
155
+    &>li{
156
+      width: 100%;
157
+      display: block;
158
+      position: relative;
159
+      overflow: hidden;
160
+      border-top: .01rem solid #eee;
161
+      &:first-child{
162
+        border-top:none
163
+      }
164
+    }
165
+  }
166
+}