Fly 1 月之前
父節點
當前提交
adfd561c20
共有 4 個文件被更改,包括 22 次插入8 次删除
  1. 3 1
      components/tiandituMap/tiandituMap.vue
  2. 5 2
      config/index.js
  3. 1 1
      manifest.json
  4. 13 4
      pages/map/model/search.vue

+ 3 - 1
components/tiandituMap/tiandituMap.vue

@@ -1,7 +1,7 @@
 <template>
 	<view id="mapDiv" class="mapDiv" :apikey="apiKey" :prop="option" :change:prop="Trenderjs.initTMap">
 		<view class="tool-btn">
-			<view class="position" @click.stop="Trenderjs.onPosition">
+			<view v-if="isGetLocation" class="position" @click.stop="Trenderjs.onPosition">
 				<image style="width: 100%;height: 100%;" src="@/static/images/position.png" mode="aspectFit"></image>
 			</view>
 			<view class="position" @click.stop="$emit('openHint')">
@@ -15,6 +15,7 @@
 	import tools from './tools.js'
 	import iconPath from '@/static/images/point.png'
 	import { EventBus } from "@/utils/vueBus.js"
+	import c  from "@/config/index.js"
 	export default {
 		name: "tianditu",
 		props: {
@@ -26,6 +27,7 @@
 		},
 		data() {
 			return {
+				isGetLocation:c.isGetLocation,
 				checkedDot: false,
 				Tmap: null,
 				option: {

+ 5 - 2
config/index.js

@@ -1,6 +1,6 @@
 export default {
-	baseURL: "https://ditu.qqzzhou.com/oa",
-	// baseURL: "http://192.168.0.152:8282", 
+	// baseURL: "https://ditu.qqzzhou.com/oa",
+	baseURL: "http://zwdt.wuhan-cloud.com:10030/oa", 
 	// baseURL: "http://192.168.0.78:8282", 
 	
 	
@@ -13,5 +13,8 @@ export default {
 	// tianKey:'1edd9c001a8425cb93631398109d5ab2',
 	tianKey:'d131bbacd0a5428f6781fa4e11871196',
 	
+	// h5 已废弃,禁止修改
 	type:'H6' , // H5 / H6,  web端打包需要修改 manifest.json web配置的基础运行路径
+	
+	isGetLocation:false
 }

+ 1 - 1
manifest.json

@@ -76,7 +76,7 @@
             "maps" : {}
         },
         "router" : {
-            "base" : "/h6/"
+            "base" : "/h5/"
         },
         "optimization" : {
             "treeShaking" : {

+ 13 - 4
pages/map/model/search.vue

@@ -56,7 +56,9 @@
 				LocationTimeout: null,
 				SearchTimeout: null,
 				type: $confog.type,
-				downFillColor: '#808080'
+				downFillColor: '#808080',
+				
+				getLocationNum:1
 			}
 		},
 		created() {
@@ -74,7 +76,7 @@
 			EventBus.$off("TianDiTuSearch")
 		},
 		methods: {
-			init() {
+			init() { 
 				clearTimeout(this.LocationTimeout);
 				this.LocationTimeout = null;
 				this.LocationTimeout = setTimeout(() => {
@@ -88,10 +90,17 @@
 							this.onSearchFocus()
 							this.$store.dispatch('updateUseLocation', { longitude, latitude })
 						} else {
-							this.init()
+							this.getLocationNum++;
+							if(this.getLocationNum <= 5){
+								this.init()
+							}
+							
 						}
 					}).catch(err => {
-						this.init()
+						this.getLocationNum++;
+						if(this.getLocationNum <= 5){
+							this.init()
+						}
 					})
 				}, 1000)
 			},