shish 2 years ago
parent
commit
889ed1c4e4
2 changed files with 12 additions and 27 deletions
  1. 1 17
      mallApp/src/components/app-area-sel-bak.vue
  2. 11 10
      mallApp/src/utils/location.js

+ 1 - 17
mallApp/src/components/app-area-sel-bak.vue

@@ -103,23 +103,7 @@ export default {
 		},
 		// 地图操作
 		reload() {
-			uni.getLocation({
-				type: 'wgs84',
-				success: res => {
-					this.latitude = res.latitude
-					this.longitude = res.longitude
-					// this.nearList()
-				},
-				// eslint-disable-next-line handle-callback-err
-				fail: err => {
-					this.$msg('定位失败')
-					// setTimeout(function() {
-					// 	uni.navigateBack({
-					// 		delta: 1
-					// 	})
-					// }, 1500)
-				}
-			})
+
 		},
 		mapChange(e) {
 			if (e.type == 'end' && (e.causedBy == 'scale' || e.causedBy == 'drag')) {

+ 11 - 10
mallApp/src/utils/location.js

@@ -24,17 +24,18 @@ export async function mGetPosition() {
 	if (!client_hash && getRoute == 'pages/page/login/index') {
 		return null
 	}
-	let getObj = await new Promise(resolve => {
-		uni.getLocation({
-			type: 'gcj02',
-			success: res => resolve(res),
-			fail: e => {
-				console.log('获取位置失败!', e)
-			}
-		})
-	})
 
-	mLocation = getObj
+	// let getObj = await new Promise(resolve => {
+	// 	uni.getLocation({
+	// 		type: 'gcj02',
+	// 		success: res => resolve(res),
+	// 		fail: e => {
+	// 			console.log('获取位置失败!', e)
+	// 		}
+	// 	})
+	// })
+
+	// mLocation = getObj
 	mLocation.lat = getObj.latitude
 	mLocation.lng = getObj.longitude