Sfoglia il codice sorgente

异地打卡修正

wgl 4 anni fa
parent
commit
079b4a7c10

+ 4 - 2
src/projects/business/views/Master/Attendance/Sign.vue

@@ -217,8 +217,10 @@
 				this.isLoading = true;
 				WxJsApi.getLocation().then((res) => {
 					this.isLoading = false;
-					this.tjForm.latitude = res.latitude;
-					this.tjForm.longitude = res.longitude;
+					this.tjForm.latitude = parseFloat(res.latitude);
+					this.tjForm.longitude = parseFloat(res.longitude);
+					
+					console.log(this.tjForm)
 
 					//获取定位地址
 					this.getPositionByLonLats()

+ 1 - 1
src/utils/wxJsApi.js

@@ -79,7 +79,7 @@ export function getLocation() {
 			wx.getLocation({
 				type: 'gcj02', // 默认为wgs84的gps坐标,可传入'gcj02'
 				success: function(res) {
-					resolve(response);
+					resolve(res);
 				},
 				faile: function(res) {
 					reject(res);