wgl 4 лет назад
Родитель
Сommit
079b4a7c10
2 измененных файлов с 5 добавлено и 3 удалено
  1. 4 2
      src/projects/business/views/Master/Attendance/Sign.vue
  2. 1 1
      src/utils/wxJsApi.js

+ 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);