wangfei 6 anni fa
parent
commit
f256a8f8dd

+ 14
- 1
src/pages/user/calendar/making.vue Vedi File

@@ -75,6 +75,7 @@
75 75
         <input
76 76
           class="input"
77 77
           type="text"
78
+          @blur="emailBlur"
78 79
           placeholder="接收电子版"
79 80
           v-model="email"
80 81
           style="border-radius:5px;background:rgba(245, 246, 250, 1);"
@@ -128,7 +129,7 @@ export default {
128 129
       imglength: 0,
129 130
       msg: '请稍候...',
130 131
       swiperOption: {
131
-        observer: true,
132
+        observer: false,
132 133
         speed: 1500,
133 134
         navigation: {
134 135
           nextEl: '.swiper-button-next',
@@ -199,6 +200,18 @@ export default {
199 200
           })
200 201
         })
201 202
       })
203
+    },  
204
+    emailBlur () {
205
+      var currentPosition,timer;
206
+      var speed=1;//页面滚动距离
207
+      timer=setInterval(function(){
208
+          currentPosition=document.documentElement.scrollTop || document.body.scrollTop;
209
+          currentPosition-=speed; 
210
+          window.scrollTo(0,currentPosition);//页面向上滚动
211
+          currentPosition+=speed; //speed变量
212
+          window.scrollTo(0,currentPosition);//页面向下滚动
213
+          clearInterval(timer);
214
+      },1);
202 215
     },
203 216
     onRead (file) {
204 217
       let that = this

+ 36
- 11
src/pages/user/mainPage/indexPage/index.vue Vedi File

@@ -37,7 +37,7 @@
37 37
           <swiper :options="swiperHOption" ref="mySwiperH">
38 38
             <swiper-slide
39 39
               class="swiper-slide"
40
-              v-for="(item,index) in project"
40
+              v-for="(item,index) in ProjectWithLocationList"
41 41
               v-if="index<5"
42 42
               :key="index"
43 43
             >
@@ -125,6 +125,7 @@
125 125
 <script>
126 126
 import { swiper, swiperSlide } from 'vue-awesome-swiper'
127 127
 import 'swiper/dist/css/swiper.css'
128
+import toolClass from '../../../../util/util'
128 129
 import { mapState, createNamespacedHelpers } from 'vuex'
129 130
 const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('index')
130 131
 const wx = require('weixin-js-sdk')
@@ -169,6 +170,38 @@ export default {
169 170
     },
170 171
     MySwiperH () {
171 172
       return this.$refs.mySwiperH.swiper
173
+    },
174
+    ProjectWithLocationList () {
175
+      var data = this.project
176
+      if (this.latitude1 === 0 && this.longitude1 === 0) {
177
+        data.forEach((item) => {
178
+          item.jl = '未获取到当前定位'
179
+        })
180
+        return data
181
+      } else {
182
+        data = data || []
183
+        let arr = []
184
+        let dataNew = []
185
+        data.forEach((item) => {
186
+          if (item.Coordinate) {
187
+            item.jl = parseInt(toolClass.getGreatCircleDistance(this.latitude1, this.longitude1, item.Coordinate.split(',')[0], item.Coordinate.split(',')[1]))
188
+            arr.push({ jl: item.jl, CmsCaseId: item.CmsCaseId })
189
+          } else {
190
+            item.jl = 400000000
191
+            arr.push({ jl: item.jl, CmsCaseId: item.CmsCaseId })
192
+          }
193
+        })
194
+        arr.sort((a, b) => { return a.jl - b.jl })
195
+        arr.forEach((curr) => {
196
+          data.forEach((item) => {
197
+            if (curr.CmsCaseId === item.CmsCaseId && item.jl === curr.jl) {
198
+              item.jl = `距离${item.jl}米`
199
+              dataNew.push(item)
200
+            }
201
+          })
202
+        })
203
+        return dataNew
204
+      }
172 205
     }
173 206
   },
174 207
   components: {
@@ -187,18 +220,10 @@ export default {
187 220
         type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
188 221
         success: function (res) {
189 222
           that.setLocation({ latitude1: res.latitude, longitude1: res.longitude })
190
-          that.showPage = true
191
-          that.init()
192 223
         },
193
-        cancel: function () {
194
-          that.showPage = true
195
-          that.init()
196
-        },
197
-        fail: function () {
198
-          that.showPage = true
199
-          that.init()
200
-        }
201 224
       })
225
+      that.showPage = true
226
+      that.init()
202 227
     })
203 228
   },
204 229
   methods: {

+ 31
- 30
src/store/index/index.js Vedi File

@@ -1,6 +1,6 @@
1 1
 import Ajax from '../../util/ajax'
2 2
 import api from '../../util/api'
3
-import toolClass from '../../util/util'
3
+
4 4
 const http = new Object
5 5
 
6 6
 // 请求数据
@@ -114,35 +114,36 @@ export default {
114 114
       }
115 115
     },
116 116
     setProject (state, data) { // 获取项目专题
117
-      if (state.latitude1 === 0 && state.longitude1 === 0) {
118
-        data.forEach((item) => {
119
-          item.jl = '未获取到当前定位'
120
-        })
121
-        state.project = data
122
-      } else {
123
-        data = data || []
124
-        let arr = []
125
-        let dataNew = []
126
-        data.forEach((item) => {
127
-          if (item.Coordinate) {
128
-            item.jl = parseInt(toolClass.getGreatCircleDistance(state.latitude1, state.longitude1, item.Coordinate.split(',')[0], item.Coordinate.split(',')[1]))
129
-            arr.push({ jl: item.jl, CmsCaseId: item.CmsCaseId })
130
-          } else {
131
-            item.jl = 400000000
132
-            arr.push({ jl: item.jl, CmsCaseId: item.CmsCaseId })
133
-          }
134
-        })
135
-        arr.sort((a, b) => { return a.jl - b.jl })
136
-        arr.forEach((curr) => {
137
-          data.forEach((item) => {
138
-            if (curr.CmsCaseId === item.CmsCaseId && item.jl === curr.jl) {
139
-              item.jl = `距离${item.jl}米`
140
-              dataNew.push(item)
141
-            }
142
-          })
143
-        })
144
-        state.project = dataNew
145
-      }
117
+      state.project = data
118
+      // if (state.latitude1 === 0 && state.longitude1 === 0) {
119
+      //   data.forEach((item) => {
120
+      //     item.jl = '未获取到当前定位'
121
+      //   })
122
+      //   state.project = data
123
+      // } else {
124
+      //   data = data || []
125
+      //   let arr = []
126
+      //   let dataNew = []
127
+      //   data.forEach((item) => {
128
+      //     if (item.Coordinate) {
129
+      //       item.jl = parseInt(toolClass.getGreatCircleDistance(state.latitude1, state.longitude1, item.Coordinate.split(',')[0], item.Coordinate.split(',')[1]))
130
+      //       arr.push({ jl: item.jl, CmsCaseId: item.CmsCaseId })
131
+      //     } else {
132
+      //       item.jl = 400000000
133
+      //       arr.push({ jl: item.jl, CmsCaseId: item.CmsCaseId })
134
+      //     }
135
+      //   })
136
+      //   arr.sort((a, b) => { return a.jl - b.jl })
137
+      //   arr.forEach((curr) => {
138
+      //     data.forEach((item) => {
139
+      //       if (curr.CmsCaseId === item.CmsCaseId && item.jl === curr.jl) {
140
+      //         item.jl = `距离${item.jl}米`
141
+      //         dataNew.push(item)
142
+      //       }
143
+      //     })
144
+      //   })
145
+      //   state.project = dataNew
146
+      // }
146 147
     },
147 148
     setCms (state, data) { // 获取cms
148 149
       data = data || []