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

+ 39
- 31
src/pages/user/mainPage/coffeeIndex/index.vue Прегледај датотеку

@@ -429,37 +429,45 @@ export default {
429 429
     },
430 430
     locationMapping () {
431 431
       let that = this
432
-      wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
433
-        title: '城的空间',
434
-        desc: '城的空间',
435
-        link: `${window.location.origin}${window.location.pathname}/user.html#/mainPage/indexPage`,
436
-        thu_image: `${window.location.origin}${window.location.pathname}${logo}`
437
-      }).then(() => {
438
-        wx.getLocation({
439
-          type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
440
-          success: function (res) {
441
-            let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
442
-            let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
443
-            for (let i = 0; i < that.CaseList.length; i++) {
444
-              let result = that.CaseList[i].Coordinate.split(",")
445
-              let latitude2 = parseFloat(result[0])
446
-              let longitude2 = parseFloat(result[1])
447
-              if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
448
-                that.topCaseInfoData.caseName = that.CaseList[i].CaseName
449
-                that.topCaseInfoData.caseId = that.CaseList[i].CaseId
450
-                that.getCaseTableList({
451
-                  caseid: that.topCaseInfoData.caseId
452
-                })
453
-                that.getCaseTotal({
454
-                  caseid: that.topCaseInfoData.caseId
455
-                })
456
-              }
457
-            }
458
-            if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName){
459
-              that.topCaseInfoData.caseName = '当前位置无案场'
460
-            }
461
-          }
462
-        })
432
+      // wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
433
+      //   title: '城的空间',
434
+      //   desc: '城的空间',
435
+      //   link: `${window.location.origin}${window.location.pathname}/user.html#/mainPage/indexPage`,
436
+      //   thu_image: `${window.location.origin}${window.location.pathname}${logo}`
437
+      // }).then(() => {
438
+      //   wx.getLocation({
439
+      //     type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
440
+      //     success: function (res) {
441
+      //       let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
442
+      //       let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
443
+      //       for (let i = 0; i < that.CaseList.length; i++) {
444
+      //         let result = that.CaseList[i].Coordinate.split(",")
445
+      //         let latitude2 = parseFloat(result[0])
446
+      //         let longitude2 = parseFloat(result[1])
447
+      //         if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
448
+      //           that.topCaseInfoData.caseName = that.CaseList[i].CaseName
449
+      //           that.topCaseInfoData.caseId = that.CaseList[i].CaseId
450
+      //           that.getCaseTableList({
451
+      //             caseid: that.topCaseInfoData.caseId
452
+      //           })
453
+      //           that.getCaseTotal({
454
+      //             caseid: that.topCaseInfoData.caseId
455
+      //           })
456
+      //         }
457
+      //       }
458
+      //       if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName){
459
+      //         that.topCaseInfoData.caseName = '当前位置无案场'
460
+      //       }
461
+      //     }
462
+      //   })
463
+      // })
464
+      that.topCaseInfoData.caseName = that.CaseList[0].CaseName
465
+      that.topCaseInfoData.caseId = that.CaseList[0].CaseId
466
+      that.getCaseTableList({
467
+        caseid: that.topCaseInfoData.caseId
468
+      })
469
+      that.getCaseTotal({
470
+        caseid: that.topCaseInfoData.caseId
463 471
       })
464 472
     },
465 473
     beforeClose (action, done) {

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

@@ -73,6 +73,7 @@ import { swiper, swiperSlide } from 'vue-awesome-swiper'
73 73
 import 'swiper/dist/css/swiper.css'
74 74
 import { mapState, createNamespacedHelpers } from 'vuex'
75 75
 const { mapActions: mapIndexActions } = createNamespacedHelpers('index')
76
+const { mapState: mapUserState } = createNamespacedHelpers('userCenter')
76 77
 export default {
77 78
   name: '',
78 79
   data () {
@@ -99,6 +100,9 @@ export default {
99 100
     }
100 101
   },
101 102
   computed: {
103
+    ...mapUserState({
104
+      userInfo: x => x.userInfo
105
+    }),
102 106
     ...mapState({
103 107
       orgid: x => x.app.orgId,
104 108
       fiveA: x => x.index.fiveA,
@@ -120,6 +124,10 @@ export default {
120 124
     swiperSlide,
121 125
   },
122 126
   created () {
127
+    if (this.userInfo.customer.MapUser) {
128
+      this.$router.push({ name: 'coffeeIndex' })
129
+      return
130
+    }
123 131
     this.getIndexLocation({ orgid: this.orgid, issys: '0' }).then((res) => {
124 132
       this.data.fiveA = this.fiveA
125 133
       this.locationId = 'index'

+ 2
- 2
src/util/api.js Прегледај датотеку

@@ -1,5 +1,5 @@
1
-const baseUrl = '/api-v2'
2
-// const baseUrl = '/api'
1
+// const baseUrl = '/api-v2'
2
+const baseUrl = '/api'
3 3
 const wechat = '/wechat/:org'
4 4
 const guest = '/guest/:org'
5 5
 const common = '/common/:org'

+ 2
- 2
vue.config.js Прегледај датотеку

@@ -25,9 +25,9 @@ module.exports = {
25 25
       // '/api-v2': {
26 26
       '/api': {
27 27
         // target: 'https://dp.huiju360.com.cn/hj_operations',
28
-        // target: 'http://192.168.0.62:8080', // wf
28
+        target: 'http://192.168.0.62:8080', // wf
29 29
         // target: 'http://192.168.0.125:8080', // hyq
30
-        target: 'http://192.168.0.11', // ys
30
+        // target: 'http://192.168.0.11', // ys
31 31
         // target: 'http://dev.ycjcjy.com', // frp
32 32
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
33 33
         // pathRewrite: {