wangfei 6 years ago
parent
commit
05da6c58e1
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      src/pages/user/mainPage/indexPage/index.vue

+ 3
- 4
src/pages/user/mainPage/indexPage/index.vue View File

172
       return this.$refs.mySwiperH.swiper
172
       return this.$refs.mySwiperH.swiper
173
     },
173
     },
174
     ProjectWithLocationList () {
174
     ProjectWithLocationList () {
175
-      var data = this.project
175
+      var data = this.project || []
176
       if (this.latitude1 === 0 && this.longitude1 === 0) {
176
       if (this.latitude1 === 0 && this.longitude1 === 0) {
177
         data.forEach((item) => {
177
         data.forEach((item) => {
178
           item.jl = '未获取到当前定位'
178
           item.jl = '未获取到当前定位'
179
         })
179
         })
180
         return data
180
         return data
181
       } else {
181
       } else {
182
-        data = data || []
183
         let arr = []
182
         let arr = []
184
         let dataNew = []
183
         let dataNew = []
185
         data.forEach((item) => {
184
         data.forEach((item) => {
222
           that.setLocation({ latitude1: res.latitude, longitude1: res.longitude })
221
           that.setLocation({ latitude1: res.latitude, longitude1: res.longitude })
223
         },
222
         },
224
       })
223
       })
225
-      that.showPage = true
226
-      that.init()
227
     })
224
     })
225
+    that.showPage = true
226
+    that.init()
228
   },
227
   },
229
   methods: {
228
   methods: {
230
     ...mapIndexActions(['getIndexLocation', 'getIndexInfo', 'getCourseList', 'setLocation']),
229
     ...mapIndexActions(['getIndexLocation', 'getIndexInfo', 'getCourseList', 'setLocation']),