yuantianjiao пре 6 година
родитељ
комит
c91d8a2a88

+ 1
- 1
public/index.html Прегледај датотеку

6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
7
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
8
     charset="utf-8" />
8
     charset="utf-8" />
9
-  <link rel="stylesheet" href="//at.alicdn.com/t/font_681879_zlsjvjaiir.css">
9
+  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_clu263vfyod.css">
10
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
10
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
11
   <title>
11
   <title>
12
     <%= htmlWebpackPlugin.options.title %>
12
     <%= htmlWebpackPlugin.options.title %>

+ 9
- 9
src/pages/user/App.vue Прегледај датотеку

12
   name: 'app',
12
   name: 'app',
13
   data () {
13
   data () {
14
     return {
14
     return {
15
-      showPage: true
15
+      showPage: false
16
     }
16
     }
17
   },
17
   },
18
   components: {},
18
   components: {},
23
     })
23
     })
24
   },
24
   },
25
   created () {
25
   created () {
26
-    // if (location.search && this.toolClass.UrlSearch(location.search).code) {
27
-    //   this.code = this.toolClass.UrlSearch(location.search).code
28
-    // } else {
29
-    //   this.code = null
30
-    // }
31
-    // this.getUserInfo({ org: this.org, code: this.code }).then(() => {
32
-    //   this.showPage = true
33
-    // })
26
+    if (location.search && this.toolClass.UrlSearch(location.search).code) {
27
+      this.code = this.toolClass.UrlSearch(location.search).code
28
+    } else {
29
+      this.code = null
30
+    }
31
+    this.getUserInfo({ org: this.org, code: this.code }).then(() => {
32
+      this.showPage = true
33
+    })
34
   },
34
   },
35
   methods: {
35
   methods: {
36
     ...actions(['getUserInfo'])
36
     ...actions(['getUserInfo'])

+ 13
- 3
src/pages/user/bindMobile/bindMobile.vue Прегледај датотеку

20
             <span>{{salesName}}</span>
20
             <span>{{salesName}}</span>
21
             <i class="iconfont icon-triangle-bottom"></i>
21
             <i class="iconfont icon-triangle-bottom"></i>
22
           </div>
22
           </div>
23
-        </div> -->
24
-
23
+        </div>-->
25
         <div class="mobile">
24
         <div class="mobile">
26
           <i class="iconfont icon-zhanghu"></i>
25
           <i class="iconfont icon-zhanghu"></i>
26
+          <input type="tel" placeholder="真实姓名" v-model="postData.name">
27
+        </div>
28
+
29
+        <div class="mobile">
30
+          <i class="iconfont icon-mima"></i>
27
           <input type="tel" placeholder="推荐码 (非必填)" v-model="postData.recommendCode">
31
           <input type="tel" placeholder="推荐码 (非必填)" v-model="postData.recommendCode">
28
         </div>
32
         </div>
29
 
33
 
61
             @confirm="onConfirmS"
65
             @confirm="onConfirmS"
62
           />
66
           />
63
         </div>
67
         </div>
64
-      </transition> -->
68
+      </transition>-->
65
     </div>
69
     </div>
66
   </div>
70
   </div>
67
 </template>
71
 </template>
83
       seconds: 61,
87
       seconds: 61,
84
       postData: {
88
       postData: {
85
         phone: '',
89
         phone: '',
90
+        name: '',
86
         // case: '',
91
         // case: '',
87
         // sales: '',
92
         // sales: '',
88
         recommendCode: '',
93
         recommendCode: '',
196
         this.canSubmit = true
201
         this.canSubmit = true
197
         return
202
         return
198
       }
203
       }
204
+      if (!this.postData.name) {
205
+        this.$toast('请填真实姓名')
206
+        this.canSubmit = true
207
+        return
208
+      }
199
       if (this.postData.recommendCode) {
209
       if (this.postData.recommendCode) {
200
         this.recommendCode({ recommendCode: this.postData.recommendCode }).then((res) => {
210
         this.recommendCode({ recommendCode: this.postData.recommendCode }).then((res) => {
201
           if (res) {
211
           if (res) {

+ 1
- 1
src/pages/user/bindMobile/page.scss Прегледај датотеку

27
     }
27
     }
28
     .box{
28
     .box{
29
       width: 3.25rem;
29
       width: 3.25rem;
30
-      height: 3.5rem;
31
       background:rgba(255,255,255,1);
30
       background:rgba(255,255,255,1);
32
       border-radius:8px;
31
       border-radius:8px;
33
       padding: .2rem;
32
       padding: .2rem;
34
       box-sizing: border-box;
33
       box-sizing: border-box;
34
+      margin-top: .5rem;
35
       .title{
35
       .title{
36
         font-size: .16rem;
36
         font-size: .16rem;
37
         font-weight: bold;
37
         font-weight: bold;

+ 37
- 15
src/pages/user/calendar/calendar.vue Прегледај датотеку

26
 </template>
26
 </template>
27
 
27
 
28
 <script>
28
 <script>
29
-import { createNamespacedHelpers } from 'vuex'
29
+import { mapState, createNamespacedHelpers } from 'vuex'
30
 const { mapActions: mapMakingActions } = createNamespacedHelpers('making')
30
 const { mapActions: mapMakingActions } = createNamespacedHelpers('making')
31
+const { mapActions: actions } = createNamespacedHelpers('userCenter')
31
 import topImg from '@/common/icon/topImg.png'
32
 import topImg from '@/common/icon/topImg.png'
32
 export default {
33
 export default {
33
   data () {
34
   data () {
37
     }
38
     }
38
   },
39
   },
39
   created () {
40
   created () {
40
-    this.getCalendarCustomer().then((res) => {
41
-      if (res) {
42
-        this.state = 2
43
-      } else {
44
-        let stringTime = "2018-12-22 00:00:00"
45
-        let timestamp = Date.parse(new Date(stringTime))
46
-        let now = new Date().getTime()
47
-        if (timestamp >= now) {
48
-          this.state = 1
41
+    this.getUserInfo({ org: this.org }).then(() => {
42
+      this.getCalendarCustomer().then((res) => {
43
+        if (res) {
44
+          this.state = 2
49
         } else {
45
         } else {
50
-          this.state = 3
46
+          let stringTime = "2018-12-22 00:00:00"
47
+          let timestamp = Date.parse(new Date(stringTime))
48
+          let now = new Date().getTime()
49
+          if (timestamp >= now) {
50
+            this.state = 1
51
+          } else {
52
+            this.state = 3
53
+          }
51
         }
54
         }
52
-      }
55
+      })
56
+    })
57
+  },
58
+  computed: {
59
+    ...mapState({
60
+      org: x => x.app.orgId,
61
+      userInfo: x => x.userCenter.userInfo
53
     })
62
     })
54
   },
63
   },
55
   methods: {
64
   methods: {
65
+    ...actions(['getUserInfo']),
56
     ...mapMakingActions(['getCalendarCustomer']),
66
     ...mapMakingActions(['getCalendarCustomer']),
57
     toCheckModel () {
67
     toCheckModel () {
58
-      this.$router.push({ name: 'checkModel' })
68
+      if (!this.userInfo.customer.Phone) {
69
+        this.$dialog.confirm({
70
+          title: '标题',
71
+          message: '您还不是注册会员,注册成功后即可参与此活动'
72
+        }).then(() => {
73
+          // on confirm
74
+          this.$router.push({ name: 'bindMobile' })
75
+        }).catch(() => {
76
+          // on cancel
77
+        });
78
+      } else {
79
+        this.$router.push({ name: 'checkModel' })
80
+      }
59
     }
81
     }
60
   }
82
   }
61
 }
83
 }
88
     padding-bottom: 0.05rem;
110
     padding-bottom: 0.05rem;
89
     font-weight: bold;
111
     font-weight: bold;
90
   }
112
   }
91
-  div{
92
-    padding-bottom: .08rem;
113
+  div {
114
+    padding-bottom: 0.08rem;
93
   }
115
   }
94
 }
116
 }
95
 .btn {
117
 .btn {

+ 19
- 4
src/pages/user/calendar/making.vue Прегледај датотеку

56
       <div class="swiper-pagination" v-show="mainIndex !== 1"></div>
56
       <div class="swiper-pagination" v-show="mainIndex !== 1"></div>
57
       <div class="swiper-cover" v-show="mainIndex === 1">封面</div>
57
       <div class="swiper-cover" v-show="mainIndex === 1">封面</div>
58
     </div>
58
     </div>
59
+    <div class="meassage" v-if="mainIndex !== 1">备注:为了美观效果请上传{{size}}尺寸照片,未按尺寸会默认裁剪</div>
60
+    <div class="meassage" v-else>&nbsp;</div>
59
     <div class="operation">
61
     <div class="operation">
60
       <div>
62
       <div>
61
         <van-uploader :after-read="onRead" v-show="mainIndex !== 1">
63
         <van-uploader :after-read="onRead" v-show="mainIndex !== 1">
149
     ...mapMakingState({
151
     ...mapMakingState({
150
       bannerBlack: item => item.bannerBlack,
152
       bannerBlack: item => item.bannerBlack,
151
       bannerRed: item => item.bannerRed
153
       bannerRed: item => item.bannerRed
152
-    })
154
+    }),
155
+    size () {
156
+      if (this.mainIndex === 1 || this.mainIndex === 3 || this.mainIndex === 7 || this.mainIndex === 10) {
157
+        return '横'
158
+      } else {
159
+        return '竖'
160
+      }
161
+    }
153
   },
162
   },
154
   created () {
163
   created () {
155
     if (this.$route.query.type == 1) {
164
     if (this.$route.query.type == 1) {
216
       }
225
       }
217
       this.calendar({ Calendar: JSON.stringify(submitData) }).then(() => {
226
       this.calendar({ Calendar: JSON.stringify(submitData) }).then(() => {
218
         this.$toast('日历已生成')
227
         this.$toast('日历已生成')
219
-        this.$router.push({ name: 'customizationList' })
228
+        this.$router.replace({ name: 'userCenter' })
220
       })
229
       })
221
     },
230
     },
222
     pre () {
231
     pre () {
328
     color: #fff;
337
     color: #fff;
329
   }
338
   }
330
 }
339
 }
340
+.meassage {
341
+  color: red;
342
+  padding: 0.1rem;
343
+  text-align: center;
344
+  font-size: 0.12rem;
345
+}
331
 .pop-box {
346
 .pop-box {
332
   width: 100%;
347
   width: 100%;
333
   height: 100%;
348
   height: 100%;
487
   display: flex;
502
   display: flex;
488
   justify-content: center;
503
   justify-content: center;
489
   align-items: center;
504
   align-items: center;
490
-  padding: 0.5rem 0.2rem;
505
+  padding: 0.2rem 0.2rem 0.3rem;
491
   > div {
506
   > div {
492
     flex: 1;
507
     flex: 1;
493
     text-align: center;
508
     text-align: center;
513
   }
528
   }
514
 }
529
 }
515
 .btn {
530
 .btn {
516
-  margin-top: 0.3rem;
531
+  margin-top: 0.1rem;
517
   width: 100%;
532
   width: 100%;
518
   box-sizing: border-box;
533
   box-sizing: border-box;
519
   display: flex;
534
   display: flex;

+ 10
- 1
src/pages/user/customization/customizationList.vue Прегледај датотеку

43
     toDetail (id) {
43
     toDetail (id) {
44
       this.$router.push({ name: 'customizationDetail', query: { id: id } })
44
       this.$router.push({ name: 'customizationDetail', query: { id: id } })
45
     }
45
     }
46
-  }
46
+  },
47
+  // beforeRouteLeave (to, from, next) {
48
+  //   console.log(to)
49
+  //   console.log(from)
50
+  //   if (to.name === 'making') {
51
+  //     next({ name: 'activeList' })
52
+  //   } else {
53
+  //     next()
54
+  //   }
55
+  // }
47
 }
56
 }
48
 </script>
57
 </script>
49
 
58
 

+ 34
- 7
src/pages/user/fiveA/index.vue Прегледај датотеку

1
 <template>
1
 <template>
2
   <div class="mainPage flex-v">
2
   <div class="mainPage flex-v">
3
     <nav class="flex-h">
3
     <nav class="flex-h">
4
-      <a class="flex-item" v-for="(item,index) in locations" :key="index" :class="{'active':index==active.index}" @click="changeLocation(item,index)">{{item.LocationName}}</a>
4
+      <a
5
+        class="flex-item"
6
+        v-for="(item,index) in locations"
7
+        :key="index"
8
+        :class="{'active':index==active.index}"
9
+        @click="changeLocation(item,index)"
10
+      >{{item.LocationName}}</a>
5
     </nav>
11
     </nav>
6
     <div class="flex-item">
12
     <div class="flex-item">
7
       <div>
13
       <div>
9
           <div class="banner flex-h">
15
           <div class="banner flex-h">
10
             <div class="flex-item">
16
             <div class="flex-item">
11
               <swiper :options="swiperOption" ref="mySwiper">
17
               <swiper :options="swiperOption" ref="mySwiper">
12
-                <swiper-slide class="swiper-slide" v-for="(banner,bindex) in item.Banners" :key="bindex">
13
-                  <img :src='banner.ImageUrl' class="cover" style="border-radius: .12rem;" alt=""  @click="jump(banner)">
18
+                <swiper-slide
19
+                  class="swiper-slide"
20
+                  v-for="(banner,bindex) in item.Banners"
21
+                  :key="bindex"
22
+                >
23
+                  <img
24
+                    :src="banner.ImageUrl"
25
+                    class="cover"
26
+                    style="border-radius: .12rem;"
27
+                    alt
28
+                    @click="jump(banner)"
29
+                  >
14
                 </swiper-slide>
30
                 </swiper-slide>
15
               </swiper>
31
               </swiper>
16
             </div>
32
             </div>
18
           <h5>{{item.Title}}</h5>
34
           <h5>{{item.Title}}</h5>
19
           <div class="courseList flex-h">
35
           <div class="courseList flex-h">
20
             <ul class="flex-item" v-if="!fiveANoData">
36
             <ul class="flex-item" v-if="!fiveANoData">
21
-              <router-link tag="li" v-for="(course,cindex) in item.Courses" :key="cindex" :to="{name:'majorProjectsDetail',query:{id: course.CourseId}}">
37
+              <router-link
38
+                tag="li"
39
+                v-for="(course,cindex) in item.Courses"
40
+                :key="cindex"
41
+                :to="{name:'majorProjectsDetail',query:{id: course.CourseId}}"
42
+              >
22
                 <courseItem :data="courseInfo(course)"></courseItem>
43
                 <courseItem :data="courseInfo(course)"></courseItem>
23
               </router-link>
44
               </router-link>
24
             </ul>
45
             </ul>
28
           <h5>{{item.Consult || '资讯'}}</h5>
49
           <h5>{{item.Consult || '资讯'}}</h5>
29
           <div class="newsList flex-h">
50
           <div class="newsList flex-h">
30
             <ul class="flex-item">
51
             <ul class="flex-item">
31
-              <li tag="li" @click="jump(newinfo)" v-for="(newinfo,nindex) in item.News" v-if="nindex < 5" :key="nindex">
52
+              <li
53
+                tag="li"
54
+                @click="jump(newinfo)"
55
+                v-for="(newinfo,nindex) in item.News"
56
+                v-if="nindex < 5"
57
+                :key="nindex"
58
+              >
32
                 <newsItem :data="newinfo"></newsItem>
59
                 <newsItem :data="newinfo"></newsItem>
33
               </li>
60
               </li>
34
             </ul>
61
             </ul>
107
         id: course.CourseId,
134
         id: course.CourseId,
108
         title: course.CourseName,
135
         title: course.CourseName,
109
         img: course.CourseImg,
136
         img: course.CourseImg,
110
-        remark: course.Remark,
137
+        remark: `${this.toolClass.dateFormat(course.BeginDate, 'yyyy-MM-dd')} ~ ${this.toolClass.dateFormat(course.EndDate, 'yyyy-MM-dd')}`,
111
         address: course.CaseAddress,
138
         address: course.CaseAddress,
112
         tag: course.CourseTags || [],
139
         tag: course.CourseTags || [],
113
         courseType: '',
140
         courseType: '',
126
       if (item.ForwardType === 'url') {
153
       if (item.ForwardType === 'url') {
127
         window.location.href = item.ForwardUrl
154
         window.location.href = item.ForwardUrl
128
       } else if (item.ForwardType === 'course') {
155
       } else if (item.ForwardType === 'course') {
129
-        if (item.ForwardResourceId){
156
+        if (item.ForwardResourceId) {
130
           this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardResourceId } }) // 此处去课程详情
157
           this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardResourceId } }) // 此处去课程详情
131
         } else {
158
         } else {
132
           this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardCourseId } }) // 此处去课程详情
159
           this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardCourseId } }) // 此处去课程详情

+ 70
- 30
src/pages/user/mainPage/indexPage/index.vue Прегледај датотеку

1
 <template>
1
 <template>
2
-  <div class="mainPage">
2
+  <div class="mainPage" v-if="showPage">
3
     <div class="banner flex-h">
3
     <div class="banner flex-h">
4
       <div class="flex-item">
4
       <div class="flex-item">
5
         <div>
5
         <div>
6
           <div>
6
           <div>
7
             <swiper :options="swiperOption" ref="mySwiper">
7
             <swiper :options="swiperOption" ref="mySwiper">
8
               <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
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)">
9
+                <img :src="item.ImageUrl" class="cover" alt @click="jump(item)">
10
               </swiper-slide>
10
               </swiper-slide>
11
             </swiper>
11
             </swiper>
12
           </div>
12
           </div>
15
     </div>
15
     </div>
16
     <div class="subNav">
16
     <div class="subNav">
17
       <ul class="flex-h">
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="">
18
+        <router-link
19
+          tag="li"
20
+          class="flex-item"
21
+          v-for="(item, index) in fiveA"
22
+          :to="{name:'fiveA',query:{id:item.LocationId}}"
23
+          :key="index"
24
+        >
25
+          <img :src="item.TypeImg" alt>
20
           <span>{{item.LocationName}}</span>
26
           <span>{{item.LocationName}}</span>
21
         </router-link>
27
         </router-link>
22
       </ul>
28
       </ul>
30
         <div>
36
         <div>
31
           <swiper :options="swiperHOption" ref="mySwiperH">
37
           <swiper :options="swiperHOption" ref="mySwiperH">
32
             <swiper-slide class="swiper-slide" v-for="(item,index) in project" :key="index">
38
             <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>
39
+              <router-link
40
+                tag="div"
41
+                :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }"
42
+                style="width:100%;height:100%;position:relative;"
43
+              >
44
+                <img :src="item.CaseImageUrl" class="cover" alt>
45
+                <span>
46
+                  <i class="iconfont icon-dingwei"></i>
47
+                  距离{{parseInt(toolClass.getGreatCircleDistance(latitude1, longitude1, item.Coordinate.split(',')[0], item.Coordinate.split(',')[1]))}}米
48
+                </span>
36
               </router-link>
49
               </router-link>
37
             </swiper-slide>
50
             </swiper-slide>
38
           </swiper>
51
           </swiper>
48
         <div>
61
         <div>
49
           <swiper :options="swiperHOption" ref="mySwiperH">
62
           <swiper :options="swiperHOption" ref="mySwiperH">
50
             <swiper-slide class="swiper-slide" v-for="(item,index) in courseList" :key="index">
63
             <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">
64
+              <router-link
65
+                tag="div"
66
+                :to="{ name:'majorProjectsDetail', query:{ id: item.CourseId } }"
67
+                style="width:100%;position:relative;overflow:visible"
68
+              >
52
                 <div class="img">
69
                 <div class="img">
53
-                  <img :src='item.CourseImg' class="cover centerLabel" alt="">
70
+                  <img :src="item.CourseImg" class="cover centerLabel" alt>
54
                   <span>{{item.CourseName}}</span>
71
                   <span>{{item.CourseName}}</span>
55
                 </div>
72
                 </div>
56
-                <div class="price"><span>¥{{item.Price}}</span></div>
73
+                <div class="price">
74
+                  <span>¥{{item.Price}}</span>
75
+                </div>
57
                 <span>{{toolClass.dateFormat(item.BeginDate)}}</span>
76
                 <span>{{toolClass.dateFormat(item.BeginDate)}}</span>
58
                 <span>{{item.CaseName}}</span>
77
                 <span>{{item.CaseName}}</span>
59
               </router-link>
78
               </router-link>
71
           <ul>
90
           <ul>
72
             <li class="flex-h" v-for="(item,index) in newsList" :key="index" @click="jump(item)">
91
             <li class="flex-h" v-for="(item,index) in newsList" :key="index" @click="jump(item)">
73
               <a class="img">
92
               <a class="img">
74
-                <img :src="item.ImageUrl" class="centerLabel cover" alt="">
93
+                <img :src="item.ImageUrl" class="centerLabel cover" alt>
75
               </a>
94
               </a>
76
               <div class="flex-item">
95
               <div class="flex-item">
77
                 <div>
96
                 <div>
92
 import 'swiper/dist/css/swiper.css'
111
 import 'swiper/dist/css/swiper.css'
93
 import { mapState, createNamespacedHelpers } from 'vuex'
112
 import { mapState, createNamespacedHelpers } from 'vuex'
94
 const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('index')
113
 const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('index')
114
+const wx = require('weixin-js-sdk')
115
+import wxsdk from '@/util/share'
95
 export default {
116
 export default {
96
   name: '',
117
   name: '',
97
   data () {
118
   data () {
109
         freeMode: true,
130
         freeMode: true,
110
         slidesPerView: 'auto',
131
         slidesPerView: 'auto',
111
       },
132
       },
112
-      newsList: []
133
+      newsList: [],
134
+      showPage: false
113
     }
135
     }
114
   },
136
   },
115
   computed: {
137
   computed: {
120
       message: x => x.index.message,
142
       message: x => x.index.message,
121
       project: x => x.index.project,
143
       project: x => x.index.project,
122
       cms: x => x.index.cms,
144
       cms: x => x.index.cms,
145
+      longitude1: x => x.index.longitude1,
146
+      latitude1: x => x.index.latitude1
123
     }),
147
     }),
124
     ...mapIndexState({
148
     ...mapIndexState({
125
       courseList: x => x.courseList
149
       courseList: x => x.courseList
136
     swiperSlide
160
     swiperSlide
137
   },
161
   },
138
   created () {
162
   created () {
139
-    this.getIndexLocation({ orgid: this.orgid, issys: '0' }).then((res) => {
140
-      // this.data.fiveA = this.fiveA
141
-      this.locationId = 'index'
142
-      this.getIndexInfo({ orgid: this.orgid, locationid: this.locationId }).then((res) => {
143
-        this.newsList = this.cms
144
-        if (this.project !== undefined && this.project !== null) {
145
-          for (let i = 0; i < this.project.length; i++) {
146
-            if (this.project[i].CmsCaseImgs != null) {
147
-              for (let j = 0; j < this.project[i].CmsCaseImgs.length; j++) {
148
-                if (this.project[i].CmsCaseImgs[j].ImageType === 'cover') {
149
-                  this.project[i].CaseImageUrl = this.project[i].CmsCaseImgs[j].CaseImageUrl
163
+    let that = this
164
+    wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
165
+      title: '城的空间',
166
+      desc: '城的空间',
167
+      link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
168
+      thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
169
+    }).then(() => {
170
+      wx.getLocation({
171
+        type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
172
+        success: function (res) {
173
+          that.setLocation({ latitude1: res.latitude, longitude1: res.longitude })
174
+          that.getIndexLocation({ orgid: that.orgid, issys: '0' }).then((res) => {
175
+            // that.data.fiveA = that.fiveA
176
+            that.locationId = 'index'
177
+            that.getIndexInfo({ orgid: that.orgid, locationid: that.locationId }).then((res) => {
178
+              that.newsList = that.cms
179
+              if (that.project !== undefined && that.project !== null) {
180
+                for (let i = 0; i < that.project.length; i++) {
181
+                  if (that.project[i].CmsCaseImgs != null) {
182
+                    for (let j = 0; j < that.project[i].CmsCaseImgs.length; j++) {
183
+                      if (that.project[i].CmsCaseImgs[j].ImageType === 'cover') {
184
+                        that.project[i].CaseImageUrl = that.project[i].CmsCaseImgs[j].CaseImageUrl
185
+                      }
186
+                    }
187
+                  }
150
                 }
188
                 }
151
               }
189
               }
152
-            }
153
-          }
190
+            })
191
+            that.getCourseList({
192
+              pagesize: 5,
193
+              page: 1
194
+            }).then(() => {
195
+              that.showPage = true
196
+            })
197
+          })
154
         }
198
         }
155
       })
199
       })
156
-      this.getCourseList({
157
-        pagesize: 5,
158
-        page: 1
159
-      })
160
     })
200
     })
161
   },
201
   },
162
   methods: {
202
   methods: {
163
-    ...mapIndexActions(['getIndexLocation', 'getIndexInfo', 'getCourseList']),
203
+    ...mapIndexActions(['getIndexLocation', 'getIndexInfo', 'getCourseList', 'setLocation']),
164
     jump (item) {
204
     jump (item) {
165
       item.ForwardType = item.ForwardType || ''
205
       item.ForwardType = item.ForwardType || ''
166
       if (item.ForwardType === 'url') {
206
       if (item.ForwardType === 'url') {

+ 3
- 1
src/pages/user/mainPage/indexPage/page.scss Прегледај датотеку

28
           top: 0;
28
           top: 0;
29
           bottom: 0;
29
           bottom: 0;
30
           overflow: hidden;
30
           overflow: hidden;
31
-          >div{
31
+          border-radius: .1rem;
32
+        >div{
32
             width: 100%;
33
             width: 100%;
33
             height: 100%;
34
             height: 100%;
35
+            border-radius: .1rem;
34
           }
36
           }
35
         }
37
         }
36
       }
38
       }

+ 1
- 3
src/pages/user/mainPage/userCenter/index.vue Прегледај датотеку

94
       this.user = this.userInfo.customer
94
       this.user = this.userInfo.customer
95
       if (this.user.AccountInfo) {
95
       if (this.user.AccountInfo) {
96
         this.AccountInfo = JSON.parse(this.user.AccountInfo)
96
         this.AccountInfo = JSON.parse(this.user.AccountInfo)
97
-
98
-
99
       }
97
       }
100
       this.headimgurl = this.user.Headimgurl
98
       this.headimgurl = this.user.Headimgurl
101
     })
99
     })
136
       userid = `${userid}${num}`
134
       userid = `${userid}${num}`
137
       window.location.href = `${window.location.origin}/game/luckdraw/#/lotteryList?from=${userid}`
135
       window.location.href = `${window.location.origin}/game/luckdraw/#/lotteryList?from=${userid}`
138
     },
136
     },
139
-    toActiveList(){
137
+    toActiveList () {
140
       this.$router.push({ name: 'activeList' })
138
       this.$router.push({ name: 'activeList' })
141
     }
139
     }
142
   }
140
   }

+ 32
- 7
src/pages/user/majorProjectsList/index.vue Прегледај датотеку

4
       <div class="flex-item">
4
       <div class="flex-item">
5
         <div>
5
         <div>
6
           <ul>
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 } }">
7
+            <router-link
8
+              v-for="(item, index) in project"
9
+              :key="index"
10
+              class="flex-h"
11
+              tag="li"
12
+              :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }"
13
+            >
8
               <a class="img">
14
               <a class="img">
9
                 <img :src="item.CmsCaseImgs[0].CaseImageUrl" class="cover" alt>
15
                 <img :src="item.CmsCaseImgs[0].CaseImageUrl" class="cover" alt>
10
               </a>
16
               </a>
11
-              <router-link tag="div" class="flex-item" :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }">
17
+              <router-link
18
+                tag="div"
19
+                class="flex-item"
20
+                :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }"
21
+              >
12
                 <div>
22
                 <div>
13
                   <span>{{item.Name}}</span>
23
                   <span>{{item.Name}}</span>
14
                   <span>{{item.CaseAddress}}</span>
24
                   <span>{{item.CaseAddress}}</span>
25
 <script>
35
 <script>
26
 import { mapState, createNamespacedHelpers } from 'vuex'
36
 import { mapState, createNamespacedHelpers } from 'vuex'
27
 const { mapActions: mapIndexActions } = createNamespacedHelpers('index')
37
 const { mapActions: mapIndexActions } = createNamespacedHelpers('index')
28
-
38
+const wx = require('weixin-js-sdk')
39
+import wxsdk from '@/util/share'
29
 export default {
40
 export default {
30
   name: '',
41
   name: '',
31
   data () {
42
   data () {
41
   components: {
52
   components: {
42
   },
53
   },
43
   created () {
54
   created () {
44
-    this.getProjectList({
45
-      orgid: this.orgid
55
+    let that = this
56
+    wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
57
+      title: '城的空间',
58
+      desc: '城的空间',
59
+      link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
60
+      thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
46
     }).then(() => {
61
     }).then(() => {
47
-      console.log(this.project)
62
+      wx.getLocation({
63
+        type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
64
+        success: function (res) {
65
+          that.setLocation({ latitude1: res.latitude, longitude1: res.longitude })
66
+          that.getProjectList({
67
+            orgid: that.orgid
68
+          }).then(() => {
69
+            console.log(that.project)
70
+          })
71
+        }
72
+      })
48
     })
73
     })
49
   },
74
   },
50
   methods: {
75
   methods: {
51
-    ...mapIndexActions(['getProjectList'])
76
+    ...mapIndexActions(['getProjectList', 'setLocation'])
52
   }
77
   }
53
 }
78
 }
54
 </script>
79
 </script>

+ 26
- 2
src/store/index/index.js Прегледај датотеку

1
 import Ajax from '../../util/ajax'
1
 import Ajax from '../../util/ajax'
2
 import api from '../../util/api'
2
 import api from '../../util/api'
3
+import toolClass from '../../util/util'
3
 const http = new Object
4
 const http = new Object
4
 
5
 
5
 // 请求数据
6
 // 请求数据
91
     message: [],
92
     message: [],
92
     project: [],
93
     project: [],
93
     cms: [],
94
     cms: [],
94
-    courseList: []
95
+    courseList: [],
96
+    longitude1: 0,
97
+    latitude1: 0
95
   },
98
   },
96
   mutations: {
99
   mutations: {
97
     setBanner (state, data) { // 获取首页轮播图
100
     setBanner (state, data) { // 获取首页轮播图
112
     },
115
     },
113
     setProject (state, data) { // 获取项目专题
116
     setProject (state, data) { // 获取项目专题
114
       data = data || []
117
       data = data || []
115
-      state.project = data
118
+      let arr = []
119
+      let dataNew = []
120
+      data.forEach((item) => {
121
+        item.jl = parseInt(toolClass.getGreatCircleDistance(state.latitude1, state.longitude1, item.Coordinate.split(',')[0], item.Coordinate.split(',')[1]))
122
+        arr.push(parseInt(toolClass.getGreatCircleDistance(state.latitude1, state.longitude1, item.Coordinate.split(',')[0], item.Coordinate.split(',')[1])))
123
+      })
124
+      arr.sort((a, b) => { return a - b })
125
+      arr.forEach((curr) => {
126
+        data.forEach((item) => {
127
+          if (curr === item.jl) {
128
+            dataNew.push(item)
129
+          }
130
+        })
131
+      })
132
+      state.project = dataNew
116
     },
133
     },
117
     setCms (state, data) { // 获取cms
134
     setCms (state, data) { // 获取cms
118
       data = data || []
135
       data = data || []
121
     updateCourseList (state, data) { // 更新附近课程
138
     updateCourseList (state, data) { // 更新附近课程
122
       state.courseList = data.list || []
139
       state.courseList = data.list || []
123
     },
140
     },
141
+    upDateLocation (state, data) {
142
+      state.longitude1 = data.longitude1
143
+      state.latitude1 = data.latitude1
144
+    }
124
   },
145
   },
125
   actions: {
146
   actions: {
147
+    setLocation (context, data) {
148
+      context.commit('upDateLocation', data)
149
+    },
126
     getCourseList (context, payload) { // 获取附近课程
150
     getCourseList (context, payload) { // 获取附近课程
127
       return new Promise((resolve, reject) => {
151
       return new Promise((resolve, reject) => {
128
         Ajax(api.index.getCourseList.url, {
152
         Ajax(api.index.getCourseList.url, {