Browse Source

bug 修复

lilei 4 năm trước cách đây
mục cha
commit
0672a7a209

+ 1 - 1
App.vue

@@ -1,6 +1,6 @@
 <script>
 	// const uat_URL = 'http://md.test.zyucgj.com/at-employee/' // 预发布
-	const uat_URL = 'http://192.168.16.102:9102/at-employee/' // 本地
+	const uat_URL = 'http://192.168.16.104:9102/at-employee/' // 本地
 	const pro_URL = 'https://car.zyucgj.com/at-employee/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url

+ 2 - 2
libs/tools.js

@@ -409,8 +409,8 @@ export const getGpsLocation = function(callback){
 		geocode: true,
 		success: function(res) {
 			console.log(res);
-			let pgs = wgs84togcj02(res.longitude,res.latitude)
-			callback(pgs)
+			let gps = wgs84togcj02(res.longitude,res.latitude)
+			callback(gps)
 		},
 		fail: function(error){
 			console.log(error)

+ 6 - 24
pages/siteInspection/siteInspection.vue

@@ -33,7 +33,7 @@
 </template>
 
 <script>
-	import { clzConfirm } from '@/libs/tools.js'
+	import { clzConfirm,getGpsLocation } from '@/libs/tools.js'
 	import { findStoreList } from '@/api/store.js'
 	import { queryCurrentTaskUsing } from '@/api/task.js'
 	export default{
@@ -60,29 +60,11 @@
 			// 获取当前位置
 			getLocation(){
 				const _this = this
-				uni.getLocation({
-				    type: 'gcj02',
-					geocode: true,
-				    success: function (res) {
-						console.log(res)
-						_this.lng = res.longitude
-						_this.lat = res.latitude
-						_this.location = res.address.province + res.address.city + res.address.district + res.address.street + res.address.streetNum +'靠近' + res.address.poiName
-						setTimeout(()=>{
-							// 按照经纬度查询
-							_this.searchHandle({lng:this.lng,lat:this.lat})
-						}, 500)
-				    },
-					fail: function(error){
-						console.log(error)
-						_this.searchHandle({})
-						if(JSON.parse(error.errMsg.replace('getLocation:fail ','')).message){
-							uni.showToast({
-								icon: 'none',
-								title: JSON.parse(error.errMsg.replace('getLocation:fail ','')).message
-							})
-						}
-					}
+				getGpsLocation(function(gps){
+					console.log(gps)
+					// _this.location
+					// 按照经纬度查询
+					_this.searchHandle({lng:gps[0],lat:gps[1]})
 				})
 			},
 			// 按名称查询

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 89 - 39
unpackage/dist/dev/app-plus/app-view.js


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác