From 5214b7f20253996f27b9df84b4a0d9195a947e8a Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Wed, 03 Apr 2024 09:56:34 +0800
Subject: [PATCH] 定位代码优化

---
 pages/home/index.vue |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/pages/home/index.vue b/pages/home/index.vue
index 3f6ff0e..d72732a 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -1348,10 +1348,10 @@
 														if (data
 															.authSetting[
 																"scope.userLocationBackground"
-																] == true
-															) {
+															] == true
+														) {
 															this
-														.getBackgroundLocation();
+																.getBackgroundLocation();
 														}
 													}
 												});
@@ -1393,13 +1393,15 @@
 						console.log('onLocationChange***************', data)
 						//微信开发工具上面只能触发一次,真机上面是循环获取
 						//设置一个公共时间,原因是时间间隔太短,自己设置时间,然后去操作相应的逻辑
+
 						if (this.time == 20) {
 							// 调取实时位置
-							this.reportLocation(this.location);
 							this.time = 0;
 						}
 						this.time++;
 						this.location = data;
+						this.reportLocation(this.location);
+
 					});
 				}
 			},
@@ -1424,7 +1426,6 @@
 				addPolicTrajectoryPoint(params).then(res => {
 					console.log(res)
 				})
-				console.log('********************location****************************************', location)
 			},
 
 

--
Gitblit v1.9.3