许成详 6 年之前
父節點
當前提交
d209fcd20a

+ 1
- 2
package-lock.json 查看文件

@@ -13389,8 +13389,7 @@
13389 13389
     "weixin-js-sdk": {
13390 13390
       "version": "1.3.3",
13391 13391
       "resolved": "https://registry.npmjs.org/weixin-js-sdk/-/weixin-js-sdk-1.3.3.tgz",
13392
-      "integrity": "sha512-1ofMi7Q1ioXV8/V8tGv3DrU7pugmyvhN86Pxbj1WaGeIEs/+yz0Jdv/5L+ocuDh/JAbKmtvMvBXh0OyuP6kQ8A==",
13393
-      "dev": true
13392
+      "integrity": "sha512-1ofMi7Q1ioXV8/V8tGv3DrU7pugmyvhN86Pxbj1WaGeIEs/+yz0Jdv/5L+ocuDh/JAbKmtvMvBXh0OyuP6kQ8A=="
13394 13393
     },
13395 13394
     "which": {
13396 13395
       "version": "1.3.1",

+ 2
- 2
src/components/courseItem/index.vue 查看文件

@@ -5,7 +5,7 @@
5 5
         <img :src="data.img" class="centerLabel cover" alt="">
6 6
       </a>
7 7
     </div>
8
-    <div class="flex-item flex-v">
8
+    <div class="flex-item flex-v" :style="{marginRight: marginRight + 'rem'}">
9 9
       <div class="flex-item">
10 10
         <div class="content">
11 11
           <div class="title flex-h">
@@ -41,7 +41,7 @@
41 41
 
42 42
 export default {
43 43
   name: '',
44
-  props: ['data'],
44
+  props: ['data', 'marginRight'],
45 45
   data () {
46 46
     return {
47 47
       

+ 10
- 9
src/pages/user/App.vue 查看文件

@@ -14,7 +14,7 @@ export default {
14 14
   name: 'app',
15 15
   data () {
16 16
     return {
17
-      showPage: false,
17
+      showPage: true,
18 18
       logo
19 19
     }
20 20
   },
@@ -26,14 +26,15 @@ export default {
26 26
     })
27 27
   },
28 28
   created () {
29
-    if (location.search && this.toolClass.UrlSearch(location.search).code) {
30
-      this.code = this.toolClass.UrlSearch(location.search).code
31
-    } else {
32
-      this.code = null
33
-    }
34
-    this.getUserInfo({ org: this.org, code: this.code }).then(() => {
35
-      this.showPage = true
36
-    })
29
+    // if (location.search && this.toolClass.UrlSearch(location.search).code) {
30
+    //   this.code = this.toolClass.UrlSearch(location.search).code
31
+    // } else {
32
+    //   this.code = null
33
+    // }
34
+    // this.getUserInfo({ org: this.org, code: this.code }).then(() => {
35
+    //   this.showPage = true
36
+    // })
37
+    
37 38
     // wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
38 39
     //   title: '城的空间',
39 40
     //   desc: '城的空间',

+ 106
- 0
src/pages/user/courseList/index.vue 查看文件

@@ -0,0 +1,106 @@
1
+<template>
2
+  <div class="mainPage" @scroll="pageScroll" ref="parentBox">
3
+    <div class="flex-h">
4
+      <div class="flex-item">
5
+        <div ref="box">
6
+          <ul>
7
+            <router-link
8
+              tag="li"
9
+              v-for="(item,index) in list"
10
+              :key="index"
11
+              :to="{name: 'majorProjectsDetail', query: {id: item.id}}"
12
+              class="flex-h"
13
+            >
14
+              <div class="flex-item">
15
+                <div>
16
+                  <courseItem :data="item" marginRight=".2"></courseItem>
17
+                </div>
18
+              </div>
19
+            </router-link>
20
+          </ul>
21
+          <span class="footerWord" v-if="total === list.length">加载完毕</span>
22
+          <span class="footerWord" v-else>正在加载更多</span>
23
+        </div>
24
+      </div>
25
+    </div>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+import { mapState, createNamespacedHelpers } from 'vuex'
31
+import courseItem from '../../../components/courseItem/index'
32
+const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('index')
33
+
34
+export default {
35
+  name: '',
36
+  data () {
37
+    return {
38
+      list: [],
39
+      ajaxOff: true,
40
+      postData: {
41
+        pagesize: 10,
42
+        page: 1
43
+      },
44
+      total: 1
45
+    }
46
+  },
47
+  computed: {
48
+    ...mapState({
49
+      orgid: x => x.app.orgId,
50
+      fiveA: x => x.index.fiveA,
51
+      banner: x => x.index.banner,
52
+      message: x => x.index.message,
53
+      project: x => x.index.project,
54
+      cms: x => x.index.cms,
55
+    }),
56
+    ...mapIndexState({
57
+      courseList: x => x.courseList
58
+    })
59
+  },
60
+  components: {
61
+    courseItem
62
+  },
63
+  created () {
64
+    this.getData()
65
+  },
66
+  methods: {
67
+    ...mapIndexActions(['getCourseList']),
68
+    pageScroll () {
69
+      var docHeight = this.$refs.box.offsetHeight, parHeight = this.$refs.parentBox.offsetHeight, scrollTop = this.$refs.parentBox.scrollTop
70
+      if (scrollTop === docHeight - parHeight) {
71
+        if (this.ajaxOff && this.list.length < this.total) {
72
+          this.ajaxOff = false
73
+          this.postData.page += 1
74
+          this.getData()
75
+        }
76
+      }
77
+    },
78
+    getData () {
79
+      this.getCourseList(this.postData).then((res) => {
80
+        this.ajaxOff = true
81
+        this.total = res.pagenum;
82
+        (res.list || []).map((item) => {
83
+          this.list.push({
84
+            id: item.CourseId,
85
+            title: item.CourseName,
86
+            img: item.CourseImg,
87
+            remark: this.toolClass.dateFormat(item.BeginDate, 'yyyy-MM-dd') + '至' + this.toolClass.dateFormat(item.EndDate, 'yyyy-MM-dd'),
88
+            address: item.CaseAddress,
89
+            tag: '',
90
+            courseType: '团体课',
91
+            defaultPrice: item.Price + '/节',
92
+            getWay: 'ticket',
93
+            startDate: new Date(item.BeginDate).getTime(),
94
+            endDate: new Date(item.EndDate).getTime(),
95
+          })
96
+        })
97
+      })
98
+    }
99
+  }
100
+}
101
+</script>
102
+
103
+<!-- Add "scoped" attribute to limit CSS to this component only -->
104
+<style lang="scss" scoped>
105
+@import 'page.scss';
106
+</style>

+ 31
- 0
src/pages/user/courseList/page.scss 查看文件

@@ -0,0 +1,31 @@
1
+.mainPage{
2
+  background: #fff;
3
+  overflow-y: scroll;
4
+  -webkit-overflow-scrolling: touch;
5
+  transform: translateZ(0);
6
+  -webkit-transform: translateZ(0);
7
+  >div{
8
+    >div{
9
+      margin-left: .2rem;
10
+      >div{
11
+        width: 100%;
12
+        position: relative;
13
+        overflow: hidden;
14
+        >ul{
15
+          >li{
16
+            padding: .2rem 0;
17
+            border-bottom: 1px solid #eee;
18
+          }
19
+        }
20
+      }
21
+    }
22
+    .footerWord{
23
+      width: 100%;
24
+      display: block;
25
+      text-align: center;
26
+      text-indent: -.1rem;
27
+      line-height: .4rem;
28
+      color: #666;
29
+    }
30
+  }
31
+}

+ 91
- 81
src/pages/user/mainPage/indexPage/index.vue 查看文件

@@ -1,113 +1,118 @@
1 1
 <template>
2 2
   <div class="mainPage">
3
-    <div class="topBanner">
4
-      <swiper :options="swiperOption" ref="mySwiper">
5
-        <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
6
-          <img :src='item.ImageUrl' class="cover" alt="" @click="jump(item)">
7
-        </swiper-slide>
8
-      </swiper>
9
-    </div>
10
-    <div class="pageTitle flex-h">
11
-      <h5 class="flex-item">
12
-        <span>银城5A全龄生活体验平台</span>
13
-      </h5>
14
-    </div>
15
-    <div class="flex-h">
16
-      <nav class="pageNav flex-item">
17
-        <router-link :to="{name:'fiveA',query:{id:item.LocationId}}" v-for="(item,index) in data.fiveA" :key="index">
18
-          <a>
19
-            <img :src="item.TypeImg" class="centerLabel cover" alt="">
20
-            <em>{{item.LocationName}}</em>
21
-          </a>
22
-          <span>{{item.Title}}</span>
23
-        </router-link>
24
-      </nav>
25
-    </div>
26
-    <div class="MsgBanner">
27
-      <div class="flex-h">
28
-        <i class="iconfont icon-xiaoxi"></i>
29
-        <span>最新消息:</span>
30
-        <div class="flex-item">
3
+    <div class="banner flex-h">
4
+      <div class="flex-item">
5
+        <div>
31 6
           <div>
32
-            <swiper :options="swiperOptionMsg" ref="mySwiperMsg">
33
-              <swiper-slide class="swiper-slide" v-for="(item,index) in message" :key="index">
34
-                <router-link :to="{name:'',query:{}}"><span @click="jump(item)">{{item.InfoName}}</span></router-link>
7
+            <swiper :options="swiperOption" ref="mySwiper">
8
+              <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
9
+                <img :src='item.ImageUrl' class="cover" alt="" @click="jump(item)">
35 10
               </swiper-slide>
36
-              <div class="swiper-pagination"  slot="pagination"></div>
37 11
             </swiper>
38 12
           </div>
39 13
         </div>
40 14
       </div>
41 15
     </div>
42
-    <div class="pageTitle flex-h">
43
-      <h5 class="flex-item">
44
-        <span>售楼处项目专题</span>
45
-      </h5>
46
-    </div>
47
-    <div class="flex-h">
48
-      <ul class="projectList flex-item">
49
-        <router-link tag="li" :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }" v-for="(item,index) in project" :key="index">
50
-          <img :src='item.CaseImageUrl' class="centerLabel cover" alt="">
16
+    <div class="subNav">
17
+      <ul class="flex-h">
18
+        <router-link tag="li" class="flex-item" v-for="(item, index) in fiveA" :to="{name:'fiveA',query:{id:item.LocationId}}" :key="index">
19
+          <img :src="item.TypeImg" alt="">
20
+          <span>{{item.LocationName}}</span>
51 21
         </router-link>
52 22
       </ul>
53 23
     </div>
54
-    <div style="width:100%;height:.1rem;background:#f8f8f8;margin:.25rem auto 0;"></div>
55
-    <div class="pageTitle flex-h">
56
-      <h5 class="flex-item">
57
-        <span>活动资讯</span>
58
-      </h5>
24
+    <div class="areaHeader flex-h">
25
+      <h1 class="flex-item">探索·发现</h1>
26
+      <router-link :to="{name: 'majorProjectsList'}">查看所有</router-link>
59 27
     </div>
60
-    <div class="flex-h">
61
-      <ul class="newsList flex-item">
62
-        <li @click="jump(item)" v-for="(item,index) in newsList" v-if="index < 5" :key="index">
63
-          <newsItem :data="item"></newsItem>
64
-        </li>
65
-      </ul>
28
+    <div class="areaContent">
29
+      <div class="scroll-h find">
30
+        <div>
31
+          <swiper :options="swiperHOption" ref="mySwiperH">
32
+            <swiper-slide class="swiper-slide" v-for="(item,index) in project" :key="index">
33
+              <router-link tag="div" :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }" style="width:100%;height:100%;position:relative;">
34
+                <img :src='item.CaseImageUrl' class="cover" alt="">
35
+                <span><i class="iconfont icon-dingwei"></i>距离{{item.Coordinate}}米</span>
36
+              </router-link>
37
+            </swiper-slide>
38
+          </swiper>
39
+        </div>
40
+      </div>
41
+    </div>
42
+    <div class="areaHeader flex-h" :hidden="!courseList.length">
43
+      <h1 class="flex-item">近期课程</h1>
44
+      <router-link :to="{name: 'courseList'}">查看所有</router-link>
45
+    </div>
46
+    <div class="areaContent" :hidden="!courseList.length">
47
+      <div class="scroll-h course">
48
+        <div>
49
+          <swiper :options="swiperHOption" ref="mySwiperH">
50
+            <swiper-slide class="swiper-slide" v-for="(item,index) in courseList" :key="index">
51
+              <router-link tag="div" :to="{ name:'majorProjectsDetail', query:{ id: item.CourseId } }" style="width:100%;position:relative;overflow:visible">
52
+                <div class="img">
53
+                  <img :src='item.CourseImg' class="cover centerLabel" alt="">
54
+                  <span>{{item.CourseName}}</span>
55
+                </div>
56
+                <div class="price"><span>¥{{item.Price}}</span></div>
57
+                <span>{{toolClass.dateFormat(item.BeginDate)}}</span>
58
+                <span>{{item.CaseName}}</span>
59
+              </router-link>
60
+            </swiper-slide>
61
+          </swiper>
62
+        </div>
63
+      </div>
64
+    </div>
65
+    <div class="areaHeader flex-h">
66
+      <h1 class="flex-item">活动资讯</h1>
67
+    </div>
68
+    <div class="areaContent newsList flex-h">
69
+      <div class="flex-item">
70
+        <div>
71
+          <ul>
72
+            <li class="flex-h" v-for="(item,index) in newsList" :key="index" @click="jump(item)">
73
+              <a class="img">
74
+                <img :src="item.ImageUrl" class="centerLabel cover" alt="">
75
+              </a>
76
+              <div class="flex-item">
77
+                <div>
78
+                  <span>{{item.Title}}</span>
79
+                  <span>{{toolClass.dateFormat(item.CreateDate)}}</span>
80
+                </div>
81
+              </div>
82
+            </li>
83
+          </ul>
84
+        </div>
85
+      </div>
66 86
     </div>
67 87
   </div>
68 88
 </template>
69 89
 
70 90
 <script>
71
-import newsItem from '../../../../components/newsItem/index'
72 91
 import { swiper, swiperSlide } from 'vue-awesome-swiper'
73 92
 import 'swiper/dist/css/swiper.css'
74 93
 import { mapState, createNamespacedHelpers } from 'vuex'
75
-const { mapActions: mapIndexActions } = createNamespacedHelpers('index')
76
-const { mapState: mapUserState } = createNamespacedHelpers('userCenter')
94
+const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('index')
77 95
 export default {
78 96
   name: '',
79 97
   data () {
80 98
     return {
81
-      data: {
82
-        fiveA: []
83
-      },
84
-      locationId: '',
85 99
       swiperOption: {
86 100
         observer: true,
87 101
         loop: true,
88
-        speed: 1000,
102
+        speed: 400,
89 103
         autoplay: {
90 104
           disableOnInteraction: false,
91 105
         }
92 106
       },
93
-      swiperOptionMsg: {
107
+      swiperHOption: {
94 108
         observer: true,
95
-        observeParents:true,
96
-        // slidesPerView: 3,
97
-        direction: 'vertical',
98
-        speed: 1000,
99
-        // loop: true,
100
-        autoplay: {
101
-          disableOnInteraction: false,
102
-        }
109
+        freeMode: true,
110
+        slidesPerView: 'auto',
103 111
       },
104 112
       newsList: []
105 113
     }
106 114
   },
107 115
   computed: {
108
-    ...mapUserState({
109
-      userInfo: x => x.userInfo
110
-    }),
111 116
     ...mapState({
112 117
       orgid: x => x.app.orgId,
113 118
       fiveA: x => x.index.fiveA,
@@ -116,23 +121,25 @@ export default {
116 121
       project: x => x.index.project,
117 122
       cms: x => x.index.cms,
118 123
     }),
124
+    ...mapIndexState({
125
+      courseList: x => x.courseList
126
+    }),
119 127
     MySwiper () {
120 128
       return this.$refs.mySwiper.swiper
121 129
     },
122
-    MySwiperMsg () {
123
-      return this.$refs.MySwiperMsg.swiper
130
+    MySwiperH () {
131
+      return this.$refs.mySwiperH.swiper
124 132
     }
125 133
   },
126 134
   components: {
127
-    newsItem,
128 135
     swiper,
129
-    swiperSlide,
136
+    swiperSlide
130 137
   },
131 138
   created () {
132 139
     this.getIndexLocation({ orgid: this.orgid, issys: '0' }).then((res) => {
133
-      this.data.fiveA = this.fiveA
140
+      // this.data.fiveA = this.fiveA
134 141
       this.locationId = 'index'
135
-      this.getIndexInfo({ orgid: this.orgid, locationid: this.locationId }).then(() => {
142
+      this.getIndexInfo({ orgid: this.orgid, locationid: this.locationId }).then((res) => {
136 143
         this.newsList = this.cms
137 144
         if (this.project !== undefined && this.project !== null) {
138 145
           for (let i = 0; i < this.project.length; i++) {
@@ -146,18 +153,21 @@ export default {
146 153
           }
147 154
         }
148 155
       })
156
+      this.getCourseList({
157
+        pagesize: 5,
158
+        page: 1
159
+      })
149 160
     })
150 161
   },
151 162
   methods: {
152
-    ...mapIndexActions(['getIndexInfo']),
153
-    ...mapIndexActions(['getIndexLocation']),
163
+    ...mapIndexActions(['getIndexLocation', 'getIndexInfo', 'getCourseList']),
154 164
     jump (item) {
155 165
       item.ForwardType = item.ForwardType || ''
156 166
       if (item.ForwardType === 'url') {
157 167
         window.location.href = item.ForwardUrl
158 168
         return
159 169
       } else if (item.ForwardType === 'course') {
160
-        if (item.ForwardResourceId){
170
+        if (item.ForwardResourceId) {
161 171
           this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardResourceId } }) // 此处去课程详情
162 172
           return
163 173
         } else {

+ 198
- 142
src/pages/user/mainPage/indexPage/page.scss 查看文件

@@ -4,180 +4,236 @@
4 4
   transform: translateZ(0);
5 5
   -webkit-transform: translateZ(0);
6 6
   background: #fff;
7
-  &>*:last-child{
8
-    margin-bottom: .2rem;
9
-  }
10
-  .topBanner{
7
+  .banner{
11 8
     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 9
     position: relative;
28 10
     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;
11
+    margin: .15rem auto 0;
12
+    >div{
13
+      margin: 0 .15rem;
45 14
       position: relative;
46 15
       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%;
16
+      >div{
17
+        width: 100%;
74 18
         position: relative;
75 19
         overflow: hidden;
20
+        border-radius: .1rem;
21
+        height: 0;
22
+        padding-bottom: 55%;
76 23
         background: #eee;
77
-        margin: 0 auto;
78
-        border-radius: 100%;
79
-        img{
80
-          z-index: 1;
81
-        }
82
-        em{
24
+        >div{
83 25
           width: 100%;
84
-          display: block;
85 26
           position: absolute;
86 27
           left: 0;
28
+          top: 0;
87 29
           bottom: 0;
88
-          line-height: .3rem;
89
-          font-size: .11rem;
90
-          text-align: center;
91
-          color: #fff;
92
-          z-index: 2;
30
+          overflow: hidden;
31
+          >div{
32
+            width: 100%;
33
+            height: 100%;
34
+          }
93 35
         }
94 36
       }
95
-      span{
96
-        width: 70%;
97
-        display: block;
98
-        margin: .1rem auto 0;
99
-        line-height: .16rem;
100
-        font-size: .1rem;
101
-        text-align: center;
102
-        color: #666;
103
-      }
104 37
     }
105 38
   }
106
-  .MsgBanner{
107
-    width: 100%;
108
-    height: .44rem;
109
-    position: relative;
110
-    overflow: hidden;
111
-    background: #f8f8f8;
112
-    margin: .25rem auto 0;
113
-    &>div{
39
+  .subNav{
40
+    margin: .3rem auto 0;
41
+    ul{
114 42
       width: 100%;
115
-      position: absolute;
116
-      left: 0;
117
-      top: 0;
118
-      bottom: 0;
119
-      align-items: center;
120
-      &>i,
121
-      &>span{
122
-        color: #f05a3f;
123
-        font-size: .12rem;
124
-        margin-left: .08rem;
43
+      li{
44
+        text-align: center;
45
+        font-size: 0;
46
+        img{
47
+          display: inline-block;
48
+          height: .25rem;
49
+        }
50
+        span{
51
+          width: 100%;
52
+          display: inline-block;
53
+          text-align: center;
54
+          font-size: .14rem;
55
+          line-height: .22rem;
56
+        }
125 57
       }
126
-      &>i{
127
-        font-size: .16rem;
128
-        margin-left: .3rem;
58
+    }
59
+  }
60
+  .areaHeader{
61
+    margin: .35rem auto 0;
62
+    align-items: center;
63
+    >h1{
64
+      line-height: .28rem;
65
+      margin-left: .15rem;
66
+      font-size: .17rem;
67
+    }
68
+    >a{
69
+      font-size: .12rem;
70
+      color: #f83c00;
71
+      margin-right: .15rem;
72
+    }
73
+  }
74
+  .areaContent{
75
+    margin: .2rem auto 0;
76
+    .find{
77
+      >div{
78
+        width: 100%;
79
+        position: relative;
80
+        .swiper-container{
81
+          width: 100%;
82
+          position: relative;
83
+          .swiper-slide{
84
+            width: 1.15rem;
85
+            height: .9rem;
86
+            background: #eee;
87
+            position: relative;
88
+            overflow: hidden;
89
+            border-radius: .1rem;
90
+            margin-right: .15rem;
91
+            &:first-child{
92
+              margin-left: .15rem;
93
+            }
94
+            img{
95
+              display: inline-block;
96
+              position: relative;
97
+              z-index: 1;
98
+            }
99
+            span{
100
+              display: inline-block;
101
+              position: absolute;
102
+              z-index: 2;
103
+              width: 100%;
104
+              left: 0;
105
+              bottom: .1rem;
106
+              color: #fff;
107
+              font-size: .11rem;
108
+              i{
109
+                font-size: .12rem;
110
+                color: #fff;
111
+                margin-left: .1rem;
112
+              }
113
+            }
114
+          }
115
+        }
129 116
       }
130
-      &>div{
131
-        margin-left: .1rem;
132
-        height: 100%;
133
-        margin-right: .2rem;
134
-        &>div{
117
+    }
118
+    .course{
119
+      >div{
120
+        width: 100%;
121
+        position: relative;
122
+        .swiper-container{
135 123
           width: 100%;
136
-          height: 100%;
137 124
           position: relative;
138
-          overflow: hidden;
139
-          &>div{
140
-            width: 100%;
141
-            height: 100%;
142
-            a{
125
+          .swiper-slide{
126
+            width: 1.15rem;
127
+            position: relative;
128
+            overflow: visible;
129
+            margin-right: .25rem;
130
+            &:first-child{
131
+              margin-left: .15rem;
132
+            }
133
+            .img{
143 134
               width: 100%;
144
-              display: inline-block;
135
+              padding-bottom: 100%;
136
+              background: #eee;
137
+              border-radius: .1rem;
138
+              position: relative;
145 139
               overflow: hidden;
146
-              white-space: nowrap;
147
-              text-overflow: ellipsis;
148
-              line-height: .44rem;
149
-              color: #f05a3f;
140
+              img{
141
+                z-index: 1;
142
+              }
150 143
               span{
151
-                color: #f05a3f;
144
+                width: 100%;
145
+                left: 0;
146
+                top: 0;
147
+                font-size: .13rem;
148
+                font-weight: bolder;
149
+                top: .1rem;
150
+                text-indent: .1rem;
151
+                display: inline-block;
152
+                z-index: 2;
153
+                position: absolute;
154
+                color: #fff;
152 155
               }
153 156
             }
157
+            .price{
158
+              position: relative;
159
+              overflow: visible;
160
+              text-align: right;
161
+              height: 0;
162
+              span{
163
+                display: inline-block;
164
+                position: relative;
165
+                z-index: 2;
166
+                line-height: .24rem;
167
+                color: #fff;
168
+                padding: 0 .1rem;
169
+                background: #ec1d24;
170
+                border-radius: .24rem;
171
+                font-size: .11rem;
172
+                transform: translate(.1rem, -.35rem);
173
+                -webkit-transform: translate(.1rem, -.35rem);
174
+                box-shadow: 0 0 .1rem .01rem rgba(236, 29, 36, .15);
175
+              }
176
+              +span{
177
+                line-height: .18rem;
178
+                font-size: .1rem;
179
+                margin: .1rem auto 0;
180
+                +span{
181
+                  line-height: .2rem;
182
+                  font-size: .13rem;
183
+                }
184
+              }
185
+            }
186
+            >span{
187
+              width: 100%;
188
+              display: block;
189
+              overflow: hidden;
190
+              text-overflow: ellipsis;
191
+            }
154 192
           }
155 193
         }
156 194
       }
157 195
     }
158 196
   }
159
-  .projectList{
160
-    margin: .1rem .1rem 0;
161
-    li{
162
-      width: 100%;
163
-      position: relative;
164
-      height: 0;
165
-      padding-bottom: 30%;
166
-      background: #eee;
167
-      overflow: hidden;
168
-      margin: .08rem auto 0;
169
-    }
170
-  }
171 197
   .newsList{
172
-    margin: .15rem .2rem .2rem;
173
-    &>li{
174
-      width: 100%;
175
-      display: block;
176
-      position: relative;
177
-      overflow: hidden;
178
-      border-top: .01rem solid #eee;
179
-      &:first-child{
180
-        border-top:none
198
+    >div{
199
+      margin: 0 .15rem .2rem;
200
+      >div{
201
+        width: 100%;
202
+        position: relative;
203
+        overflow: hidden;
204
+        ul{
205
+          li{
206
+            margin: .2rem auto 0;
207
+            align-items: center;
208
+            &:first-child{
209
+              margin: 0 auto;
210
+            }
211
+            .img{
212
+              width: 1.25rem;
213
+              height: .8rem;
214
+              border-radius: .1rem;
215
+              background: #eee;
216
+              position: relative;
217
+              overflow: hidden;
218
+            }
219
+            >div{
220
+              margin-left: .15rem;
221
+              span{
222
+                width: 100%;
223
+                display: block;
224
+                line-height: .24rem;
225
+                &:first-child{
226
+                  font-size: .14rem;
227
+                  font-weight: bold;
228
+                }
229
+                &:nth-child(2){
230
+                  font-size: .12rem;
231
+                  color: #9d9d9d;
232
+                }
233
+              }
234
+            }
235
+          }
236
+        }
181 237
       }
182 238
     }
183 239
   }

+ 7
- 0
src/pages/user/mainPage/userCenter/index.vue 查看文件

@@ -57,6 +57,10 @@
57 57
           <span>抽奖记录</span>
58 58
           <i class="iconfont icon-jiantou-right"></i>
59 59
         </div>
60
+        <div class="menu-item flex-h" @click="toActivity">
61
+          <span>活动记录</span>
62
+          <i class="iconfont icon-jiantou-right"></i>
63
+        </div>
60 64
       </div>
61 65
     </div>
62 66
   </div>
@@ -96,6 +100,9 @@ export default {
96 100
   },
97 101
   methods: {
98 102
     ...actions(['getUserInfo', 'getNum']),
103
+    toActivity () {
104
+      this.$router.push({ name: 'activityList' })
105
+    },
99 106
     toLessonOrder () {
100 107
       this.$router.push({ name: 'lessonOrder' })
101 108
     },

+ 59
- 0
src/pages/user/majorProjectsList/index.vue 查看文件

@@ -0,0 +1,59 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="flex-h">
4
+      <div class="flex-item">
5
+        <div>
6
+          <ul>
7
+            <router-link v-for="(item, index) in project" :key="index" class="flex-h" tag="li" :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }">
8
+              <a class="img">
9
+                <img :src="item.CmsCaseImgs[0].CaseImageUrl" class="cover" alt>
10
+              </a>
11
+              <router-link tag="div" class="flex-item" :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }">
12
+                <div>
13
+                  <span>{{item.Name}}</span>
14
+                  <span>{{item.CaseAddress}}</span>
15
+                </div>
16
+              </router-link>
17
+            </router-link>
18
+          </ul>
19
+        </div>
20
+      </div>
21
+    </div>
22
+  </div>
23
+</template>
24
+
25
+<script>
26
+import { mapState, createNamespacedHelpers } from 'vuex'
27
+const { mapActions: mapIndexActions } = createNamespacedHelpers('index')
28
+
29
+export default {
30
+  name: '',
31
+  data () {
32
+    return {
33
+    }
34
+  },
35
+  computed: {
36
+    ...mapState({
37
+      orgid: x => x.app.orgId,
38
+      project: x => x.index.project
39
+    })
40
+  },
41
+  components: {
42
+  },
43
+  created () {
44
+    this.getProjectList({
45
+      orgid: this.orgid
46
+    }).then(() => {
47
+      console.log(this.project)
48
+    })
49
+  },
50
+  methods: {
51
+    ...mapIndexActions(['getProjectList'])
52
+  }
53
+}
54
+</script>
55
+
56
+<!-- Add "scoped" attribute to limit CSS to this component only -->
57
+<style lang="scss" scoped>
58
+@import 'page.scss';
59
+</style>

+ 55
- 0
src/pages/user/majorProjectsList/page.scss 查看文件

@@ -0,0 +1,55 @@
1
+.mainPage{
2
+  background: #fff;
3
+  overflow-y: scroll;
4
+  -webkit-overflow-scrolling: touch;
5
+  transform: translateZ(0);
6
+  -webkit-transform: translateZ(0);
7
+  >div{
8
+    >div{
9
+      margin: 0 .15rem;
10
+      >div{
11
+        width: 100%;
12
+        position: relative;
13
+        overflow: hidden;
14
+        >ul{
15
+          margin: .15rem auto;
16
+          >li{
17
+            width: 100%;
18
+            position: relative;
19
+            overflow: hidden;
20
+            align-items: center;
21
+            padding: .03rem 0;
22
+            border-bottom: 1px solid #ededed;
23
+            img{
24
+              width: 1.15rem;
25
+              height: .9rem;
26
+              position: relative;
27
+              overflow: hidden;
28
+              border-radius: .05rem;
29
+            }
30
+            >div{
31
+              margin-left: .15rem;
32
+              >div{
33
+                width: 100%;
34
+                position: relative;
35
+                overflow: hidden;
36
+                >span{
37
+                  width: 100%;
38
+                  display: block;
39
+                  line-height: .2rem;
40
+                  font-size: .14rem;
41
+                  font-weight: bolder;
42
+                  &:nth-child(2){
43
+                    font-size: .12rem;
44
+                    color: #999;
45
+                    font-weight: normal;
46
+                  }
47
+                }
48
+              }
49
+            }
50
+          }
51
+        }
52
+      }
53
+    }
54
+  }
55
+}

+ 12
- 0
src/pages/user/router.js 查看文件

@@ -5,6 +5,7 @@ import mainPage from './mainPage/index' // 主页
5 5
 import indexPage from './mainPage/indexPage/index' // 首页
6 6
 import fiveA from './fiveA/index' // 5A
7 7
 import majorProjects from './majorProjects/index' // 项目专题
8
+import majorProjectsList from './majorProjectsList/index' // 项目专题列表
8 9
 import majorProjectsDetail from './majorProjectsDetail/index' // 项目专题详情
9 10
 import placeOrderForCourse from './placeOrderForCourse/index' // 购买课程下单
10 11
 import coffeeIndex from './mainPage/coffeeIndex/index' // 城咖啡
@@ -18,6 +19,7 @@ import vip from './vip/index' // vip卡说明
18 19
 import vipDetail from './vipDetail/index' // vip卡说明
19 20
 import card from './card/index' // 卡
20 21
 import coupons from './coupons/index' // 优惠券
22
+import courseList from './courseList/index' // 课程列表
21 23
 import lessonDetail from './lessonDetail/index' // 课程详情
22 24
 import cardDetail from './cardDetail/index' // 体验卡详情
23 25
 import gymCardDetail from './gymCardDetail/index' // 健身卡详情
@@ -70,6 +72,16 @@ const router = new Router({
70 72
     name: 'majorProjects',
71 73
     component: majorProjects,
72 74
     children: []
75
+  }, { // 课程列表
76
+    path: '/courseList',
77
+    name: 'courseList',
78
+    component: courseList,
79
+    children: []
80
+  }, { // 项目专题列表
81
+    path: '/majorProjectsList',
82
+    name: 'majorProjectsList',
83
+    component: majorProjectsList,
84
+    children: []
73 85
   }, { // 项目专题详情
74 86
     path: '/majorProjectsDetail',
75 87
     name: 'majorProjectsDetail',

+ 36
- 3
src/store/index/index.js 查看文件

@@ -90,7 +90,8 @@ export default {
90 90
     fiveA: [],
91 91
     message: [],
92 92
     project: [],
93
-    cms: []
93
+    cms: [],
94
+    courseList: []
94 95
   },
95 96
   mutations: {
96 97
     setBanner (state, data) { // 获取首页轮播图
@@ -104,7 +105,7 @@ export default {
104 105
     setMessage (state, data) { // 获取首页消息
105 106
       data = data || []
106 107
       if (data.length > 3) {
107
-        state.message = data.slice(0,3)
108
+        state.message = data.slice(0, 3)
108 109
       } else {
109 110
         state.message = data
110 111
       }
@@ -116,9 +117,25 @@ export default {
116 117
     setCms (state, data) { // 获取cms
117 118
       data = data || []
118 119
       state.cms = data
119
-    }
120
+    },
121
+    updateCourseList (state, data) { // 更新附近课程
122
+      state.courseList = data.list || []
123
+    },
120 124
   },
121 125
   actions: {
126
+    getCourseList (context, payload) { // 获取附近课程
127
+      return new Promise((resolve, reject) => {
128
+        Ajax(api.index.getCourseList.url, {
129
+          method: api.index.getCourseList.method,
130
+          queryData: { ...payload }
131
+        }).then(res => {
132
+          context.commit('updateCourseList', res)
133
+          resolve(res)
134
+        }).catch((err) => {
135
+          reject(err)
136
+        })
137
+      })
138
+    },
122 139
     getIndexLocation (context, data) {
123 140
       return new Promise((resolve) => {
124 141
         http.getIndexLocation(data).then((res) => {
@@ -127,6 +144,22 @@ export default {
127 144
         })
128 145
       })
129 146
     },
147
+    getProjectList (context, data) {
148
+      return new Promise((resolve, reject) => {
149
+        Ajax(api.index.project.url, {
150
+          method: api.index.project.method,
151
+          queryData: {
152
+            locationid: data.locationid,
153
+            orgid: data.orgid
154
+          }
155
+        }).then(res => {
156
+          context.commit('setProject', res)
157
+          resolve(res)
158
+        }).catch((err) => {
159
+          reject(err)
160
+        })
161
+      })
162
+    },
130 163
     async getIndexInfo (context, param) { // 首页全部请求
131 164
       try {
132 165
         let banner = await http.getBanner(param)

+ 4
- 0
src/util/api.js 查看文件

@@ -33,6 +33,10 @@ const $api = {
33 33
       method: 'get',
34 34
       url: `${baseUrl}${guest}/cms/location/detail`
35 35
     },
36
+    getCourseList: { // 获取附近课程
37
+      method: 'get',
38
+      url: `${baseUrl}${guest}/course`
39
+    }
36 40
   },
37 41
   caseForCoffee: {
38 42
     getCaseTableList: { // 获取案场桌位列表

+ 3
- 3
vue.config.js 查看文件

@@ -23,8 +23,8 @@ module.exports = {
23 23
     proxy: {
24 24
       '/api': {
25 25
         // target: 'https://dp.huiju360.com.cn/hj_operations',
26
-        target: 'http://192.168.0.62:8080', // wf
27
-        // target: 'http://192.168.0.125:8080', // hyq
26
+        // target: 'http://192.168.0.62:8080', // wf
27
+        target: 'http://192.168.0.102:8080', // hyq
28 28
         // target: 'http://192.168.0.11', // ys
29 29
         // target: 'http://dev.ycjcjy.com', // frp
30 30
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
@@ -34,7 +34,7 @@ module.exports = {
34 34
       },
35 35
     },
36 36
     // compress: true,
37
-    devtool: 'source-map',
37
+    // devtool: 'source-map',
38 38
     disableHostCheck: true,   // That solved it
39 39
   }
40 40
 }